Package jmri.jmrit.beantable.sensor
Class SensorTableDataModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Data model for a SensorTable.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classVisualize state in table as a graphic, customized for Sensors (2 states).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 intstatic 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
ConstructorsConstructorDescriptionCreate a new Sensor Table Data Model.SensorTableDataModel(Manager<Sensor> manager) Create a new Sensor Table Data Model. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidProcess a click on The value cell.voidconfigureTable(JTable table) Configure a table to have our standard rows and columns.protected voidconfigValueColumn(JTable table) Customize the sensor table Value (State) column to show an appropriate graphic for the sensor state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.(package private) voideditButton(Sensor s) protected SensorgetBySystemName(String name) protected SensorgetByUserName(String name) protected StringClass<?>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 voidsetColumnIdentities(JTable table) Set identities for any columns that need an identity.protected final voidsetManager(Manager<Sensor> manager) Set the Model Bean Manager.voidsetValueAt(Object value, int row, int col) voidshowDebounce(boolean show, JTable table) Show or hide the Debounce columns.voidshowPullUp(boolean show, JTable table) Show or hide the Pullup column.voidshowStateForgetAndQuery(boolean show, JTable table) Show or hide the State - Forget and Query columns.FORGETCOL, QUERYCOLMethods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureButton, configureJTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getBeanType, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, propertyChange, removeName, renameBean, 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
-
INVERTCOL
- See Also:
-
EDITCOL
- See Also:
-
USEGLOBALDELAY
- See Also:
-
ACTIVEDELAY
- See Also:
-
INACTIVEDELAY
- See Also:
-
PULLUPCOL
- See Also:
-
FORGETCOL
- See Also:
-
QUERYCOL
- See Also:
-
_graphicState
-
-
Constructor Details
-
SensorTableDataModel
public SensorTableDataModel()Create a new Sensor Table Data Model. The default Manager for the bean type will be a Proxy Manager. -
SensorTableDataModel
Create a new Sensor Table Data Model. The default Manager for the bean type will be a Proxy Manager unless one is specified here.- Parameters:
manager- Bean Manager.
-
-
Method Details
-
getValue
Get the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<Sensor>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
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<Sensor>- Parameters:
manager- Bean Manager that the Model should use.
-
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<Sensor>- Returns:
- current Manager in use by the Model.
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<Sensor>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<Sensor>
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<Sensor>
-
clickOn
Process a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<Sensor>- Parameters:
t- the Bean that has been clicked.
-
getColumnCount
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<Sensor>
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<Sensor>
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<Sensor>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<Sensor>
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<Sensor>
-
getValueAt
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<Sensor>
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<Sensor>
-
matchPropertyName
Is 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<Sensor>- Parameters:
e- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
configValueColumn
Customize the sensor table Value (State) column to show an appropriate graphic for the sensor state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.- Overrides:
configValueColumnin classBeanTableDataModel<Sensor>- Parameters:
table- a JTable of Sensors
-
configureTable
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. This also persists the table user interface state.- Overrides:
configureTablein classBeanTableDataModel<Sensor>- Parameters:
table-JTableto configure
-
editButton
-
showDebounce
Show or hide the Debounce columns. USEGLOBALDELAY, ACTIVEDELAY, INACTIVEDELAY- Parameters:
show- true to display, false to hide.table- the JTable to set column visibility on.
-
showPullUp
Show or hide the Pullup column. PULLUPCOL- Parameters:
show- true to display, false to hide.table- the JTable to set column visibility on.
-
showStateForgetAndQuery
Show or hide the State - Forget and Query columns.FORGETCOL, QUERYCOL- Parameters:
show- true to display, false to hide.table- the JTable to set column visibility on.
-
getClassName
-
getClassDescription
-
setColumnIdentities
Set identities for any columns that need an identity. It is recommended that all columns get a constant identity to prevent identities from being subject to changes due to translation.The default implementation sets column identities to the String
Column#where#is the model index for the column. Note that if the TableColumnModel is aXTableColumnModel, the index includes hidden columns.- Overrides:
setColumnIdentitiesin classBeanTableDataModel<Sensor>- Parameters:
table- the table to set identities for.
-