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 voidclickOn(Memory t)Process a click on The value cell.javax.swing.JButtonconfigureButton()voidconfigValueColumn(javax.swing.JTable table)MemorygetBySystemName(java.lang.String name)MemorygetByUserName(java.lang.String name)java.lang.StringgetCellToolTip(javax.swing.JTable table, int row, int col)Additionally provide Memory value Class in value column.java.lang.Class<?>getColumnClass(int col)java.lang.StringgetColumnName(int col)Manager<Memory>getManager()Get the Table Model Bean Manager.protected java.lang.StringgetMasterClassName()java.lang.StringgetValue(java.lang.String name)Get the current Bean state value in human readable form.protected booleanmatchPropertyName(java.beans.PropertyChangeEvent e)Is this property event announcing a change this table should display?voidsetValueAt(java.lang.Object value, int row, int col)-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, allowBlockNameChange, configDeleteColumn, configureJTable, configureTable, copySystemName, copyUserName, deleteBean, dispose, doDelete, editComment, exportToCSV, 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:
getValuein 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:
getManagerin classBeanTableDataModel<Memory>- Returns:
- current Manager in use by the Model.
-
getBySystemName
public Memory getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemNamein classBeanTableDataModel<Memory>
-
getByUserName
public Memory getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserNamein classBeanTableDataModel<Memory>
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassNamein classBeanTableDataModel<Memory>
-
clickOn
public void clickOn(Memory t)
Process a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<Memory>- Parameters:
t- the Bean that has been clicked.
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classBeanTableDataModel<Memory>
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classBeanTableDataModel<Memory>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classBeanTableDataModel<Memory>
-
configValueColumn
public void configValueColumn(javax.swing.JTable table)
- Overrides:
configValueColumnin 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:
matchPropertyNamein 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:
configureButtonin 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:
getCellToolTipin 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.
-
-