projectviewer.vpt
Class VPTGroup

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by projectviewer.vpt.VPTNode
          extended by projectviewer.vpt.VPTGroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<VPTNode>, javax.swing.tree.MutableTreeNode, 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
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 compareTo(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, canRename, canWrite, changed, close, compareName, delete, findIndexForChild, findProjectFor, getBackgroundColor, getChildWithName, getClipType, getForegroundColor, getGroup, getLock, getName, getVersionControlState, insert, isDirectory, isFile, isGroup, isOpened, isProject, isRoot, lock, open, persistChildren, remove, remove, removeAllChildren, removeFromParent, setName, setParent, setVersionControlState, sortChildren, sortChildren, unlock
 
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, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, 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

compareTo

public int compareTo(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.

Specified by:
compareTo in interface java.lang.Comparable<VPTNode>
Overrides:
compareTo 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