Package jmri.jmrix.can.cbus.eventtable
Class CbusBasicEventTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.can.cbus.eventtable.CbusBasicEventTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
- Direct Known Subclasses:
CbusEventTableDataModel
public class CbusBasicEventTableModel extends javax.swing.table.AbstractTableModel
Class to provide access to the EventTableData.xml file.- See Also:
- Serialized Form
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CbusBasicEventTableModel(CanSystemConnectionMemo memo)
CbusBasicEventTableModel(CanSystemConnectionMemo memo, int initialRowSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
java.lang.String
getEventName(int node, int event)
Get event name for an event in the tablejava.util.ArrayList<CbusTableEvent>
getEvents()
Get the core list containing all table eventsjava.lang.String
getEventString(int node, int event)
Get event String for an event in the tableint
getEventTableRow(int node, int event)
Do Node + Event check, returns -1 if not on table, otherwise the row idint
getRowCount()
java.lang.Object
getValueAt(int row, int col)
CbusTableEvent
provideEvent(int nn, int en)
Provide a new Event and add to Table.void
setValueAt(java.lang.Object value, int row, int col)
void
setValueAt2(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, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
-
-
-
-
Field Detail
-
NODE_COLUMN
public static final int NODE_COLUMN
- See Also:
- Constant Field Values
-
EVENT_COLUMN
public static final int EVENT_COLUMN
- See Also:
- Constant Field Values
-
NAME_COLUMN
public static final int NAME_COLUMN
- See Also:
- Constant Field Values
-
NODENAME_COLUMN
public static final int NODENAME_COLUMN
- See Also:
- Constant Field Values
-
COMMENT_COLUMN
public static final int COMMENT_COLUMN
- See Also:
- Constant Field Values
-
STATE_COLUMN
public static final int STATE_COLUMN
- See Also:
- Constant Field Values
-
TOGGLE_BUTTON_COLUMN
public static final int TOGGLE_BUTTON_COLUMN
- See Also:
- Constant Field Values
-
ON_BUTTON_COLUMN
public static final int ON_BUTTON_COLUMN
- See Also:
- Constant Field Values
-
OFF_BUTTON_COLUMN
public static final int OFF_BUTTON_COLUMN
- See Also:
- Constant Field Values
-
CANID_COLUMN
public static final int CANID_COLUMN
- See Also:
- Constant Field Values
-
LATEST_TIMESTAMP_COLUMN
public static final int LATEST_TIMESTAMP_COLUMN
- See Also:
- Constant Field Values
-
STATUS_REQUEST_BUTTON_COLUMN
public static final int STATUS_REQUEST_BUTTON_COLUMN
- See Also:
- Constant Field Values
-
SESSION_TOTAL_COLUMN
public static final int SESSION_TOTAL_COLUMN
- See Also:
- Constant Field Values
-
SESSION_ON_COLUMN
public static final int SESSION_ON_COLUMN
- See Also:
- Constant Field Values
-
SESSION_OFF_COLUMN
public static final int SESSION_OFF_COLUMN
- See Also:
- Constant Field Values
-
SESSION_IN_COLUMN
public static final int SESSION_IN_COLUMN
- See Also:
- Constant Field Values
-
SESSION_OUT_COLUMN
public static final int SESSION_OUT_COLUMN
- See Also:
- Constant Field Values
-
ALL_TOTAL_COLUMN
public static final int ALL_TOTAL_COLUMN
- See Also:
- Constant Field Values
-
ALL_ON_COLUMN
public static final int ALL_ON_COLUMN
- See Also:
- Constant Field Values
-
ALL_OFF_COLUMN
public static final int ALL_OFF_COLUMN
- See Also:
- Constant Field Values
-
ALL_IN_COLUMN
public static final int ALL_IN_COLUMN
- See Also:
- Constant Field Values
-
ALL_OUT_COLUMN
public static final int ALL_OUT_COLUMN
- See Also:
- Constant Field Values
-
DELETE_BUTTON_COLUMN
public static final int DELETE_BUTTON_COLUMN
- See Also:
- Constant Field Values
-
STLR_ON_COLUMN
public static final int STLR_ON_COLUMN
- See Also:
- Constant Field Values
-
STLR_OFF_COLUMN
public static final int STLR_OFF_COLUMN
- See Also:
- Constant Field Values
-
EVENT_DAT_1
public static final int EVENT_DAT_1
- See Also:
- Constant Field Values
-
EVENT_DAT_2
public static final int EVENT_DAT_2
- See Also:
- Constant Field Values
-
EVENT_DAT_3
public static final int EVENT_DAT_3
- See Also:
- Constant Field Values
-
MAX_COLUMN
public static final int MAX_COLUMN
- See Also:
- Constant Field Values
-
_memo
protected final CanSystemConnectionMemo _memo
-
_mainArray
protected java.util.ArrayList<CbusTableEvent> _mainArray
-
ta
public final CbusEventTableAction ta
-
INITIAL_COLS
public static final int[] INITIAL_COLS
-
canFrameCols
static final int[] canFrameCols
-
-
Constructor Detail
-
CbusBasicEventTableModel
public CbusBasicEventTableModel(CanSystemConnectionMemo memo)
-
CbusBasicEventTableModel
public CbusBasicEventTableModel(CanSystemConnectionMemo memo, int initialRowSize)
-
-
Method Detail
-
getColumnCount
public int getColumnCount()
-
getRowCount
public int getRowCount()
-
getValueAt
public java.lang.Object getValueAt(int row, int col)
-
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
-
setValueAt2
public void setValueAt2(java.lang.Object value, int row, int col)
-
provideEvent
@Nonnull public CbusTableEvent provideEvent(int nn, int en)
Provide a new Event and add to Table.- Parameters:
nn
- Node Numberen
- Event Number- Returns:
- New or existing table event.
-
getEventTableRow
public int getEventTableRow(int node, int event)
Do Node + Event check, returns -1 if not on table, otherwise the row id- Parameters:
event
- intnode
- int- Returns:
- int of row, otherwise -1
- Since:
- 4.13.3
-
getEventName
@Nonnull public java.lang.String getEventName(int node, int event)
Get event name for an event in the table- Parameters:
event
- intnode
- int- Returns:
- String of event name, empty string if not present.
-
getEventString
@Nonnull public java.lang.String getEventString(int node, int event)
Get event String for an event in the table- Parameters:
event
- intnode
- int- Returns:
- String of event name, empty string if not present.
-
getEvents
@Nonnull public java.util.ArrayList<CbusTableEvent> getEvents()
Get the core list containing all table events- Returns:
- actual array of events
-
-