Package com.anylogic.engine.markup
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.markup.AbstractDrawableMarkupAggregator
- Methods inherited from class com.anylogic.engine.markup.AbstractMarkupAggregator
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Constructor Detail
- Method Detail
- java.lang.Object
-
- com.anylogic.engine.markup.AbstractMarkupAggregator<Agent>
-
- com.anylogic.engine.markup.AbstractDrawableMarkupAggregator
-
- com.anylogic.engine.markup.RailwayNetwork
- All Implemented Interfaces:
AggregatableAnimationElement
,HasLevel
,LevelElement
,LevelMarkup
,java.io.Serializable
public class RailwayNetwork extends AbstractDrawableMarkupAggregator implements LevelMarkup, AggregatableAnimationElement
- See Also:
- Serialized Form
RailwayNetwork(Agent owner,
java.lang.String name,
ShapeDrawMode drawMode,
double z) |
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
|
RailwayNetwork(Agent owner,
java.lang.String name,
ShapeDrawMode drawMode,
double z,
boolean isPublic,
boolean visible) |
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
|
RailwayNetwork(Agent owner,
java.lang.String name,
ShapeDrawMode drawMode,
double z,
boolean isPublic,
boolean visible,
AbstractRailwayMarkup... contents) |
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
|
Constructor | Description |
---|
void |
add(PositionOnTrack pointOnTrack) |
Adds a PositionOnTrack object to the network.
|
void |
add(RailwaySwitch sw) |
Adds a RailwaySwitch object to the network.
|
void |
add(RailwayTrack track) |
Adds a RailwayTrack object to the network.
|
void |
addAll(AbstractRailwayMarkup... contents) |
Adds all arguments to the network
|
java.util.stream.Stream<? extends AbstractMarkup> |
elementsInternal() |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
ShapeDrawMode |
getDrawMode() |
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D). |
Level |
getLevel() |
Returns level associated with this space markup element or
null
if this element has no level |
java.util.List<PositionOnTrack> |
getPointOnTracks() |
Returns the list of all PositionOnTrack elements in this network.
|
Agent |
getSpace() |
|
java.util.List<RailwaySwitch> |
getSwitches() |
Returns the list of all switches in this network.
|
java.util.List<RailwayTrack> |
getTracks() |
Returns the list of all tracks in this network.
|
double |
getZ() |
Returns the base level z coordinate
|
double |
metersToPixels(double value) |
Converts specified value from meters to pixels in the space of this network
|
double |
pixelsToMeters(double value) |
Converts specified value from pixels to meters in the space of this network
|
void |
setLevel(Level level) |
|
void |
setZ(double z) |
Sets the base level z coordinate.
|
Modifier and Type | Method | Description |
---|
setDrawMode
error, getName, getOwner, initializeInternal, isVisible, onAggregatorVisibilityChanged, setVisible
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, onAggregatorVisibilityChanged, postInitialize
@Deprecated public RailwayNetwork(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
- Parameters:
owner
-name
-drawMode
-z
-
@Deprecated public RailwayNetwork(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
- Parameters:
owner
-name
-drawMode
-z
-isPublic
-visible
-
@AnyLogicInternalAPI @Deprecated public RailwayNetwork(Agent owner, java.lang.String name, ShapeDrawMode drawMode, double z, boolean isPublic, boolean visible, AbstractRailwayMarkup... contents)
Deprecated.
deprecated in version 8.5.0, will be removed in the future releases
- Parameters:
owner
-name
-drawMode
-z
-isPublic
-visible
-contents
-
public void addAll(AbstractRailwayMarkup... contents)
Adds all arguments to the network
- Parameters:
contents
- - an instance of any of the following classes:RailwayTrack
,RailwaySwitch
,PositionOnTrack
}
public Agent getSpace()
public void setZ(double z)
Sets the base level z coordinate. Elements in network have z-coordinates related to this level.
- Parameters:
z
- the base level z coordinate
public double getZ()
Returns the base level z coordinate
- Returns:
- the base level z coordinate
public java.util.List<RailwayTrack> getTracks()
Returns the list of all tracks in this network.
The network should be initialized
- Returns:
- the list of all tracks in this network
public java.util.List<RailwaySwitch> getSwitches()
Returns the list of all switches in this network.
The network should be initialized
- Returns:
- the list of all switches in this network
public java.util.List<PositionOnTrack> getPointOnTracks()
Returns the list of all PositionOnTrack elements in this network.
The network should be initialized
- Returns:
- the list of all PositionOnTrack elements in this network
@AnyLogicInternalAPI public java.util.stream.Stream<? extends AbstractMarkup> elementsInternal()
Description copied from class:
AbstractMarkupAggregator
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
- Specified by:
elementsInternal
in classAbstractMarkupAggregator<Agent>
public void add(RailwayTrack track)
Adds a RailwayTrack object to the network.
The network should be uninitialized
- Parameters:
track
- RailwayTrack element to be added
public void add(RailwaySwitch sw)
Adds a RailwaySwitch object to the network.
The network should be uninitialized
- Parameters:
sw
- RailwaySwitch element to be added
public void add(PositionOnTrack pointOnTrack)
Adds a PositionOnTrack object to the network.
The network should be uninitialized
- Parameters:
pointOnTrack
- PositionOnTrack element to be added
public double pixelsToMeters(double value)
Converts specified value from pixels to meters in the space of this network
- Parameters:
value
- in pixels
public double metersToPixels(double value)
Converts specified value from meters to pixels in the space of this network
- Parameters:
value
- in meters
public Level getLevel()
Description copied from interface:
HasLevel
Returns level associated with this space markup element or
null
if this element has no level- Specified by:
getLevel
in interfaceHasLevel
- Returns:
- the level associated with this space markup element
public ShapeDrawMode getDrawMode()
Description copied from class:
AbstractDrawableMarkupAggregator
Returns the drawing mode of the shape (where to draw this shape: 2D, 3D or 2D+3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
If the shape has been created with no-argument constructor, and has no specific limitations (like 2D-only), and drawing mode hasn't yet been set, then it is initialized to default (2D + 3D).
- Overrides:
getDrawMode
in classAbstractDrawableMarkupAggregator
@AnyLogicInternalAPI public void setLevel(Level level)
- Specified by:
setLevel
in interfaceLevelElement
-
How can we improve this article?
-