Package jmri.jmrit.beantable.oblock
Class SignalTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.beantable.oblock.SignalTableModel
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class SignalTableModel extends javax.swing.table.AbstractTableModel implements java.beans.PropertyChangeListener
GUI to define the Signals within an OBlock.Can be used with two interfaces:
- original "desktop" InternalFrames (parent class TableFrames, an extended JmriJFrame)
- JMRI standard Tabbed tables (parent class JPanel)
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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SignalTableModel.NameSorter
(package private) static class
SignalTableModel.SignalArray
protected static class
SignalTableModel.SignalRow
-
Field Summary
Fields Modifier and Type Field Description (package private) int
_lastIdx
(package private) TableFrames
_parent
(package private) PortalManager
_portalMgr
static int
DELETE_COL
static int
EDIT_COL
static int
FROM_BLOCK_COLUMN
(package private) boolean
inEditMode
static int
LENGTHCOL
static int
NAME_COLUMN
static int
NUMCOLS
static int
PORTAL_COLUMN
static int
TO_BLOCK_COLUMN
(package private) java.text.DecimalFormat
twoDigit
static int
UNITSCOL
-
Constructor Summary
Constructors Constructor Description SignalTableModel(TableFrames parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
checkDuplicateSignal(NamedBean signal)
protected void
deleteSignal(SignalTableModel.SignalRow signalRow)
boolean
editMode()
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
static int
getPreferredWidth(int col)
int
getRowCount()
java.lang.Object
getValueAt(int rowIndex, int columnIndex)
void
init()
(package private) void
initTempRow()
boolean
isCellEditable(int row, int col)
void
propertyChange(java.beans.PropertyChangeEvent e)
void
setEditMode(boolean editing)
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
-
NAME_COLUMN
public static final int NAME_COLUMN
- See Also:
- Constant Field Values
-
FROM_BLOCK_COLUMN
public static final int FROM_BLOCK_COLUMN
- See Also:
- Constant Field Values
-
PORTAL_COLUMN
public static final int PORTAL_COLUMN
- See Also:
- Constant Field Values
-
TO_BLOCK_COLUMN
public static final int TO_BLOCK_COLUMN
- See Also:
- Constant Field Values
-
LENGTHCOL
public static final int LENGTHCOL
- See Also:
- Constant Field Values
-
UNITSCOL
public static final int UNITSCOL
- See Also:
- Constant Field Values
-
DELETE_COL
public static final int DELETE_COL
- See Also:
- Constant Field Values
-
EDIT_COL
public static final int EDIT_COL
- See Also:
- Constant Field Values
-
NUMCOLS
public static final int NUMCOLS
- See Also:
- Constant Field Values
-
_lastIdx
int _lastIdx
-
_portalMgr
PortalManager _portalMgr
-
_parent
TableFrames _parent
-
inEditMode
boolean inEditMode
-
twoDigit
java.text.DecimalFormat twoDigit
-
-
Constructor Detail
-
SignalTableModel
public SignalTableModel(TableFrames parent)
-
-
Method Detail
-
init
public void init()
-
initTempRow
void initTempRow()
-
checkDuplicateSignal
protected java.lang.String checkDuplicateSignal(NamedBean signal)
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
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
-
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
-
deleteSignal
protected void deleteSignal(SignalTableModel.SignalRow signalRow)
-
isCellEditable
public boolean isCellEditable(int row, int col)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
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
-
getPreferredWidth
public static int getPreferredWidth(int col)
-
editMode
public boolean editMode()
-
setEditMode
public void setEditMode(boolean editing)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-