Package jmri.managers

Class DefaultLogixManager

    • Field Detail

      • loadDisabled

        boolean loadDisabled
        Support for loading Logixs in a disabled state to debug loops
    • Method Detail

      • getXMLOrder

        public int getXMLOrder()
        Description copied from interface: Manager
        Determine 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:
        getXMLOrder in interface Manager<Logix>
        Returns:
        write order for this Manager; larger is later.
      • createNewLogix

        public Logix createNewLogix​(java.lang.String systemName,
                                    java.lang.String userName)
        Create a new Logix if the Logix does not exist.
        Specified by:
        createNewLogix in interface LogixManager
        Parameters:
        systemName - the system name
        userName - the user name
        Returns:
        null if a Logix with the same systemName or userName already exists, or if there is trouble creating a new Logix
      • createNewLogix

        public Logix createNewLogix​(java.lang.String userName)
        Description copied from interface: LogixManager
        For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.
        Specified by:
        createNewLogix in interface LogixManager
        Parameters:
        userName - the user name
        Returns:
        a new Logix or null if unable to create
      • deleteLogix

        public void deleteLogix​(Logix x)
        Remove an existing Logix and delete all its conditionals. Logix must have been deactivated before invoking this.
        Specified by:
        deleteLogix in interface LogixManager
        Parameters:
        x - the Logix to delete
      • getLogix

        public Logix getLogix​(java.lang.String name)
        Get an existing Logix. First looks up assuming name is a User Name. If this fails looks up assuming name is a System Name. If both fail, returns null.
        Specified by:
        getLogix in interface LogixManager
        Parameters:
        name - User name or system name to match
        Returns:
        null if no match found
      • setLoadDisabled

        public void setLoadDisabled​(boolean s)
        Description copied from interface: LogixManager
        Support for loading Logixs in a disabled state to debug loops
        Specified by:
        setLoadDisabled in interface LogixManager
        Parameters:
        s - true if Logix should be loadable while disabled
      • getBeanTypeHandled

        @Nonnull
        public java.lang.String getBeanTypeHandled​(boolean plural)
        Description copied from interface: Manager
        Get 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:
        getBeanTypeHandled in interface Manager<Logix>
        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

        public java.lang.Class<LogixgetNamedBeanClass()
        Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.
        Specified by:
        getNamedBeanClass in interface Manager<Logix>
        Returns:
        the class supported by this Manager.