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

public class ShapeRoundedRectangle
extends ShapeRectangle
Persistent rounded rectangle shape.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

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

UNKNOWN_NAME

Constructor Summary

Constructors 
ShapeRoundedRectangle()
Constructs a rounded rectangle with default attributes.
ShapeRoundedRectangle​(boolean ispublic, double x, double y, double rotation, java.awt.Paint lineColor, java.awt.Paint fillColor, double width, double height, double radius, double lineWidth, LineStyle lineStyle)
Constructs a rounded rectangle with specific attributes.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods 
ShapeRoundedRectangle 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 getRadius()
Returns the corner radius of the rounded rectangle.
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 setRadius​(double radius)
Sets the corner radius of the rounded rectangle.
Modifier and Type Method Description

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

getCenter, getCenter3D, getHeight, getWidth, setHeight, setSize, setSize, setWidth

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

getFillColor, getFillTexture, getLineColor, getLineStyle, getLineTexture, getLineWidth, getPresentable, getZHeight, getZOffset, setContextReference_xjal, setFillColor, setFillColor, setLineColor, setLineColor, setLineStyle, setLineWidth, setZHeight

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

canHandleClick, getDrawMode, getScaleZ, getZ, setDrawMode, setPos, setPos, setPos, setRotation, setScale, setScale, setScaleZ, setZ

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

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

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

Methods inherited from interface com.anylogic.engine.Area2D

getX, getY

Methods inherited from interface com.anylogic.engine.Area3D

getZ, getZHeight

Methods inherited from interface com.anylogic.engine.Locatable3D

getZOffset

Constructor Detail

ShapeRoundedRectangle

public ShapeRoundedRectangle()
Constructs a rounded rectangle with default attributes.

ShapeRoundedRectangle

public ShapeRoundedRectangle​(boolean ispublic,
                             double x,
                             double y,
                             double rotation,
                             java.awt.Paint lineColor,
                             java.awt.Paint fillColor,
                             double width,
                             double height,
                             double radius,
                             double lineWidth,
                             LineStyle lineStyle)
Constructs a rounded rectangle with specific attributes.
Parameters:
ispublic - if true, the shape is visible on container's presentation
x - the x coordinate of the rounded rectangle upper left corner
y - the y coordinate of the rounded rectangle upper left corner
rotation - the rotation of the rounded rectangle in radians
lineColor - line color (or Texture) of the rounded rectangle
fillColor - fill color (or Texture) of the rounded rectangle
width - the width of the rounded rectangle
height - the height of the rounded rectangle
radius - the corner radius of the rounded rectangle
lineWidth - the line width of the rounded rectangle
lineStyle - the line stroke style of the rounded rectangle (solid, dotted, dashed)

Method Detail

setRadius

public void setRadius​(double radius)
Sets the corner radius of the rounded rectangle.
Parameters:
radius - the corner radius of the rounded rectangle

getRadius

public double getRadius()
Returns the corner radius of the rounded rectangle.
Returns:
the corner radius of the rounded rectangle

randomPointInside

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.
Overrides:
randomPointInside in class ShapeRectangle
Parameters:
rng - the random number generator.
Returns:
the randomly chosen point inside the shape area.

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)
Overrides:
contains in class ShapeRectangle
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

clone

public final ShapeRoundedRectangle 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
Overrides:
clone in class ShapeRectangle

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 ShapeRectangle
Parameters:
att - attribute names
val - attribute values
publicOnly - TODO
How can we improve this article?