Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractRailwayMarkup
- Methods inherited from class com.anylogic.engine.markup.MarkupShape
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkup
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Details
- Method Details
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkup
- com.anylogic.engine.markup.MarkupShape
- com.anylogic.engine.markup.AbstractRailwayMarkup
- com.anylogic.engine.markup.PositionOnTrack<T>
- All Implemented Interfaces:
AggregatableAnimationElement
,IDescriptor
,HasLevel
,IMarkupLibraryDescriptor
,IRailStopLineDescriptor<T>
,RailMarkup
,SVGElement
,Serializable
public class PositionOnTrack<T extends Agent> extends AbstractRailwayMarkup implements IRailStopLineDescriptor<T>
- See Also:
- Serialized Form
Constructor | Description |
---|---|
PositionOnTrack() | |
PositionOnTrack | |
PositionOnTrack |
Deprecated.
deprecated in version 8.4, will be removed in the future releases
|
Modifier and Type | Method | Description |
---|---|---|
boolean | contains |
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e.
|
Paint | getColor() |
Returns the color of this element
|
double | getOffset() |
Returns offset (measured in pixels)
|
double | getOffset |
Returns offset (measured in the given units)
|
RailwayTrack | getTrack() |
Returns the track that this position is located on.
|
double | getX() |
Returns the absolute x coordinate of this element
|
double | getY() |
Returns the absolute y coordinate of this element
|
void | onTrainEnter | |
void | onTrainExit | |
void | setColor |
Sets the color of this element
|
void | setPointOnTrack |
Sets the PositionOnTrack on the specified track at the specified offset.
|
error, getFullName, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner
discardOwner, executeUserAction, findSVGElement, getName, getSVGId, initializeInternal, isVisible, onAggregatorInitialized, onAggregatorVisibilityChanged, removeSVGFromOwner, resetSVGState, setVisible, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
public PositionOnTrack()
@Deprecated public PositionOnTrack(Agent owner, ShapeDrawMode drawMode, boolean isPublic, Paint color, RailwayTrack track, double offset)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
- Parameters:
owner
-drawMode
-isPublic
-color
-track
-offset
-
@AnyLogicInternalCodegenAPI public PositionOnTrack(Agent owner, IRailStopLineDescriptor<T> d, ShapeDrawMode drawMode, boolean isPublic, Paint color, RailwayTrack track, double offset)
public void setPointOnTrack(RailwayTrack track, double offset)
Sets the PositionOnTrack on the specified track at the specified offset.
This method is used when creating PositionOnTrack
element from code and should not be used with the initialized element
- Parameters:
track
- track to put PositionOnTrack onoffset
- offset of the PositionOnTrack
public RailwayTrack getTrack()
Returns the track that this position is located on.
The element should be initialized
public double getOffset()
Returns offset (measured in pixels)
- Returns:
- offset
public double getOffset(LengthUnits units)
Returns offset (measured in the given units)
- Parameters:
units
- the units of length- Returns:
- offset
- Since:
- 7.1
public double getX()
Returns the absolute x coordinate of this element
- Returns:
- the absolute x coordinate of this element
public double getY()
Returns the absolute y coordinate of this element
- Returns:
- the absolute y coordinate of this element
public Paint getColor()
Returns the color of this element
- Returns:
- the color of this element
public void setColor(Paint color)
Sets the color of this element
- Parameters:
color
- new color
@AnyLogicInternalCodegenAPI public void onTrainEnter(T train)
- Specified by:
onTrainEnter
in interfaceIRailStopLineDescriptor<T extends Agent>
@AnyLogicInternalCodegenAPI public void onTrainExit(T train)
- Specified by:
onTrainExit
in interfaceIRailStopLineDescriptor<T extends Agent>
public boolean contains(double px, double py)
Description copied from class:
MarkupShape
Test if the shape contains the point with the given coordinates (relative
to this shape's container, i.e. in the same system with the coordinates
of this shape, x and y)
- Specified by:
contains
in classMarkupShape
- Parameters:
px
- the x coordinate relative to this shape's containerpy
- the y coordinate relative to this shape's container- Returns:
true
if the shape contains the point with the given coordinates