Package jmri.jmrit.operations.locations
Class Location
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.locations.Location
- All Implemented Interfaces:
PropertyChangeListener,EventListener,Identifiable,PropertyChangeFirer,PropertyChangeProvider
Represents a location on the layout
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Divisionprotected intprotected Stringprotected intprotected intprotected intprotected Stringprotected intprotected intprotected intprotected PhysicalLocationprotected intprotected Reporterprotected Stringprotected booleanprotected Stringprotected intprotected intprotected Pointprotected Pointprotected intprotected intprotected Pointprotected Pointprotected intstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final intstatic final intstatic final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsTypeName(String type) voidIncrements the number of cars and or engines that will be dropped off by trains at this location.voidIncrements the number of cars and or engines that will be picked up by a train at this location.Adds a track pool for this location.voidaddRS(RollingStock rs) Adds rolling stock to a specific location.Adds a track to this location.voidaddTypeName(String type) Adds the specific type of rolling stock to the will service listvoidvoidvoidchangeTrackType(String type) Change all tracks at this location to typevoidcopyLocation(Location newLocation) Makes a copy of this location.voidcopyTracksLocation(Location location) Copies all of the tracks at this location.voidDecrements the number of cars and or engines that will be dropped off by trains at this location.voidDecrements the number of cars and or engines that will be picked up by a train at this location.voiddeleteRS(RollingStock rs) voiddeleteTrack(Track track) voiddeleteTypeName(String type) voiddispose()Gets the comment text without color attributesGets the comment text with optional color attributesGets the division for this locationintgetId()Get the identity of the object.intgetName()intintintintGets the number of cars and engines at this locationintgetPoolByName(String name) Gets a list of Pools for this location.The print status for this location's switch listGets the switch list comment text without color attributesGets the switch list comment text with optional color attributesintReturns the state of the switch list for this location.getTrackById(String id) getTrackByName(String name, String type) Get track at this location by name and type.Gets a list of track ids ordered by id for this location.Sorted list by track blocking order.Gets a sorted by id list of tracks for this location.getTracksByMoves(String type) Sorted list by track moves.getTracksByNameList(String type) Sorted list by track name.Gets a unsorted list of the tracks at this location.intGets the train directions that this location can service.intUsed to determine the sensitivity when a user is manually moving a train icon on a panel.intUsed to determine the sensitivity when a user is manually moving a train icon on a panel.String[]intbooleanbooleanUsed to determine if there are any track destination restrictions at this location.booleanbooleanbooleanUsed to determine if there are any load restrictions at this location.booleanbooleanUsed to determine if there are any planned pickups at this location.booleanhasPools()Used to determine if there are Pools at this location.booleanbooleanbooleanUsed to determine if there are any road restrictions at this location.booleanbooleanTrue if this location has a track with pick up or set out restrictions.booleanUsed to determine if there are any load ship restrictions at this location.booleanhasSpurs()booleanbooleanbooleanbooleanhasTrackType(String trackType) booleanhasWork()booleanhasYards()booleanUsed to determine if location is setup for stagingbooleanUsed to determine if switch list is needed for this locationbooleanisTrackAtLocation(Track track) voidvoidvoidRemember a NamedBean Object created outside the manager.voidremovePool(Pool pool) voidvoidReset the move count for all tracks at this locationvoidvoidsetComment(String comment) voidsetDefaultPrinterName(String name) protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidsetDivision(Division division) voidsetLength(int length) Set total length of all tracks for this locationvoidSets the location's name.voidsetNumberRS(int number) Sets the quantity of rolling stock for this locationvoidvoidvoidSets the print status for this location's switch listvoidsetSwitchListComment(String comment) voidsetSwitchListEnabled(boolean switchList) When true, a switchlist is desired for this location.voidsetSwitchListState(int state) voidsetTrainDirections(int direction) Sets the train directions that this location can service.voidsetTrainIconEast(Point point) Sets the train icon coordinates for an eastbound train arriving at this location.voidsetTrainIconNorth(Point point) voidsetTrainIconRangeX(int x) Sets the X range for detecting the manual movement of a train icon.voidsetTrainIconRangeY(int y) Sets the Y range for detecting the manual movement of a train icon.voidsetTrainIconSouth(Point point) voidsetTrainIconWest(Point point) voidsetUsedLength(int length) org.jdom2.Elementstore()Create an XML element to represent this Entry.toString()voidupdateComboBox(JComboBox<Track> box) Updates a JComboBox with all of the track locations for this location.voidupdateComboBox(JComboBox<Track> box, RollingStock rs, boolean filter, boolean isDestination) Updates a JComboBox with tracks that can service the rolling stock.voidupdatePoolComboBox(JComboBox<Pool> box) Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
LOC_TRACK_REGIX
- See Also:
-
NONE
- See Also:
-
RANGE_DEFAULT
- See Also:
-
_id
-
_name
-
_IdNumber
-
_numberRS
-
_numberCars
-
_numberEngines
-
_pickupRS
-
_dropRS
-
_trainDir
-
_length
-
_usedLength
-
_comment
-
_switchListComment
-
_switchList
-
_defaultPrinter
-
_status
-
_switchListState
-
_trainIconEast
-
_trainIconWest
-
_trainIconNorth
-
_trainIconSouth
-
_trainIconRangeX
-
_trainIconRangeY
-
_trackHashTable
-
_physicalLocation
-
_listTypes
-
_division
-
_reader
-
_idPoolNumber
-
_poolHashTable
-
NORMAL
- See Also:
-
STAGING
- See Also:
-
EAST
- See Also:
-
WEST
- See Also:
-
NORTH
- See Also:
-
SOUTH
- See Also:
-
UNKNOWN
- See Also:
-
PRINTED
-
CSV_GENERATED
-
MODIFIED
-
UPDATED
-
SW_CREATE
- See Also:
-
SW_APPEND
- See Also:
-
SW_PRINTED
- See Also:
-
TRACK_LISTLENGTH_CHANGED_PROPERTY
- See Also:
-
TYPES_CHANGED_PROPERTY
- See Also:
-
TRAIN_DIRECTION_CHANGED_PROPERTY
- See Also:
-
LENGTH_CHANGED_PROPERTY
- See Also:
-
USEDLENGTH_CHANGED_PROPERTY
- See Also:
-
NAME_CHANGED_PROPERTY
- See Also:
-
SWITCHLIST_CHANGED_PROPERTY
- See Also:
-
DISPOSE_CHANGED_PROPERTY
- See Also:
-
STATUS_CHANGED_PROPERTY
- See Also:
-
POOL_LENGTH_CHANGED_PROPERTY
- See Also:
-
SWITCHLIST_COMMENT_CHANGED_PROPERTY
- See Also:
-
TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
- See Also:
-
LOCATION_REPORTER_CHANGED_PROPERTY
- See Also:
-
LOCATION_DIVISION_CHANGED_PROPERTY
- See Also:
-
-
Constructor Details
-
Location
-
Location
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-locations.dtd- Parameters:
e- Consist XML element
-
-
Method Details
-
getId
Description copied from interface:IdentifiableGet the identity of the object.- Specified by:
getIdin interfaceIdentifiable- Returns:
- the identity
-
setName
Sets the location's name.- Parameters:
name- The string name for this location.
-
toString
-
getName
-
getSplitName
-
copyLocation
Makes a copy of this location.- Parameters:
newLocation- the location to copy to
-
copyTracksLocation
Copies all of the tracks at this location. If there's a track already at the copy to location with the same name, the track is skipped.- Parameters:
location- the location to copy the tracks to.
-
getPhysicalLocation
-
setPhysicalLocation
-
setLength
Set total length of all tracks for this location- Parameters:
length- The integer sum of all tracks at this location.
-
getLength
- Returns:
- total length of all tracks for this location
-
setUsedLength
-
getUsedLength
- Returns:
- The length of the track that is occupied by cars and engines
-
isStaging
Used to determine if location is setup for staging- Returns:
- true if location is setup as staging
-
hasSpurs
- Returns:
- True if location has spurs
-
hasInterchanges
- Returns:
- True if location has classification/interchange tracks
-
hasYards
- Returns:
- True if location has yard tracks
-
hasTrackType
- Parameters:
trackType- The track type to check.- Returns:
- True if location has the track type specified Track.INTERCHANGE Track.YARD Track.SPUR Track.Staging
-
changeTrackType
Change all tracks at this location to type- Parameters:
type- Track.INTERCHANGE Track.YARD Track.SPUR Track.Staging
-
getNumberOfTracks
-
setTrainDirections
Sets the train directions that this location can service. EAST means that an Eastbound train can service the location.- Parameters:
direction- Any combination of EAST WEST NORTH SOUTH
-
getTrainDirections
Gets the train directions that this location can service. EAST means that an Eastbound train can service the location.- Returns:
- Any combination of EAST WEST NORTH SOUTH
-
setNumberRS
Sets the quantity of rolling stock for this location- Parameters:
number- An integer representing the quantity of rolling stock at this location.
-
getNumberRS
Gets the number of cars and engines at this location- Returns:
- number of cars at this location
-
getNumberCars
- Returns:
- The number of cars at this location
-
getNumberEngines
- Returns:
- The number of engines at this location
-
setSwitchListEnabled
When true, a switchlist is desired for this location. Used for preview and printing a manifest for a single location- Parameters:
switchList- When true, switch lists are enabled for this location.
-
isSwitchListEnabled
Used to determine if switch list is needed for this location- Returns:
- true if switch list needed
-
setDefaultPrinterName
-
getDefaultPrinterName
-
setStatus
Sets the print status for this location's switch list- Parameters:
status- UNKNOWN PRINTED MODIFIED UPDATED CSV_GENERATED
-
getStatus
The print status for this location's switch list- Returns:
- UNKNOWN PRINTED MODIFIED UPDATED CSV_GENERATED
-
setSwitchListState
- Parameters:
state- Location.SW_CREATE Location.SW_PRINTED Location.SW_APPEND
-
getSwitchListState
Returns the state of the switch list for this location.- Returns:
- Location.SW_CREATE, Location.SW_PRINTED or Location.SW_APPEND
-
setTrainIconEast
Sets the train icon coordinates for an eastbound train arriving at this location.- Parameters:
point- The XY coordinates on the panel.
-
getTrainIconEast
-
setTrainIconWest
-
getTrainIconWest
-
setTrainIconNorth
-
getTrainIconNorth
-
setTrainIconSouth
-
getTrainIconSouth
-
setTrainIconRangeX
Sets the X range for detecting the manual movement of a train icon.- Parameters:
x- the +/- range for detection
-
getTrainIconRangeX
Used to determine the sensitivity when a user is manually moving a train icon on a panel.- Returns:
- the x +/- range for a train icon
-
setTrainIconRangeY
Sets the Y range for detecting the manual movement of a train icon.- Parameters:
y- the +/- range for detection
-
getTrainIconRangeY
Used to determine the sensitivity when a user is manually moving a train icon on a panel.- Returns:
- the y +/- range for a train icon
-
addRS
Adds rolling stock to a specific location.- Parameters:
rs- The RollingStock to add.
-
deleteRS
-
addPickupRS
Increments the number of cars and or engines that will be picked up by a train at this location. -
deletePickupRS
Decrements the number of cars and or engines that will be picked up by a train at this location. -
addDropRS
Increments the number of cars and or engines that will be dropped off by trains at this location. -
deleteDropRS
Decrements the number of cars and or engines that will be dropped off by trains at this location. -
getPickupRS
- Returns:
- the number of cars and engines that are scheduled for pick up at this location.
-
getDropRS
- Returns:
- the number of cars and engines that are scheduled for drop at this location.
-
setDivision
-
getDivision
Gets the division for this location- Returns:
- the division for this location
-
getDivisionName
-
getDivisionId
-
setComment
-
getComment
Gets the comment text without color attributes- Returns:
- the comment text
-
getCommentWithColor
Gets the comment text with optional color attributes- Returns:
- text with optional color attributes
-
setSwitchListComment
-
getSwitchListComment
Gets the switch list comment text without color attributes- Returns:
- the comment text
-
getSwitchListCommentWithColor
Gets the switch list comment text with optional color attributes- Returns:
- text with optional color attributes
-
getTypeNames
-
addTypeName
Adds the specific type of rolling stock to the will service list- Parameters:
type- of rolling stock that location will service
-
deleteTypeName
-
acceptsTypeName
-
addTrack
Adds a track to this location. Valid track types are spurs, yards, staging and interchange tracks.- Parameters:
name- of tracktype- of track, Track.INTERCHANGE, Track.SPUR, Track.STAGING, Track.YARD- Returns:
- Track
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
track- The Track to be loaded at this location.
-
deleteTrack
-
getTrackByName
Get track at this location by name and type. Track type can be null.- Parameters:
name- track's nametype- track type- Returns:
- track at location
-
getTrackById
-
getTrackIdsByIdList
Gets a list of track ids ordered by id for this location.- Returns:
- list of track ids for this location
-
getTracksByIdList
Gets a sorted by id list of tracks for this location.- Returns:
- Sorted list of tracks by id for this location.
-
getTracksList
Gets a unsorted list of the tracks at this location.- Returns:
- tracks at this location.
-
getTracksByNameList
Sorted list by track name. Returns a list of tracks of a given track type. If type is null returns all tracks for the location.- Parameters:
type- track type: Track.YARD, Track.SPUR, Track.INTERCHANGE, Track.STAGING- Returns:
- list of tracks ordered by name for this location
-
getTracksByMoves
Sorted list by track moves. Returns a list of a given track type. If type is null, all tracks for the location are returned. Tracks with schedules are placed at the start of the list. Tracks that are alternates are removed.- Parameters:
type- track type: Track.YARD, Track.SPUR, Track.INTERCHANGE, Track.STAGING- Returns:
- list of tracks at this location ordered by moves
-
getTracksByBlockingOrderList
Sorted list by track blocking order. Returns a list of a given track type. If type is null, all tracks for the location are returned.- Parameters:
type- track type: Track.YARD, Track.SPUR, Track.INTERCHANGE, Track.STAGING- Returns:
- list of tracks at this location ordered by blocking order
-
resetTracksByBlockingOrder
-
resequnceTracksByBlockingOrder
-
changeTrackBlockingOrderEarlier
-
changeTrackBlockingOrderLater
-
isTrackAtLocation
-
resetMoves
Reset the move count for all tracks at this location -
updateComboBox
Updates a JComboBox with all of the track locations for this location.- Parameters:
box- JComboBox to be updated.
-
updateComboBox
public void updateComboBox(JComboBox<Track> box, RollingStock rs, boolean filter, boolean isDestination) Updates a JComboBox with tracks that can service the rolling stock.- Parameters:
box- JComboBox to be updated.rs- Rolling Stock to be servicedfilter- When true, remove tracks not able to service rs.isDestination- When true, the tracks are destinations for the rs.
-
addPool
Adds a track pool for this location. A track pool is a set of tracks where the length of the tracks is shared between all of them.- Parameters:
name- the name of the Pool to create- Returns:
- Pool
-
removePool
-
getPoolByName
-
register
-
updatePoolComboBox
-
getPoolsByNameList
Gets a list of Pools for this location.- Returns:
- A list of Pools
-
hasServiceRestrictions
True if this location has a track with pick up or set out restrictions.- Returns:
- True if there are restrictions at this location.
-
hasPools
Used to determine if there are Pools at this location.- Returns:
- True if there are Pools at this location
-
hasPlannedPickups
Used to determine if there are any planned pickups at this location.- Returns:
- True if there are planned pickups
-
hasLoadRestrictions
Used to determine if there are any load restrictions at this location.- Returns:
- True if there are load restrictions
-
hasShipLoadRestrictions
Used to determine if there are any load ship restrictions at this location.- Returns:
- True if there are load ship restrictions
-
hasRoadRestrictions
Used to determine if there are any road restrictions at this location.- Returns:
- True if there are road restrictions
-
hasDestinationRestrictions
Used to determine if there are any track destination restrictions at this location.- Returns:
- True if there are destination restrictions
-
hasAlternateTracks
-
hasOrderRestrictions
-
hasSchedules
-
hasWork
-
hasDisableLoadChange
-
hasQuickService
-
hasTracksWithRestrictedTrainDirections
-
hasTrackMessages
-
hasTrackPriortyChanges
-
hasReporters
-
setReporter
-
getReporter
-
getReporterName
-
dispose
-
store
Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-locations.dtd.- Returns:
- Contents in a JDOM Element
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
setDirtyAndFirePropertyChange
-