Position on Track

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

  1. Drag the  Position on Track element from the Space Markup section of the  Rail Library palette to the agent diagram.
  2. When moving the mouse over the agent diagram, you will see that only railway tracks are shown, other shapes and elements are temporarily hidden. 
  3. Place the mouse over the railway track just where you want to place it and release the mouse button.
  4. You will see the element being put on the track.
  5. You can change its position on the track by dragging it with the mouse.



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.

Visible on upper level – 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.

double getOffset(LengthUnits units) - Returns the offset 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.

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

Related topics

 Railway track

 Railway switch

 Railway network

 Rail Library

 API reference: PositionOnTrack class