Package jmri.jmrix.rfid.swing.tagcarwin
Class TableDataModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.rfid.swing.tagcarwin.TableDataModel
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.ItemListener
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class TableDataModel extends javax.swing.table.AbstractTableModel implements java.beans.PropertyChangeListener, java.awt.event.ItemListener, java.awt.event.ActionListener
The table model for displaying rows of incoming RFID tags and associating them with cars and locations. This is where most of the logic resides, though the actually receiving of the table is done in the parent- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TableDataModel.EditTrackCellEditor
-
Field Summary
Fields Modifier and Type Field Description protected static int
ACTION1_COLUMN
protected static int
ACTION2_COLUMN
(package private) AssociateFrame
associateFrame
protected static int
CAR_NUMBER_COLUMN
(package private) CarEditFrame
cef
protected static int
COLUMN_COUNT
protected static int
DESTINATION_COLUMN
(package private) boolean
forceSetLocation
protected static int
LOCATION_COLUMN
protected java.util.List<java.lang.String>
locations
(package private) TagMonitorPane
parentPane
protected static int
ROAD_COLUMN
protected boolean
showTimestamps
protected javax.swing.JTable
tableParent
protected static int
TAG_COLUMN
(package private) java.util.List<TagCarItem>
tagList
protected static int
TIME_COLUMN
protected static int
TRACK_COLUMN
protected java.util.Hashtable<java.lang.String,java.util.List<java.lang.String>>
trackLists
protected static int
TRAIN_COLUMN
protected static int
TRAIN_POSITION_COLUMN
-
Constructor Summary
Constructors Constructor Description TableDataModel()
TableDataModel(TagMonitorPane parentPane)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
add(TagCarItem newItem)
void
clearTable()
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
(package private) java.awt.Component
getLocationRowEditor(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
int
getRowCount()
(package private) java.awt.Component
getTrackRowEditor(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
java.lang.Object
getValueAt(int rowIndex, int columnIndex)
(package private) void
initTable()
boolean
isCellEditable(int row, int col)
void
itemStateChanged(java.awt.event.ItemEvent e)
void
propertyChange(java.beans.PropertyChangeEvent evt)
void
setForceSetLocation(boolean forceSetLocation)
void
setLast(java.time.LocalTime newLast)
void
setParent(javax.swing.JTable parent)
void
setRowMax(int rowMax)
void
setValueAt(java.lang.Object value, int row, int col)
void
showTimestamps(boolean showTimestamps)
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
tableParent
protected javax.swing.JTable tableParent
-
TIME_COLUMN
protected static final int TIME_COLUMN
- See Also:
- Constant Field Values
-
ROAD_COLUMN
protected static final int ROAD_COLUMN
- See Also:
- Constant Field Values
-
CAR_NUMBER_COLUMN
protected static final int CAR_NUMBER_COLUMN
- See Also:
- Constant Field Values
-
TAG_COLUMN
protected static final int TAG_COLUMN
- See Also:
- Constant Field Values
-
LOCATION_COLUMN
protected static final int LOCATION_COLUMN
- See Also:
- Constant Field Values
-
TRACK_COLUMN
protected static final int TRACK_COLUMN
- See Also:
- Constant Field Values
-
TRAIN_COLUMN
protected static final int TRAIN_COLUMN
- See Also:
- Constant Field Values
-
TRAIN_POSITION_COLUMN
protected static final int TRAIN_POSITION_COLUMN
- See Also:
- Constant Field Values
-
DESTINATION_COLUMN
protected static final int DESTINATION_COLUMN
- See Also:
- Constant Field Values
-
ACTION1_COLUMN
protected static final int ACTION1_COLUMN
- See Also:
- Constant Field Values
-
ACTION2_COLUMN
protected static final int ACTION2_COLUMN
- See Also:
- Constant Field Values
-
COLUMN_COUNT
protected static final int COLUMN_COUNT
- See Also:
- Constant Field Values
-
tagList
java.util.List<TagCarItem> tagList
-
locations
protected java.util.List<java.lang.String> locations
-
trackLists
protected java.util.Hashtable<java.lang.String,java.util.List<java.lang.String>> trackLists
-
parentPane
TagMonitorPane parentPane
-
cef
CarEditFrame cef
-
associateFrame
AssociateFrame associateFrame
-
forceSetLocation
boolean forceSetLocation
-
showTimestamps
protected boolean showTimestamps
-
-
Constructor Detail
-
TableDataModel
public TableDataModel(TagMonitorPane parentPane)
-
TableDataModel
public TableDataModel()
-
-
Method Detail
-
setForceSetLocation
public void setForceSetLocation(boolean forceSetLocation)
-
showTimestamps
public void showTimestamps(boolean showTimestamps)
-
setRowMax
public void setRowMax(int rowMax)
-
clearTable
public void clearTable()
-
add
public void add(TagCarItem newItem)
-
setLast
public void setLast(java.time.LocalTime newLast)
-
setParent
public void setParent(javax.swing.JTable parent)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
-
setValueAt
public void setValueAt(java.lang.Object value, int row, int col)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.swing.table.AbstractTableModel
-
getLocationRowEditor
java.awt.Component getLocationRowEditor(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
-
getTrackRowEditor
java.awt.Component getTrackRowEditor(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column)
-
initTable
void initTable()
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getColumnClass
public java.lang.Class<?> getColumnClass(int col)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
itemStateChanged
public void itemStateChanged(java.awt.event.ItemEvent e)
- Specified by:
itemStateChanged
in interfacejava.awt.event.ItemListener
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
-