Package jmri.managers

Class DefaultLogixManager

All Implemented Interfaces:
PropertyChangeListener, VetoableChangeListener, EventListener, PropertyChangeFirer, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeFirer, VetoableChangeProvider, LogixManager, Manager<Logix>

public class DefaultLogixManager extends AbstractManager<Logix> implements LogixManager
Basic Implementation of a LogixManager.

Note that Logix system names must begin with system prefix and type character, usually IX, and be followed by a string, usually, but not always, a number. This is enforced when a Logix is created.

The system names of Conditionals belonging to a Logix begin with the Logix's system name, then there is a capital C and a number.

  • Field Details

    • loadDisabled

      boolean loadDisabled
      Support for loading Logixs in a disabled state to debug loops
  • Constructor Details

  • Method Details

    • 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.
    • typeLetter

      public char typeLetter()
      Specified by:
      typeLetter in interface Manager<Logix>
      Returns:
      The type letter for a specific implementation
    • createNewLogix

      public Logix createNewLogix(String systemName, 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(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
    • activateAllLogixs

      public void activateAllLogixs()
      Activate all Logixs that are not currently active This method is called after a configuration file is loaded.
      Specified by:
      activateAllLogixs in interface LogixManager
    • getLogix

      public Logix getLogix(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 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

      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.