Package org.apache.jorphan.gui
Class AbstractTreeTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
org.apache.jorphan.gui.AbstractTreeTableModel
- All Implemented Interfaces:
Serializable
,TableModel
,TreeTableModel
- Direct Known Subclasses:
DefaultTreeTableModel
- See Also:
-
Field Summary
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTreeTableModel
(String[] headers, Functor[] readFunctors, Functor[] writeFunctors, Class<?>[] editorClasses) protected
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
fireTreeNodesChanged
(TreeNode source, Object[] path, int[] indexes, Object[] children) int
getChildCount
(Object parent) Class<?>
getColumnClass
(int arg0) int
The implementation is exactly the same as ObjectTableModel.getColumnCount.getColumnName
(int columnIndex) The root node for the TreeTableint
The implementation is exactly the same as ObjectTableModel.getRowCount.getValueAt
(int rowIndex, int columnIndex) Subclasses need to implement the logic for the method and return the value at the specific cell.getValueAt
(Object node, int col) The method is similar to getValueAt(int,int).boolean
isCellEditable
(int rowIndex, int columnIndex) By default the abstract class returns true.boolean
isCellEditable
(Object node, int col) the method is similar to isCellEditable(int,int).boolean
the implementation checks if the Object is a treenode.void
nodeStructureChanged
(TreeNode node) void
void
setValueAt
(Object aValue, int rowIndex, int columnIndex) void
setValueAt
(Object val, Object node, int column) the method is similar to isCellEditable(int,int).Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
Methods inherited from class javax.swing.table.AbstractTableModel
findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
-
Field Details
-
rootNode
-
listener
-
objects
-
headers
-
classes
-
readFunctors
-
writeFunctors
-
-
Constructor Details
-
AbstractTreeTableModel
-
AbstractTreeTableModel
-
-
Method Details
-
getRootNode
The root node for the TreeTable- Returns:
- the root node
-
getValueAt
The method is similar to getValueAt(int,int). Instead of int, the row is an object.- Specified by:
getValueAt
in interfaceTreeTableModel
- Parameters:
node
- the node which value is to be fetchedcol
- the column of the node- Returns:
- the value at the column
-
isCellEditable
the method is similar to isCellEditable(int,int). Instead of int, the row is an object.- Specified by:
isCellEditable
in interfaceTreeTableModel
- Parameters:
node
- the node which value is to be fetchedcol
- the column of the node- Returns:
true
if cell is editable
-
setValueAt
the method is similar to isCellEditable(int,int). Instead of int, the row is an object.- Specified by:
setValueAt
in interfaceTreeTableModel
- Parameters:
val
- the value to be setnode
- the node which value is to be setcolumn
- the column of the node
-
getColumnCount
public int getColumnCount()The implementation is exactly the same as ObjectTableModel.getColumnCount.- Specified by:
getColumnCount
in interfaceTableModel
- Overrides:
getColumnCount
in classDefaultTableModel
-
getRowCount
public int getRowCount()The implementation is exactly the same as ObjectTableModel.getRowCount.- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classDefaultTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) By default the abstract class returns true. It is up to subclasses to override the implementation.- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classDefaultTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getValueAt
Subclasses need to implement the logic for the method and return the value at the specific cell.- Specified by:
getValueAt
in interfaceTableModel
- Overrides:
getValueAt
in classDefaultTableModel
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classDefaultTableModel
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classDefaultTableModel
-
getChildCount
-
getChild
-
isLeaf
the implementation checks if the Object is a treenode. If it is, it returnsisLeaf()
, otherwise it returnsfalse
.- Parameters:
node
- object to be checked forisLeaf()
- Returns:
true
if object is a leaf node,false
otherwise
-
addTableModelListener
- Specified by:
addTableModelListener
in interfaceTableModel
- Overrides:
addTableModelListener
in classAbstractTableModel
-
removeTableModelListener
- Specified by:
removeTableModelListener
in interfaceTableModel
- Overrides:
removeTableModelListener
in classAbstractTableModel
-
nodeStructureChanged
-
fireTreeNodesChanged
-
clearData
public void clearData()
-