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 TypeMethodDescriptionvoid
Gets the child node at a specified index.Gets a child node with a given name.int
getChildCount
(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.int
getIndexOfChild
(Object parent, Object child) Gets the index of the specified child node.org.opensourcephysics.tools.JarTreeModel.JarNode
getJarNode
(File jarFile, String path) org.opensourcephysics.tools.JarTreeModel.JarNode[]
getJarNodes
(File jarFile) getRoot()
Gets the root of this tree model.boolean
Returns true if the specified node is a leaf.void
void
valueForPathChanged
(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:
getChildCount
in 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:
getIndexOfChild
in interfaceTreeModel
- Parameters:
parent
- the parent nodechild
- the child node- Returns:
- the index of the child
-
valueForPathChanged
- Specified by:
valueForPathChanged
in interfaceTreeModel
-
addTreeModelListener
- Specified by:
addTreeModelListener
in interfaceTreeModel
-
removeTreeModelListener
- Specified by:
removeTreeModelListener
in 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
-