AnyLogic
Expand
Font size
All Implemented Interfaces:
AbstractPositionalMarkup, AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, MarkupPort, SVGElement, UsdElement, Serializable

public class LevelGate
extends AbstractLevelMarkup
implements MarkupPort, AbstractPositionalMarkup
See Also:
Serialized Form

Field Summary

Fields inherited from interface com.anylogic.engine.presentation.UsdElement

ID_NOT_SET

Constructor Summary

ConstructorDescription
LevelGate() 
LevelGate(double x, double y, double dx, double dy) 
LevelGate(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double x, double y, double dx, double dy) 

Method Summary

Modifier and TypeMethodDescription
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
booleancontains(double px, double py, double distance)
Returns true if the gate contains the point with the given coordinates using the given distance tolerance; returns false otherwise.
booleancontainsSq(double px, double py, double squareDistance)
Returns true if the gate contains the point with the given coordinates using the given square distance tolerance; returns false otherwise.
BoundingRectanglegetBoundingRectangle() 
PointgetCentroid() 
ColorgetColor()
Returns the color of the level gate, or null if the level gate has no color.
doublegetDx()
Returns the end x coordinate of the gate.
doublegetDy()
Returns the end y coordinate of the gate.
PointgetLeft() 
MarkupPortgetPairedPort()
Returns the paired port for this markup port.
PointgetRight() 
doublegetX()
Returns the start x coordinate of the gate.
PointgetXYZ() 
doublegetY()
Returns the start y coordinate of the gate.
doublegetZ()
This method shouldn't be called by user
(is public due to technical reasons)
voidsetColor(Color color)
Sets the color of the level gate
voidsetDx(double dx)
Sets the end x coordinate of the gate.
voidsetDy(double dy)
Sets the end y coordinate of the gate.
voidsetPairedPort(MarkupPort pairedPort)
Sets the paired port for this markup port.
voidsetX(double x)
Sets the start x coordinate of the gate.
voidsetY(double y)
Sets the start y coordinate of the gate.

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AbstractPositionalMarkup

getRotation, getSpace, isVisible

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Methods inherited from interface com.anylogic.engine.markup.MarkupPort

getFullName, getLevel, getName

Methods inherited from interface com.anylogic.engine.presentation.SVGElement

executeUserAction, findSVGElement, getSVGId, removeSVGFromOwner, resetSVGState, updateSVGProperties

Methods inherited from interface com.anylogic.engine.presentation.UsdElement

getOrGenerateUSDId

Constructor Details

LevelGate

public LevelGate()

LevelGate

public LevelGate(double x,
 double y,
 double dx,
 double dy)

LevelGate

@AnyLogicInternalCodegenAPI
public LevelGate(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double x,
 double y,
 double dx,
 double dy)

Method Details

getX

public double getX()
Returns the start x coordinate of the gate.
Specified by:
getX in interface AbstractPositionalMarkup
Returns:
the start x coordinate of the gate

getZ

@AnyLogicInternalAPI
public double getZ()
This method shouldn't be called by user
(is public due to technical reasons)
Specified by:
getZ in interface AbstractPositionalMarkup
Returns:
Always 0

setX

public void setX(double x)
Sets the start x coordinate of the gate. The gate should be uninitialized
Parameters:
x - coordinate value

getY

public double getY()
Returns the start y coordinate of the gate.
Specified by:
getY in interface AbstractPositionalMarkup
Returns:
the start y coordinate of the gate

setY

public void setY(double y)
Sets the start y coordinate of the gate. The gate should be uninitialized
Parameters:
y - coordinate value

getDx

public double getDx()
Returns the end x coordinate of the gate.
Returns:
the end x coordinate of the gate

setDx

public void setDx(double dx)
Sets the end x coordinate of the gate. The gate should be uninitialized
Parameters:
x - coordinate value

getDy

public double getDy()
Returns the end y coordinate of the gate.
Returns:
the end y coordinate of the gate

setDy

public void setDy(double dy)
Sets the end y coordinate of the gate. The gate should be uninitialized
Parameters:
y - coordinate value

getColor

public Color getColor()
Returns the color of the level gate, or null if the level gate has no color.
Returns:
gate color

setColor

public void setColor(Color color)
Sets the color of the level gate
Parameters:
color - new color

getXYZ

public Point getXYZ()
Specified by:
getXYZ in interface MarkupPort

setPairedPort

public void setPairedPort(MarkupPort pairedPort)
Description copied from interface: MarkupPort
Sets the paired port for this markup port.
Specified by:
setPairedPort in interface MarkupPort
Parameters:
pairedPort - - a markup port from another

getPairedPort

public MarkupPort getPairedPort()
Description copied from interface: MarkupPort
Returns the paired port for this markup port.
Specified by:
getPairedPort in interface MarkupPort
Returns:
the paired port for this markup port

contains

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 class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

contains

public boolean contains(double px,
 double py,
 double distance)
Returns true if the gate contains the point with the given coordinates using the given distance tolerance; returns false otherwise.
Parameters:
px - point x coordinate
py - point y coordinate
distance - the distance tolerance to determine whether the given point lies within the gate proximity.

containsSq

public boolean containsSq(double px,
 double py,
 double squareDistance)
Returns true if the gate contains the point with the given coordinates using the given square distance tolerance; returns false otherwise.
Parameters:
px - point x coordinate
py - point y coordinate
distance - the square of distance tolerance to determine whether the given point lies within the gate proximity.

getLeft

@AnyLogicInternalAPI
public Point getLeft()

getRight

@AnyLogicInternalAPI
public Point getRight()

getCentroid

@AnyLogicInternalAPI
public Point getCentroid()

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()