projectviewer.vpt
Class VPTGroup

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byprojectviewer.vpt.VPTNode
          extended byprojectviewer.vpt.VPTGroup
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode
Direct Known Subclasses:
VPTRoot

public class VPTGroup
extends VPTNode

A VPTGroup is a container for groups and projects.

Since:
PV 2.1.0
Version:
$Id: VPTGroup.java 8932 2007-02-09 05:29:17Z vanza $
Author:
Marcelo Vanzin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class projectviewer.vpt.VPTNode
name, treeNoSelectionBackground, treeNoSelectionForeground, treeSelectionBackground, treeSelectionForeground
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
VPTGroup(java.lang.String name)
           
 
Method Summary
 int compareToNode(VPTNode n)
          This method is used to sort the nodes in the trees.
 javax.swing.Icon getIcon(boolean expanded)
          Returns the icon to be shown on the tree next to the node name.
 java.lang.String getNodePath()
          Returns the path to this group in the group tree.
 java.lang.String toString()
          Returns a string representation of the current node.
 
Methods inherited from class projectviewer.vpt.VPTNode
canOpen, canWrite, close, compareName, compareTo, delete, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getName, isDirectory, isFile, isGroup, isOpened, isProject, isRoot, open, persistChildren, setName, setParent, sortChildren, sortChildren
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VPTGroup

public VPTGroup(java.lang.String name)
Method Detail

getIcon

public javax.swing.Icon getIcon(boolean expanded)
Returns the icon to be shown on the tree next to the node name.

Specified by:
getIcon in class VPTNode
Parameters:
expanded - If the node is currently expanded or not.

getNodePath

public java.lang.String getNodePath()
Returns the path to this group in the group tree.

Specified by:
getNodePath in class VPTNode

compareToNode

public int compareToNode(VPTNode n)
Description copied from class: VPTNode
This method is used to sort the nodes in the trees. The rough hierarchy is Root -> Groups -> Projects -> "allows children" -> leaves, so try to keep that consistent.

IT'S VERY IMPORTANT TO IMPLEMENT THIS METHOD CORRECTLY. Especially for nodes that allow children nodes, since VPTDirectory expects nodes of these kinds to take care of the comparison themselves. There's danger of infinite recursion if you don't take this into account.

Overrides:
compareToNode in class VPTNode

toString

public java.lang.String toString()
Description copied from class: VPTNode
Returns a string representation of the current node.

Overrides:
toString in class VPTNode