Package jmri.jmrit.signalling
Class SignallingSourcePanel.SignalMastAspectModel
java.lang.Object
javax.swing.table.AbstractTableModel
jmri.jmrit.signalling.SignallingSourcePanel.SignalMastAspectModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
- Enclosing class:
- SignallingSourcePanel
public class SignallingSourcePanel.SignalMastAspectModel
extends AbstractTableModel
implements PropertyChangeListener
TableModel to store SML control Signal Masts and their Set To Aspect.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigEditColumn(JTable table) Display buttons in 2 columns of the manual control signal masts table.voidconfigureTable(JTable table) protected voiddeletePair(int r) voiddispose()Remove references to and from this object, so that it can eventually be garbage-collected.protected voideditPair(int r) Respond to the Edit Logic button being clicked.Class<?>getColumnClass(int c) intGet the number of columns in the signal masts table.getColumnName(int col) intgetPreferredWidth(int col) intGet the number of Included signal masts for this SML.getValueAt(int r, int c) Retrieve the contents to display in a cell in the table, in terms of modelbooleanisCellEditable(int r, int c) Query whether the cells in a table column should respond to clicks.voidListen for changes to specific properties of the displayed Signal Masts.protected voidsetColumnToHoldButton(JTable table, int column, JButton sample) Helper function forconfigEditColumn(JTable).voidvoidsetValueAt(Object type, int r, int c) Process the contents from a table cell, in terms of model(package private) voidupdateSignalMastLogic(SignalMastLogic smlOld, SignalMastLogic smlNew) Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
SYSNAME_COLUMN
- See Also:
-
USERNAME_COLUMN
- See Also:
-
ACTIVE_COLUMN
- See Also:
-
ENABLE_COLUMN
- See Also:
-
EDIT_COLUMN
- See Also:
-
DEL_COLUMN
- See Also:
-
-
Constructor Details
-
SignalMastAspectModel
-
-
Method Details
-
updateSignalMastLogic
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
configureTable
-
getPreferredWidth
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
dispose
Remove references to and from this object, so that it can eventually be garbage-collected. -
propertyChange
Listen for changes to specific properties of the displayed Signal Masts.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
e- The ChangeEvent heard
-
configEditColumn
Display buttons in 2 columns of the manual control signal masts table.- Parameters:
table- The control signal mast table to be configured
-
setColumnToHoldButton
Helper function forconfigEditColumn(JTable).- Parameters:
table- The control signal mast table to be configuredcolumn- Index for the column to put the button insample- JButton to put there
-
getColumnCount
Get the number of columns in the signal masts table.- Specified by:
getColumnCountin interfaceTableModel- Returns:
- Fixed value of 6
-
isCellEditable
Query whether the cells in a table column should respond to clicks.- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel- Parameters:
r- Index for the cell rowc- Index for the cell column
-
editPair
Respond to the Edit Logic button being clicked.- Parameters:
r- Index for the cell row
-
deletePair
-
setSetToState
-
getRowCount
Get the number of Included signal masts for this SML.- Specified by:
getRowCountin interfaceTableModel
-
getValueAt
Retrieve the contents to display in a cell in the table, in terms of model- Specified by:
getValueAtin interfaceTableModel- Parameters:
r- index for the cell rowc- index for the cell column- Returns:
- The value (text) stored in the cell
-
setValueAt
Process the contents from a table cell, in terms of model- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel- Parameters:
type- the object type of the cell contentsr- index for the cell rowc- index for the cell column
-