Class EnginesTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.operations.rollingstock.engines.EnginesTableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class EnginesTableModel extends javax.swing.table.AbstractTableModel implements java.beans.PropertyChangeListener
Table Model for edit of engines used by operations- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) EnginesTableFrame
_frame
(package private) int
_index
(package private) java.lang.String
_roadNumber
(package private) javax.swing.JTable
_table
(package private) EngineEditFrame
engineEditFrame
(package private) java.util.List<Engine>
engineList
(package private) EngineManager
engineManager
(package private) EngineSetFrame
engineSetFrame
int
SORTBY_BUILT
int
SORTBY_COMMENT
int
SORTBY_CONSIST
int
SORTBY_DCC_ADDRESS
int
SORTBY_DESTINATION
int
SORTBY_HP
int
SORTBY_LAST
int
SORTBY_LOCATION
int
SORTBY_MODEL
int
SORTBY_MOVES
int
SORTBY_NUMBER
int
SORTBY_OWNER
int
SORTBY_RFID
int
SORTBY_ROAD
int
SORTBY_TRAIN
int
SORTBY_VALUE
-
Constructor Summary
Constructors Constructor Description EnginesTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
int
findEngineByRoadNumber(java.lang.String roadNumber)
Search for engine by road numberjava.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
Engine
getEngineAtIndex(int index)
java.util.List<Engine>
getEngineList(int sort)
int
getRowCount()
java.util.List<Engine>
getSelectedEngineList()
java.lang.String
getSortByName()
java.lang.String
getSortByName(int sort)
java.lang.Object
getValueAt(int row, int col)
(package private) void
initTable()
(package private) void
initTable(javax.swing.JTable table, EnginesTableFrame frame)
boolean
isCellEditable(int row, int col)
void
propertyChange(java.beans.PropertyChangeEvent e)
void
setSort(int sort)
Not all columns are visible at the same time.void
setValueAt(java.lang.Object value, int row, int col)
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
engineManager
EngineManager engineManager
-
SORTBY_NUMBER
public final int SORTBY_NUMBER
- See Also:
- Constant Field Values
-
SORTBY_ROAD
public final int SORTBY_ROAD
- See Also:
- Constant Field Values
-
SORTBY_MODEL
public final int SORTBY_MODEL
- See Also:
- Constant Field Values
-
SORTBY_LOCATION
public final int SORTBY_LOCATION
- See Also:
- Constant Field Values
-
SORTBY_DESTINATION
public final int SORTBY_DESTINATION
- See Also:
- Constant Field Values
-
SORTBY_TRAIN
public final int SORTBY_TRAIN
- See Also:
- Constant Field Values
-
SORTBY_MOVES
public final int SORTBY_MOVES
- See Also:
- Constant Field Values
-
SORTBY_CONSIST
public final int SORTBY_CONSIST
- See Also:
- Constant Field Values
-
SORTBY_BUILT
public final int SORTBY_BUILT
- See Also:
- Constant Field Values
-
SORTBY_OWNER
public final int SORTBY_OWNER
- See Also:
- Constant Field Values
-
SORTBY_VALUE
public final int SORTBY_VALUE
- See Also:
- Constant Field Values
-
SORTBY_RFID
public final int SORTBY_RFID
- See Also:
- Constant Field Values
-
SORTBY_LAST
public final int SORTBY_LAST
- See Also:
- Constant Field Values
-
SORTBY_HP
public final int SORTBY_HP
- See Also:
- Constant Field Values
-
SORTBY_DCC_ADDRESS
public final int SORTBY_DCC_ADDRESS
- See Also:
- Constant Field Values
-
SORTBY_COMMENT
public final int SORTBY_COMMENT
- See Also:
- Constant Field Values
-
_roadNumber
java.lang.String _roadNumber
-
_index
int _index
-
engineList
java.util.List<Engine> engineList
-
_table
javax.swing.JTable _table
-
_frame
EnginesTableFrame _frame
-
engineEditFrame
EngineEditFrame engineEditFrame
-
engineSetFrame
EngineSetFrame engineSetFrame
-
-
Constructor Detail
-
EnginesTableModel
public EnginesTableModel()
-
-
Method Detail
-
setSort
public void setSort(int sort)
Not all columns are visible at the same time.- Parameters:
sort
- which sort is active
-
getSortByName
public java.lang.String getSortByName()
-
getSortByName
public java.lang.String getSortByName(int sort)
-
findEngineByRoadNumber
public int findEngineByRoadNumber(java.lang.String roadNumber)
Search for engine by road number- Parameters:
roadNumber
- The string road number to search for.- Returns:
- -1 if not found, table row number if found
-
getEngineAtIndex
public Engine getEngineAtIndex(int index)
-
getSelectedEngineList
public java.util.List<Engine> getSelectedEngineList()
-
getEngineList
public java.util.List<Engine> getEngineList(int sort)
-
initTable
void initTable(javax.swing.JTable table, EnginesTableFrame frame)
-
initTable
void initTable()
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
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
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
- 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
-
dispose
public void dispose()
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-