Package jmri.jmrit.signalling
Class SignallingPanel.TableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.signalling.SignallingPanel.TableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
- Direct Known Subclasses:
SignallingPanel.BlockModel
,SignallingPanel.SensorModel
,SignallingPanel.SignalMastModel
,SignallingPanel.TurnoutModel
- Enclosing class:
- SignallingPanel
abstract class SignallingPanel.TableModel extends javax.swing.table.AbstractTableModel implements java.beans.PropertyChangeListener
A series of TableModels to display and edit configurations for SignalMastLogic (SML) on the Tabs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SignallingPanel.TableModel.StateComboBoxPanel
Provide a table cell renderer looking like a JComboBox as an editor/renderer for the manual tables on all except the Masts tab.
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
INCLUDE_COLUMN
static int
SNAME_COLUMN
static int
STATE_COLUMN
static int
UNAME_COLUMN
-
Constructor Summary
Constructors Constructor Description TableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configStateColumn(javax.swing.JTable table)
Customize the State column to show an appropriate ComboBox of available options.void
dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.java.lang.Class<?>
getColumnClass(int c)
int
getColumnCount()
java.lang.String
getColumnName(int col)
(package private) javax.swing.JComboBox<java.lang.String>
getStateEditorBox(int row)
Provide a static JComboBox element to display inside the JPanel CellEditor.boolean
isCellEditable(int r, int c)
void
propertyChange(java.beans.PropertyChangeEvent e)
Respond to change from bean.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
SNAME_COLUMN
public static final int SNAME_COLUMN
- See Also:
- Constant Field Values
-
UNAME_COLUMN
public static final int UNAME_COLUMN
- See Also:
- Constant Field Values
-
INCLUDE_COLUMN
static final int INCLUDE_COLUMN
- See Also:
- Constant Field Values
-
STATE_COLUMN
public static final int STATE_COLUMN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TableModel
TableModel()
-
-
Method Detail
-
getColumnClass
public java.lang.Class<?> getColumnClass(int c)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Respond to change from bean. Prevent State change during edit.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Parameters:
e
- A property change of any bean
-
dispose
public void dispose()
Remove references to and from this object, so that it can eventually be garbage-collected.
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
isCellEditable
public boolean isCellEditable(int r, int c)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
configStateColumn
protected void configStateColumn(javax.swing.JTable table)
Customize the State column to show an appropriate ComboBox of available options.- Parameters:
table
- a JTable of beans
-
getStateEditorBox
javax.swing.JComboBox<java.lang.String> getStateEditorBox(int row)
Provide a static JComboBox element to display inside the JPanel CellEditor. When not yet present, create, store and return a new one.- Parameters:
row
- Index number (in TableDataModel)- Returns:
- A combobox containing the valid aspect names for this mast
-
-