Package jmri.jmrit.beantable.turnout
Class TurnoutTableDataModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Data model for a Turnout Table.
Code originally within TurnoutTableAction.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classVisualize state in table as a graphic, customized for Turnouts (4 states).Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer -
Field Summary
FieldsModifier and TypeFieldDescription(package private) String(package private) String(package private) Stringstatic final intstatic final intprotected static AtomicBooleanstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) Stringstatic final intstatic final int(package private) Stringstatic final intstatic final intstatic final intstatic final int(package private) String(package private) StringFields 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.voidconfigureTable(JTable tbl) Configure a table to have our standard rows and columns.protected voidconfigValueColumn(JTable table) Customize the turnout table Value (State) column to show an appropriate graphic for the turnout state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.protected JButtonCreate a JButton to edit a turnout's operation.(package private) voidCreate action to edit a turnout in Edit pane.protected voideditTurnoutOperation(Turnout t, JComboBox<String> box) Pop up a TurnoutOperationConfig for the turnout.getBySystemName(String name) getByUserName(String name) protected StringClass<?>getColumnClass(int col) intGet Column Count INCLUDING Bean Property Columns.getColumnName(int col) protected StringgetHeaderTooltip(int col) Get a ToolTip for a Table Column Header.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) Create a JComboBox<String> containing all the options for turnout automation parameters for this turnout.makeJTable(String name, TableModel model, RowSorter<? extends TableModel> sorter) Create and configure a new table using the given model and row sorter.protected booleanIs this property event announcing a change this table should display?voidprotected voidsetColumnIdentities(JTable table) Set identities for any columns that need an identity.protected final voidsetManager(Manager<Turnout> manager) Set the Model Bean Manager.protected voidsetTurnoutOperation(Turnout t, JComboBox<String> cb) Set the turnout's operation info based on the contents of the combo box.voidsetValueAt(Object value, int row, int col) voidshowFeedbackChanged(boolean visible, JTable table) voidshowLockChanged(boolean visible, JTable table) voidshowStateForgetAndQueryChanged(boolean visible, JTable table) voidshowTurnoutSpeedChanged(boolean visible, JTable table) Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureButton, configureJTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getBeanType, getCellToolTip, getDisplayDeleteMsg, getFilter, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, moveBean, persistTable, printColumns, printTable, 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:
-
LOCKCOL
- See Also:
-
EDITCOL
- See Also:
-
KNOWNCOL
- See Also:
-
MODECOL
- See Also:
-
SENSOR1COL
- See Also:
-
SENSOR2COL
- See Also:
-
OPSONOFFCOL
- See Also:
-
OPSEDITCOL
- See Also:
-
LOCKOPRCOL
- See Also:
-
LOCKDECCOL
- See Also:
-
STRAIGHTCOL
- See Also:
-
DIVERGCOL
- See Also:
-
FORGETCOL
- See Also:
-
QUERYCOL
- See Also:
-
closedText
-
thrownText
-
defaultThrownSpeedText
-
defaultClosedSpeedText
-
useBlockSpeed
-
bothText
-
cabOnlyText
-
pushbutText
-
noneText
-
speedListClosed
-
speedListThrown
-
editingOps
-
-
Constructor Details
-
TurnoutTableDataModel
public TurnoutTableDataModel() -
TurnoutTableDataModel
-
-
Method Details
-
getColumnCount
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<Turnout>
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<Turnout>
-
getHeaderTooltip
Get a ToolTip for a Table Column Header.- Overrides:
getHeaderTooltipin classBeanTableDataModel<Turnout>- Parameters:
col- the model column number.- Returns:
- ToolTip, else null.
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<Turnout>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<Turnout>
-
isCellEditable
- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<Turnout>
-
getValueAt
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<Turnout>
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<Turnout>
-
getValue
Get the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<Turnout>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
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<Turnout>- 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<Turnout>- Parameters:
manager- Bean Manager that the Model should use.
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<Turnout>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<Turnout>
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<Turnout>
-
getClassName
-
clickOn
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<Turnout>- Parameters:
t- the Bean that has been clicked.
-
configureTable
Description copied from class:BeanTableDataModelConfigure 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<Turnout>- Parameters:
tbl-JTableto configure
-
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<Turnout>- Parameters:
e- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
propertyChange
Description copied from class:BeanTableDataModel- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<Turnout>
-
configValueColumn
Customize the turnout table Value (State) column to show an appropriate graphic for the turnout state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.- Overrides:
configValueColumnin classBeanTableDataModel<Turnout>- Parameters:
table- a JTable of Turnouts
-
makeJTable
public JTable makeJTable(@Nonnull String name, @Nonnull TableModel model, @CheckForNull RowSorter<? extends TableModel> sorter) Description copied from class:BeanTableDataModelCreate and configure a new table using the given model and row sorter.- Overrides:
makeJTablein classBeanTableDataModel<Turnout>- Parameters:
name- the name of the tablemodel- the data model for the tablesorter- the row sorter for the table; if null, the table will not be sortable- Returns:
- the table
-
setColumnIdentities
Description copied from class:BeanTableDataModelSet 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<Turnout>- Parameters:
table- the table to set identities for.
-
editTurnoutOperation
Pop up a TurnoutOperationConfig for the turnout.- Parameters:
t- turnoutbox- JComboBox that triggered the edit
-
makeAutomationBox
Create a JComboBox<String> containing all the options for turnout automation parameters for this turnout.- Parameters:
t- the turnout- Returns:
- the JComboBox
-
setTurnoutOperation
Set the turnout's operation info based on the contents of the combo box.- Parameters:
t- turnout being configuredcb- JComboBox for ops for t in the TurnoutTable
-
editButton
Create action to edit a turnout in Edit pane. (also used in windowTest)- Parameters:
t- the turnout to be edited
-
editButton
Create a JButton to edit a turnout's operation.- Returns:
- the JButton
-
showFeedbackChanged
-
showLockChanged
-
showTurnoutSpeedChanged
-
showStateForgetAndQueryChanged
-