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 class
SignalMastTableDataModel.AspectComboBoxPanel
A 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>>
boxMap
static int
EDITLOGICCOL
static int
EDITMASTCOL
(package private) java.util.HashMap<java.lang.Object,javax.swing.JComboBox<java.lang.String>>
editorMap
static int
HELDCOL
static int
LITCOL
-
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 void
clearAspectVector(int row)
Clear the old aspect comboboxes and force them to be rebuiltprotected void
clickOn(SignalMast t)
Process a click on The value cell.javax.swing.JButton
configureButton()
Set column width.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.(package private) void
editLogic(int row, int col)
(package private) void
editMast(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 SignalMast
getBySystemName(java.lang.String name)
protected SignalMast
getByUserName(java.lang.String name)
java.lang.String
getClassDescription()
protected java.lang.String
getClassName()
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
Get Column Count INCLUDING Bean Property Columns.java.lang.String
getColumnName(int col)
protected Manager<SignalMast>
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
int
getPreferredWidth(int col)
java.lang.String
getValue(java.lang.String name)
Get the current Bean state value in human readable form.java.lang.Object
getValueAt(int row, int col)
SYSNAMECOL returns the actual Bean, NOT the System Name.boolean
isCellEditable(int row, int col)
protected boolean
matchPropertyName(java.beans.PropertyChangeEvent e)
Is this property event announcing a change this table should display?void
propertyChange(java.beans.PropertyChangeEvent e)
Respond to change from bean.void
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureJTable, configureTable, copyName, deleteBean, dispose, doDelete, editComment, 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:BeanTableDataModel
Get the current Bean state value in human readable form.- Specified by:
getValue
in classBeanTableDataModel<SignalMast>
- Parameters:
name
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getColumnCount
public int getColumnCount()
Description copied from class:BeanTableDataModel
Get Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnCount
in classBeanTableDataModel<SignalMast>
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from class:BeanTableDataModel
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classBeanTableDataModel<SignalMast>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
Description copied from class:BeanTableDataModel
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classBeanTableDataModel<SignalMast>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<SignalMast>
-
isCellEditable
public boolean isCellEditable(int row, int col)
Description copied from class:BeanTableDataModel
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classBeanTableDataModel<SignalMast>
-
getManager
protected Manager<SignalMast> getManager()
Description copied from class:BeanTableDataModel
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:
getManager
in classBeanTableDataModel<SignalMast>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
protected SignalMast getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<SignalMast>
-
getByUserName
protected SignalMast getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<SignalMast>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<SignalMast>
-
clickOn
protected void clickOn(SignalMast t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<SignalMast>
- Parameters:
t
- the Bean that has been clicked.
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Description copied from class:BeanTableDataModel
SYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
getValueAt
in classBeanTableDataModel<SignalMast>
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
Description copied from class:BeanTableDataModel
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in 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:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classBeanTableDataModel<SignalMast>
- Parameters:
e
- the change event to respond to
-
matchPropertyName
protected boolean matchPropertyName(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel
Is 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:
matchPropertyName
in 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:
configValueColumn
in classBeanTableDataModel<SignalMast>
- Parameters:
table
- a JTable of Signal Masts
-
configureButton
public javax.swing.JButton configureButton()
Set column width.- Overrides:
configureButton
in 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()
-
-