jmri.jmrit.catalog
Class CatalogTreeIndex

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by jmri.jmrit.catalog.AbstractCatalogTree
          extended by jmri.jmrit.catalog.CatalogTreeIndex
All Implemented Interfaces:
Serializable, TreeModel, CatalogTree, NamedBean

public class CatalogTreeIndex
extends AbstractCatalogTree

TreeModel used by CatalogPanel to create a tree of resources. This model is for trees that can be permanently stored to and reloaded from an XML file.

Source of the tree content is an XML file.

Author:
Pete Cressman Copyright 2009
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Fields inherited from interface jmri.CatalogTree
FILESYS, IMAGE, NOFILTER, SCRIPT, SOUND, XML
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
CatalogTreeIndex(String sysName, String userName)
           
 
Method Summary
 Object getProperty(Object key)
          Retrieve the value associated with a key.
 Set<Object> getPropertyKeys()
          Retrieve the complete current set of keys.
 void insertNodes(String pName, String pPath, CatalogTreeNode pParent)
          Recursively add nodes to the tree
 void setProperty(Object key, Object value)
          Attach a key/value pair to the NamedBean, which can be retrieved later.
 
Methods inherited from class jmri.jmrit.catalog.AbstractCatalogTree
addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getPropertyChangeListeners, getState, getSystemName, getUserName, insertNodes, removePropertyChangeListener, setComment, setState, setUserName, updateListenerRef
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.tree.TreeModel
addTreeModelListener, getChild, getChildCount, getIndexOfChild, getRoot, isLeaf, removeTreeModelListener, valueForPathChanged
 

Constructor Detail

CatalogTreeIndex

public CatalogTreeIndex(String sysName,
                        String userName)
Method Detail

insertNodes

public void insertNodes(String pName,
                        String pPath,
                        CatalogTreeNode pParent)
Recursively add nodes to the tree

Specified by:
insertNodes in interface CatalogTree
Specified by:
insertNodes in class AbstractCatalogTree
Parameters:
pName - Name of the resource to be scanned; this is only used for the human-readable tree
pPath - Path to this resource, including the pName part
pParent - Node for the parent of the resource to be scanned, e.g. where in the tree to insert it.

setProperty

public void setProperty(Object key,
                        Object value)
Description copied from interface: NamedBean
Attach a key/value pair to the NamedBean, which can be retrieved later. These are not bound properties as yet, and don't throw events on modification. Key must not be null.


getProperty

public Object getProperty(Object key)
Description copied from interface: NamedBean
Retrieve the value associated with a key. If no value has been set for that key, returns null.


getPropertyKeys

public Set<Object> getPropertyKeys()
Description copied from interface: NamedBean
Retrieve the complete current set of keys.



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads