Package jmri.jmrit.beantable.light
Class LightControlTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.light.LightControlTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
public class LightControlTableModel extends javax.swing.table.AbstractTableModel
Table model for Light Controls in the Add/Edit Light windows. No direct access to this class is normally required, access via LightControlPane.java Code originally within LightTableAction.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String[]
controlTypes
static int
DESCRIPTION_COLUMN
static int
EDIT_COLUMN
protected static java.lang.String
fastClockControl
protected static java.lang.String
noControl
static int
REMOVE_COLUMN
protected static java.lang.String
sensorControl
protected static java.lang.String
timedOnControl
protected static java.lang.String
turnoutStatusControl
protected static java.lang.String
twoSensorControl
static int
TYPE_COLUMN
-
Constructor Summary
Constructors Constructor Description LightControlTableModel(LightControlPane pane)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addControl(LightControl lc)
protected void
configureJTable(javax.swing.JTable table)
java.lang.Class<?>
getColumnClass(int c)
int
getColumnCount()
java.lang.String
getColumnName(int col)
java.util.List<LightControl>
getControlList()
Get the Current Light Control List for the Table.static java.lang.String
getControlTypeText(int type)
Get text showing the type of Light Control.protected static java.util.List<java.lang.String>
getControlTypeTips()
int
getRowCount()
java.lang.Object
getValueAt(int r, int c)
boolean
isCellEditable(int r, int c)
void
removeControl(LightControl lc)
void
setTableToLight(Light light)
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
-
TYPE_COLUMN
public static final int TYPE_COLUMN
- See Also:
- Constant Field Values
-
DESCRIPTION_COLUMN
public static final int DESCRIPTION_COLUMN
- See Also:
- Constant Field Values
-
EDIT_COLUMN
public static final int EDIT_COLUMN
- See Also:
- Constant Field Values
-
REMOVE_COLUMN
public static final int REMOVE_COLUMN
- See Also:
- Constant Field Values
-
sensorControl
protected static final java.lang.String sensorControl
-
fastClockControl
protected static final java.lang.String fastClockControl
-
turnoutStatusControl
protected static final java.lang.String turnoutStatusControl
-
timedOnControl
protected static final java.lang.String timedOnControl
-
twoSensorControl
protected static final java.lang.String twoSensorControl
-
noControl
protected static final java.lang.String noControl
-
controlTypes
static final java.lang.String[] controlTypes
-
-
Constructor Detail
-
LightControlTableModel
public LightControlTableModel(LightControlPane pane)
-
-
Method Detail
-
getControlTypeTips
protected static final java.util.List<java.lang.String> getControlTypeTips()
-
getControlTypeText
public static java.lang.String getControlTypeText(int type)
Get text showing the type of Light Control.- Parameters:
type
- the type of Light Control- Returns:
- name of type or the description for
Light.NO_CONTROL
if type is not recognized
-
getControlList
public java.util.List<LightControl> getControlList()
Get the Current Light Control List for the Table.- Returns:
- unmodifiable List of Light Controls.
-
setTableToLight
public void setTableToLight(Light light)
-
addControl
public void addControl(LightControl lc)
-
removeControl
public void removeControl(LightControl lc)
-
getColumnClass
public java.lang.Class<?> getColumnClass(int c)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
isCellEditable
public boolean isCellEditable(int r, int c)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
getColumnName
public java.lang.String getColumnName(int col)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int r, int c)
-
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
-
configureJTable
protected void configureJTable(javax.swing.JTable table)
-
-