jmri.jmrit.operations.routes
Class RouteLocation

Show UML class diagram
java.lang.Object
  extended by jmri.jmrit.operations.routes.RouteLocation
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class RouteLocation
extends Object
implements PropertyChangeListener

Represents a location in a route, a location can appear more than once in a route.


Field Summary
protected  int _carMoves
           
protected  String _comment
           
protected  String _departureTime
           
protected  boolean _drops
           
protected  double _grade
           
protected  String _id
           
protected  Location _location
           
protected  String _locationId
           
protected  int _maxCarMoves
           
protected  int _maxTrainLength
           
protected  boolean _pickups
           
protected  int _sequenceId
           
protected  int _trainDir
           
protected  int _trainIconX
           
protected  int _trainIconY
           
protected  int _trainLength
           
protected  int _trainWeight
           
protected  int _wait
           
static String DELETED
           
static String DEPARTURE_TIME_CHANGED_PROPERTY
           
static String DISPOSE
           
static String DROP_CHANGED_PROPERTY
           
static int EAST
           
static String EAST_DIR
           
(package private) static org.slf4j.Logger log
           
static String MAXMOVES_CHANGED_PROPERTY
           
static int NORTH
           
static String NORTH_DIR
           
(package private)  PropertyChangeSupport pcs
           
static String PICKUP_CHANGED_PROPERTY
           
static int SOUTH
           
static String SOUTH_DIR
           
static String TRAIN_DIRECTION_CHANGED_PROPERTY
           
static int WEST
           
static String WEST_DIR
           
 
Constructor Summary
RouteLocation(org.jdom.Element e)
          Construct this Entry from XML.
RouteLocation(String id, Location location)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 boolean canDrop()
           
 boolean canPickup()
           
 void dispose()
           
protected  void firePropertyChange(String p, Object old, Object n)
           
 int getCarMoves()
           
 String getComment()
           
 String getDepartureTime()
           
 String getFormatedDepartureTime()
           
 double getGrade()
           
 String getId()
           
 Location getLocation()
           
 int getMaxCarMoves()
          Get the maximum number of moves for this location
 int getMaxTrainLength()
           
 String getName()
           
 int getSequenceId()
           
 int getTrainDirection()
          Gets the binary representation of the train's direction at this location
 String getTrainDirectionString()
          Gets the String representation of the train's direction at this location
 int getTrainIconX()
           
 int getTrainIconY()
           
 int getTrainLength()
           
 int getTrainWeight()
           
 int getWait()
           
 void propertyChange(PropertyChangeEvent e)
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void setCanDrop(boolean drops)
          When true allow car drops at this location
 void setCanPickup(boolean pickups)
          When true allow car pick ups at this location
 void setCarMoves(int moves)
          Set the number of moves that this location has when building a train
 void setComment(String comment)
           
 void setDepartureTime(String time)
           
protected  void setDirtyAndFirePropertyChange(String p, Object old, Object n)
           
 void setGrade(double grade)
           
 void setMaxCarMoves(int moves)
           
 void setMaxTrainLength(int length)
           
 void setSequenceId(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 train
 void setTrainWeight(int weight)
          Set the train weight departing this location when building a train
 void setWait(int time)
           
 org.jdom.Element store()
          Create an XML element to represent this Entry.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

protected String _id

_location

protected Location _location

_locationId

protected String _locationId

_trainDir

protected int _trainDir

_maxTrainLength

protected int _maxTrainLength

_maxCarMoves

protected int _maxCarMoves

_drops

protected boolean _drops

_pickups

protected boolean _pickups

_sequenceId

protected int _sequenceId

_grade

protected double _grade

_wait

protected int _wait

_departureTime

protected String _departureTime

_trainIconX

protected int _trainIconX

_trainIconY

protected int _trainIconY

_comment

protected String _comment

_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 String EAST_DIR

WEST_DIR

public static final String WEST_DIR

NORTH_DIR

public static final String NORTH_DIR

SOUTH_DIR

public static final String SOUTH_DIR

DISPOSE

public static final String DISPOSE
See Also:
Constant Field Values

DELETED

public static final String DELETED

DROP_CHANGED_PROPERTY

public static final String DROP_CHANGED_PROPERTY
See Also:
Constant Field Values

PICKUP_CHANGED_PROPERTY

public static final String PICKUP_CHANGED_PROPERTY
See Also:
Constant Field Values

MAXMOVES_CHANGED_PROPERTY

public static final String MAXMOVES_CHANGED_PROPERTY
See Also:
Constant Field Values

TRAIN_DIRECTION_CHANGED_PROPERTY

public static final String TRAIN_DIRECTION_CHANGED_PROPERTY
See Also:
Constant Field Values

DEPARTURE_TIME_CHANGED_PROPERTY

public static final String DEPARTURE_TIME_CHANGED_PROPERTY
See Also:
Constant Field Values

pcs

PropertyChangeSupport pcs

log

static org.slf4j.Logger log
Constructor Detail

RouteLocation

public RouteLocation(String id,
                     Location location)

RouteLocation

public RouteLocation(org.jdom.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 String toString()
Overrides:
toString in class Object

getId

public String getId()

getName

public String getName()

getLocation

public Location getLocation()

getSequenceId

public int getSequenceId()

setSequenceId

public void setSequenceId(int sequence)

setComment

public void setComment(String comment)

getComment

public String getComment()

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 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 -

getTrainLength

public int getTrainLength()

setTrainWeight

public void setTrainWeight(int weight)
Set the train weight departing this location when building a train

Parameters:
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

setCanDrop

public void setCanDrop(boolean drops)
When true allow car drops at this location

Parameters:
drops - when true drops allowed at this location

canDrop

public boolean canDrop()

setCanPickup

public void setCanPickup(boolean pickups)
When true allow car pick ups at this location

Parameters:
pickups - when true pick ups allowed at this location

canPickup

public boolean canPickup()

setCarMoves

public void setCarMoves(int moves)
Set the number of moves that this location has when building a train

Parameters:
moves -

getCarMoves

public int getCarMoves()

setWait

public void setWait(int time)

getWait

public int getWait()

setDepartureTime

public void setDepartureTime(String time)

getDepartureTime

public String getDepartureTime()

getFormatedDepartureTime

public 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()

setTrainIconCoordinates

public void setTrainIconCoordinates()
Set the train icon panel coordinates to the location defaults. Coordinates are dependent on the train's departure direction.


dispose

public void dispose()

store

public org.jdom.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(PropertyChangeEvent e)
Specified by:
propertyChange in interface PropertyChangeListener

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)

firePropertyChange

protected void firePropertyChange(String p,
                                  Object old,
                                  Object n)

setDirtyAndFirePropertyChange

protected void setDirtyAndFirePropertyChange(String p,
                                             Object old,
                                             Object n)


Copyright © 1997-2013 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads