Package jmri.jmrit.operations.routes
Class RouteLocation
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.jmrit.operations.routes.RouteLocation
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
public class RouteLocation extends PropertyChangeSupport implements java.beans.PropertyChangeListener
Represents a location in a route, a location can appear more than once in a route.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
_blockingOrder
protected int
_carMoves
protected java.lang.String
_comment
protected java.awt.Color
_commentColor
protected java.lang.String
_departureTime
protected boolean
_drops
protected double
_grade
protected java.lang.String
_id
protected Location
_location
protected java.lang.String
_locationId
protected int
_maxCarMoves
protected int
_maxTrainLength
protected boolean
_pickups
protected java.lang.String
_randomControl
protected int
_sequenceNum
protected int
_trainDir
protected int
_trainIconX
protected int
_trainIconY
protected int
_trainLength
protected int
_trainWeight
protected int
_wait
static java.lang.String
DELETED
static java.lang.String
DEPARTURE_TIME_CHANGED_PROPERTY
static java.lang.String
DISABLED
static java.lang.String
DISPOSE
static java.lang.String
DROP_CHANGED_PROPERTY
static int
EAST
static java.lang.String
EAST_DIR
static java.lang.String
MAX_LENGTH_CHANGED_PROPERTY
static java.lang.String
MAX_MOVES_CHANGED_PROPERTY
static java.lang.String
NONE
static int
NORTH
static java.lang.String
NORTH_DIR
static java.lang.String
PICKUP_CHANGED_PROPERTY
static int
SOUTH
static java.lang.String
SOUTH_DIR
static java.lang.String
TRAIN_DIRECTION_CHANGED_PROPERTY
static int
WEST
static java.lang.String
WEST_DIR
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description RouteLocation(java.lang.String id, Location location)
RouteLocation(org.jdom2.Element e)
Construct this Entry from XML.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
int
getBlockingOrder()
int
getCarMoves()
java.lang.String
getComment()
java.awt.Color
getCommentColor()
java.lang.String
getCommentTextColor()
java.lang.String
getCommentWithColor()
java.lang.String
getDepartureTime()
java.lang.String
getDepartureTimeHour()
java.lang.String
getDepartureTimeMinute()
java.lang.String
getFormatedDepartureTime()
double
getGrade()
java.lang.String
getId()
Location
getLocation()
int
getMaxCarMoves()
Get the maximum number of moves for this locationint
getMaxTrainLength()
java.lang.String
getName()
java.lang.String
getRandomControl()
int
getSequenceNumber()
java.lang.String
getSplitName()
int
getTrainDirection()
Gets the binary representation of the train's direction at this locationjava.lang.String
getTrainDirectionString()
Gets the String representation of the train's direction at this locationjava.awt.Point
getTrainIconCoordinates()
int
getTrainIconRangeX()
Gets the X range for detecting the manual movement of a train icon.int
getTrainIconRangeY()
Gets the Y range for detecting the manual movement of a train icon.int
getTrainIconX()
int
getTrainIconY()
int
getTrainLength()
int
getTrainWeight()
int
getWait()
boolean
isDropAllowed()
boolean
isPickUpAllowed()
void
propertyChange(java.beans.PropertyChangeEvent e)
void
setBlockingOrder(int order)
void
setCarMoves(int moves)
Set the number of moves completed when building a trainvoid
setComment(java.lang.String comment)
void
setCommentColor(java.awt.Color color)
Sets the text color for the route commentvoid
setCommentTextColor(java.lang.String color)
void
setDepartureTime(java.lang.String time)
Sets the formated departure time from this locationvoid
setDepartureTime(java.lang.String hour, java.lang.String minute)
protected void
setDirtyAndFirePropertyChange(java.lang.String p, java.lang.Object old, java.lang.Object n)
void
setDropAllowed(boolean drops)
When true allow car drops at this locationvoid
setGrade(double grade)
void
setMaxCarMoves(int moves)
void
setMaxTrainLength(int length)
void
setPickUpAllowed(boolean pickups)
When true allow car pick ups at this locationvoid
setRandomControl(java.lang.String value)
void
setSequenceNumber(int sequence)
void
setTrainDirection(int direction)
void
setTrainIconCoordinates()
Set the train icon panel coordinates to the location defaults.void
setTrainIconX(int x)
void
setTrainIconY(int y)
void
setTrainLength(int length)
Set the train length departing this location when building a trainvoid
setTrainWeight(int weight)
Set the train weight departing this location when building a trainvoid
setWait(int time)
org.jdom2.Element
store()
Create an XML element to represent this Entry.java.lang.String
toString()
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
_id
protected java.lang.String _id
-
_locationId
protected java.lang.String _locationId
-
_trainDir
protected int _trainDir
-
_maxTrainLength
protected int _maxTrainLength
-
_maxCarMoves
protected int _maxCarMoves
-
_randomControl
protected java.lang.String _randomControl
-
_drops
protected boolean _drops
-
_pickups
protected boolean _pickups
-
_sequenceNum
protected int _sequenceNum
-
_grade
protected double _grade
-
_wait
protected int _wait
-
_departureTime
protected java.lang.String _departureTime
-
_trainIconX
protected int _trainIconX
-
_trainIconY
protected int _trainIconY
-
_blockingOrder
protected int _blockingOrder
-
_comment
protected java.lang.String _comment
-
_commentColor
protected java.awt.Color _commentColor
-
_carMoves
protected int _carMoves
-
_trainWeight
protected int _trainWeight
-
_trainLength
protected int _trainLength
-
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
-
EAST_DIR
public static final java.lang.String EAST_DIR
-
WEST_DIR
public static final java.lang.String WEST_DIR
-
NORTH_DIR
public static final java.lang.String NORTH_DIR
-
SOUTH_DIR
public static final java.lang.String SOUTH_DIR
-
DISPOSE
public static final java.lang.String DISPOSE
- See Also:
- Constant Field Values
-
DELETED
public static final java.lang.String DELETED
-
DROP_CHANGED_PROPERTY
public static final java.lang.String DROP_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
PICKUP_CHANGED_PROPERTY
public static final java.lang.String PICKUP_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
MAX_MOVES_CHANGED_PROPERTY
public static final java.lang.String MAX_MOVES_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
-
DEPARTURE_TIME_CHANGED_PROPERTY
public static final java.lang.String DEPARTURE_TIME_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
MAX_LENGTH_CHANGED_PROPERTY
public static final java.lang.String MAX_LENGTH_CHANGED_PROPERTY
- See Also:
- Constant Field Values
-
DISABLED
public static final java.lang.String DISABLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RouteLocation
public RouteLocation(java.lang.String id, Location location)
-
RouteLocation
public RouteLocation(org.jdom2.Element e)
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 Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getId
public java.lang.String getId()
-
getName
public java.lang.String getName()
-
getSplitName
public java.lang.String getSplitName()
-
getLocation
public Location getLocation()
-
getSequenceNumber
public int getSequenceNumber()
-
setSequenceNumber
public void setSequenceNumber(int sequence)
-
getBlockingOrder
public int getBlockingOrder()
-
setBlockingOrder
public void setBlockingOrder(int order)
-
setComment
public void setComment(java.lang.String comment)
-
getComment
public java.lang.String getComment()
-
setCommentColor
public void setCommentColor(java.awt.Color color)
Sets the text color for the route comment- Parameters:
color
- The color of the text
-
getCommentColor
public java.awt.Color getCommentColor()
-
getCommentWithColor
public java.lang.String getCommentWithColor()
-
setCommentTextColor
public void setCommentTextColor(java.lang.String color)
-
getCommentTextColor
public java.lang.String getCommentTextColor()
-
setTrainDirection
public void setTrainDirection(int direction)
-
getTrainDirection
public int getTrainDirection()
Gets the binary representation of the train's direction at this location- Returns:
- int representing train direction EAST WEST NORTH SOUTH
-
getTrainDirectionString
public java.lang.String getTrainDirectionString()
Gets the String representation of the train's direction at this location- Returns:
- String representing train direction at this location
-
setMaxTrainLength
public void setMaxTrainLength(int length)
-
getMaxTrainLength
public int getMaxTrainLength()
-
setTrainLength
public void setTrainLength(int length)
Set the train length departing this location when building a train- Parameters:
length
- The train's current length.
-
getTrainLength
public int getTrainLength()
-
setTrainWeight
public void setTrainWeight(int weight)
Set the train weight departing this location when building a train- Parameters:
weight
- The train's current weight.
-
getTrainWeight
public int getTrainWeight()
-
setMaxCarMoves
public void setMaxCarMoves(int moves)
-
getMaxCarMoves
public int getMaxCarMoves()
Get the maximum number of moves for this location- Returns:
- maximum number of moves
-
setRandomControl
public void setRandomControl(java.lang.String value)
-
getRandomControl
public java.lang.String getRandomControl()
-
setDropAllowed
public void setDropAllowed(boolean drops)
When true allow car drops at this location- Parameters:
drops
- when true drops allowed at this location
-
isDropAllowed
public boolean isDropAllowed()
-
setPickUpAllowed
public void setPickUpAllowed(boolean pickups)
When true allow car pick ups at this location- Parameters:
pickups
- when true pick ups allowed at this location
-
isPickUpAllowed
public boolean isPickUpAllowed()
-
setCarMoves
public void setCarMoves(int moves)
Set the number of moves completed when building a train- Parameters:
moves
- An integer representing the amount of moves completed.
-
getCarMoves
public int getCarMoves()
-
setWait
public void setWait(int time)
-
getWait
public int getWait()
-
setDepartureTime
public void setDepartureTime(java.lang.String time)
Sets the formated departure time from this location- Parameters:
time
- format hours:minutes
-
setDepartureTime
public void setDepartureTime(java.lang.String hour, java.lang.String minute)
-
getDepartureTime
public java.lang.String getDepartureTime()
-
getDepartureTimeHour
public java.lang.String getDepartureTimeHour()
-
getDepartureTimeMinute
public java.lang.String getDepartureTimeMinute()
-
getFormatedDepartureTime
public java.lang.String getFormatedDepartureTime()
-
setGrade
public void setGrade(double grade)
-
getGrade
public double getGrade()
-
setTrainIconX
public void setTrainIconX(int x)
-
getTrainIconX
public int getTrainIconX()
-
setTrainIconY
public void setTrainIconY(int y)
-
getTrainIconY
public int getTrainIconY()
-
getTrainIconRangeX
public int getTrainIconRangeX()
Gets the X range for detecting the manual movement of a train icon.- Returns:
- the range for detection
-
getTrainIconRangeY
public int getTrainIconRangeY()
Gets the Y range for detecting the manual movement of a train icon.- Returns:
- the range for detection
-
setTrainIconCoordinates
public void setTrainIconCoordinates()
Set the train icon panel coordinates to the location defaults. Coordinates are dependent on the train's departure direction.
-
getTrainIconCoordinates
public java.awt.Point getTrainIconCoordinates()
-
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-config.xml.- 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)
-
-