Package jmri.jmrit.beantable
Class SignalHeadTableModel
- All Implemented Interfaces:
PropertyChangeListener,Serializable,EventListener,TableModel
Model for a SignalHeadTable.
Code originally located within SignalHeadTableAction.java
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classA row specific Appearance combobox cell editor/renderer.Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer, BeanTableDataModel.DateRenderer, BeanTableDataModel.DeleteBeanWorker, BeanTableDataModel.HeaderActionListener, BeanTableDataModel.PopupListener, BeanTableDataModel.TableHeaderListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptionvoidclearAppearanceVector(int row) Clear the old appearance comboboxes and force them to be rebuilt.voidProcess a click on The value cell.Set column width.protected voidconfigValueColumn(JTable table) Customize the SignalHead Value (Appearance) column to show an appropriate ComboBox of available Appearances when the TableDataModel is being called from ListedTableAction.voiddispose()Removes property change listeners from Beans.getAppearanceEditorBox(int row) Provide a JComboBox element to display inside the JPanel CellEditor.protected StringGet String of the Single Bean Type.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) getRowVector(int row) Holds a Hashtable of valid appearances per signal head, used by getEditorBox()Get a list of all the valid appearances that have not been disabled.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) booleanIs this property event announcing a change this table should display?voidRespond to change from bean.voidsetValueAt(Object value, int row, int col) Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addEditProperty, addMouseListenerToHeader, allowBlockNameChange, configDeleteColumn, configureJTable, configureTable, copySystemName, copyUserName, deleteBean, doDelete, editComment, exportToCSV, formatToolTip, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, 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
-
LITCOL
- See Also:
-
HELDCOL
- See Also:
-
EDITCOL
- See Also:
-
editorMap
-
boxMap
-
-
Constructor Details
-
SignalHeadTableModel
public SignalHeadTableModel()
-
-
Method Details
-
getColumnCount
Description copied from class:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfaceTableModel- Overrides:
getColumnCountin classBeanTableDataModel<SignalHead>
-
getColumnName
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classBeanTableDataModel<SignalHead>
-
getColumnClass
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classBeanTableDataModel<SignalHead>
-
getPreferredWidth
- Overrides:
getPreferredWidthin classBeanTableDataModel<SignalHead>
-
isCellEditable
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classBeanTableDataModel<SignalHead>
-
getValueAt
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfaceTableModel- Overrides:
getValueAtin classBeanTableDataModel<SignalHead>
-
setValueAt
Description copied from class:BeanTableDataModel- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classBeanTableDataModel<SignalHead>
-
getValue
Description copied from class:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<SignalHead>- 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<SignalHead>- Returns:
- current Manager in use by the Model.
-
getBySystemName
- Specified by:
getBySystemNamein classBeanTableDataModel<SignalHead>
-
getByUserName
- Specified by:
getByUserNamein classBeanTableDataModel<SignalHead>
-
getMasterClassName
- Specified by:
getMasterClassNamein classBeanTableDataModel<SignalHead>
-
clickOn
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<SignalHead>- Parameters:
t- the Bean that has been clicked.
-
configureButton
Set column width.- Overrides:
configureButtonin classBeanTableDataModel<SignalHead>- Returns:
- a button to fit inside the VALUE column
-
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<SignalHead>- Parameters:
e- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
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<SignalHead>- Returns:
- Bean Type String.
-
propertyChange
Respond to change from bean. Prevent Appearance change when Signal Head is set to Hold or Unlit.- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<SignalHead>- Parameters:
e- A property change of any bean
-
configValueColumn
Customize the SignalHead Value (Appearance) column to show an appropriate ComboBox of available Appearances when the TableDataModel is being called from ListedTableAction.- Overrides:
configValueColumnin classBeanTableDataModel<SignalHead>- Parameters:
table- a JTable of Signal Head
-
clearAppearanceVector
Clear the old appearance comboboxes and force them to be rebuilt. Used with the Single Output Signal Head to capture reconfiguration.- Parameters:
row- Index of the signal mast (in TableDataModel) to be rebuilt in the Hashtables
-
getAppearanceEditorBox
Provide a 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 appearance names for this mast
-
getValidAppearances
Get a list of all the valid appearances that have not been disabled.- Parameters:
head- the name of the signal head- Returns:
- List of valid signal head appearance names
-
getRowVector
Holds a Hashtable of valid appearances per signal head, used by getEditorBox()- Parameters:
row- Index number (in TableDataModel)- Returns:
- The Vector of valid appearance names for this mast to show in the JComboBox
-
dispose
Description copied from class:BeanTableDataModelRemoves property change listeners from Beans.- Overrides:
disposein classBeanTableDataModel<SignalHead>
-