Class RouteManager

java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.routes.RouteManager
All Implemented Interfaces:
PropertyChangeFirer, PropertyChangeProvider, InstanceManagerAutoDefault, InstanceManagerAutoInitialize

Manages the routes
  • Field Details

  • Constructor Details

  • Method Details

    • dispose

      public void dispose()
    • getRouteByName

      public Route getRouteByName(String name)
      Parameters:
      name - The string name of the Route.
      Returns:
      requested Route object or null if none exists
    • getRouteById

      public Route getRouteById(String id)
    • newRoute

      public Route newRoute(String name)
      Finds an existing route or creates a new route if needed requires route's name creates a unique id for this route
      Parameters:
      name - The string name of the new Route.
      Returns:
      new route or existing route
    • register

      public void register(Route route)
      Remember a NamedBean Object created outside the manager.
      Parameters:
      route - The Route to add.
    • deregister

      public void deregister(Route route)
      Forget a NamedBean Object created outside the manager.
      Parameters:
      route - The Route to delete.
    • getRoutesByNameList

      Sort by route name
      Returns:
      list of routes ordered by name
    • getRoutesByIdList

      Sort by route number, number can alpha numeric
      Returns:
      list of routes ordered by id numbers
    • isLocationInUse

      Used to determine if a location is part of any route.
      Parameters:
      loc - The location being checked.
      Returns:
      null if location isn't used, otherwise a route using the location.
    • getComboBox

    • updateComboBox

      public void updateComboBox(JComboBox<Route> box)
    • copyRoute

      public Route copyRoute(Route route, String routeName, boolean invert)
      Copy route, returns a new route named routeName. If invert is true the reverse of the route is returned.
      Parameters:
      route - The route to be copied
      routeName - The name of the new route
      invert - If true, return the inversion of route
      Returns:
      A copy of the route
    • numEntries

      public int numEntries()
      Returns:
      Number of routes
    • load

      public void load(org.jdom2.Element root)
    • store

      public void store(org.jdom2.Element root)
    • setDirtyAndFirePropertyChange

      protected void setDirtyAndFirePropertyChange(String p, Object old, Object n)
    • initialize

      public void initialize()
      Description copied from interface: InstanceManagerAutoInitialize
      Perform any initialization that occurs after this object has been constructed and made available by the InstanceManager.
      Specified by:
      initialize in interface InstanceManagerAutoInitialize