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.JFileChooser
chooser
(package private) SpjFile
file
static int
FILENAMECOL
static int
HANDLECOL
static int
HEADERCOL
static int
LENGTHCOL
static int
MAPCOL
static int
NUMCOLUMN
static int
PLAYBUTTONCOL
static int
REPLACEBUTTONCOL
static int
TYPECOL
-
Constructor Summary
Constructors Constructor Description EditorTableDataModel(SpjFile file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureTable(javax.swing.JTable table)
Configure a table to have our standard rows and columns.void
dispose()
(package private) void
editSdfButtonPressed(java.lang.Object value, int row, int col)
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
int
getPreferredWidth(int col)
int
getRowCount()
java.lang.Object
getValueAt(int row, int col)
boolean
isCellEditable(int row, int col)
javax.swing.JButton
largestWidthButton(int col)
(package private) void
playButtonPressed(java.lang.Object value, int row, int col)
protected void
printColumns(HardcopyWriter w, java.lang.String[] columnStrings, int columnSize)
void
printTable(HardcopyWriter w)
Self print - or print preview - the table.(package private) void
replWavButtonPressed(java.lang.Object value, int row, int col)
(package private) 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.void
setValueAt(java.lang.Object value, int row, int col)
(package private) void
viewSdfButtonPressed(java.lang.Object value, int row, int col)
(package private) void
viewTxtButtonPressed(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:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in 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:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in 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)
-
-