Package jmri.jmrit.operations.locations
Class Location
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.locations.Location
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,Identifiable
,PropertyChangeFirer
,PropertyChangeProvider
public class Location extends PropertyChangeSupport implements Identifiable, java.beans.PropertyChangeListener
Represents a location on the layout
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_comment
protected java.lang.String
_defaultPrinter
protected Division
_division
protected int
_dropRS
protected java.lang.String
_id
protected int
_IdNumber
protected int
_idPoolNumber
protected int
_length
protected java.util.List<java.lang.String>
_listTypes
protected java.lang.String
_name
protected int
_numberCars
protected int
_numberEngines
protected int
_numberRS
protected PhysicalLocation
_physicalLocation
protected int
_pickupRS
protected java.util.Hashtable<java.lang.String,Pool>
_poolHashTable
protected Reporter
_reader
protected java.lang.String
_status
protected boolean
_switchList
protected java.lang.String
_switchListComment
protected int
_switchListState
protected java.util.Hashtable<java.lang.String,Track>
_trackHashTable
protected int
_trainDir
protected java.awt.Point
_trainIconEast
protected java.awt.Point
_trainIconNorth
protected int
_trainIconRangeX
protected int
_trainIconRangeY
protected java.awt.Point
_trainIconSouth
protected java.awt.Point
_trainIconWest
protected int
_usedLength
static java.lang.String
CSV_GENERATED
static java.lang.String
DISPOSE_CHANGED_PROPERTY
static int
EAST
static java.lang.String
LENGTH_CHANGED_PROPERTY
static java.lang.String
LOC_TRACK_REGIX
static java.lang.String
LOCATION_DIVISION_CHANGED_PROPERTY
static java.lang.String
LOCATION_REPORTER_CHANGED_PROPERTY
static java.lang.String
MODIFIED
static java.lang.String
NAME_CHANGED_PROPERTY
static java.lang.String
NONE
static java.lang.String
NORMAL
static int
NORTH
static java.lang.String
POOL_LENGTH_CHANGED_PROPERTY
static java.lang.String
PRINTED
static int
RANGE_DEFAULT
static int
SOUTH
static java.lang.String
STAGING
static java.lang.String
STATUS_CHANGED_PROPERTY
static int
SW_APPEND
static int
SW_CREATE
static int
SW_PRINTED
static java.lang.String
SWITCHLIST_CHANGED_PROPERTY
static java.lang.String
SWITCHLIST_COMMENT_CHANGED_PROPERTY
static java.lang.String
TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
static java.lang.String
TRACK_LISTLENGTH_CHANGED_PROPERTY
static java.lang.String
TRAIN_DIRECTION_CHANGED_PROPERTY
static java.lang.String
TYPES_CHANGED_PROPERTY
static java.lang.String
UNKNOWN
static java.lang.String
UPDATED
static java.lang.String
USEDLENGTH_CHANGED_PROPERTY
static int
WEST
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsTypeName(java.lang.String type)
void
addDropRS()
Increments the number of cars and or engines that will be dropped off by trains at this location.void
addPickupRS()
Increments the number of cars and or engines that will be picked up by a train at this location.Pool
addPool(java.lang.String name)
Adds a track pool for this location.void
addRS(RollingStock rs)
Adds rolling stock to a specific location.Track
addTrack(java.lang.String name, java.lang.String type)
Adds a track to this location.void
addTypeName(java.lang.String type)
Adds the specific type of rolling stock to the will service listvoid
changeTrackBlockingOrderEarlier(Track track)
void
changeTrackBlockingOrderLater(Track track)
void
changeTrackType(java.lang.String type)
Change all tracks at this location to typevoid
copyLocation(Location newLocation)
Makes a copy of this location.void
copyTracksLocation(Location location)
Copies all of the tracks at this location.void
deleteDropRS()
Decrements the number of cars and or engines that will be dropped off by trains at this location.void
deletePickupRS()
Decrements the number of cars and or engines that will be picked up by a train at this location.void
deleteRS(RollingStock rs)
void
deleteTrack(Track track)
void
deleteTypeName(java.lang.String type)
void
dispose()
java.lang.String
getComment()
Gets the comment text without color attributesjava.lang.String
getCommentWithColor()
Gets the comment text with optional color attributesjava.lang.String
getDefaultPrinterName()
Division
getDivision()
Gets the division for this locationjava.lang.String
getDivisionId()
java.lang.String
getDivisionName()
int
getDropRS()
java.lang.String
getId()
Get the identity of the object.int
getLength()
java.lang.String
getName()
int
getNumberCars()
int
getNumberEngines()
int
getNumberOfTracks()
int
getNumberRS()
Gets the number of cars and engines at this locationPhysicalLocation
getPhysicalLocation()
int
getPickupRS()
Pool
getPoolByName(java.lang.String name)
java.util.List<Pool>
getPoolsByNameList()
Gets a list of Pools for this location.Reporter
getReporter()
java.lang.String
getReporterName()
java.lang.String
getSplitName()
java.lang.String
getStatus()
The print status for this location's switch listjava.lang.String
getSwitchListComment()
Gets the switch list comment text without color attributesjava.lang.String
getSwitchListCommentWithColor()
Gets the switch list comment text with optional color attributesint
getSwitchListState()
Returns the state of the switch list for this location.Track
getTrackById(java.lang.String id)
Track
getTrackByName(java.lang.String name, java.lang.String type)
Get track at this location by name and type.java.util.List<java.lang.String>
getTrackIdsByIdList()
Gets a list of track ids ordered by id for this location.java.util.List<Track>
getTracksByBlockingOrderList(java.lang.String type)
Sorted list by track blocking order.java.util.List<Track>
getTracksByIdList()
Gets a sorted by id list of tracks for this location.java.util.List<Track>
getTracksByMoves(java.lang.String type)
Sorted list by track moves.java.util.List<Track>
getTracksByNameList(java.lang.String type)
Sorted list by track name.java.util.List<Track>
getTracksList()
Gets a unsorted list of the tracks at this location.int
getTrainDirections()
Gets the train directions that this location can service.java.awt.Point
getTrainIconEast()
java.awt.Point
getTrainIconNorth()
int
getTrainIconRangeX()
Used to determine the sensitivity when a user is manually moving a train icon on a panel.int
getTrainIconRangeY()
Used to determine the sensitivity when a user is manually moving a train icon on a panel.java.awt.Point
getTrainIconSouth()
java.awt.Point
getTrainIconWest()
java.lang.String[]
getTypeNames()
int
getUsedLength()
boolean
hasAlternateTracks()
boolean
hasDestinationRestrictions()
Used to determine if there are any track destination restrictions at this location.boolean
hasDisableLoadChange()
boolean
hasInterchanges()
boolean
hasLoadRestrictions()
Used to determine if there are any load restrictions at this location.boolean
hasOrderRestrictions()
boolean
hasPlannedPickups()
Used to determine if there are any planned pickups at this location.boolean
hasPools()
Used to determine if there are Pools at this location.boolean
hasReporters()
boolean
hasRoadRestrictions()
Used to determine if there are any road restrictions at this location.boolean
hasSchedules()
boolean
hasServiceRestrictions()
True if this location has a track with pick up or set out restrictions.boolean
hasShipLoadRestrictions()
Used to determine if there are any load ship restrictions at this location.boolean
hasSpurs()
boolean
hasTrackMessages()
boolean
hasTracksWithRestrictedTrainDirections()
boolean
hasTrackType(java.lang.String trackType)
boolean
hasWork()
boolean
hasYards()
boolean
isStaging()
Used to determine if location is setup for stagingboolean
isSwitchListEnabled()
Used to determine if switch list is needed for this locationboolean
isTrackAtLocation(Track track)
void
propertyChange(java.beans.PropertyChangeEvent e)
void
register(Pool pool)
void
register(Track track)
Remember a NamedBean Object created outside the manager.void
removePool(Pool pool)
void
resequnceTracksByBlockingOrder()
void
resetMoves()
Reset the move count for all tracks at this locationvoid
resetTracksByBlockingOrder()
void
setComment(java.lang.String comment)
void
setDefaultPrinterName(java.lang.String name)
protected void
setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
setDivision(Division division)
void
setLength(int length)
Set total length of all tracks for this locationvoid
setName(java.lang.String name)
Sets the location's name.void
setNumberRS(int number)
Sets the quantity of rolling stock for this locationvoid
setPhysicalLocation(PhysicalLocation l)
void
setReporter(Reporter r)
void
setStatus(java.lang.String status)
Sets the print status for this location's switch listvoid
setSwitchListComment(java.lang.String comment)
void
setSwitchListEnabled(boolean switchList)
When true, a switchlist is desired for this location.void
setSwitchListState(int state)
void
setTrainDirections(int direction)
Sets the train directions that this location can service.void
setTrainIconEast(java.awt.Point point)
Sets the train icon coordinates for an eastbound train arriving at this location.void
setTrainIconNorth(java.awt.Point point)
void
setTrainIconRangeX(int x)
Sets the X range for detecting the manual movement of a train icon.void
setTrainIconRangeY(int y)
Sets the Y range for detecting the manual movement of a train icon.void
setTrainIconSouth(java.awt.Point point)
void
setTrainIconWest(java.awt.Point point)
void
setUsedLength(int length)
org.jdom2.Element
store()
Create an XML element to represent this Entry.java.lang.String
toString()
void
updateComboBox(javax.swing.JComboBox<Track> box)
Updates a JComboBox with all of the track locations for this location.void
updateComboBox(javax.swing.JComboBox<Track> box, RollingStock rs, boolean filter, boolean isDestination)
Updates a JComboBox with tracks that can service the rolling stock.void
updatePoolComboBox(javax.swing.JComboBox<Pool> box)
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
LOC_TRACK_REGIX
public static final java.lang.String LOC_TRACK_REGIX
- See Also:
- Constant Field Values
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
RANGE_DEFAULT
public static final int RANGE_DEFAULT
- See Also:
- Constant Field Values
-
_id
protected java.lang.String _id
-
_name
protected java.lang.String _name
-
_IdNumber
protected int _IdNumber
-
_numberRS
protected int _numberRS
-
_numberCars
protected int _numberCars
-
_numberEngines
protected int _numberEngines
-
_pickupRS
protected int _pickupRS
-
_dropRS
protected int _dropRS
-
_trainDir
protected int _trainDir
-
_length
protected int _length
-
_usedLength
protected int _usedLength
-
_comment
protected java.lang.String _comment
-
_switchListComment
protected java.lang.String _switchListComment
-
_switchList
protected boolean _switchList
-
_defaultPrinter
protected java.lang.String _defaultPrinter
-
_status
protected java.lang.String _status
-
_switchListState
protected int _switchListState
-
_trainIconEast
protected java.awt.Point _trainIconEast
-
_trainIconWest
protected java.awt.Point _trainIconWest
-
_trainIconNorth
protected java.awt.Point _trainIconNorth
-
_trainIconSouth
protected java.awt.Point _trainIconSouth
-
_trainIconRangeX
protected int _trainIconRangeX
-
_trainIconRangeY
protected int _trainIconRangeY
-
_trackHashTable
protected java.util.Hashtable<java.lang.String,Track> _trackHashTable
-
_physicalLocation
protected PhysicalLocation _physicalLocation
-
_listTypes
protected java.util.List<java.lang.String> _listTypes
-
_idPoolNumber
protected int _idPoolNumber
-
_poolHashTable
protected java.util.Hashtable<java.lang.String,Pool> _poolHashTable
-
NORMAL
public static final java.lang.String NORMAL
- See Also:
- Constant Field Values
-
STAGING
public static final java.lang.String STAGING
- See Also:
- Constant Field Values
-
EAST
public static final int EAST
- See Also:
- Constant Field Values
-
WEST
public static final int WEST
- See Also:
- Constant Field Values
-
NORTH
public static final int NORTH
- See Also:
- Constant Field Values
-
SOUTH
public static final int SOUTH
- See Also:
- Constant Field Values
-
UNKNOWN
public static final java.lang.String UNKNOWN
- See Also:
- Constant Field Values
-
PRINTED
public static final java.lang.String PRINTED
-
CSV_GENERATED
public static final java.lang.String CSV_GENERATED
-
MODIFIED
public static final java.lang.String MODIFIED
-
UPDATED
public static final java.lang.String UPDATED
-
SW_CREATE
public static final int SW_CREATE
- See Also:
- Constant Field Values
-
SW_APPEND
public static final int SW_APPEND
- See Also:
- Constant Field Values
-
SW_PRINTED
public static final int SW_PRINTED
- See Also:
- Constant Field Values
-
TRACK_LISTLENGTH_CHANGED_PROPERTY
public static final java.lang.String TRACK_LISTLENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TYPES_CHANGED_PROPERTY
public static final java.lang.String TYPES_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRAIN_DIRECTION_CHANGED_PROPERTY
public static final java.lang.String TRAIN_DIRECTION_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LENGTH_CHANGED_PROPERTY
public static final java.lang.String LENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
USEDLENGTH_CHANGED_PROPERTY
public static final java.lang.String USEDLENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
NAME_CHANGED_PROPERTY
public static final java.lang.String NAME_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SWITCHLIST_CHANGED_PROPERTY
public static final java.lang.String SWITCHLIST_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DISPOSE_CHANGED_PROPERTY
public static final java.lang.String DISPOSE_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
STATUS_CHANGED_PROPERTY
public static final java.lang.String STATUS_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
POOL_LENGTH_CHANGED_PROPERTY
public static final java.lang.String POOL_LENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
SWITCHLIST_COMMENT_CHANGED_PROPERTY
public static final java.lang.String SWITCHLIST_COMMENT_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
public static final java.lang.String TRACK_BLOCKING_ORDER_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LOCATION_REPORTER_CHANGED_PROPERTY
public static final java.lang.String LOCATION_REPORTER_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
LOCATION_DIVISION_CHANGED_PROPERTY
public static final java.lang.String LOCATION_DIVISION_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:Identifiable
Get the identity of the object.- Specified by:
getId
in interfaceIdentifiable
- Returns:
- the identity
-
setName
public void setName(java.lang.String name)
Sets the location's name.- Parameters:
name
- The string name for this location.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getName
public java.lang.String getName()
-
getSplitName
public java.lang.String getSplitName()
-
copyLocation
public void copyLocation(Location newLocation)
Makes a copy of this location.- Parameters:
newLocation
- the location to copy to
-
copyTracksLocation
public void copyTracksLocation(Location location)
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
public PhysicalLocation getPhysicalLocation()
-
setPhysicalLocation
public void setPhysicalLocation(PhysicalLocation l)
-
setLength
public void setLength(int length)
Set total length of all tracks for this location- Parameters:
length
- The integer sum of all tracks at this location.
-
getLength
public int getLength()
- Returns:
- total length of all tracks for this location
-
setUsedLength
public void setUsedLength(int length)
-
getUsedLength
public int getUsedLength()
- Returns:
- The length of the track that is occupied by cars and engines
-
isStaging
public boolean isStaging()
Used to determine if location is setup for staging- Returns:
- true if location is setup as staging
-
hasSpurs
public boolean hasSpurs()
- Returns:
- True if location has spurs
-
hasInterchanges
public boolean hasInterchanges()
- Returns:
- True if location has classification/interchange tracks
-
hasYards
public boolean hasYards()
- Returns:
- True if location has yard tracks
-
hasTrackType
public boolean hasTrackType(java.lang.String trackType)
- 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
public void changeTrackType(java.lang.String type)
Change all tracks at this location to type- Parameters:
type
- Track.INTERCHANGE Track.YARD Track.SPUR Track.Staging
-
getNumberOfTracks
public int getNumberOfTracks()
-
setTrainDirections
public void setTrainDirections(int direction)
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
public int 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
public void setNumberRS(int number)
Sets the quantity of rolling stock for this location- Parameters:
number
- An integer representing the quantity of rolling stock at this location.
-
getNumberRS
public int getNumberRS()
Gets the number of cars and engines at this location- Returns:
- number of cars at this location
-
getNumberCars
public int getNumberCars()
- Returns:
- The number of cars at this location
-
getNumberEngines
public int getNumberEngines()
- Returns:
- The number of engines at this location
-
setSwitchListEnabled
public void setSwitchListEnabled(boolean switchList)
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
public boolean isSwitchListEnabled()
Used to determine if switch list is needed for this location- Returns:
- true if switch list needed
-
setDefaultPrinterName
public void setDefaultPrinterName(java.lang.String name)
-
getDefaultPrinterName
public java.lang.String getDefaultPrinterName()
-
setStatus
public void setStatus(java.lang.String status)
Sets the print status for this location's switch list- Parameters:
status
- UNKNOWN PRINTED MODIFIED UPDATED CSV_GENERATED
-
getStatus
public java.lang.String getStatus()
The print status for this location's switch list- Returns:
- UNKNOWN PRINTED MODIFIED UPDATED CSV_GENERATED
-
setSwitchListState
public void setSwitchListState(int state)
- Parameters:
state
- Location.SW_CREATE Location.SW_PRINTED Location.SW_APPEND
-
getSwitchListState
public int getSwitchListState()
Returns the state of the switch list for this location.- Returns:
- Location.SW_CREATE, Location.SW_PRINTED or Location.SW_APPEND
-
setTrainIconEast
public void setTrainIconEast(java.awt.Point point)
Sets the train icon coordinates for an eastbound train arriving at this location.- Parameters:
point
- The XY coordinates on the panel.
-
getTrainIconEast
public java.awt.Point getTrainIconEast()
-
setTrainIconWest
public void setTrainIconWest(java.awt.Point point)
-
getTrainIconWest
public java.awt.Point getTrainIconWest()
-
setTrainIconNorth
public void setTrainIconNorth(java.awt.Point point)
-
getTrainIconNorth
public java.awt.Point getTrainIconNorth()
-
setTrainIconSouth
public void setTrainIconSouth(java.awt.Point point)
-
getTrainIconSouth
public java.awt.Point getTrainIconSouth()
-
setTrainIconRangeX
public void setTrainIconRangeX(int x)
Sets the X range for detecting the manual movement of a train icon.- Parameters:
x
- the +/- range for detection
-
getTrainIconRangeX
public int 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
public void setTrainIconRangeY(int y)
Sets the Y range for detecting the manual movement of a train icon.- Parameters:
y
- the +/- range for detection
-
getTrainIconRangeY
public int 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
public void addRS(RollingStock rs)
Adds rolling stock to a specific location.- Parameters:
rs
- The RollingStock to add.
-
deleteRS
public void deleteRS(RollingStock rs)
-
addPickupRS
public void addPickupRS()
Increments the number of cars and or engines that will be picked up by a train at this location.
-
deletePickupRS
public void deletePickupRS()
Decrements the number of cars and or engines that will be picked up by a train at this location.
-
addDropRS
public void addDropRS()
Increments the number of cars and or engines that will be dropped off by trains at this location.
-
deleteDropRS
public void deleteDropRS()
Decrements the number of cars and or engines that will be dropped off by trains at this location.
-
getPickupRS
public int getPickupRS()
- Returns:
- the number of cars and engines that are scheduled for pick up at this location.
-
getDropRS
public int getDropRS()
- Returns:
- the number of cars and engines that are scheduled for drop at this location.
-
setDivision
public void setDivision(Division division)
-
getDivision
public Division getDivision()
Gets the division for this location- Returns:
- the division for this location
-
getDivisionName
public java.lang.String getDivisionName()
-
getDivisionId
public java.lang.String getDivisionId()
-
setComment
public void setComment(java.lang.String comment)
-
getComment
public java.lang.String getComment()
Gets the comment text without color attributes- Returns:
- the comment text
-
getCommentWithColor
public java.lang.String getCommentWithColor()
Gets the comment text with optional color attributes- Returns:
- text with optional color attributes
-
setSwitchListComment
public void setSwitchListComment(java.lang.String comment)
-
getSwitchListComment
public java.lang.String getSwitchListComment()
Gets the switch list comment text without color attributes- Returns:
- the comment text
-
getSwitchListCommentWithColor
public java.lang.String getSwitchListCommentWithColor()
Gets the switch list comment text with optional color attributes- Returns:
- text with optional color attributes
-
getTypeNames
public java.lang.String[] getTypeNames()
-
addTypeName
public void addTypeName(java.lang.String type)
Adds the specific type of rolling stock to the will service list- Parameters:
type
- of rolling stock that location will service
-
deleteTypeName
public void deleteTypeName(java.lang.String type)
-
acceptsTypeName
public boolean acceptsTypeName(java.lang.String type)
-
addTrack
public Track addTrack(java.lang.String name, java.lang.String type)
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
public void register(Track track)
Remember a NamedBean Object created outside the manager.- Parameters:
track
- The Track to be loaded at this location.
-
deleteTrack
public void deleteTrack(Track track)
-
getTrackByName
public Track getTrackByName(java.lang.String name, java.lang.String type)
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
public Track getTrackById(java.lang.String id)
-
getTrackIdsByIdList
public java.util.List<java.lang.String> getTrackIdsByIdList()
Gets a list of track ids ordered by id for this location.- Returns:
- list of track ids for this location
-
getTracksByIdList
public java.util.List<Track> getTracksByIdList()
Gets a sorted by id list of tracks for this location.- Returns:
- Sorted list of tracks by id for this location.
-
getTracksList
public java.util.List<Track> getTracksList()
Gets a unsorted list of the tracks at this location.- Returns:
- tracks at this location.
-
getTracksByNameList
public java.util.List<Track> getTracksByNameList(java.lang.String type)
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
public java.util.List<Track> getTracksByMoves(java.lang.String type)
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
public java.util.List<Track> getTracksByBlockingOrderList(java.lang.String type)
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
public void resetTracksByBlockingOrder()
-
resequnceTracksByBlockingOrder
public void resequnceTracksByBlockingOrder()
-
changeTrackBlockingOrderEarlier
public void changeTrackBlockingOrderEarlier(Track track)
-
changeTrackBlockingOrderLater
public void changeTrackBlockingOrderLater(Track track)
-
isTrackAtLocation
public boolean isTrackAtLocation(Track track)
-
resetMoves
public void resetMoves()
Reset the move count for all tracks at this location
-
updateComboBox
public void updateComboBox(javax.swing.JComboBox<Track> box)
Updates a JComboBox with all of the track locations for this location.- Parameters:
box
- JComboBox to be updated.
-
updateComboBox
public void updateComboBox(javax.swing.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
public Pool addPool(java.lang.String name)
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
public void removePool(Pool pool)
-
getPoolByName
public Pool getPoolByName(java.lang.String name)
-
updatePoolComboBox
public void updatePoolComboBox(javax.swing.JComboBox<Pool> box)
-
getPoolsByNameList
public java.util.List<Pool> getPoolsByNameList()
Gets a list of Pools for this location.- Returns:
- A list of Pools
-
hasServiceRestrictions
public boolean 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
public boolean hasPools()
Used to determine if there are Pools at this location.- Returns:
- True if there are Pools at this location
-
hasPlannedPickups
public boolean hasPlannedPickups()
Used to determine if there are any planned pickups at this location.- Returns:
- True if there are planned pickups
-
hasLoadRestrictions
public boolean hasLoadRestrictions()
Used to determine if there are any load restrictions at this location.- Returns:
- True if there are load restrictions
-
hasShipLoadRestrictions
public boolean hasShipLoadRestrictions()
Used to determine if there are any load ship restrictions at this location.- Returns:
- True if there are load ship restrictions
-
hasRoadRestrictions
public boolean hasRoadRestrictions()
Used to determine if there are any road restrictions at this location.- Returns:
- True if there are road restrictions
-
hasDestinationRestrictions
public boolean hasDestinationRestrictions()
Used to determine if there are any track destination restrictions at this location.- Returns:
- True if there are destination restrictions
-
hasAlternateTracks
public boolean hasAlternateTracks()
-
hasOrderRestrictions
public boolean hasOrderRestrictions()
-
hasSchedules
public boolean hasSchedules()
-
hasWork
public boolean hasWork()
-
hasDisableLoadChange
public boolean hasDisableLoadChange()
-
hasTracksWithRestrictedTrainDirections
public boolean hasTracksWithRestrictedTrainDirections()
-
hasTrackMessages
public boolean hasTrackMessages()
-
hasReporters
public boolean hasReporters()
-
setReporter
public void setReporter(Reporter r)
-
getReporter
public Reporter getReporter()
-
getReporterName
public java.lang.String getReporterName()
-
dispose
public void dispose()
-
store
public org.jdom2.Element 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
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
setDirtyAndFirePropertyChange
protected void setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
-
-