edu.berkeley.guir.papier_mache.assoc
Class AssociationTreeTable.AssociationTreeTableModel

java.lang.Object
  extended by edu.berkeley.guir.lib.swing.treetable.AbstractTreeTableModel
      extended by edu.berkeley.guir.papier_mache.assoc.AssociationTreeTable.AssociationTreeTableModel
All Implemented Interfaces:
javax.swing.tree.TreeModel, edu.berkeley.guir.lib.swing.treetable.TreeTableModel
Enclosing class:
AssociationTreeTable

public class AssociationTreeTable.AssociationTreeTableModel
extends edu.berkeley.guir.lib.swing.treetable.AbstractTreeTableModel


Constructor Summary
AssociationTreeTable.AssociationTreeTableModel(java.lang.Object root)
           
 
Method Summary
 java.lang.Object getChild(java.lang.Object parent, int index)
           
 int getChildCount(java.lang.Object parent)
           
 java.lang.Class getColumnClass(int column)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
           
 javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.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.
 java.lang.Object getValueAt(java.lang.Object node, int column)
           
 void insertNodeInto(javax.swing.tree.MutableTreeNode newChild, javax.swing.tree.MutableTreeNode parent, int index)
           
 boolean isLeaf(java.lang.Object node)
           
 void nodeChanged(javax.swing.tree.TreeNode node)
          Invoke this method after you've changed how node is to be represented in the tree.
 void nodesChanged(javax.swing.tree.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 nodesWereInserted(javax.swing.tree.TreeNode node, int[] childIndices)
           
 void nodesWereRemoved(javax.swing.tree.TreeNode node, int[] childIndices, java.lang.Object[] removedChildren)
          Invoke this method after you've removed some TreeNodes from node.
 void removeNodeFromParent(javax.swing.tree.MutableTreeNode node)
          Message this to remove node from its parent.
 
Methods inherited from class edu.berkeley.guir.lib.swing.treetable.AbstractTreeTableModel
addTreeModelListener, getIndexOfChild, getRoot, isCellEditable, removeTreeModelListener, setValueAt, valueForPathChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationTreeTable.AssociationTreeTableModel

public AssociationTreeTable.AssociationTreeTableModel(java.lang.Object root)
Parameters:
root -
Method Detail

insertNodeInto

public void insertNodeInto(javax.swing.tree.MutableTreeNode newChild,
                           javax.swing.tree.MutableTreeNode parent,
                           int index)

nodesWereInserted

public void nodesWereInserted(javax.swing.tree.TreeNode node,
                              int[] childIndices)

getPathToRoot

public javax.swing.tree.TreeNode[] getPathToRoot(javax.swing.tree.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. The length of the returned array gives the node's depth in the tree.

Parameters:
aNode - the TreeNode to get the path for

removeNodeFromParent

public void removeNodeFromParent(javax.swing.tree.MutableTreeNode node)
Message this to remove node from its parent. This will message nodesWereRemoved to create the appropriate event. This is the preferred way to remove a node as it handles the event creation for you.


nodesWereRemoved

public void nodesWereRemoved(javax.swing.tree.TreeNode node,
                             int[] childIndices,
                             java.lang.Object[] removedChildren)
Invoke this method after you've removed some TreeNodes from node. childIndices should be the index of the removed elements and must be sorted in ascending order. And removedChildren should be the array of the children objects that were removed.


nodeChanged

public void nodeChanged(javax.swing.tree.TreeNode node)
Invoke this method after you've changed how node is to be represented in the tree.


nodesChanged

public void nodesChanged(javax.swing.tree.TreeNode node,
                         int[] childIndices)
Invoke this method after you've changed how the children identified by childIndicies are to be represented in the tree.


getColumnCount

public int getColumnCount()

getColumnName

public java.lang.String getColumnName(int column)

getValueAt

public java.lang.Object getValueAt(java.lang.Object node,
                                   int column)

getChildCount

public int getChildCount(java.lang.Object parent)

getChild

public java.lang.Object getChild(java.lang.Object parent,
                                 int index)

getColumnClass

public java.lang.Class getColumnClass(int column)
Specified by:
getColumnClass in interface edu.berkeley.guir.lib.swing.treetable.TreeTableModel
Overrides:
getColumnClass in class edu.berkeley.guir.lib.swing.treetable.AbstractTreeTableModel

isLeaf

public boolean isLeaf(java.lang.Object node)
Specified by:
isLeaf in interface javax.swing.tree.TreeModel
Overrides:
isLeaf in class edu.berkeley.guir.lib.swing.treetable.AbstractTreeTableModel