Package jmri.jmrit.beantable.block
Class BlockTableDataModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Data model for a Block Table.
Code originally within BlockTableAction.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classVisualize state in table as a graphic, customized for Blocks (2 states).Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidProcess a click on The value cell.protected voidconfigStateColumn(JTable table) Customize the block table State column to show an appropriate graphic for the block occupancy state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.voidconfigureTable(JTable table) Configure a table to have our standard rows and columns.voidconfigValueColumn(JTable table) (package private) voideditButton(Block b) getBySystemName(String name) getByUserName(String name) getCellToolTip(JTable table, int modelRow, int modelCol) Display the comment text for the current row as a tool tip.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) makeJTable(String name, TableModel model, RowSorter<? extends TableModel> sorter) Create and configure a new table using the given model and row sorter.protected booleanreturns true for all Block properties.voidvoidsetDefaultSpeeds(JFrame frame) voidsetMetric(boolean boo) Set and refresh the UI to use Metric or Imperial values.voidsetValueAt(Object value, int row, int col) Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureJTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getBeanType, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, moveBean, persistTable, printColumns, printTable, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setManager, 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
-
EDITCOL
- See Also:
-
DIRECTIONCOL
- See Also:
-
LENGTHCOL
- See Also:
-
CURVECOL
- See Also:
-
STATECOL
- See Also:
-
SENSORCOL
- See Also:
-
REPORTERCOL
- See Also:
-
CURRENTREPCOL
- See Also:
-
PERMISCOL
- See Also:
-
SPEEDCOL
- See Also:
-
GHOSTCOL
- See Also:
-
COLUMNCOUNT
- See Also:
-
-
Constructor Details
-
BlockTableDataModel
-
-
Method Details
-
getValue
Description copied from class:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<Block>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
getManager
Description copied from class:BeanTableDataModelGet 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<Block>- Returns:
- current Manager in use by the Model.
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<Block>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<Block>
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<Block>
-
clickOn
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<Block>- Parameters:
t- the Bean that has been clicked.
-
getColumnCount
Description copied from class:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<Block>
-
getValueAt
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<Block>
-
setValueAt
Description copied from class:BeanTableDataModel- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<Block>
-
getColumnName
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<Block>
-
getColumnClass
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<Block>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<Block>
-
configValueColumn
- Overrides:
configValueColumnin classBeanTableDataModel<Block>
-
isCellEditable
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<Block>
-
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<Block>- 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
-
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<Block>- Parameters:
table-JTableto configure
-
editButton
-
matchPropertyName
returns true for all Block properties.- Overrides:
matchPropertyNamein classBeanTableDataModel<Block>- Parameters:
e- property event that has changed.- Returns:
- true as all matched.
-
configureButton
- Overrides:
configureButtonin classBeanTableDataModel<Block>
-
propertyChange
Description copied from class:BeanTableDataModel- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<Block>
-
setMetric
Set and refresh the UI to use Metric or Imperial values.- Parameters:
boo- true if metric, false for Imperial.
-
setDefaultSpeeds
-
configStateColumn
Customize the block table State column to show an appropriate graphic for the block occupancy state if _graphicState = true, or (default) just show the localized state text when the TableDataModel is being called from ListedTableAction.- Parameters:
table- a JTable of Blocks
-
getCellToolTip
Description copied from class:BeanTableDataModelDisplay the comment text for the current row as a tool tip. Most of the bean tables use the standard model with comments in column 3.- Overrides:
getCellToolTipin classBeanTableDataModel<Block>- Parameters:
table- The current table.modelRow- The current row.modelCol- The current column.- Returns:
- a formatted tool tip or null if there is none.
-