Position on Track is a graphical element that is used to define the exact position on the railway track.
To define the position on railway track
Name – The name of this position on track. The name is used to identify and access this element from code and flowchart blocks properties.
Ignore – If selected, the position on track is excluded from the model.
– If selected, the position on track is also visible
on the upper level where this agent lives.
Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.
RailwayTrack getTrack() - Returns the railway track this element belongs to.
RailwayNetwork getRailYard() - Returns the railway network this element belongs to, or null if this element is not a part of a railway network.
double getOffset() - Returns the offset of this element from the start point of the railway track, measured in pixels.
- Returns the
of this element from the start point of the railway track, measured in
given length units.
Parameter: units - a constant defining the length units
double getX() - Returns the X-coordinate of this element.
double getY() - Returns the Y-coordinate of this element.
Paint getColor() - Returns the color (or texture) of this element.
void setColor(Paint color) -
Sets the color (or texture) of this element.
Parameter: color - the color (or texture) of this element
boolean isVisible() - Returns true if this element is visible; returns false otherwise.
setVisible(boolean v) - Sets the visibility of this element.
Parameter: v - visibility. If v is true - this element is set to be visible, if it is false - not visible.
void remove() - Removes this element from the presentation. If the element is not a part of presentation, the function does nothing. Note, that removal from the presentation does not necessarily mean removing from the model logic, since logical networks and routes may have been created before the removal and survive it.
API reference: PositionOnTrack class