public abstract class AbstractSortableTreeTableModel extends Object implements SortableTreeTableModel
Modifier and Type | Field and Description |
---|---|
protected EventListenerList |
listenerList |
Constructor and Description |
---|
AbstractSortableTreeTableModel() |
Modifier and Type | Method and Description |
---|---|
void |
addTreeModelListener(TreeModelListener l) |
protected void |
fireTreeNodesChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children) |
protected void |
fireTreeNodesInserted(Object source,
Object[] path,
int[] childIndices,
Object[] children) |
protected void |
fireTreeNodesRemoved(Object source,
Object[] path,
int[] childIndices,
Object[] children) |
protected void |
fireTreeStructureChanged(Object source,
Object[] path) |
protected void |
fireTreeStructureChanged(Object source,
Object[] path,
int[] childIndices,
Object[] children) |
Object |
getChild(Object parent,
int index) |
int |
getChildCount(Object parent) |
abstract Class |
getColumnClass(int column)
Returns the most specific superclass for all the cell values in the
column.
|
abstract int |
getColumnCount()
Returns the number of columns in the model.
|
abstract String |
getColumnName(int column)
Returns the name of the column at
columnIndex . |
int |
getIndexOfChild(Object parent,
Object child) |
Object[] |
getPathToRoot(TreeNode aNode)
Builds the parents of node up to and including the root node, where the
original node is the last element in the returned array.
|
protected Object[] |
getPathToRoot(TreeNode aNode,
int depth)
Builds the parents of node up to and including the root node, where the
original node is the last element in the returned array.
|
abstract Object |
getRoot() |
TreeModelListener[] |
getTreeModelListeners()
Returns an array of all the tree model listeners registered on this
model.
|
abstract Object |
getValueAt(Object node,
int column)
Returns the value for the
node at columnIndex . |
boolean |
isCellEditable(Object node,
int column)
Returns true if the cell for the
node at columnIndex is
editable. |
boolean |
isLeaf(Object node) |
void |
nodeChanged(TreeNode node)
Invoke this method after you've changed how node is to be
represented in the tree.
|
void |
nodesChanged(TreeNode node,
int[] childIndices)
Invoke this method after you've changed how the children identified by
childIndicies are to be represented in the tree.
|
void |
nodeStructureChanged(TreeNode node)
Invoke this method if you've totally changed the children of node and its
childrens children...
|
void |
nodesWereInserted(TreeNode node,
int[] childIndices)
Invoke this method after you've inserted some TreeNodes into node.
|
void |
nodesWereRemoved(TreeNode node,
int[] childIndices,
Object[] removedChildren)
Invoke this method after you've removed some TreeNodes from node.
|
void |
removeTreeModelListener(TreeModelListener l) |
void |
setValueAt(Object value,
Object node,
int column)
Sets the value for the
node at columnIndex to
value . |
abstract void |
sortOrderChanged(SortEvent e) |
void |
valueForPathChanged(TreePath path,
Object newValue) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHierarchicalColumn
protected EventListenerList listenerList
public AbstractSortableTreeTableModel()
public void addTreeModelListener(TreeModelListener l)
addTreeModelListener
in interface TreeModel
public void removeTreeModelListener(TreeModelListener l)
removeTreeModelListener
in interface TreeModel
public void valueForPathChanged(TreePath path, Object newValue)
valueForPathChanged
in interface TreeModel
public abstract void sortOrderChanged(SortEvent e)
sortOrderChanged
in interface ColumnSorter
public void nodesWereInserted(TreeNode node, int[] childIndices)
node
- Description of the ParameterchildIndices
- Description of the Parameterpublic void nodeChanged(TreeNode node)
public void nodesWereRemoved(TreeNode node, int[] childIndices, Object[] removedChildren)
node
- Description of the ParameterchildIndices
- Description of the ParameterremovedChildren
- Description of the Parameterpublic void nodesChanged(TreeNode node, int[] childIndices)
node
- Description of the ParameterchildIndices
- Description of the Parameterpublic void nodeStructureChanged(TreeNode node)
node
- Description of the Parameterprotected void fireTreeNodesChanged(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeNodesInserted(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeNodesRemoved(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeStructureChanged(Object source, Object[] path, int[] childIndices, Object[] children)
protected void fireTreeStructureChanged(Object source, Object[] path)
public void setValueAt(Object value, Object node, int column)
TreeTableModel
node
at columnIndex
to
value
. The node
must be managed by this model.
Unamanaged nodes should throw an IllegalArgumentException
.setValueAt
in interface TreeTableModel
value
- the new valuenode
- the node whose value is to be changedcolumn
- the column whose value is to be changedTreeTableModel.getValueAt(java.lang.Object, int)
,
TreeTableModel.isCellEditable(java.lang.Object, int)
,
TableModel.setValueAt(Object, int, int)
public Object[] getPathToRoot(TreeNode aNode)
aNode
- the TreeNode to get the path forpublic TreeModelListener[] getTreeModelListeners()
TreeModelListener
s or an
empty array if no tree model listeners are currently registeredaddTreeModelListener(javax.swing.event.TreeModelListener)
,
removeTreeModelListener(javax.swing.event.TreeModelListener)
public boolean isCellEditable(Object node, int column)
TreeTableModel
node
at columnIndex
is
editable. Otherwise, setValueAt
on the cell will not change the
value of that cell. The node
must be managed by this model.
Unamanaged nodes should throw an IllegalArgumentException
.isCellEditable
in interface TreeTableModel
node
- the node whose value to be queriedcolumn
- the column whose value to be queriedTreeTableModel.setValueAt(java.lang.Object, java.lang.Object, int)
,
TableModel.isCellEditable(int, int)
public int getChildCount(Object parent)
getChildCount
in interface TreeModel
public int getIndexOfChild(Object parent, Object child)
getIndexOfChild
in interface TreeModel
public abstract Class getColumnClass(int column)
TreeTableModel
JXTreeTable
to set up a default
renderer and editor for the column.getColumnClass
in interface TreeTableModel
column
- the index of the columnTableModel.getColumnClass(int)
public abstract int getColumnCount()
TreeTableModel
JXTreeTable
uses
this method to determine how many columns it should create and display by
default.getColumnCount
in interface TreeTableModel
TableModel.getColumnCount()
public abstract String getColumnName(int column)
TreeTableModel
columnIndex
. This is used to
initialize the table's column header name. Note: this name does not need
to be unique; two columns in a table can have the same name.getColumnName
in interface TreeTableModel
column
- the index of the columnTableModel.getColumnName(int)
public abstract Object getValueAt(Object node, int column)
TreeTableModel
node
at columnIndex
. The
node
must be managed by this model. Unamanaged nodes should throw
an IllegalArgumentException
.getValueAt
in interface TreeTableModel
node
- the node whose value is to be queriedcolumn
- the column whose value is to be queriedTreeTableModel.setValueAt(java.lang.Object, java.lang.Object, int)
,
TableModel.getValueAt(int, int)
protected Object[] getPathToRoot(TreeNode aNode, int depth)
aNode
- the TreeNode to get the path fordepth
- an int giving the number of steps already taken towards the
root (on recursive calls), used to size the returned arrayWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses