Package jmri.jmrix.can.cbus.node
Class CbusBasicNodeTableOperations
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- jmri.jmrix.can.cbus.node.CbusBasicNodeTable
-
- jmri.jmrix.can.cbus.node.CbusBasicNodeTableOperations
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
- Direct Known Subclasses:
CbusBasicNodeTableFetch
,CbusNodeFromFcuTableDataModel
public class CbusBasicNodeTableOperations extends CbusBasicNodeTable
Table data model for display of CBUS Nodes- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeTable
_mainArray, _memo, BYTES_REMAINING_COLUMN, CANID_COLUMN, COLUMNTOOLTIPS, COMMAND_STAT_NUMBER_COLUMN, LAST_BACKUP_COLUMN, MAX_COLUMN, NODE_EDIT_BUTTON_COLUMN, NODE_EVENT_INDEX_VALID_COLUMN, NODE_EVENTS_COLUMN, NODE_IN_LEARN_MODE_COLUMN, NODE_NUMBER_COLUMN, NODE_RESYNC_BUTTON_COLUMN, NODE_TOTAL_BYTES_COLUMN, NODE_TYPE_NAME_COLUMN, NODE_USER_NAME_COLUMN, NUMBER_BACKUPS_COLUMN, progMan, SESSION_BACKUP_STATUS_COLUMN
-
-
Constructor Summary
Constructors Constructor Description CbusBasicNodeTableOperations(CanSystemConnectionMemo memo, int row, int column)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNode(CbusNode node)
Register new node to tableint
getAnyNodeInLearnMode()
Returns Node number of any node currently in Learn ModeCbusNode
getCsByNum(int csnum)
Returns an existing command station by cs number, NOT node numberjava.util.ArrayList<java.lang.String>
getListOfNodeNumberNames()
Returns a string ArrayList of all Node Number and User Names on the tableint
getNextAvailableNodeNumber(int higherthan)
Returns the next available Node NumberCbusNode
getNodeByNodeNum(int nodenum)
Returns an existing node by node numberCbusNode
getNodeByRowNum(int rowNum)
Returns an existing node by table row numberjava.lang.String
getNodeName(int nn)
Single Node User Namejava.lang.String
getNodeNameFromCanId(int canId)
For a given CAN ID, if in use, return formatted Node Name and number else returns zero length stringjava.lang.String
getNodeNumberName(int nodenum)
Returns formatted Node Number and User Name by node numberint
getNodeRowFromNodeNum(int nodenum)
Returns the table row number by node numberint
getRequestNodeRowToDisplay()
protected CbusNode
provideCsByNum(int csnum, int nodenum)
Returns a new or existing command station by cs number, NOT node numberCbusNode
provideNodeByNodeNum(int nodenum)
Returns a new or existing node by node numbervoid
removeRow(int row, boolean removeXml)
Remove Row from table and dispose of itvoid
setRequestNodeDisplay(int nodeNumber)
-
Methods inherited from class jmri.jmrix.can.cbus.node.CbusBasicNodeTable
getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, setValueAt
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Constructor Detail
-
CbusBasicNodeTableOperations
public CbusBasicNodeTableOperations(@Nonnull CanSystemConnectionMemo memo, int row, int column)
-
-
Method Detail
-
addNode
public void addNode(CbusNode node)
Register new node to table- Parameters:
node
- The CbusNode to add to the table
-
getCsByNum
@CheckForNull public CbusNode getCsByNum(int csnum)
Returns an existing command station by cs number, NOT node number- Parameters:
csnum
- The Command Station Number ( the default in CBUS is 0 )- Returns:
- the Node which has the command station number, else null
-
provideCsByNum
@Nonnull protected CbusNode provideCsByNum(int csnum, int nodenum)
Returns a new or existing command station by cs number, NOT node number- Parameters:
csnum
- The Command Station Number to provide bynodenum
- if existing CS sets node num to this, else node with this number and starts param lookup- Returns:
- the Node which has the command station number
-
provideNodeByNodeNum
@Nonnull public CbusNode provideNodeByNodeNum(int nodenum)
Returns a new or existing node by node number- Parameters:
nodenum
- number to search nodes by, else creates node with this number and starts param lookup- Returns:
- the Node which has the node number
-
getNodeByRowNum
public CbusNode getNodeByRowNum(int rowNum)
Returns an existing node by table row number- Parameters:
rowNum
- The Row Number- Returns:
- the Node
-
getNodeRowFromNodeNum
public int getNodeRowFromNodeNum(int nodenum)
Returns the table row number by node number- Parameters:
nodenum
- The Node Number ( min 1, max 65535 )- Returns:
- the Model Row which has the node number, else -1
-
getNodeNameFromCanId
public java.lang.String getNodeNameFromCanId(int canId)
For a given CAN ID, if in use, return formatted Node Name and number else returns zero length string- Parameters:
canId
- the CAN ID to search the table for- Returns:
- Node Number and name
-
getAnyNodeInLearnMode
public int getAnyNodeInLearnMode()
Returns Node number of any node currently in Learn Mode- Returns:
- Node Num, else -1 if no nodes known to be in learn mode
-
getNodeByNodeNum
@CheckForNull public CbusNode getNodeByNodeNum(int nodenum)
Returns an existing node by node number- Parameters:
nodenum
- The Node Number ( min 1, max 65535 )- Returns:
- the Node which has the node number, else null
-
removeRow
public void removeRow(int row, boolean removeXml)
Remove Row from table and dispose of it- Parameters:
row
- int row numberremoveXml
- true to also remove the Node xml file
-
getNextAvailableNodeNumber
public int getNextAvailableNodeNumber(int higherthan)
Returns the next available Node Number- Parameters:
higherthan
- Node Number- Returns:
- calculated next available number, else original value
-
getListOfNodeNumberNames
@Nonnull public java.util.ArrayList<java.lang.String> getListOfNodeNumberNames()
Returns a string ArrayList of all Node Number and User Names on the table- Returns:
- Node Number + either node model or Username.
-
getNodeNumberName
public java.lang.String getNodeNumberName(int nodenum)
Returns formatted Node Number and User Name by node number- Parameters:
nodenum
- The Node Number ( min 1, max 65535 )- Returns:
- Node Number + either node model or Username.
-
getNodeName
@Nonnull public java.lang.String getNodeName(int nn)
Single Node User Name- Parameters:
nn
- Node Number, NOT row number- Returns:
- Node Username, if unset returns node type name, else empty String
-
getRequestNodeRowToDisplay
public int getRequestNodeRowToDisplay()
-
setRequestNodeDisplay
public void setRequestNodeDisplay(int nodeNumber)
-
-