Package jmri.jmrix.loconet.soundloader
Class EditorTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.loconet.soundloader.EditorTableDataModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.table.TableModel
public class EditorTableDataModel extends javax.swing.table.AbstractTableModel
Table data model for display of Digitrax SPJ files.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static javax.swing.JFileChooserchooser(package private) SpjFilefilestatic intFILENAMECOLstatic intHANDLECOLstatic intHEADERCOLstatic intLENGTHCOLstatic intMAPCOLstatic intNUMCOLUMNstatic intPLAYBUTTONCOLstatic intREPLACEBUTTONCOLstatic intTYPECOL
-
Constructor Summary
Constructors Constructor Description EditorTableDataModel(SpjFile file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureTable(javax.swing.JTable table)Configure a table to have our standard rows and columns.voiddispose()(package private) voideditSdfButtonPressed(java.lang.Object value, int row, int col)java.lang.Class<?>getColumnClass(int col)intgetColumnCount()java.lang.StringgetColumnName(int col)intgetPreferredWidth(int col)intgetRowCount()java.lang.ObjectgetValueAt(int row, int col)booleanisCellEditable(int row, int col)javax.swing.JButtonlargestWidthButton(int col)(package private) voidplayButtonPressed(java.lang.Object value, int row, int col)protected voidprintColumns(HardcopyWriter w, java.lang.String[] columnStrings, int columnSize)voidprintTable(HardcopyWriter w)Self print - or print preview - the table.(package private) voidreplWavButtonPressed(java.lang.Object value, int row, int col)(package private) voidsetColumnToHoldButton(javax.swing.JTable table, int column, javax.swing.JButton sample)Service method to set up a column so that it will hold a button for it's values.voidsetValueAt(java.lang.Object value, int row, int col)(package private) voidviewSdfButtonPressed(java.lang.Object value, int row, int col)(package private) voidviewTxtButtonPressed(java.lang.Object value, int row, int col)-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
HEADERCOL
public static final int HEADERCOL
- See Also:
- Constant Field Values
-
TYPECOL
public static final int TYPECOL
- See Also:
- Constant Field Values
-
MAPCOL
public static final int MAPCOL
- See Also:
- Constant Field Values
-
HANDLECOL
public static final int HANDLECOL
- See Also:
- Constant Field Values
-
FILENAMECOL
public static final int FILENAMECOL
- See Also:
- Constant Field Values
-
LENGTHCOL
public static final int LENGTHCOL
- See Also:
- Constant Field Values
-
PLAYBUTTONCOL
public static final int PLAYBUTTONCOL
- See Also:
- Constant Field Values
-
REPLACEBUTTONCOL
public static final int REPLACEBUTTONCOL
- See Also:
- Constant Field Values
-
NUMCOLUMN
public static final int NUMCOLUMN
- See Also:
- Constant Field Values
-
chooser
static javax.swing.JFileChooser chooser
-
-
Constructor Detail
-
EditorTableDataModel
public EditorTableDataModel(SpjFile file)
-
-
Method Detail
-
getRowCount
public int getRowCount()
-
getColumnCount
public int getColumnCount()
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classjavax.swing.table.AbstractTableModel
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
-
getPreferredWidth
public int getPreferredWidth(int col)
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classjavax.swing.table.AbstractTableModel
-
replWavButtonPressed
void replWavButtonPressed(java.lang.Object value, int row, int col)
-
playButtonPressed
void playButtonPressed(java.lang.Object value, int row, int col)
-
viewTxtButtonPressed
void viewTxtButtonPressed(java.lang.Object value, int row, int col)
-
viewSdfButtonPressed
void viewSdfButtonPressed(java.lang.Object value, int row, int col)
-
editSdfButtonPressed
void editSdfButtonPressed(java.lang.Object value, int row, int col)
-
configureTable
public void configureTable(javax.swing.JTable table)
Configure a table to have our standard rows and columns. This is optional, in that other table formats can use this table model. But we put it here to help keep it consistent.- Parameters:
table- table to configured.
-
largestWidthButton
public javax.swing.JButton largestWidthButton(int col)
-
setColumnToHoldButton
void setColumnToHoldButton(javax.swing.JTable table, int column, javax.swing.JButton sample)
Service method to set up a column so that it will hold a button for it's values.- Parameters:
table- The overall table, accessed for formattingcolumn- Which column to configure with this callsample- Typical button, used for size
-
dispose
public void dispose()
-
printTable
public void printTable(HardcopyWriter w)
Self print - or print preview - the table.Printed in equally sized columns across the page with headings and vertical lines between each column. Data is word wrapped within a column. Can handle data as strings, comboboxes or booleans.
- Parameters:
w- the printer output to write to
-
printColumns
protected void printColumns(HardcopyWriter w, java.lang.String[] columnStrings, int columnSize)
-
-