Class DefaultSignalAppearanceMap
- All Implemented Interfaces:
Comparable<NamedBean>,PropertyChangeProvider,NamedBean,SignalAppearanceMap
The default contents are taken from the NamedBeanBundle properties file. This makes creation a little more heavy-weight, but speeds operation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static HashMap<String,DefaultSignalAppearanceMap> protected SignalSystemFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.SignalAppearanceMap
DANGER, DARK, HELD, PERMISSIVE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSignalAppearanceMap(String systemName) DefaultSignalAppearanceMap(String systemName, String userName) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancheckAspect(String aspect) Check if an aspect can be displayed.static DefaultSignalAppearanceMapProvide the Aspect elements to GUI and store methods.int[]getAspectSettings(String aspect) For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.getImageLink(String aspect, String type) Get an Image Link associated with a specific aspect and typegetImageTypes(String aspect) Get a list of valid icon sets.static DefaultSignalAppearanceMapgetProperty(String aspect, String key) Get a property associated with a specific aspect.Get the associated signal system and the common information it contains.getSpecificAppearance(int appearance) Return the aspect for a specific appearance.intgetState()Provide generic access to internal state.String[]getValidAspectsForAdvancedAspect(String advancedAspect) Get a list of potential aspects that we could set the SignalMast to, given the state of the advanced signal mast.(package private) static voidloadAspectRelationMap(String signalSystemName, String aspectMapName, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) void(package private) static voidloadImageMaps(List<org.jdom2.Element> img, String name, DefaultSignalAppearanceMap map) (package private) static DefaultSignalAppearanceMap(package private) static voidloadSpecificAspect(String signalSystemName, String aspectMapName, int aspectType, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) (package private) static voidloadSpecificMap(String signalSystemName, String aspectMapName, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) protected voidvoidvoidsetState(int s) Provide generic access to internal state.summary()Provide a multi-line summary of the signal system content, typically for printing.Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.NamedBean
compareTo, getRecommendedToolTip, getUsageReport
-
Field Details
-
aspectAttributeMap
-
aspectImageMap
-
maps
-
specificMaps
-
aspectRelationshipMap
-
systemDefn
-
table
-
-
Constructor Details
-
DefaultSignalAppearanceMap
-
DefaultSignalAppearanceMap
-
-
Method Details
-
getBeanType
Description copied from interface:NamedBeanFor instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanTypein interfaceNamedBean- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
getMap
-
registerMap
-
findMap
-
loadMap
-
loadImageMaps
-
loadSpecificMap
static void loadSpecificMap(String signalSystemName, String aspectMapName, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) -
loadSpecificAspect
static void loadSpecificAspect(String signalSystemName, String aspectMapName, int aspectType, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) -
loadAspectRelationMap
static void loadAspectRelationMap(String signalSystemName, String aspectMapName, DefaultSignalAppearanceMap SMmap, org.jdom2.Element root) -
getProperty
Get a property associated with a specific aspect.- Specified by:
getPropertyin interfaceSignalAppearanceMap- Parameters:
aspect- the aspect containing the propertykey- the property key- Returns:
- the property value or null if none is defined for key
-
getImageLink
Description copied from interface:SignalAppearanceMapGet an Image Link associated with a specific aspect and type- Specified by:
getImageLinkin interfaceSignalAppearanceMap- Parameters:
aspect- the aspecttype- the image link key- Returns:
- the image link or an empty String if none is defined
-
getImageTypes
Description copied from interface:SignalAppearanceMapGet a list of valid icon sets.- Specified by:
getImageTypesin interfaceSignalAppearanceMap- Parameters:
aspect- the aspect to get icon sets for- Returns:
- a list of sets or an empty list if none are defined
-
loadDefaults
-
checkAspect
Description copied from interface:SignalAppearanceMapCheck if an aspect can be displayed.- Specified by:
checkAspectin interfaceSignalAppearanceMap- Parameters:
aspect- the aspect to check- Returns:
- true if the aspect can be displayed; false otherwise
-
addAspect
-
getAspects
Provide the Aspect elements to GUI and store methods.- Specified by:
getAspectsin interfaceSignalAppearanceMap- Returns:
- all aspects in this signal mast appearance map, in the order defined in xml definition
-
getSpecificAppearance
Description copied from interface:SignalAppearanceMapReturn the aspect for a specific appearance.- Specified by:
getSpecificAppearancein interfaceSignalAppearanceMap- Parameters:
appearance- the appearance- Returns:
- the aspect
-
getValidAspectsForAdvancedAspect
Get a list of potential aspects that we could set the SignalMast to, given the state of the advanced signal mast.- Specified by:
getValidAspectsForAdvancedAspectin interfaceSignalAppearanceMap- Parameters:
advancedAspect- the aspect- Returns:
- a string array of potential aspects or null if none defined
-
getSignalSystem
Description copied from interface:SignalAppearanceMapGet the associated signal system and the common information it contains.- Specified by:
getSignalSystemin interfaceSignalAppearanceMap- Returns:
- the signal system
-
setSignalSystem
-
getState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read. This method returns a constant result on the DefaultSignalAppearanceMap.
- Specified by:
getStatein interfaceNamedBean- Returns:
NamedBean.INCONSISTENT
-
setState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read. This method has no effect on the DefaultSignalAppearanceMap.
-
getAspectSettings
-
summary
Description copied from interface:SignalAppearanceMapProvide a multi-line summary of the signal system content, typically for printing.Not intended for further parsing, i.e. for persistence, as format likely to differ from type to type, and to change often.
- Specified by:
summaryin interfaceSignalAppearanceMap- Returns:
- summary string.
-