Package jmri.jmrit.beantable.light
Class LightTableDataModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Data model for a Light Table.
Code originally within LightTableAction.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classVisualize state in table as a graphic, customized for Lights (2 states + ... for transitioning).Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final intstatic final intstatic final intstatic final intFields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOLFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess a click on The value cell.protected voidconfigValueColumn(JTable table) Customize the light table Value (State) column to show an appropriate graphic for the light state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.protected voidDelete the bean after all the checking has been done.getBySystemName(String name) getByUserName(String name) Class<?>getColumnClass(int col) intGet Column Count INCLUDING Bean Property Columns.getColumnName(int col) Get the Table Model Bean Manager.protected StringintgetPreferredWidth(int col) Get the current Bean state value in human readable form.getValueAt(int row, int col) SYSNAMECOL returns the actual Bean, NOT the System Name.booleanisCellEditable(int row, int col) protected booleanIs this property event announcing a change this table should display?protected final voidsetManager(Manager<Light> manager) Set the Model Bean Manager.voidsetValueAt(Object value, int row, int col) Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureJTable, configureTable, copySystemName, copyUserName, deleteBean, dispose, editComment, exportToCSV, formatToolTip, getBeanType, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, propertyChange, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setPropertyColumnsVisible, showPopup, showTableHeaderPopup, stopPersistingTable, updateNameListMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
ENABLECOL
- See Also:
-
INTENSITYCOL
- See Also:
-
EDITCOL
- See Also:
-
CONTROLCOL
- See Also:
-
_graphicState
-
-
Constructor Details
-
LightTableDataModel
public LightTableDataModel() -
LightTableDataModel
-
-
Method Details
-
getManager
Get the Table Model Bean Manager. In many cases, especially around Model startup, this will be the Proxy Manager, which is then changed to the hardware specific manager.- Specified by:
getManagerin classBeanTableDataModel<Light>- Returns:
- current Manager in use by the Model.
-
setManager
Set the Model Bean Manager. Note that for many Models this may not work as the manager is currently obtained directly from the Action class.- Overrides:
setManagerin classBeanTableDataModel<Light>- Parameters:
manager- Bean Manager that the Model should use.
-
getColumnCount
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<Light>
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<Light>
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<Light>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<Light>
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<Light>
-
getValue
Get the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<Light>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
getValueAt
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<Light>
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<Light>
-
doDelete
Delete the bean after all the checking has been done.Deactivate the light, then use the superclass to delete it.
- Overrides:
doDeletein classBeanTableDataModel<Light>- Parameters:
bean- NamedBean to delete
-
matchPropertyName
Description copied from class:BeanTableDataModelIs this property event announcing a change this table should display?Note that events will come both from the NamedBeans and also from the manager
- Overrides:
matchPropertyNamein classBeanTableDataModel<Light>- Parameters:
e- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<Light>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<Light>
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<Light>
-
clickOn
Process a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<Light>- Parameters:
t- the Bean that has been clicked.
-
configureButton
- Overrides:
configureButtonin classBeanTableDataModel<Light>
-
configValueColumn
Customize the light table Value (State) column to show an appropriate graphic for the light state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.- Overrides:
configValueColumnin classBeanTableDataModel<Light>- Parameters:
table- a JTable of Lights
-