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 void
configureTable(javax.swing.JTable table)
Configure a table to have our standard rows and columns.void
dispose()
java.lang.Class<?>
getColumnClass(int col)
Note that this returns String even for columns that contain buttons.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)
(package private) 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 valuesvoid
setValueAt(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:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in 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:
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
-
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()
-
-