org.emboss.jemboss.gui.filetree
Class FileNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.emboss.jemboss.gui.filetree.FileNode
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, java.awt.datatransfer.Transferable, javax.swing.tree.TreeNode

public class FileNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.awt.datatransfer.Transferable, java.io.Serializable

File node for local file tree manager

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
private  boolean explored
          true if explored
static java.awt.datatransfer.DataFlavor FILENODE
          data flavour of a file node
(package private) static java.awt.datatransfer.DataFlavor[] flavors
          flavours file node and string
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
FileNode(java.io.File file)
           
 
Method Summary
 void explore()
          Explores a directory adding a FileNode for each child
 boolean getAllowsChildren()
          Determine if this is a directory
 java.io.File getFile()
          Get the File this node represents
 java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor d)
           
 java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor f)
           
 boolean isDirectory()
          Determine if this is a directory
 boolean isExplored()
          Determine if this node has been explored
 boolean isLeaf()
          Determine if this is a file
private  void readObject(java.io.ObjectInputStream in)
           
 void reExplore()
          Forces the directory to be re-explored
 java.lang.String toString()
          Returns the name of the file
private  void writeObject(java.io.ObjectOutputStream out)
           
 
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 explored


FILENODE

public static java.awt.datatransfer.DataFlavor FILENODE
data flavour of a file node


flavors

static java.awt.datatransfer.DataFlavor[] flavors
flavours file node and string

Constructor Detail

FileNode

public FileNode(java.io.File file)
Parameters:
file - file node file
Method Detail

getAllowsChildren

public boolean getAllowsChildren()
Determine if this is a directory

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Determine if this is a file

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

getFile

public java.io.File getFile()
Get the File this node represents


isExplored

public boolean isExplored()
Determine if this node has been explored


isDirectory

public boolean isDirectory()
Determine if this is a directory


toString

public java.lang.String toString()
Returns the name of the file


explore

public void explore()
Explores a directory adding a FileNode for each child


reExplore

public void reExplore()
Forces the directory to be re-explored


getTransferDataFlavors

public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface java.awt.datatransfer.Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor f)
Specified by:
isDataFlavorSupported in interface java.awt.datatransfer.Transferable

getTransferData

public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor d)
                                 throws java.awt.datatransfer.UnsupportedFlavorException,
                                        java.io.IOException
Specified by:
getTransferData in interface java.awt.datatransfer.Transferable
Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException

writeObject

private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
Throws:
java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException