Package jmri.jmrit.catalog
Class CatalogTreeFS
- java.lang.Object
-
- javax.swing.tree.DefaultTreeModel
-
- jmri.jmrit.catalog.AbstractCatalogTree
-
- jmri.jmrit.catalog.CatalogTreeFS
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NamedBean>
,javax.swing.tree.TreeModel
,PropertyChangeProvider
,CatalogTree
,NamedBean
public class CatalogTreeFS extends AbstractCatalogTree
TreeModel used by CatalogPanel to create a tree of resources.Source of the tree content is the file system. Only directories are included in the tree. A filter can be set to extract particular file types.
- 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.lang.String[]
_filter
(package private) int
count
(package private) int
leafcount
(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_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description CatalogTreeFS(java.lang.String sysName, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
filter(java.lang.String ext)
java.lang.String[]
getFilter()
java.lang.Object
getProperty(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.void
insertNodes(java.lang.String pName, java.lang.String pPath, CatalogTreeNode pParent)
Recursively add nodes to the treevoid
removeProperty(java.lang.String key)
Remove the key/value pair against the NamedBean.void
setFilter(java.lang.String[] filter)
void
setProperty(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, getUsageReport, toString
-
-
-
-
Field Detail
-
_filter
java.lang.String[] _filter
-
count
int count
-
leafcount
int leafcount
-
parameters
java.util.HashMap<java.lang.String,java.lang.Object> parameters
-
-
Constructor Detail
-
CatalogTreeFS
public CatalogTreeFS(java.lang.String sysName, java.lang.String userName)
-
-
Method Detail
-
setFilter
public void setFilter(java.lang.String[] filter)
-
getFilter
public java.lang.String[] getFilter()
-
filter
boolean filter(java.lang.String ext)
-
insertNodes
public void insertNodes(java.lang.String pName, java.lang.String pPath, CatalogTreeNode pParent)
Recursively add nodes to the tree- Specified by:
insertNodes
in interfaceCatalogTree
- Specified by:
insertNodes
in 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: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.Prior to JMRI 4.3, the key was of Object type. It was constrained to String to make these more 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:NamedBean
Retrieve 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:NamedBean
Retrieve the complete current set of keys.- Returns:
- empty set if none
-
removeProperty
public void removeProperty(java.lang.String key)
Description copied from interface:NamedBean
Remove the key/value pair against the NamedBean.- Parameters:
key
- the property to remove
-
-