Package jmri.jmrit.automat.monitor
Class AutomatTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.automat.monitor.AutomatTableDataModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.table.TableModel
public class AutomatTableDataModel extends javax.swing.table.AbstractTableModel
Table data model for display of Automat instances.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AutomatTableDataModel()
-
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()java.lang.Class<?>getColumnClass(int col)Note that this returns String even for columns that contain buttons.intgetColumnCount()java.lang.StringgetColumnName(int col)intgetPreferredWidth(int col)intgetRowCount()java.lang.ObjectgetValueAt(int row, int col)booleanisCellEditable(int row, int col)(package private) voidsetColumnToHoldButton(javax.swing.JTable table, int column, javax.swing.JButton sample)Service method to setup a column so that it will hold a button for its valuesvoidsetValueAt(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
-
NAMECOL
static final int NAMECOL
- See Also:
- Constant Field Values
-
TURNSCOL
static final int TURNSCOL
- See Also:
- Constant Field Values
-
KILLCOL
static final int KILLCOL
- See Also:
- Constant Field Values
-
NUMCOLUMN
static final int NUMCOLUMN
- See Also:
- Constant Field Values
-
summary
AutomatSummary summary
-
-
Constructor Detail
-
AutomatTableDataModel
public AutomatTableDataModel()
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
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)
Note that this returns String even for columns that contain buttons.- 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
-
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- the table to configure
-
setColumnToHoldButton
void setColumnToHoldButton(javax.swing.JTable table, int column, javax.swing.JButton sample)
Service method to setup a column so that it will hold a button for its values- Parameters:
table- the table in which to configure the columncolumn- the position of the configured columnsample- typical button, used for size
-
dispose
public void dispose()
-
-