Package jmri.jmrit.catalog
Class DefaultCatalogTreeManager
- All Implemented Interfaces:
PropertyChangeListener,VetoableChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,SilenceablePropertyChangeProvider,VetoableChangeFirer,VetoableChangeProvider,CatalogTreeManager,Manager<CatalogTree>
public class DefaultCatalogTreeManager
extends AbstractManager<CatalogTree>
implements CatalogTreeManager
Provide the concrete implementation for the Internal CatalogTree Manager.
Control of the systemName is internal so the more casual approach like that of SignalHeadManager is used rather than the ProxyManager style.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity -
Field Summary
Fields inherited from class jmri.managers.AbstractManager
_beans, _tsys, _tuser, memo, silenceableProperties, silencedPropertiesFields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupportFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields inherited from interface jmri.CatalogTreeManager
IMAGE_FILTER, SCRIPT_FILTER, SOUND_FILTERFields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogTreecreateNewCatalogTree(String systemName, String userName) Create a CatalogTree.getBeanTypeHandled(boolean plural) Get the user-readable name of the type of NamedBean handled by this manager.getBySystemName(String key) Locate an existing instance based on a system name.getByUserName(String key) Locate an existing instance based on a user name.getCatalogTree(String name) Locate via user name, then system name if needed.Get the class of NamedBean supported by this Manager.intDetermine the order that types should be written when storing panel files.final voidindexChanged(boolean changed) booleanbooleanvoidLoad the index file, one time per session.newCatalogTree(String systemName, String userName) Provide CatalogTree by UserName, then SystemName, then creates if not found.protected voidOverride parent method to not register this object to be stored automatically as part of the general storage mechanism.voidcharBogus typeLetterMethods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getOuterBean, getSystemPrefix, handleUserNameUniqueness, makeSystemName, propertyChange, register, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, updateAutoNumber, validSystemNameFormat, vetoableChangeMethods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormatMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilencedMethods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Constructor Details
-
DefaultCatalogTreeManager
public DefaultCatalogTreeManager()
-
-
Method Details
-
registerSelf
Override parent method to not register this object to be stored automatically as part of the general storage mechanism.- Overrides:
registerSelfin classAbstractManager<CatalogTree>
-
getXMLOrder
Description copied from interface:ManagerDetermine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrderin interfaceManager<CatalogTree>- Returns:
- write order for this Manager; larger is later.
-
typeLetter
Bogus typeLetter- Specified by:
typeLetterin interfaceManager<CatalogTree>- Returns:
- The type letter for a specific implementation
-
getCatalogTree
Description copied from interface:CatalogTreeManagerLocate via user name, then system name if needed. If that fails, return null- Specified by:
getCatalogTreein interfaceCatalogTreeManager- Parameters:
name- CatalogTree object to locate- Returns:
- null if no match found
-
getBySystemName
Description copied from class:AbstractManagerLocate an existing instance based on a system name.- Specified by:
getBySystemNamein interfaceCatalogTreeManager- Specified by:
getBySystemNamein interfaceManager<CatalogTree>- Overrides:
getBySystemNamein classAbstractManager<CatalogTree>- Parameters:
key- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
Description copied from class:AbstractManagerLocate an existing instance based on a user name.- Specified by:
getByUserNamein interfaceCatalogTreeManager- Specified by:
getByUserNamein interfaceManager<CatalogTree>- Overrides:
getByUserNamein classAbstractManager<CatalogTree>- Parameters:
key- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
newCatalogTree
@Nonnull public CatalogTree newCatalogTree(@Nonnull String systemName, String userName) throws IllegalArgumentException Provide CatalogTree by UserName, then SystemName, then creates if not found. Get a CatalogTree instance with the specified system and user names. Note that two calls with the same arguments will get the same instance; there is only one CatalogTree object representing a given physical CatalogTree and therefore only one with a specific system or user name.This will always return a valid object reference; a new object will be created if necessary. In that case:
- If a null reference is given for user name, no user name will be associated with the CatalogTree object created; a valid system name must be provided
- If both names are provided, the system name defines the hardware access of the desired CatalogTree, and the user address is associated with it. The system name must be valid.
- Specified by:
newCatalogTreein interfaceCatalogTreeManager- Parameters:
systemName- system name for new CatalogTreeuserName- user name for new CatalogTree- Returns:
- requested CatalogTree object (never null)
- Throws:
IllegalArgumentException- if unable to create.
-
createNewCatalogTree
@Nonnull protected CatalogTree createNewCatalogTree(@Nonnull String systemName, String userName) throws IllegalArgumentException Create a CatalogTree.Naming convention is:
IF... - filter for image files from the file system SF... - filter for sound files from the file system TF... - filter for script files from the file system NF... - no filter for files from the file system IX... - index for image files stored in XML config file SX... - index for sound files stored in XML config file TX... - index for script files stored in XML config file NX... - index for files stored in XML config file
- Parameters:
systemName- system name for catalog tree, never null/emptyuserName- user name for catalog tree- Returns:
- the new catalog tree or
- Throws:
IllegalArgumentException- if unable to create
-
getBeanTypeHandled
Description copied from interface:ManagerGet the user-readable name of the type of NamedBean handled by this manager.For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.
- Specified by:
getBeanTypeHandledin interfaceManager<CatalogTree>- Parameters:
plural- true to return plural form of the type; false to return singular form- Returns:
- a string of the bean type that the manager handles, eg Turnout, Sensor etc
-
getNamedBeanClass
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClassin interfaceManager<CatalogTree>- Returns:
- the class supported by this Manager.
-
storeImageIndex
- Specified by:
storeImageIndexin interfaceCatalogTreeManager
-
loadImageIndex
Load the index file, one time per session.- Specified by:
loadImageIndexin interfaceCatalogTreeManager
-
isIndexChanged
- Specified by:
isIndexChangedin interfaceCatalogTreeManager
-
isIndexLoaded
- Specified by:
isIndexLoadedin interfaceCatalogTreeManager
-
indexChanged
- Specified by:
indexChangedin interfaceCatalogTreeManager
-