Package jmri.jmrit.beantable.signalmast
Class SignalMastLogicTableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<SignalMastLogic>
-
- jmri.jmrit.beantable.signalmast.SignalMastLogicTableDataModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class SignalMastLogicTableDataModel extends BeanTableDataModel<SignalMastLogic>
Create a SignalMastLogic Table Data Model. Code originally from SignalMastLogicTableAction- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLUMNCOUNT
static int
COMCOL
static int
DELCOL
static int
DESTAPPCOL
static int
DESTCOL
static int
EDITLOGICCOL
static int
ENABLECOL
static int
MAXSPEEDCOL
(package private) SignallingAction
sigLog
static int
SOURCEAPPCOL
static int
SOURCECOL
-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Constructor Description SignalMastLogicTableDataModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickOn(SignalMastLogic t)
Process a click on The value cell.protected void
configDeleteColumn(javax.swing.JTable table)
void
configureTable(javax.swing.JTable table)
Configure a table to have our standard rows and columns.(package private) void
deleteLogic(int row)
void
dispose()
Removes property change listeners from Beans.(package private) void
editLogic(int row)
protected java.lang.String
getBeanType()
Get String of the Single Bean Type.SignalMastLogic
getBySystemName(java.lang.String name)
SignalMastLogic
getByUserName(java.lang.String name)
java.lang.String
getCellToolTip(javax.swing.JTable table, int row, int col)
Display the comment text for the current row as a tool tip.java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
Get Column Count INCLUDING Bean Property Columns.java.lang.String
getColumnName(int col)
SignalMast
getDestMastFromRow(int row)
SignalMastLogic
getLogicFromRow(int row)
protected SignalMastLogicManager
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
int
getPreferredWidth(int col)
int
getRowCount()
java.lang.String
getValue(java.lang.String s)
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)
protected void
setColumnIdentities(javax.swing.JTable table)
Set identities for any columns that need an identity.void
setSuppressUpdate(boolean newVal)
void
setValueAt(java.lang.Object value, int row, int col)
protected void
showPopup(JmriMouseEvent e)
Display popup menu when right clicked on table cell.protected void
updateNameList()
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configureButton, configureJTable, configValueColumn, copyName, deleteBean, doDelete, editComment, exportToCSV, formatToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, isClearUserNameAllowed, makeJTable, moveBean, persistTable, printColumns, printTable, removeName, renameBean, setColumnToHoldButton, setDisplayDeleteMsg, setFilter, setManager, setPropertyColumnsVisible, showTableHeaderPopup, stopPersistingTable
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
SOURCECOL
public static final int SOURCECOL
- See Also:
- Constant Field Values
-
SOURCEAPPCOL
public static final int SOURCEAPPCOL
- See Also:
- Constant Field Values
-
DESTCOL
public static final int DESTCOL
- See Also:
- Constant Field Values
-
DESTAPPCOL
public static final int DESTAPPCOL
- See Also:
- Constant Field Values
-
COMCOL
public static final int COMCOL
- See Also:
- Constant Field Values
-
DELCOL
public static final int DELCOL
- See Also:
- Constant Field Values
-
ENABLECOL
public static final int ENABLECOL
- See Also:
- Constant Field Values
-
EDITLOGICCOL
public static final int EDITLOGICCOL
- See Also:
- Constant Field Values
-
MAXSPEEDCOL
public static final int MAXSPEEDCOL
- See Also:
- Constant Field Values
-
COLUMNCOUNT
public static final int COLUMNCOUNT
- See Also:
- Constant Field Values
-
sigLog
final SignallingAction sigLog
-
-
Constructor Detail
-
SignalMastLogicTableDataModel
public SignalMastLogicTableDataModel()
-
-
Method Detail
-
getManager
protected SignalMastLogicManager 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<SignalMastLogic>
- Returns:
- current Manager in use by the Model.
-
getValue
public java.lang.String getValue(java.lang.String s)
Description copied from class:BeanTableDataModel
Get the current Bean state value in human readable form.- Specified by:
getValue
in classBeanTableDataModel<SignalMastLogic>
- Parameters:
s
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<SignalMastLogic>
-
clickOn
public void clickOn(SignalMastLogic t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<SignalMastLogic>
- Parameters:
t
- the Bean that has been clicked.
-
updateNameList
protected void updateNameList()
- Overrides:
updateNameList
in classBeanTableDataModel<SignalMastLogic>
-
setSuppressUpdate
public void setSuppressUpdate(boolean newVal)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classBeanTableDataModel<SignalMastLogic>
-
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<SignalMastLogic>
- Parameters:
e
- the event to match- Returns:
- true if the property name is of interest, false otherwise
-
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<SignalMastLogic>
-
getRowCount
public int getRowCount()
Description copied from class:BeanTableDataModel
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
- Overrides:
getRowCount
in classBeanTableDataModel<SignalMastLogic>
-
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<SignalMastLogic>
-
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<SignalMastLogic>
-
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<SignalMastLogic>
-
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<SignalMastLogic>
-
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<SignalMastLogic>
-
editLogic
void editLogic(int row)
-
deleteLogic
void deleteLogic(int row)
-
getDestMastFromRow
@CheckForNull public SignalMast getDestMastFromRow(int row)
-
getLogicFromRow
@CheckForNull public SignalMastLogic getLogicFromRow(int row)
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<SignalMastLogic>
-
configureTable
public void configureTable(javax.swing.JTable table)
Description copied from class:BeanTableDataModel
Configure a table to have our standard rows and columns. This is optional, in that other table formats can use this table model. But we put it here to help keep it consistent. This also persists the table user interface state.- Overrides:
configureTable
in classBeanTableDataModel<SignalMastLogic>
- Parameters:
table
-JTable
to configure
-
getBySystemName
public SignalMastLogic getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<SignalMastLogic>
-
getByUserName
public SignalMastLogic getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<SignalMastLogic>
-
dispose
public void dispose()
Description copied from class:BeanTableDataModel
Removes property change listeners from Beans.- Overrides:
dispose
in classBeanTableDataModel<SignalMastLogic>
-
configDeleteColumn
protected void configDeleteColumn(javax.swing.JTable table)
- Overrides:
configDeleteColumn
in classBeanTableDataModel<SignalMastLogic>
-
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<SignalMastLogic>
- Returns:
- Bean Type String.
-
showPopup
protected void showPopup(JmriMouseEvent e)
Description copied from class:BeanTableDataModel
Display popup menu when right clicked on table cell.Copy UserName Rename Remove UserName Move Edit Comment Delete
- Overrides:
showPopup
in classBeanTableDataModel<SignalMastLogic>
- Parameters:
e
- source event.
-
setColumnIdentities
protected void setColumnIdentities(javax.swing.JTable table)
Description copied from class:BeanTableDataModel
Set identities for any columns that need an identity. It is recommended that all columns get a constant identity to prevent identities from being subject to changes due to translation.The default implementation sets column identities to the String
Column#
where#
is the model index for the column. Note that if the TableColumnModel is aXTableColumnModel
, the index includes hidden columns.- Overrides:
setColumnIdentities
in classBeanTableDataModel<SignalMastLogic>
- Parameters:
table
- the table to set identities for.
-
getCellToolTip
public java.lang.String getCellToolTip(javax.swing.JTable table, int row, int col)
Description copied from class:BeanTableDataModel
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<SignalMastLogic>
- Parameters:
table
- The current table.row
- The current row.col
- The current column.- Returns:
- a formatted tool tip or null if there is none.
-
-