Package jmri.jmrit.operations.routes
Class RouteManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.routes.RouteManager
- All Implemented Interfaces:
PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class RouteManager
extends PropertyChangeSupport
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
Manages the routes
-
Field Summary
FieldsFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCopy route, returns a new route named routeName.voidderegister(Route route) Forget a NamedBean Object created outside the manager.voiddispose()getRouteById(String id) getRouteByName(String name) Sort by route number, number can alpha numericSort by route namevoidPerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.isLocationInUse(Location loc) Used to determine if a location is part of any route.voidload(org.jdom2.Element root) Finds an existing route or creates a new route if needed requires route's name creates a unique id for this routeintvoidRemember a NamedBean Object created outside the manager.protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidstore(org.jdom2.Element root) voidupdateComboBox(JComboBox<Route> box) Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
LISTLENGTH_CHANGED_PROPERTY
- See Also:
-
_routeHashTable
-
-
Constructor Details
-
RouteManager
public RouteManager()
-
-
Method Details
-
dispose
-
getRouteByName
- Parameters:
name- The string name of the Route.- Returns:
- requested Route object or null if none exists
-
getRouteById
-
newRoute
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
Remember a NamedBean Object created outside the manager.- Parameters:
route- The Route to add.
-
deregister
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
-
copyRoute
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 copiedrouteName- The name of the new routeinvert- If true, return the inversion of route- Returns:
- A copy of the route
-
numEntries
- Returns:
- Number of routes
-
load
-
store
-
setDirtyAndFirePropertyChange
-
initialize
Description copied from interface:InstanceManagerAutoInitializePerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.- Specified by:
initializein interfaceInstanceManagerAutoInitialize
-