public class NodeTableModel extends AbstractTableModel
Node.Property
) as columns and nodes (Node
) as rows.
It is used as model for displaying node properties in table. Each column is represented by
Node.Property
object. Each row is represented by Node
object.
Each cell contains Node.Property
property which equals with column object
and should be in property sets of row representant (Node
).listenerList
Constructor and Description |
---|
NodeTableModel() |
Modifier and Type | Method and Description |
---|---|
Class |
getColumnClass(int column)
Getter for column class.
|
int |
getColumnCount()
Getter for column count.
|
String |
getColumnName(int column)
Getter for column name
|
protected Node.Property |
getPropertyFor(Node node,
Node.Property prop)
Returns node property if found in nodes property sets.
|
int |
getRowCount()
Getter for row count.
|
Object |
getValueAt(int row,
int column)
Getter for property.
|
boolean |
isCellEditable(int row,
int column)
Cell is editable only if it has non null value.
|
void |
setNodes(Node[] nodes)
Set rows.
|
void |
setProperties(Node.Property[] props)
Set columns.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
public void setNodes(Node[] nodes)
nodes
- the rowspublic void setProperties(Node.Property[] props)
props
- the columnsprotected Node.Property getPropertyFor(Node node, Node.Property prop)
node
- represents single rowprop
- represents columnpublic int getRowCount()
public int getColumnCount()
public Object getValueAt(int row, int column)
row
- table row indexcolumn
- table column indexpublic boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
row
- table row indexcolumn
- table column indexpublic Class getColumnClass(int column)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
column
- table column indexNode.Property.class
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
column
- table column index