Package com.anylogic.engine.presentation
- Field Summary
- Fields inherited from class com.anylogic.engine.presentation.Shape3D
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.presentation.ShapeOval
- Methods inherited from class com.anylogic.engine.presentation.ShapeLineFill
- Methods inherited from class com.anylogic.engine.presentation.Shape3D
- Methods inherited from class com.anylogic.engine.presentation.Shape
- Methods inherited from class java.lang.Object
- Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement
- Methods inherited from interface com.anylogic.engine.Locatable2D
- Constructor Detail
- Method Detail
- java.lang.Object
-
- com.anylogic.engine.presentation.Shape
-
- com.anylogic.engine.presentation.Shape3D
-
- com.anylogic.engine.presentation.ShapeLineFill
-
- com.anylogic.engine.presentation.ShapeOval
-
- com.anylogic.engine.presentation.ShapeArc
- All Implemented Interfaces:
com.anylogic.engine.internal.Child
,Locatable2D
,Locatable3D
,AggregatableAnimationElement
,HasLevel
,LevelElement
,SVGElement
,java.io.Serializable
,java.lang.Cloneable
public class ShapeArc extends ShapeOval
Arc shape. The shape has a start angle and a angular extent, or simply angle. For angles equal to 2*PI (with
a certain tolerance), a full circle is drawn. For angles greater than 2*PI, the remainder
of the angle divided by 2*PI is drawn.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
UNKNOWN_NAME
ShapeArc() |
Constructs an arc with default attributes.
|
ShapeArc(boolean ispublic,
double x,
double y,
double rotation,
java.awt.Paint lineColor,
java.awt.Paint fillColor,
double radiusX,
double radiusY,
double angleStart,
double angle,
double lineWidth,
LineStyle lineStyle) |
Constructs a 2D-only arc with specific attributes.
|
ShapeArc(ShapeDrawMode drawMode,
boolean ispublic,
double x,
double y,
double z,
double rotation,
java.awt.Paint lineColor,
java.awt.Paint fillColor,
double radiusX,
double radiusY,
double zHeight,
double dz,
double angleStart,
double angle,
double lineWidth,
LineStyle lineStyle) |
Constructs an arc with specific attributes.
|
Constructor | Description |
---|
ShapeArc |
clone() |
Creates and returns a copy of this shape (i.e.
|
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.
|
double |
getAngle() |
Returns the angular extent of the arc in radians, clockwise.
|
double |
getAngleStart() |
Returns the starting angle of the arc (0 means 3 o'clock) in radians, clockwise.
|
double |
getDz() |
Returns the difference of z coordinates of the arc end and start points.
|
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.
|
Point |
randomPointInside(java.util.Random rng) |
Returns the randomly chosen point inside the shape area.
This method utilises the given Random Number Generator. Throws error if this shape type doesn't support returning random point inside. |
void |
setAngle(double angle) |
Sets the angular extent of the arc in radians, clockwise.
|
void |
setAngleStart(double angleStart) |
Sets the starting angle of the arc (0 means 3 o'clock) in radians, clockwise.
|
void |
setDz(double dz) |
Sets the difference of z coordinates of the arc end and start points.
|
Modifier and Type | Method | Description |
---|
getRadiusX, getRadiusY, setRadius, setRadiusX, setRadiusY
getFillColor, getFillTexture, getLineColor, getLineStyle, getLineTexture, getLineWidth, getPresentable, getZHeight, getZOffset, setContextReference_xjal, setFillColor, setFillColor, setLineColor, setLineColor, setLineStyle, setLineWidth, setZHeight
canHandleClick, getDrawMode, getScaleZ, getZ, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ
executeUserAction, findSVGElement, getGroup, getLevel, getName, getRotation, getScaleX, getScaleY, getSVGId, getX, getY, isJava2DSwingPresentation, isPublic_xjal, isSVGPresentation, isVisible, onAggregatorVisibilityChanged, onClick, randomPointInside, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setLevel, setPublic_xjal, setScale, setScaleX, setScaleY, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initializeInternal, postInitialize
getX, getY
public ShapeArc()
Constructs an arc with default attributes.
public ShapeArc(boolean ispublic, double x, double y, double rotation, java.awt.Paint lineColor, java.awt.Paint fillColor, double radiusX, double radiusY, double angleStart, double angle, double lineWidth, LineStyle lineStyle)
Constructs a 2D-only arc with specific attributes.
- Parameters:
ispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the arc centery
- the y coordinate of the arcrotation
- the rotation of the arc in radianslineColor
- line color (orTexture
) of the arcfillColor
- fill color (orTexture
) of the arcradiusX
- "horizontal" radius of the arcradiusY
- "vertical" radius of the arcangleStart
- the starting angle of the arc (0 means 3 o'clock) in radians, clockwiseangle
- the angular extent of the arc in radians, clockwiselineWidth
- the line width of the arclineStyle
- the line stroke style of the arc (solid, dotted, dashed)
public ShapeArc(ShapeDrawMode drawMode, boolean ispublic, double x, double y, double z, double rotation, java.awt.Paint lineColor, java.awt.Paint fillColor, double radiusX, double radiusY, double zHeight, double dz, double angleStart, double angle, double lineWidth, LineStyle lineStyle)
Constructs an arc with specific attributes.
- Parameters:
drawMode
- where to draw this shape: 2D, 3D or 2D+3Dispublic
- iftrue
, the shape is visible on container's presentationx
- the x coordinate of the arc centery
- the y coordinate of the arc centerz
- the z coordinate of the arc centerrotation
- the rotation of the arc in radianslineColor
- line color (orTexture
) of the arcfillColor
- fill color (orTexture
) of the arcradiusX
- the radius of the arc along X-axisradiusY
- the radius of the arc along Y-axiszHeight
- the height of the arc along Z-axisdz
- the difference of z coordinates of the arc end and start pointsangleStart
- the starting angle of the arc (0 means 3 o'clock) in radians, clockwiseangle
- the angular extent of the arc in radians, clockwiselineWidth
- the line width of the arclineStyle
- the line stroke style of the arc (only solid is supported)
public void setAngleStart(double angleStart)
Sets the starting angle of the arc (0 means 3 o'clock) in radians, clockwise.
- Parameters:
angleStart
- the starting angle of the arc
public double getAngleStart()
Returns the starting angle of the arc (0 means 3 o'clock) in radians, clockwise.
- Returns:
- the starting angle of the arc
public void setAngle(double angle)
Sets the angular extent of the arc in radians, clockwise. For angles equal to 2*PI (with
a certain tolerance), a full circle is drawn. For angles greater than 2*PI, the remainder
of the angle divided by 2*PI is drawn.
- Parameters:
angle
- the angular extent of the arc
public double getAngle()
Returns the angular extent of the arc in radians, clockwise.
- Returns:
- the angular extent of the arc
public void setDz(double dz)
Sets the difference of z coordinates of the arc end and start points.
- Parameters:
dz
- the new difference of z coordinates of the arc end and start points
public double getDz()
Returns the difference of z coordinates of the arc end and start points.
- Returns:
- the difference of z coordinates of the arc end and start points
public Point randomPointInside(java.util.Random rng)
Description copied from class:
Shape
Returns the randomly chosen point inside the shape area.
This method utilises the given Random Number Generator.
Throws error if this shape type doesn't support returning random point inside.
This method utilises the given Random Number Generator.
Throws error if this shape type doesn't support returning random point inside.
- Overrides:
randomPointInside
in classShapeOval
- Parameters:
rng
- the random number generator.- Returns:
- the randomly chosen point inside the shape area.
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)
- Overrides:
contains
in classShapeOval
- 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
public ShapeArc clone()
Description copied from class:
Shape
Creates and returns a copy of this shape (i.e. new shape instance).
The returned shape is the object of the same class
The returned copy isn't automatically added to the group this shape belongs to.
The clone is created in the context of the same experiment or agent
Note that cloning of GIS shape, controls and charts is not supported
The returned shape is the object of the same class
The returned copy isn't automatically added to the group this shape belongs to.
The clone is created in the context of the same experiment or agent
Note that cloning of GIS shape, controls and charts is not supported
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 classShapeOval
- Parameters:
att
- attribute namesval
- attribute valuespublicOnly
- TODO
-
How can we improve this article?
-