Package org.opensourcephysics.tools
Class JarTreeModel
java.lang.Object
org.opensourcephysics.tools.JarTreeModel
- All Implemented Interfaces:
TreeModel
A tree model to display files and jar/zip contents.
- Version:
- 1.0
- Author:
- Doug Brown
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidGets the child node at a specified index.Gets a child node with a given name.intgetChildCount(Object parent) Determines the number of child nodes for the specified node.protected Collection<Object[]>getDescendantPaths(Object[] parentPath) Returns all descendant paths for a parent path.intgetIndexOfChild(Object parent, Object child) Gets the index of the specified child node.org.opensourcephysics.tools.JarTreeModel.JarNodegetJarNode(File jarFile, String path) org.opensourcephysics.tools.JarTreeModel.JarNode[]getJarNodes(File jarFile) getRoot()Gets the root of this tree model.booleanReturns true if the specified node is a leaf.voidvoidvalueForPathChanged(TreePath path, Object newvalue)
-
Field Details
-
root
-
topLevelNodeArrays
-
pathMaps
-
-
Constructor Details
-
JarTreeModel
Constructor.- Parameters:
root- a directory file
-
-
Method Details
-
getRoot
Gets the root of this tree model. -
isLeaf
Returns true if the specified node is a leaf. -
getChildCount
Determines the number of child nodes for the specified node.- Specified by:
getChildCountin interfaceTreeModel- Parameters:
parent- the parent node- Returns:
- the number of child nodes
-
getChild
Gets the child node at a specified index. Parent and child may be a File or JarNode. -
getIndexOfChild
Gets the index of the specified child node.- Specified by:
getIndexOfChildin interfaceTreeModel- Parameters:
parent- the parent nodechild- the child node- Returns:
- the index of the child
-
valueForPathChanged
- Specified by:
valueForPathChangedin interfaceTreeModel
-
addTreeModelListener
- Specified by:
addTreeModelListenerin interfaceTreeModel
-
removeTreeModelListener
- Specified by:
removeTreeModelListenerin interfaceTreeModel
-
getChild
Gets a child node with a given name. Parent and child may be a File or JarNode.- Parameters:
parent- the parent nodename- the name- Returns:
- the child node
-
getDescendantPaths
Returns all descendant paths for a parent path. Descendants include the parent path itself.- Parameters:
parentPath- the parent Object[] path- Returns:
- a collection of descendant Object[] paths
-
getJarNode
-
getJarNodes
-