org.gerhardb.lib.filetree
Class DirectoryTreeNode
java.lang.Object
javax.swing.tree.DefaultMutableTreeNode
org.gerhardb.lib.filetree.DirectoryTreeNode
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
public class DirectoryTreeNode
- extends javax.swing.tree.DefaultMutableTreeNode
A directory node designed to count its files and populate
all of its sub-directories.
The sub-directory population occurs in a depth-first fashion.
Specifically, for a given root, its children are identified and files counted.
Then the same recursively occurs for each sub-directory of the root.
This allows the highest level directory to be displayed immediately while
other directories are populating. If a user chooses an unpopulated
sub-directory, then that sub-directory is immediately populated, but its
children are not recursed until the normal time.
This is ALWAYS a directory and is tested on construction.
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| 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, 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 |
myNodeDirCount
protected int myNodeDirCount
myNodeAllFileCount
protected int myNodeAllFileCount
myNodeImageFileCount
protected int myNodeImageFileCount
myNodeAllFileSize
protected long myNodeAllFileSize
myNodeImageFileSize
protected long myNodeImageFileSize
DirectoryTreeNode
public DirectoryTreeNode(DirectoryTree tree,
java.io.File f,
ILoadingMessage loadingMsg)
throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
cancelRecursiveLoading
public static void cancelRecursiveLoading()
resetRecursiveLoading
public static void resetRecursiveLoading()
getDirectory
public java.io.File getDirectory()
getAbsolutePath
public java.lang.String getAbsolutePath()
getFile
public java.io.File getFile()
getName
public java.lang.String getName()
getDirCountForTree
public int getDirCountForTree()
getTotalFileCount
public int getTotalFileCount()
getImageFileCount
public int getImageFileCount()
getTotalFileSize
public long getTotalFileSize()
getImageFileSize
public long getImageFileSize()
getTreeTotals
public DirectoryTreeNode.TreeTotals getTreeTotals()
populate
public void populate(ILoadingMessage loadingMsg)
recount
public void recount()
incrementFileCount
public void incrementFileCount(long newFileSize)
decrementFileCount
public void decrementFileCount(long newFileSize)
reloadNodes
public void reloadNodes(java.awt.Window topWindow)
reloadNodes
public void reloadNodes(ModalProgressDialogFlex flex)
newSubDir
public void newSubDir()
renameDir
public void renameDir()
deleteDir
public void deleteDir()
toString
public java.lang.String toString()
- Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode
main
public static void main(java.lang.String[] args)
Copyright ? 2007 Gerhard Beck. All rights reserved. Subject to GPL.