Package jmri.jmrit.beantable.signalmast
Class SignalMastTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<SignalMast>
-
- jmri.jmrit.beantable.signalmast.SignalMastTableDataModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.io.Serializable,java.util.EventListener,javax.swing.table.TableModel
public class SignalMastTableDataModel extends BeanTableDataModel<SignalMast>
Data model for a SignalMastTable- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSignalMastTableDataModel.AspectComboBoxPanelA row specific Aspect combobox cell editor/renderer-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.HashMap<java.lang.Object,java.util.Vector<java.lang.String>>boxMapstatic intEDITLOGICCOLstatic intEDITMASTCOL(package private) java.util.HashMap<java.lang.Object,javax.swing.JComboBox<java.lang.String>>editorMapstatic intHELDCOLstatic intLITCOL-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Constructor Description SignalMastTableDataModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAspectVector(int row)Clear the old aspect comboboxes and force them to be rebuiltprotected voidclickOn(SignalMast t)Process a click on The value cell.javax.swing.JButtonconfigureButton()Set column width.protected voidconfigValueColumn(javax.swing.JTable table)Customize the SignalMast Value (Aspect) column to show an appropriate ComboBox of available Aspects when the TableDataModel is being called from ListedTableAction.(package private) voideditLogic(int row, int col)(package private) voideditMast(int row, int col)(package private) javax.swing.JComboBox<java.lang.String>getAspectEditorBox(int row)Provide a JComboBox element to display inside the JPanel CellEditor.(package private) java.util.Vector<java.lang.String>getAspectVector(int row)Holds a HashMap of valid aspects per signal mast used by getEditorBox()protected SignalMastgetBySystemName(java.lang.String name)protected SignalMastgetByUserName(java.lang.String name)java.lang.StringgetClassDescription()protected java.lang.StringgetClassName()java.lang.Class<?>getColumnClass(int col)intgetColumnCount()Get Column Count INCLUDING Bean Property Columns.java.lang.StringgetColumnName(int col)protected Manager<SignalMast>getManager()Get the Table Model Bean Manager.protected java.lang.StringgetMasterClassName()intgetPreferredWidth(int col)java.lang.StringgetValue(java.lang.String name)Get the current Bean state value in human readable form.java.lang.ObjectgetValueAt(int row, int col)SYSNAMECOL returns the actual Bean, NOT the System Name.booleanisCellEditable(int row, int col)protected booleanmatchPropertyName(java.beans.PropertyChangeEvent e)Is this property event announcing a change this table should display?voidpropertyChange(java.beans.PropertyChangeEvent e)Respond to change from bean.voidsetValueAt(java.lang.Object value, int row, int col)-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureJTable, configureTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getBeanType, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setManager, setPropertyColumnsVisible, showPopup, showTableHeaderPopup, stopPersistingTable, updateNameList
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
EDITMASTCOL
public static final int EDITMASTCOL
- See Also:
- Constant Field Values
-
EDITLOGICCOL
public static final int EDITLOGICCOL
- See Also:
- Constant Field Values
-
LITCOL
public static final int LITCOL
- See Also:
- Constant Field Values
-
HELDCOL
public static final int HELDCOL
- See Also:
- Constant Field Values
-
editorMap
java.util.HashMap<java.lang.Object,javax.swing.JComboBox<java.lang.String>> editorMap
-
boxMap
java.util.HashMap<java.lang.Object,java.util.Vector<java.lang.String>> boxMap
-
-
Constructor Detail
-
SignalMastTableDataModel
public SignalMastTableDataModel()
-
-
Method Detail
-
getValue
public java.lang.String getValue(java.lang.String name)
Description copied from class:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<SignalMast>- Parameters:
name- System name of Bean.- Returns:
- state value in localised human readable form.
-
getColumnCount
public int getColumnCount()
Description copied from class:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfacejavax.swing.table.TableModel- Overrides:
getColumnCountin classBeanTableDataModel<SignalMast>
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classBeanTableDataModel<SignalMast>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classBeanTableDataModel<SignalMast>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidthin classBeanTableDataModel<SignalMast>
-
isCellEditable
public boolean isCellEditable(int row, int col)
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein classBeanTableDataModel<SignalMast>
-
getManager
protected Manager<SignalMast> 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<SignalMast>- Returns:
- current Manager in use by the Model.
-
getBySystemName
protected SignalMast getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemNamein classBeanTableDataModel<SignalMast>
-
getByUserName
protected SignalMast getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserNamein classBeanTableDataModel<SignalMast>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassNamein classBeanTableDataModel<SignalMast>
-
clickOn
protected void clickOn(SignalMast t)
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<SignalMast>- Parameters:
t- the Bean that has been clicked.
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfacejavax.swing.table.TableModel- Overrides:
getValueAtin classBeanTableDataModel<SignalMast>
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
Description copied from class:BeanTableDataModel- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classBeanTableDataModel<SignalMast>
-
editLogic
void editLogic(int row, int col)
-
editMast
void editMast(int row, int col)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Respond to change from bean.- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Overrides:
propertyChangein classBeanTableDataModel<SignalMast>- Parameters:
e- the change event to respond to
-
matchPropertyName
protected boolean matchPropertyName(java.beans.PropertyChangeEvent e)
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<SignalMast>- Parameters:
e- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
configValueColumn
protected void configValueColumn(javax.swing.JTable table)
Customize the SignalMast Value (Aspect) column to show an appropriate ComboBox of available Aspects when the TableDataModel is being called from ListedTableAction.- Overrides:
configValueColumnin classBeanTableDataModel<SignalMast>- Parameters:
table- a JTable of Signal Masts
-
configureButton
public javax.swing.JButton configureButton()
Set column width.- Overrides:
configureButtonin classBeanTableDataModel<SignalMast>- Returns:
- a button to fit inside the VALUE column
-
clearAspectVector
public void clearAspectVector(int row)
Clear the old aspect comboboxes and force them to be rebuilt- Parameters:
row- Index of the signal mast (in TableDataModel) to be rebuilt in the HashMaps
-
getAspectEditorBox
javax.swing.JComboBox<java.lang.String> getAspectEditorBox(int row)
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 aspect names for this mast
-
getAspectVector
java.util.Vector<java.lang.String> getAspectVector(int row)
Holds a HashMap of valid aspects per signal mast used by getEditorBox()- Parameters:
row- Index number (in TableDataModel)- Returns:
- The Vector of valid aspect names for this mast to show in the JComboBox
-
getClassName
protected java.lang.String getClassName()
-
getClassDescription
public java.lang.String getClassDescription()
-
-