com.sun.electric.tool.user.ui
Class JobTree

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.sun.electric.tool.user.ui.JobTree
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class JobTree
extends javax.swing.tree.DefaultMutableTreeNode

Class defines Job information in the explorer tree.

See Also:
Serialized Form

Nested Class Summary
static class JobTree.JobTreeNode
           
 
Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Method Summary
 boolean getAllowsChildren()
           
static javax.swing.tree.DefaultMutableTreeNode getExplorerTree()
          Build Job explorer tree
 int getIndex(javax.swing.tree.TreeNode aChild)
          Returns the index of the specified child in this node's child array.
static javax.swing.JPopupMenu getPopupStatus(JobTree.JobTreeNode jobNode)
          popup menu when user right-clicks on job in explorer tree
 void insert(javax.swing.tree.MutableTreeNode newChild, int childIndex)
           
 boolean isLeaf()
           
 void remove(int childIndex)
           
static void update(java.util.List<Job> jobs)
          Update Job Tree to given list of Jobs.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getExplorerTree

public static javax.swing.tree.DefaultMutableTreeNode getExplorerTree()
Build Job explorer tree


update

public static void update(java.util.List<Job> jobs)
Update Job Tree to given list of Jobs.

Parameters:
jobs - given list of jobs.

getPopupStatus

public static javax.swing.JPopupMenu getPopupStatus(JobTree.JobTreeNode jobNode)
popup menu when user right-clicks on job in explorer tree


isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Overrides:
isLeaf in class javax.swing.tree.DefaultMutableTreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Overrides:
getAllowsChildren in class javax.swing.tree.DefaultMutableTreeNode

insert

public void insert(javax.swing.tree.MutableTreeNode newChild,
                   int childIndex)
Specified by:
insert in interface javax.swing.tree.MutableTreeNode
Overrides:
insert in class javax.swing.tree.DefaultMutableTreeNode

remove

public void remove(int childIndex)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Overrides:
remove in class javax.swing.tree.DefaultMutableTreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode aChild)
Returns the index of the specified child in this node's child array. If the specified node is not a child of this node, returns -1. This method performs a linear search and is O(n) where n is the number of children.

Specified by:
getIndex in interface javax.swing.tree.TreeNode
Overrides:
getIndex in class javax.swing.tree.DefaultMutableTreeNode
Parameters:
aChild - the TreeNode to search for among this node's children
Returns:
an int giving the index of the node in this node's child array, or -1 if the specified node is a not a child of this node
Throws:
java.lang.IllegalArgumentException - if aChild is null