Package jmri.jmrit.catalog
Class CatalogTreeModel
- java.lang.Object
-
- javax.swing.tree.DefaultTreeModel
-
- jmri.jmrit.catalog.CatalogTreeModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.tree.TreeModel
,InstanceManagerAutoDefault
public class CatalogTreeModel extends javax.swing.tree.DefaultTreeModel implements InstanceManagerAutoDefault
TreeModel used by CatalogPane to create a tree of resources.Accessed via the instance() member, as we expect to have only one of these models.
The tree has two top-level visible nodes. One, "icons", represents the contents of the icons directory in the resources tree in the .jar file. The other, "files", is all files found in the "resources" filetree in the preferences directory. Note that this means that files in the distribution directory are _not_ included.
As a special case "simplification", the catalog tree will not contain CVS directories, or files whose name starts with a "."
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.tree.DefaultMutableTreeNode
dRoot
(package private) static java.lang.String
fileRoot
(package private) static java.lang.String
resourceRoot
Starting point in the .jar file for the "icons" part of the tree
-
Constructor Summary
Constructors Constructor Description CatalogTreeModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
insertFileNodes(java.lang.String name, java.lang.String path, javax.swing.tree.DefaultMutableTreeNode parent)
Recursively add a representation of the files below a particular file(package private) void
insertResourceNodes(java.lang.String pName, java.lang.String pPath, javax.swing.tree.DefaultMutableTreeNode pParent)
Recursively add a representation of the resources below a particular resource-
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
-
-
-
-
Field Detail
-
dRoot
javax.swing.tree.DefaultMutableTreeNode dRoot
-
resourceRoot
static final java.lang.String resourceRoot
Starting point in the .jar file for the "icons" part of the tree- See Also:
- Constant Field Values
-
fileRoot
static final java.lang.String fileRoot
-
-
Constructor Detail
-
CatalogTreeModel
public CatalogTreeModel()
-
-
Method Detail
-
insertResourceNodes
void insertResourceNodes(java.lang.String pName, java.lang.String pPath, javax.swing.tree.DefaultMutableTreeNode pParent)
Recursively add a representation of the resources below a particular resource- Parameters:
pName
- Name of the resource to be scanned; this is only used for the human-readable treepPath
- Path to this resource, including the pName partpParent
- Node for the parent of the resource to be scanned, e.g. where in the tree to insert it.
-
insertFileNodes
void insertFileNodes(java.lang.String name, java.lang.String path, javax.swing.tree.DefaultMutableTreeNode parent)
Recursively add a representation of the files below a particular file- Parameters:
name
- Name of the file to be scannedpath
- the path to the fileparent
- Node for the parent of the file to be scanned
-
-