AnyLogic
Expand
Font size
All Implemented Interfaces:
com.anylogic.engine.internal.Child, Locatable2D, AggregatableAnimationElement, HasLevel, LevelElement, SVGElement, java.io.Serializable, java.lang.Cloneable

public class ShapeScale
extends Shape
This shape draws Scale of the agent on its animation
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

Fields inherited from class com.anylogic.engine.presentation.Shape

UNKNOWN_NAME

Constructor Summary

Constructors 
ShapeScale​(Agent owner, boolean ispublic, double x, double y, double rotation, double length, LengthUnits displayedUnits)
Constructs a text shape with specific attributes.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
boolean contains​(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
LengthUnits getDisplayedUnits()  
double getLength()  
Agent getOwner()  
Presentable getPresentable()
Returns the Presentable object (Agent or Experiment) where this shape belongs to, or null.
void postSVGShapeSpecificAttributes​(java.util.List<java.lang.String> att, java.util.List<java.lang.String> val, boolean publicOnly)
Posts general properties specific to a particular shape class.
void restoreOwner​(java.lang.Object owner)
Deprecated.
void setDisplayedUnits​(LengthUnits displayedUnits)  
void setLength​(double length)  
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.presentation.Shape

canHandleClick, clone, executeUserAction, findSVGElement, getDrawMode, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, setLevel, setPos, setPos, setPublic_xjal, setRotation, setScale, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

Methods inherited from class java.lang.Object

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

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

initializeInternal, postInitialize

Constructor Detail

ShapeScale

public ShapeScale​(Agent owner,
                  boolean ispublic,
                  double x,
                  double y,
                  double rotation,
                  double length,
                  LengthUnits displayedUnits)
Constructs a text shape with specific attributes.
Parameters:
ispublic - if true, the shape is visible on container's presentation
x - the x coordinate of the beginning of the first line of the text
y - the y coordinate of the beginning of the first line of the text
rotation - the rotation of the text in radians
color - color of the text
text - the text displayed by the text shape
font - the font used by the text shape
alignment - the alignment of the text shape

Method Detail

getLength

public double getLength()

setLength

public void setLength​(double length)

getDisplayedUnits

public LengthUnits getDisplayedUnits()

setDisplayedUnits

public void setDisplayedUnits​(LengthUnits displayedUnits)

getOwner

public Agent getOwner()

contains

public boolean contains​(double px,
                        double py)
Description copied from class: Shape
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 Shape
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

getPresentable

public Presentable getPresentable()
Description copied from class: Shape
Returns the Presentable object (Agent or Experiment) where this shape belongs to, or null.
Overrides:
getPresentable in class Shape
Returns:
the Presentable that owns this shape, or null

restoreOwner

@AnyLogicInternalCodegenAPI
@Deprecated
public void restoreOwner​(java.lang.Object owner)
Deprecated.
Description copied from class: Shape
This method normally should not be called by user
This method restores owner of this object
The method is used in snapshot saving/loading
Specified by:
restoreOwner in interface com.anylogic.engine.internal.Child
Overrides:
restoreOwner in class Shape
Parameters:
owner - owner of this object, usually Agent, Experiment or ShapeGroup

postSVGShapeSpecificAttributes

public void postSVGShapeSpecificAttributes​(java.util.List<java.lang.String> att,
                                           java.util.List<java.lang.String> val,
                                           boolean publicOnly)
Description copied from class: Shape
Posts general properties specific to a particular shape class. Is triggered by SVG_DIRTY_SHAPE flag. Made public for occasional posting of additional SVG properties from outside engine (e.g. from libraries)
Overrides:
postSVGShapeSpecificAttributes in class Shape
Parameters:
att - attribute names
val - attribute values
publicOnly - TODO
How can we improve this article?