JET

edu.utep.cs.et.gui.explorer
Class DirectoryTree.DirNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by edu.utep.cs.et.gui.explorer.DirectoryTree.DirNode
All Implemented Interfaces:
Serializable, Cloneable, MutableTreeNode, TreeNode
Enclosing class:
DirectoryTree

private static class DirectoryTree.DirNode
extends DefaultMutableTreeNode

A class representing nodes of directory trees. A node represents either a directory or a file.


Field Summary
private  boolean explored
          True if this node is explored.
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
DirectoryTree.DirNode(File file)
          Returns a directory node representing the give file.
 
Method Summary
 void explore()
          Explores this node.
 boolean getAllowsChildren()
          Returns true if this node allows children.
 File getFile()
          Returns the file that this node represents.
 Icon icon()
          Returns icon for this node.
 boolean isDirectory()
          Returns true if this node represents a directory.
 boolean isExplored()
          Returns true if this node has already been explored.
 boolean isLeaf()
          Returns true if this node is a leaf.
 String toString()
          Returns the string representation of this node.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, 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, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

explored

private boolean explored
True if this node is explored. I.e., all its children are also visible.

Constructor Detail

DirectoryTree.DirNode

public DirectoryTree.DirNode(File file)
Returns a directory node representing the give file.

Method Detail

getAllowsChildren

public boolean getAllowsChildren()
Returns true if this node allows children. True if is returned only if this node represents a directory, not a file.

Specified by:
getAllowsChildren in interface TreeNode
Overrides:
getAllowsChildren in class DefaultMutableTreeNode

isLeaf

public boolean isLeaf()
Returns true if this node is a leaf. True is returned only if this node is not a directory.

Specified by:
isLeaf in interface TreeNode
Overrides:
isLeaf in class DefaultMutableTreeNode

getFile

public File getFile()
Returns the file that this node represents.


isExplored

public boolean isExplored()
Returns true if this node has already been explored.


isDirectory

public boolean isDirectory()
Returns true if this node represents a directory.


icon

public Icon icon()
Returns icon for this node.


toString

public String toString()
Returns the string representation of this node. This method returns directory or file name.

Overrides:
toString in class DefaultMutableTreeNode

explore

public void explore()
Explores this node. That is, show all its children.


JET

JET is Copyright (C) 2005-2007 by The University of Texas at El Paso and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.