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 intCOLUMNCOUNTstatic intCOMCOLstatic intDELCOLstatic intDESTAPPCOLstatic intDESTCOLstatic intEDITLOGICCOLstatic intENABLECOLstatic intMAXSPEEDCOL(package private) SignallingActionsigLogstatic intSOURCEAPPCOLstatic intSOURCECOL-
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 voidclickOn(SignalMastLogic t)Process a click on The value cell.protected voidconfigDeleteColumn(javax.swing.JTable table)voidconfigureTable(javax.swing.JTable table)Configure a table to have our standard rows and columns.(package private) voiddeleteLogic(int row)voiddispose()Removes property change listeners from Beans.(package private) voideditLogic(int row)protected java.lang.StringgetBeanType()Get String of the Single Bean Type.SignalMastLogicgetBySystemName(java.lang.String name)SignalMastLogicgetByUserName(java.lang.String name)java.lang.StringgetCellToolTip(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)intgetColumnCount()Get Column Count INCLUDING Bean Property Columns.java.lang.StringgetColumnName(int col)SignalMastgetDestMastFromRow(int row)SignalMastLogicgetLogicFromRow(int row)protected SignalMastLogicManagergetManager()Get the Table Model Bean Manager.protected java.lang.StringgetMasterClassName()intgetPreferredWidth(int col)intgetRowCount()java.lang.StringgetValue(java.lang.String s)Get the current Bean state value in human readable form.java.lang.ObjectgetValueAt(int row, int col)SYSNAMECOL returns the actual Bean, NOT the System Name.booleanisCellEditable(int row, int col)protected booleanmatchPropertyName(java.beans.PropertyChangeEvent e)Is this property event announcing a change this table should display?voidpropertyChange(java.beans.PropertyChangeEvent e)protected voidsetColumnIdentities(javax.swing.JTable table)Set identities for any columns that need an identity.voidsetSuppressUpdate(boolean newVal)voidsetValueAt(java.lang.Object value, int row, int col)protected voidshowPopup(JmriMouseEvent e)Display popup menu when right clicked on table cell.protected voidupdateNameList()-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configureButton, configureJTable, configValueColumn, copySystemName, copyUserName, 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:BeanTableDataModelGet 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<SignalMastLogic>- Returns:
- current Manager in use by the Model.
-
getValue
public java.lang.String getValue(java.lang.String s)
Description copied from class:BeanTableDataModelGet the current Bean state value in human readable form.- Specified by:
getValuein classBeanTableDataModel<SignalMastLogic>- Parameters:
s- System name of Bean.- Returns:
- state value in localised human readable form.
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassNamein classBeanTableDataModel<SignalMastLogic>
-
clickOn
public void clickOn(SignalMastLogic t)
Description copied from class:BeanTableDataModelProcess a click on The value cell.- Specified by:
clickOnin classBeanTableDataModel<SignalMastLogic>- Parameters:
t- the Bean that has been clicked.
-
updateNameList
protected void updateNameList()
- Overrides:
updateNameListin classBeanTableDataModel<SignalMastLogic>
-
setSuppressUpdate
public void setSuppressUpdate(boolean newVal)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Overrides:
propertyChangein 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:
matchPropertyNamein 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:BeanTableDataModelGet Column Count INCLUDING Bean Property Columns.- Specified by:
getColumnCountin interfacejavax.swing.table.TableModel- Overrides:
getColumnCountin classBeanTableDataModel<SignalMastLogic>
-
getRowCount
public int getRowCount()
Description copied from class:BeanTableDataModel- Specified by:
getRowCountin interfacejavax.swing.table.TableModel- Overrides:
getRowCountin classBeanTableDataModel<SignalMastLogic>
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
Description copied from class:BeanTableDataModelSYSNAMECOL returns the actual Bean, NOT the System Name.- Specified by:
getValueAtin interfacejavax.swing.table.TableModel- Overrides:
getValueAtin classBeanTableDataModel<SignalMastLogic>
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
Description copied from class:BeanTableDataModel- Specified by:
setValueAtin interfacejavax.swing.table.TableModel- Overrides:
setValueAtin classBeanTableDataModel<SignalMastLogic>
-
getColumnName
public java.lang.String getColumnName(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnNamein interfacejavax.swing.table.TableModel- Overrides:
getColumnNamein classBeanTableDataModel<SignalMastLogic>
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
Description copied from class:BeanTableDataModel- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classBeanTableDataModel<SignalMastLogic>
-
isCellEditable
public boolean isCellEditable(int row, int col)
Description copied from class:BeanTableDataModel- Specified by:
isCellEditablein interfacejavax.swing.table.TableModel- Overrides:
isCellEditablein 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:
getPreferredWidthin classBeanTableDataModel<SignalMastLogic>
-
configureTable
public void configureTable(javax.swing.JTable table)
Description copied from class:BeanTableDataModelConfigure 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:
configureTablein classBeanTableDataModel<SignalMastLogic>- Parameters:
table-JTableto configure
-
getBySystemName
public SignalMastLogic getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemNamein classBeanTableDataModel<SignalMastLogic>
-
getByUserName
public SignalMastLogic getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserNamein classBeanTableDataModel<SignalMastLogic>
-
dispose
public void dispose()
Description copied from class:BeanTableDataModelRemoves property change listeners from Beans.- Overrides:
disposein classBeanTableDataModel<SignalMastLogic>
-
configDeleteColumn
protected void configDeleteColumn(javax.swing.JTable table)
- Overrides:
configDeleteColumnin classBeanTableDataModel<SignalMastLogic>
-
getBeanType
protected java.lang.String getBeanType()
Description copied from class:BeanTableDataModelGet String of the Single Bean Type. In many cases the return is Bundle localised so should not be used for matching Bean types.- Overrides:
getBeanTypein classBeanTableDataModel<SignalMastLogic>- Returns:
- Bean Type String.
-
showPopup
protected void showPopup(JmriMouseEvent e)
Description copied from class:BeanTableDataModelDisplay popup menu when right clicked on table cell.Copy UserName Rename Remove UserName Move Edit Comment Delete
- Overrides:
showPopupin classBeanTableDataModel<SignalMastLogic>- Parameters:
e- source event.
-
setColumnIdentities
protected void setColumnIdentities(javax.swing.JTable table)
Description copied from class:BeanTableDataModelSet 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:
setColumnIdentitiesin 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:BeanTableDataModelDisplay 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<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.
-
-