Class DefaultSignalAppearanceMap

    • Field Detail

      • aspectAttributeMap

        protected java.util.Hashtable<java.lang.String,​java.util.Hashtable<java.lang.String,​java.lang.String>> aspectAttributeMap
      • aspectImageMap

        protected java.util.Hashtable<java.lang.String,​java.util.Hashtable<java.lang.String,​java.lang.String>> aspectImageMap
      • specificMaps

        protected java.util.Hashtable<java.lang.Integer,​java.lang.String> specificMaps
      • aspectRelationshipMap

        protected java.util.Hashtable<java.lang.String,​java.lang.String[]> aspectRelationshipMap
      • table

        protected java.util.HashMap<java.lang.String,​int[]> table
    • Method Detail

      • getBeanType

        public java.lang.String getBeanType()
        Description copied from interface: NamedBean
        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.
        Specified by:
        getBeanType in interface NamedBean
        Returns:
        a string of the bean type, eg Turnout, Sensor etc
      • getProperty

        public java.lang.String getProperty​(java.lang.String aspect,
                                            java.lang.String key)
        Get a property associated with a specific aspect.
        Specified by:
        getProperty in interface SignalAppearanceMap
        Parameters:
        aspect - the aspect containing the property
        key - the property key
        Returns:
        the property value or null if none is defined for key
      • getImageLink

        public java.lang.String getImageLink​(java.lang.String aspect,
                                             java.lang.String type)
        Description copied from interface: SignalAppearanceMap
        Get an Image Link associated with a specific aspect and type
        Specified by:
        getImageLink in interface SignalAppearanceMap
        Parameters:
        aspect - the aspect
        type - the image link key
        Returns:
        the image link or an empty String if none is defined
      • getImageTypes

        public java.util.Vector<java.lang.String> getImageTypes​(java.lang.String aspect)
        Description copied from interface: SignalAppearanceMap
        Get a list of valid icon sets.
        Specified by:
        getImageTypes in interface SignalAppearanceMap
        Parameters:
        aspect - the aspect to get icon sets for
        Returns:
        a list of sets or an empty list if none are defined
      • checkAspect

        public boolean checkAspect​(java.lang.String aspect)
        Description copied from interface: SignalAppearanceMap
        Check if an aspect can be displayed.
        Specified by:
        checkAspect in interface SignalAppearanceMap
        Parameters:
        aspect - the aspect to check
        Returns:
        true if the aspect can be displayed; false otherwise
      • addAspect

        public void addAspect​(java.lang.String aspect,
                              int[] appearances)
      • getAspects

        public java.util.Enumeration<java.lang.String> getAspects()
        Provide the Aspect elements to GUI and store methods.
        Specified by:
        getAspects in interface SignalAppearanceMap
        Returns:
        all aspects in this signal mast appearance map, in the order defined in xml definition
      • getValidAspectsForAdvancedAspect

        public java.lang.String[] getValidAspectsForAdvancedAspect​(java.lang.String advancedAspect)
        Get a list of potential aspects that we could set the SignalMast to, given the state of the advanced signal mast.
        Specified by:
        getValidAspectsForAdvancedAspect in interface SignalAppearanceMap
        Parameters:
        advancedAspect - the aspect
        Returns:
        a string array of potential aspects or null if none defined
      • getState

        public int 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:
        getState in interface NamedBean
        Returns:
        NamedBean.INCONSISTENT
      • setState

        public void setState​(int s)
        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.

        Specified by:
        setState in interface NamedBean
        Parameters:
        s - the state
      • summary

        public java.lang.String summary()
        Description copied from interface: SignalAppearanceMap
        Provide 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:
        summary in interface SignalAppearanceMap
        Returns:
        summary string.