org.jscience.io
Class FileTreeNode

java.lang.Object
  extended by org.jscience.io.FileTreeNode
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeNode
Direct Known Subclasses:
DirectoryTreeNode

public class FileTreeNode
extends java.lang.Object
implements javax.swing.tree.TreeNode, java.io.Serializable

FileTreeNode implements a TreeNode that can be used to visualize a file structure. Both, directories and files are visible by default. Optionally, a FileFilter can be used to restrict the files in the tree.

See Also:
DirectoryTreeNode, JTree, DefaultTreeModel, Serialized Form

Constructor Summary
FileTreeNode(java.io.File file)
          initializes the FileTreeNode with the given file
FileTreeNode(java.io.File file, java.io.FileFilter filter)
          initializes the FileTreeNode with the given file and filter
 
Method Summary
 java.util.Enumeration children()
          DOCUMENT ME!
 boolean equals(java.lang.Object obj)
          DOCUMENT ME!
 boolean getAllowsChildren()
          DOCUMENT ME!
 javax.swing.tree.TreeNode getChildAt(int childIndex)
          DOCUMENT ME!
 int getChildCount()
          DOCUMENT ME!
 java.io.File getFile()
          DOCUMENT ME!
 java.io.FileFilter getFilter()
          DOCUMENT ME!
 int getIndex(javax.swing.tree.TreeNode node)
          DOCUMENT ME!
 javax.swing.tree.TreeNode getParent()
          DOCUMENT ME!
 boolean isLeaf()
          DOCUMENT ME!
 void refresh()
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTreeNode

public FileTreeNode(java.io.File file)
initializes the FileTreeNode with the given file


FileTreeNode

public FileTreeNode(java.io.File file,
                    java.io.FileFilter filter)
initializes the FileTreeNode with the given file and filter

Method Detail

refresh

public void refresh()
DOCUMENT ME!


getFile

public java.io.File getFile()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getFilter

public java.io.FileFilter getFilter()
DOCUMENT ME!

Returns:
DOCUMENT ME!

children

public java.util.Enumeration children()
DOCUMENT ME!

Specified by:
children in interface javax.swing.tree.TreeNode
Returns:
DOCUMENT ME!

getChildCount

public int getChildCount()
DOCUMENT ME!

Specified by:
getChildCount in interface javax.swing.tree.TreeNode
Returns:
DOCUMENT ME!

getAllowsChildren

public boolean getAllowsChildren()
DOCUMENT ME!

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Returns:
DOCUMENT ME!

getChildAt

public javax.swing.tree.TreeNode getChildAt(int childIndex)
DOCUMENT ME!

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Parameters:
childIndex - DOCUMENT ME!
Returns:
DOCUMENT ME!

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
DOCUMENT ME!

Specified by:
getIndex in interface javax.swing.tree.TreeNode
Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

isLeaf

public boolean isLeaf()
DOCUMENT ME!

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Returns:
DOCUMENT ME!

getParent

public javax.swing.tree.TreeNode getParent()
DOCUMENT ME!

Specified by:
getParent in interface javax.swing.tree.TreeNode
Returns:
DOCUMENT ME!

equals

public boolean equals(java.lang.Object obj)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
obj - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!