Package jmri.jmrit.beantable.oblock
Class OBlockTableModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
GUI to define OBlocks.
Duplicates the JTable model for BlockTableAction and adds a column for the occupancy sensor. Configured for use within an internal frame.
Can be used with two interfaces:
- original "desktop" InternalFrames (parent class TableFrames, an extended JmriJFrame)
- JMRI "standard" Tabbed tables (parent class JPanel)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProvide a table cell renderer looking like a JComboBox as an editor/renderer for the OBlock table CURVE column.static classProvide a table cell renderer looking like a JComboBox as an editor/renderer for the OBlock table SPEED column.Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer -
Field Summary
FieldsModifier and TypeFieldDescription(package private) OBlockManager(package private) TableFramesstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int(package private) DecimalFormatstatic final intstatic final intstatic final intstatic final int(package private) static StringFields inherited from class jmri.jmrit.beantable.BeanTableDataModel
DELETECOL, NUMCOLUMN, sysNameList, VALUECOLFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHeaderListener(JTable table) Respond to mouse events to show/hide columns.protected voidvoidProcess a click on The value cell.voidconfigCurveColumn(JTable table) Customize the Turnout column to show an appropriate ComboBox of available options.voidconfigSpeedColumn(JTable table) Customize the Turnout column to show an appropriate ComboBox of available options.(package private) voiddeleteBean(OBlock bean) protected StringGet String of the Single Bean Type.getBySystemName(String name) getByUserName(String name) protected StringClass<?>getColumnClass(int col) intGet Column Count INCLUDING Bean Property Columns.getColumnName(int col) getCurveEditorBox(int row) Provide a static JComboBox element to display inside the JPanel CellEditor.Get the Table Model Bean Manager.protected StringintgetPreferredWidth(int col) intgetSpeedEditorBox(int row) Provide a static JComboBox element to display inside the JPanel CellEditor.protected static StringgetValue(int state) Get the current Bean state value in human readable form.getValueAt(int row, int col) SYSNAMECOL returns the actual Bean, NOT the System Name.(package private) voidbooleanisCellEditable(int row, int col) protected booleanisMetric()voidvoidsetValueAt(Object value, int row, int col) Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureButton, configureJTable, configureTable, configValueColumn, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, isClearUserNameAllowed, makeJTable, matchPropertyName, 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
-
SYSNAMECOL
- See Also:
-
USERNAMECOL
- See Also:
-
COMMENTCOL
- See Also:
-
STATECOL
- See Also:
-
SENSORCOL
- See Also:
-
EDIT_COL
- See Also:
-
DELETE_COL
- See Also:
-
LENGTHCOL
- See Also:
-
UNITSCOL
- See Also:
-
REPORTERCOL
- See Also:
-
REPORT_CURRENTCOL
- See Also:
-
PERMISSIONCOL
- See Also:
-
SPEEDCOL
- See Also:
-
WARRANTCOL
- See Also:
-
ERR_SENSORCOL
- See Also:
-
CURVECOL
- See Also:
-
VALUE
- See Also:
-
NUMCOLS
- See Also:
-
ZEROS
-
twoDigit
-
_manager
-
_parent
-
-
Constructor Details
-
OBlockTableModel
-
-
Method Details
-
addHeaderListener
Respond to mouse events to show/hide columns. Has public access to allow setting from OBlockTableAction OBlock Panel.- Parameters:
table- the table based on this model
-
initTempRow
void initTempRow() -
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<OBlock>- Returns:
- current Manager in use by the Model.
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<OBlock>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<OBlock>
-
getBeanType
Description copied from class:BeanTableDataModelGet String of the Single Bean Type. In many cases the return is Bundle localised so should not be used for matching Bean types.- Overrides:
getBeanTypein classBeanTableDataModel<OBlock>- Returns:
- Bean Type String.
-
clickOn
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<OBlock>- Parameters:
t- the Bean that has been clicked.
-
isMetric
-
changeUnits
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<OBlock>
-
getBeanList
-
getValue
Description copied from class:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<OBlock>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
getValue
-
getColumnCount
Description copied from class:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<OBlock>
-
getRowCount
Description copied from class:BeanTableDataModel- Specified by:
getRowCountin interfaceTableModel- Overrides:
getRowCountin classBeanTableDataModel<OBlock>
-
getValueAt
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<OBlock>
-
setValueAt
Description copied from class:BeanTableDataModel- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<OBlock>
-
getColumnName
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<OBlock>
-
deleteBean
-
getColumnClass
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<OBlock>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<OBlock>
-
isCellEditable
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<OBlock>
-
getCurveEditorBox
Provide a static JComboBox element to display inside the JPanel CellEditor. When not yet present, create, store and return a new one.- Parameters:
row- Index number (in TableDataModel)- Returns:
- A JCombobox containing the valid curvature names.
-
configCurveColumn
Customize the Turnout column to show an appropriate ComboBox of available options.- Parameters:
table- a JTable of beans
-
getSpeedEditorBox
Provide a static JComboBox element to display inside the JPanel CellEditor. When not yet present, create, store and return a new one.- Parameters:
row- Index number (in TableDataModel)- Returns:
- A combobox containing the valid aspect names for this mast
-
configSpeedColumn
Customize the Turnout column to show an appropriate ComboBox of available options.- Parameters:
table- a JTable of beans
-
propertyChange
Description copied from class:BeanTableDataModel- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<OBlock>
-
getClassName
-