Package jmri.jmrit.operations.routes
Class Route
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.routes.Route
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider
Represents a route on the layout
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected intprotected Stringprotected Hashtable<String,RouteLocation> protected intstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final intstatic final Stringstatic final intFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLocation(Location location) Adds a location to the end of this routeaddLocation(Location location, int sequence) Add a location at a specific place (sequence) in the route Allowable sequence numbers are 1 to max size of route. 1 = start of route, or Route.STARTvoidDelete a RouteLocationvoiddispose()Get the first location in a routegetId()getLastLocationByName(String name) Get location by name (gets last route location with name)Get a list of RouteLocations sorted by route ordergetName()Gets the next route location in a routeGet a RouteLocation by idgetRouteLocationBySequenceNumber(int sequence) 1st RouteLocation in a route starts at 1.intGets the longest train length specified in the route.intGets the shortest train length specified in the route.Gets the status of the route: OKAY ORPHAN ERROR TRAIN_BUILTGet the last location in a routebooleanisLocationNameInRoute(String name) Used to determine if a "similar" location name is in the route.voidMoves a RouteLocation later in the route.voidPlaces a RouteLocation earlier in the route.voidvoidRemember a NamedBean Object created outside the manager.voidvoidvoidvoidsetComment(String comment) protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidintsize()org.jdom2.Elementstore()Create an XML element to represent this Entry.toString()voidMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
NONE
- See Also:
-
_id
-
_name
-
_comment
-
_routeHashTable
-
_IdNumber
-
_sequenceNum
-
EAST
- See Also:
-
WEST
- See Also:
-
NORTH
- See Also:
-
SOUTH
- See Also:
-
LISTCHANGE_CHANGED_PROPERTY
- See Also:
-
ROUTE_STATUS_CHANGED_PROPERTY
- See Also:
-
ROUTE_BLOCKING_CHANGED_PROPERTY
- See Also:
-
ROUTE_NAME_CHANGED_PROPERTY
- See Also:
-
DISPOSE
- See Also:
-
OKAY
-
TRAIN_BUILT
-
ORPHAN
-
ERROR
-
START
- See Also:
-
-
Constructor Details
-
Route
-
Route
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-config.xml- Parameters:
e- Consist XML element
-
-
Method Details
-
getId
-
setName
-
toString
-
getName
-
setComment
-
getComment
-
dispose
-
addLocation
Adds a location to the end of this route- Parameters:
location- The Location.- Returns:
- RouteLocation created for the location added
-
addLocation
Add a location at a specific place (sequence) in the route Allowable sequence numbers are 1 to max size of route. 1 = start of route, or Route.START- Parameters:
location- The Location to add.sequence- Where in the route to add the location.- Returns:
- route location
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
rl- The RouteLocation to add to this route.
-
deleteLocation
Delete a RouteLocation- Parameters:
rl- The RouteLocation to remove from the route.
-
size
-
getDepartsRouteLocation
Get the first location in a route- Returns:
- the first route location
-
getDepartureDirection
-
getTerminatesRouteLocation
Get the last location in a route- Returns:
- the last route location
-
getNextRouteLocation
Gets the next route location in a route- Parameters:
rl- the current route location- Returns:
- the next route location, null if rl is the last location in a route.
-
getLastLocationByName
Get location by name (gets last route location with name)- Parameters:
name- The string location name.- Returns:
- route location
-
isLocationNameInRoute
Used to determine if a "similar" location name is in the route. Note that a similar name might not actually be part of the route.- Parameters:
name- the name of the location- Returns:
- true if a "similar" name was found
-
getRouteLocationById
Get a RouteLocation by id- Parameters:
id- The string id.- Returns:
- route location
-
getLocationsBySequenceList
Get a list of RouteLocations sorted by route order- Returns:
- list of RouteLocations ordered by sequence
-
getBlockingOrder
-
getBlockingLocationFrontOfTrain
-
getBlockingLocationRearOfTrain
-
setBlockingOrderUp
-
setBlockingOrderDown
-
resetBlockingOrder
-
moveLocationUp
Places a RouteLocation earlier in the route.- Parameters:
rl- The RouteLocation to move.
-
moveLocationDown
Moves a RouteLocation later in the route.- Parameters:
rl- The RouteLocation to move.
-
getRouteLocationBySequenceNumber
1st RouteLocation in a route starts at 1.- Parameters:
sequence- selects which RouteLocation is to be returned- Returns:
- RouteLocation selected
-
getStatus
Gets the status of the route: OKAY ORPHAN ERROR TRAIN_BUILT- Returns:
- string with status of route.
-
getRouteMinimumTrainLength
Gets the shortest train length specified in the route.- Returns:
- the minimum scale train length for this route.
-
getRouteMaximumTrainLength
Gets the longest train length specified in the route.- Returns:
- the maximum scale train length for this route.
-
getComboBox
-
updateComboBox
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-config.xml.- Returns:
- Contents in a JDOM Element
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
setDirtyAndFirePropertyChange
-