com.metamatrix.toolbox.ui.widget.tree
Class DefaultTreeView

java.lang.Object
  extended by com.metamatrix.toolbox.ui.widget.tree.DefaultTreeView
All Implemented Interfaces:
PropertiedObjectView, UserTransactionFactory, TreeView, java.util.Comparator

public class DefaultTreeView
extends java.lang.Object
implements java.util.Comparator, TreeView

This is the default TreeView used by DefaultTreeModel.

Since:
2.0
Version:
2.0
Author:
John P. A. Verhaeg

Constructor Summary
DefaultTreeView()
          Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.
DefaultTreeView(DefaultTreeNode root)
          Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.
DefaultTreeView(java.lang.Object value)
          Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.
 
Method Summary
 boolean allowsChild(TreeNode parent, TreeNode potentialChild)
           
 boolean allowsChildren(TreeNode node)
           
 int compare(java.lang.Object firstNode, java.lang.Object secondNode)
           
 UserTransaction createReadTransaction()
           
 UserTransaction createWriteTransaction()
           
 UserTransaction createWriteTransaction(java.lang.Object source)
           
 java.lang.String getAbsolutePath(TreeNode node)
           
 DefaultTreeNode getChild(DefaultTreeNode parent, int index)
           
 int getChildCount(TreeNode parent)
           
 int getChildIndex(DefaultTreeNode parent, DefaultTreeNode child)
           
 java.util.List getChildren(TreeNode parent)
           
 java.util.Comparator getComparator()
           
 TreeNodeFilter getFilter()
           
 TreeNode getHome()
           
 java.util.Set getMarked()
          Return the set of marked nodes for this view.
 TreeNode getParent(TreeNode child)
           
 java.lang.String getPath(TreeNode node)
           
 PropertiedObjectEditor getPropertiedObjectEditor()
           
 java.util.List getPropertyDefinitions()
           
 DefaultTreeNode getRoot()
           
 java.util.List getRoots()
           
 java.lang.String getSeparator()
          Not implemented.
 char getSeparatorChar()
           
 TreeNodeEditor getTreeNodeEditor()
           
protected  void initializeDefaultTreeView()
           
 boolean isAncestorOf(TreeNode ancestor, TreeNode descendent)
           
 boolean isHidden(TreeNode node)
           
 boolean isMarked(TreeNode node)
           
 boolean isParentOf(TreeNode parent, TreeNode child)
           
 boolean isRoot(TreeNode node)
           
 java.util.Iterator iterator()
           
 java.util.Iterator iterator(TreeNode startingPoint)
           
 void setComparator(java.util.Comparator comparator)
           
 void setFilter(TreeNodeFilter filter)
           
 void setMarked(TreeNode node, boolean isMarked)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DefaultTreeView

public DefaultTreeView()
Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.

Since:
2.0

DefaultTreeView

public DefaultTreeView(DefaultTreeNode root)
Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.

Since:
2.0

DefaultTreeView

public DefaultTreeView(java.lang.Object value)
Creates a DefaultTreeView with an empty DefaultTreeNode as a root node.

Since:
2.0
Method Detail

allowsChildren

public boolean allowsChildren(TreeNode node)
Specified by:
allowsChildren in interface TreeView
Since:
2.0

allowsChild

public boolean allowsChild(TreeNode parent,
                           TreeNode potentialChild)
Specified by:
allowsChild in interface TreeView
Since:
2.0

compare

public int compare(java.lang.Object firstNode,
                   java.lang.Object secondNode)
Specified by:
compare in interface java.util.Comparator
Since:
2.0

createReadTransaction

public UserTransaction createReadTransaction()
Specified by:
createReadTransaction in interface UserTransactionFactory
Since:
2.0

createWriteTransaction

public UserTransaction createWriteTransaction()
Specified by:
createWriteTransaction in interface UserTransactionFactory
Since:
2.0

createWriteTransaction

public UserTransaction createWriteTransaction(java.lang.Object source)
Specified by:
createWriteTransaction in interface UserTransactionFactory
Since:
2.0

getAbsolutePath

public java.lang.String getAbsolutePath(TreeNode node)
Since:
2.0

getChild

public DefaultTreeNode getChild(DefaultTreeNode parent,
                                int index)
Since:
2.0

getChildCount

public int getChildCount(TreeNode parent)
Since:
2.0

getChildIndex

public int getChildIndex(DefaultTreeNode parent,
                         DefaultTreeNode child)
Since:
2.0

getChildren

public java.util.List getChildren(TreeNode parent)
Specified by:
getChildren in interface TreeView
Since:
2.0

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface TreeView
Since:
2.0

iterator

public java.util.Iterator iterator(TreeNode startingPoint)
Specified by:
iterator in interface TreeView
Since:
2.0

getComparator

public java.util.Comparator getComparator()
Specified by:
getComparator in interface TreeView
Since:
2.0

getPropertiedObjectEditor

public PropertiedObjectEditor getPropertiedObjectEditor()
Specified by:
getPropertiedObjectEditor in interface PropertiedObjectView
Since:
2.0

getFilter

public TreeNodeFilter getFilter()
Specified by:
getFilter in interface TreeView
Since:
2.0

getHome

public TreeNode getHome()
Specified by:
getHome in interface TreeView
Since:
2.0

getParent

public TreeNode getParent(TreeNode child)
Specified by:
getParent in interface TreeView
Since:
2.0

getPath

public java.lang.String getPath(TreeNode node)
Specified by:
getPath in interface TreeView
Since:
2.0

getPropertyDefinitions

public java.util.List getPropertyDefinitions()
Specified by:
getPropertyDefinitions in interface TreeView
Since:
2.0

getRoot

public DefaultTreeNode getRoot()
Since:
2.0

getRoots

public java.util.List getRoots()
Specified by:
getRoots in interface TreeView
Since:
2.0

getSeparator

public java.lang.String getSeparator()
Not implemented.

Specified by:
getSeparator in interface TreeView
Since:
2.0

getSeparatorChar

public char getSeparatorChar()
Specified by:
getSeparatorChar in interface TreeView
Since:
2.0

getTreeNodeEditor

public TreeNodeEditor getTreeNodeEditor()
Specified by:
getTreeNodeEditor in interface TreeView
Since:
2.0

initializeDefaultTreeView

protected void initializeDefaultTreeView()
Since:
2.0

isAncestorOf

public boolean isAncestorOf(TreeNode ancestor,
                            TreeNode descendent)
Specified by:
isAncestorOf in interface TreeView
Since:
2.0

isHidden

public boolean isHidden(TreeNode node)
Specified by:
isHidden in interface TreeView
Since:
2.0

isMarked

public boolean isMarked(TreeNode node)
Specified by:
isMarked in interface TreeView
Since:
2.0

isParentOf

public boolean isParentOf(TreeNode parent,
                          TreeNode child)
Specified by:
isParentOf in interface TreeView
Since:
2.0

isRoot

public boolean isRoot(TreeNode node)
Specified by:
isRoot in interface TreeView
Since:
2.0

setComparator

public void setComparator(java.util.Comparator comparator)
Specified by:
setComparator in interface TreeView
Since:
2.0

setFilter

public void setFilter(TreeNodeFilter filter)
Specified by:
setFilter in interface TreeView
Since:
2.0

setMarked

public void setMarked(TreeNode node,
                      boolean isMarked)
Specified by:
setMarked in interface TreeView
Since:
2.0

getMarked

public java.util.Set getMarked()
Return the set of marked nodes for this view.

Specified by:
getMarked in interface TreeView
Parameters:
the - unmodifiable set of marked nodes; never null


Copyright © 2009. All Rights Reserved.