Package jmri.jmrit.beantable
Class RailComTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<IdTag>
-
- jmri.jmrit.beantable.RailComTableDataModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class RailComTableDataModel extends BeanTableDataModel<IdTag>
TableDataModel for the RailCom Table. Split fromRailComTableAction
- Since:
- 2.11.4
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer, BeanTableDataModel.DateRenderer, BeanTableDataModel.DeleteBeanWorker, BeanTableDataModel.HeaderActionListener, BeanTableDataModel.PopupListener, BeanTableDataModel.TableHeaderListener
-
-
Field Summary
Fields Modifier and Type Field Description static int
CLEARCOL
static int
DELETECOL
static int
FUELCOL
static int
LOADCOL
static int
LOCATIONCOL
static int
NUMCOLUMN
static int
ROUTINGCOL
static int
SPEEDCOL
static int
TEMPCOL
static int
VALUECOL
static int
WATERCOL
static int
WHENCOL
static int
WHERECOL
-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, SYSNAMECOL, sysNameList, USERNAMECOL
-
-
Constructor Summary
Constructors Constructor Description RailComTableDataModel(Manager<IdTag> mgr)
Create a new Memory Table Data Model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickOn(IdTag t)
Process a click on The value cell.javax.swing.JButton
configureButton()
void
configValueColumn(javax.swing.JTable table)
protected java.lang.String
getBeanType()
Get String of the Single Bean Type.RailCom
getBySystemName(java.lang.String name)
RailCom
getByUserName(java.lang.String name)
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
Get Column Count INCLUDING Bean Property Columns.java.lang.String
getColumnName(int col)
RailComManager
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
setManager(Manager<IdTag> mgr)
Set the Model Bean Manager.void
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, allowBlockNameChange, configDeleteColumn, configureJTable, configureTable, copyName, deleteBean, dispose, doDelete, editComment, exportToCSV, formatToolTip, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, propertyChange, removeName, renameBean, setColumnIdentities, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, 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
-
VALUECOL
public static final int VALUECOL
- See Also:
- Constant Field Values
-
WHERECOL
public static final int WHERECOL
- See Also:
- Constant Field Values
-
WHENCOL
public static final int WHENCOL
- See Also:
- Constant Field Values
-
CLEARCOL
public static final int CLEARCOL
- See Also:
- Constant Field Values
-
SPEEDCOL
public static final int SPEEDCOL
- See Also:
- Constant Field Values
-
LOADCOL
public static final int LOADCOL
- See Also:
- Constant Field Values
-
TEMPCOL
public static final int TEMPCOL
- See Also:
- Constant Field Values
-
FUELCOL
public static final int FUELCOL
- See Also:
- Constant Field Values
-
WATERCOL
public static final int WATERCOL
- See Also:
- Constant Field Values
-
LOCATIONCOL
public static final int LOCATIONCOL
- See Also:
- Constant Field Values
-
ROUTINGCOL
public static final int ROUTINGCOL
- See Also:
- Constant Field Values
-
DELETECOL
public static final int DELETECOL
- See Also:
- Constant Field Values
-
NUMCOLUMN
public static final int NUMCOLUMN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RailComTableDataModel
public RailComTableDataModel(Manager<IdTag> mgr)
Create a new Memory Table Data Model.- Parameters:
mgr
- Memory manager to use in the model, default MemoryManager always used.
-
-
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<IdTag>
- Parameters:
name
- System name of Bean.- Returns:
- state value in localised human readable form.
-
setManager
public final void setManager(Manager<IdTag> mgr)
Description copied from class:BeanTableDataModel
Set the Model Bean Manager. Note that for many Models this may not work as the manager is currently obtained directly from the Action class.- Overrides:
setManager
in classBeanTableDataModel<IdTag>
- Parameters:
mgr
- Bean Manager that the Model should use.
-
getManager
public RailComManager 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<IdTag>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
public RailCom getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<IdTag>
-
getByUserName
public RailCom getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<IdTag>
-
clickOn
public void clickOn(IdTag t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<IdTag>
- Parameters:
t
- the Bean that has been clicked.
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
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<IdTag>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<IdTag>
-
configValueColumn
public void configValueColumn(javax.swing.JTable table)
- Overrides:
configValueColumn
in classBeanTableDataModel<IdTag>
-
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<IdTag>
- Parameters:
e
- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
configureButton
public javax.swing.JButton configureButton()
- Overrides:
configureButton
in classBeanTableDataModel<IdTag>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<IdTag>
-
getBeanType
protected java.lang.String getBeanType()
Description copied from class:BeanTableDataModel
Get String of the Single Bean Type. In many cases the return is Bundle localised so should not be used for matching Bean types.- Overrides:
getBeanType
in classBeanTableDataModel<IdTag>
- Returns:
- Bean Type String.
-
-