Package jmri.jmrit.catalog
Class CatalogTreeIndex
- java.lang.Object
-
- javax.swing.tree.DefaultTreeModel
-
- jmri.jmrit.catalog.AbstractCatalogTree
-
- jmri.jmrit.catalog.CatalogTreeIndex
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<NamedBean>,javax.swing.tree.TreeModel,PropertyChangeProvider,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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.HashMap<java.lang.String,java.lang.Object>parameters-
Fields inherited from class jmri.jmrit.catalog.AbstractCatalogTree
listenerRefs, mSystemName, pcs, register
-
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description CatalogTreeIndex(java.lang.String sysName, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetProperty(java.lang.String key)Retrieve the value associated with a key.java.util.Set<java.lang.String>getPropertyKeys()Retrieve the complete current set of keys.voidinsertNodes(java.lang.String pName, java.lang.String pPath, CatalogTreeNode pParent)Recursively add nodes to the treevoidremoveProperty(java.lang.String key)Remove the key/value pair against the NamedBean.voidsetProperty(java.lang.String key, java.lang.Object value)Attach a key/value pair to the NamedBean, which can be retrieved later.-
Methods inherited from class jmri.jmrit.catalog.AbstractCatalogTree
addDeleteLock, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, firePropertyChange, getBeanType, getComment, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getRoot, getState, getSystemName, getUserName, insertNodes, isDeleteAllowed, removeDeleteLock, removePropertyChangeListener, removePropertyChangeListener, setComment, setState, setUserName, updateListenerRef, vetoableChange
-
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, 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 jmri.NamedBean
compareTo, getDisplayName, getDisplayName, getRecommendedToolTip, getUsageReport, toString
-
-
-
-
Field Detail
-
parameters
java.util.HashMap<java.lang.String,java.lang.Object> parameters
-
-
Constructor Detail
-
CatalogTreeIndex
public CatalogTreeIndex(java.lang.String sysName, java.lang.String userName)
-
-
Method Detail
-
insertNodes
public void insertNodes(java.lang.String pName, java.lang.String pPath, CatalogTreeNode pParent)
Recursively add nodes to the tree- Specified by:
insertNodesin interfaceCatalogTree- Specified by:
insertNodesin classAbstractCatalogTree- 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.
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)
Description copied from interface:NamedBeanAttach 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.The key is constrained to String to make these behave like normal Java Beans.
- Parameters:
key- the property to setvalue- the value of the property
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Description copied from interface:NamedBeanRetrieve the value associated with a key. If no value has been set for that key, returns null.- Parameters:
key- the property to get- Returns:
- The value of the property or null.
-
getPropertyKeys
public java.util.Set<java.lang.String> getPropertyKeys()
Description copied from interface:NamedBeanRetrieve the complete current set of keys.- Returns:
- empty set if none
-
removeProperty
public void removeProperty(java.lang.String key)
Description copied from interface:NamedBeanRemove the key/value pair against the NamedBean.- Parameters:
key- the property to remove
-
-