Package jmri.jmrit.logix
Class WarrantTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.BeanTableDataModel<Warrant>
-
- jmri.jmrit.logix.WarrantTableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
class WarrantTableModel extends BeanTableDataModel<Warrant>
Table Model for the Warrant List
This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.jmrit.beantable.BeanTableDataModel
BeanTableDataModel.BeanTableTooltipHeaderRenderer
-
-
Field Summary
Fields Modifier and Type Field Description (package private) WarrantTableFrame
_frame
(package private) WarrantManager
_manager
static int
ADDRESS_COLUMN
static int
ALLOCATE_COLUMN
static int
AUTO_RUN_COLUMN
static int
CONTROL_COLUMN
static int
DEALLOC_COLUMN
static int
DELETE_COLUMN
static int
EDIT_COLUMN
(package private) static java.lang.String
GREEN_LED
static int
MANUAL_RUN_COLUMN
(package private) static java.awt.Color
myGold
(package private) static java.awt.Color
myGreen
static int
NUMCOLS
(package private) static java.lang.String
OFF_LED
(package private) static java.lang.String
RED_LED
static int
ROUTE_COLUMN
static int
TRAIN_NAME_COLUMN
static int
WARRANT_COLUMN
(package private) static java.lang.String
YELLOW_LED
-
Fields inherited from class jmri.jmrit.beantable.BeanTableDataModel
COMMENTCOL, DELETECOL, NUMCOLUMN, SYSNAMECOL, sysNameList, USERNAMECOL, VALUECOL
-
-
Constructor Summary
Constructors Constructor Description WarrantTableModel(WarrantTableFrame frame)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeaderListener(javax.swing.JTable table)
protected void
addNXWarrant(Warrant w)
protected java.lang.String
checkAddressInUse(Warrant warrant)
void
clickOn(Warrant t)
Process a click on The value cell.protected java.lang.String
getBeanType()
Get String of the Single Bean Type.Warrant
getBySystemName(java.lang.String name)
Warrant
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)
Manager<Warrant>
getManager()
Get the Table Model Bean Manager.protected java.lang.String
getMasterClassName()
int
getPreferredWidth(int col)
protected int
getRow(Warrant w)
int
getRowCount()
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.protected Warrant
getWarrant(java.lang.String name)
Warrant
getWarrantAt(int index)
protected void
haltAllTrains()
void
init()
Preserve current listeners so that there is no gap to miss a propertyChangeboolean
isCellEditable(int row, int col)
void
propertyChange(java.beans.PropertyChangeEvent e)
void
removeWarrant(Warrant w, boolean deregister)
Removes any warrant, not just NXWarrantvoid
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class jmri.jmrit.beantable.BeanTableDataModel
addMouseListenerToHeader, configDeleteColumn, configureButton, configureJTable, configureTable, configValueColumn, copyName, deleteBean, dispose, doDelete, editComment, formatToolTip, getCellToolTip, getDisplayDeleteMsg, getFilter, getHeaderTooltip, getPropertyColumnCount, getPropertyColumnDescriptor, isClearUserNameAllowed, makeJTable, matchPropertyName, moveBean, persistTable, printColumns, printTable, 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
-
-
-
-
Field Detail
-
WARRANT_COLUMN
public static final int WARRANT_COLUMN
- See Also:
- Constant Field Values
-
ROUTE_COLUMN
public static final int ROUTE_COLUMN
- See Also:
- Constant Field Values
-
TRAIN_NAME_COLUMN
public static final int TRAIN_NAME_COLUMN
- See Also:
- Constant Field Values
-
ADDRESS_COLUMN
public static final int ADDRESS_COLUMN
- See Also:
- Constant Field Values
-
ALLOCATE_COLUMN
public static final int ALLOCATE_COLUMN
- See Also:
- Constant Field Values
-
DEALLOC_COLUMN
public static final int DEALLOC_COLUMN
- See Also:
- Constant Field Values
-
AUTO_RUN_COLUMN
public static final int AUTO_RUN_COLUMN
- See Also:
- Constant Field Values
-
MANUAL_RUN_COLUMN
public static final int MANUAL_RUN_COLUMN
- See Also:
- Constant Field Values
-
CONTROL_COLUMN
public static final int CONTROL_COLUMN
- See Also:
- Constant Field Values
-
EDIT_COLUMN
public static final int EDIT_COLUMN
- See Also:
- Constant Field Values
-
DELETE_COLUMN
public static final int DELETE_COLUMN
- See Also:
- Constant Field Values
-
NUMCOLS
public static final int NUMCOLS
- See Also:
- Constant Field Values
-
_manager
WarrantManager _manager
-
_frame
WarrantTableFrame _frame
-
myGreen
static java.awt.Color myGreen
-
myGold
static java.awt.Color myGold
-
GREEN_LED
static java.lang.String GREEN_LED
-
YELLOW_LED
static java.lang.String YELLOW_LED
-
OFF_LED
static java.lang.String OFF_LED
-
RED_LED
static java.lang.String RED_LED
-
-
Constructor Detail
-
WarrantTableModel
public WarrantTableModel(WarrantTableFrame frame)
-
-
Method Detail
-
addHeaderListener
public void addHeaderListener(javax.swing.JTable table)
-
getManager
public Manager<Warrant> 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<Warrant>
- Returns:
- current Manager in use by the Model.
-
getBySystemName
public Warrant getBySystemName(@Nonnull java.lang.String name)
- Specified by:
getBySystemName
in classBeanTableDataModel<Warrant>
-
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<Warrant>
- Parameters:
name
- System name of Bean.- Returns:
- state value in localised human readable form.
-
getByUserName
public Warrant getByUserName(@Nonnull java.lang.String name)
- Specified by:
getByUserName
in classBeanTableDataModel<Warrant>
-
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<Warrant>
- Returns:
- Bean Type String.
-
clickOn
public void clickOn(Warrant t)
Description copied from class:BeanTableDataModel
Process a click on The value cell.- Specified by:
clickOn
in classBeanTableDataModel<Warrant>
- Parameters:
t
- the Bean that has been clicked.
-
getMasterClassName
protected java.lang.String getMasterClassName()
- Specified by:
getMasterClassName
in classBeanTableDataModel<Warrant>
-
init
public void init()
Preserve current listeners so that there is no gap to miss a propertyChange
-
haltAllTrains
protected void haltAllTrains()
-
addNXWarrant
protected void addNXWarrant(Warrant w)
-
removeWarrant
public void removeWarrant(Warrant w, boolean deregister)
Removes any warrant, not just NXWarrant- Parameters:
w
- Warrantderegister
- deregister warrant
-
getWarrantAt
public Warrant getWarrantAt(int index)
-
getWarrant
protected Warrant getWarrant(java.lang.String name)
-
checkAddressInUse
protected java.lang.String checkAddressInUse(Warrant warrant)
-
getRowCount
public int getRowCount()
Description copied from class:BeanTableDataModel
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
- Overrides:
getRowCount
in classBeanTableDataModel<Warrant>
-
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<Warrant>
-
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<Warrant>
-
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<Warrant>
-
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<Warrant>
-
getPreferredWidth
public int getPreferredWidth(int col)
- Overrides:
getPreferredWidth
in classBeanTableDataModel<Warrant>
-
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<Warrant>
-
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<Warrant>
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
Description copied from class:BeanTableDataModel
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in classBeanTableDataModel<Warrant>
-
-