Package jmri.jmrit.beantable
Class MemoryTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<Memory>
-
- jmri.jmrit.beantable.MemoryTableDataModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class MemoryTableDataModel extends BeanTableDataModel<Memory>
TableDataModel for the Memory Table. Split fromMemoryTableAction
- 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 inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Constructor Description MemoryTableDataModel()
Constructor for use by preferences and messages systemMemoryTableDataModel(Manager<Memory> mgr)
Create a new Memory Table Data Model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickOn(Memory t)
Process a click on The value cell.javax.swing.JButton
configureButton()
void
configValueColumn(javax.swing.JTable table)
Memory
getBySystemName(java.lang.String name)
Memory
getByUserName(java.lang.String name)
java.lang.String
getCellToolTip(javax.swing.JTable table, int row, int col)
Additionally provide Memory value Class in value column.java.lang.Class<?>
getColumnClass(int col)
java.lang.String
getColumnName(int col)
Manager<Memory>
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
java.lang.String
getValue(java.lang.String name)
Get the current Bean state value in human readable form.protected boolean
matchPropertyName(java.beans.PropertyChangeEvent e)
Is this property event announcing a change this table should display?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, formatToolTip, getBeanType, getColumnCount, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPreferredWidth, getPropertyColumnCount, getPropertyColumnDescriptor, getRowCount, getValueAt, isCellEditable, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, propertyChange, 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
-
-
-
-
Constructor Detail
-
MemoryTableDataModel
public MemoryTableDataModel(Manager<Memory> mgr)
Create a new Memory Table Data Model.- Parameters:
mgr
- Memory manager to use in the model, default MemoryManager always used.
-
MemoryTableDataModel
public MemoryTableDataModel()
Constructor for use by preferences and messages system
-
-
Method Detail
-
getValue
public java.lang.String getValue(java.lang.String name)
Get the current Bean state value in human readable form.- Specified by:
getValue
in classBeanTableDataModel<Memory>
- Parameters:
name
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getManager
public Manager<Memory> getManager()
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<Memory>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
public Memory getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<Memory>
-
getByUserName
public Memory getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<Memory>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<Memory>
-
clickOn
public void clickOn(Memory t)
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<Memory>
- Parameters:
t
- the Bean that has been clicked.
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classBeanTableDataModel<Memory>
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classBeanTableDataModel<Memory>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classBeanTableDataModel<Memory>
-
configValueColumn
public void configValueColumn(javax.swing.JTable table)
- Overrides:
configValueColumn
in classBeanTableDataModel<Memory>
-
matchPropertyName
protected boolean matchPropertyName(java.beans.PropertyChangeEvent e)
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<Memory>
- 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<Memory>
-
getCellToolTip
public java.lang.String getCellToolTip(javax.swing.JTable table, int row, int col)
Additionally provide Memory value Class in value column. Display the comment text for the current row as a tool tip. Most of the bean tables use the standard model with comments in column 3.- Overrides:
getCellToolTip
in classBeanTableDataModel<Memory>
- Parameters:
table
- The current table.row
- The current row.col
- The current column.- Returns:
- a formatted tool tip or null if there is none.
-
-