Package jmri.jmrit.symbolicprog
Class CvTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrit.symbolicprog.CvTableModel
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.swing.table.TableModel
public class CvTableModel extends javax.swing.table.AbstractTableModel implements java.awt.event.ActionListener, java.beans.PropertyChangeListener
Table data model for display of CvValues in symbolic programmer.This represents the contents of a single decoder, so the Programmer used to access it is a data member.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CvTableModel(javax.swing.JLabel status, Programmer pProgrammer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
addCV(java.lang.String s, boolean readOnly, boolean infoOnly, boolean writeOnly)
java.util.HashMap<java.lang.String,CvValue>
allCvMap()
boolean
decoderDirty()
void
dispose()
java.lang.Class<?>
getColumnClass(int col)
int
getColumnCount()
java.lang.String
getColumnName(int col)
CvValue
getCvByNumber(java.lang.String number)
CvValue
getCvByRow(int row)
java.util.Set<java.lang.String>
getCvToVariableMapping(java.lang.String cv)
java.lang.String
getName(int row)
Programmer
getProgrammer()
Gives access to the programmer used to reach these CVs, so you can check on mode, capabilities, etc.int
getRowCount()
javax.swing.JLabel
getStatusLabel()
java.lang.String
getValString(int row)
java.lang.Object
getValueAt(int row, int col)
(package private) int
holdsAddress()
(package private) boolean
holdsLongAddress()
boolean
isCellEditable(int row, int col)
void
propertyChange(java.beans.PropertyChangeEvent e)
void
registerCvToVariableMapping(java.lang.String cv, java.lang.String variableName)
Register a VariableValue in a common store mapping CV numbers to variable names.void
setNoDecoder()
void
setProgrammer(Programmer p)
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
-
MAXCVNUM
static final int MAXCVNUM
- See Also:
- Constant Field Values
-
NUMCOLUMN
public static final int NUMCOLUMN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CvTableModel
public CvTableModel(javax.swing.JLabel status, Programmer pProgrammer)
-
-
Method Detail
-
getStatusLabel
public javax.swing.JLabel getStatusLabel()
-
setNoDecoder
public void setNoDecoder()
-
getProgrammer
public Programmer getProgrammer()
Gives access to the programmer used to reach these CVs, so you can check on mode, capabilities, etc.- Returns:
- Programmer object for the CVs
-
setProgrammer
public void setProgrammer(Programmer p)
-
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
-
getName
public java.lang.String getName(int row)
-
getValString
public java.lang.String getValString(int row)
-
getCvByRow
public CvValue getCvByRow(int row)
-
getCvByNumber
public CvValue getCvByNumber(java.lang.String number)
-
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
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
addCV
public void addCV(java.lang.String s, boolean readOnly, boolean infoOnly, boolean writeOnly)
-
decoderDirty
public boolean decoderDirty()
-
registerCvToVariableMapping
public void registerCvToVariableMapping(java.lang.String cv, java.lang.String variableName)
Register a VariableValue in a common store mapping CV numbers to variable names. This is for use by e.g. a CVTable to show tooltips efficiently.- Parameters:
cv
- specific CV number that the variable referencesvariableName
- from the variable being defined
-
getCvToVariableMapping
public java.util.Set<java.lang.String> getCvToVariableMapping(java.lang.String cv)
-
dispose
public void dispose()
-
holdsAddress
int holdsAddress()
-
holdsLongAddress
boolean holdsLongAddress()
-
-