Package com.anylogic.engine.presentation
- Field Summary
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.presentation.ShapePolyLine
- Methods inherited from class com.anylogic.engine.presentation.ShapeMultiplePoints
- 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.Locatable3D
- Methods inherited from interface com.anylogic.engine.Path2D
- Methods inherited from interface com.anylogic.engine.Path3D
- Constructor Details
- Method Details
- All Implemented Interfaces:
com.anylogic.engine.internal.Child,Locatable2D,Locatable3D,AggregatableAnimationElement,HasLevel,LevelElement,Path2D,Path3D,SVGElement,UsdElement,Serializable,Cloneable
public class ShapeCurve extends ShapePolyLine
Persistent curve shape.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
| Constructor | Description |
|---|---|
ShapeCurve() |
Constructs a curve with default attributes.
|
ShapeCurve |
Deprecated.
|
ShapeCurve |
Constructs a 2D-only curve with specific attributes.
|
| Modifier and Type | Method | Description |
|---|---|---|
final ShapeCurve | clone() |
Creates and returns a copy of this shape (i.e.
|
boolean | contains |
Tests if the polygon (based on this polyline points) contains the point with coordinates (x,y).
|
double | getPointDx |
Returns the x coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode ( isManualControlPoints() returns true)
returns x-coordinates of control points too. |
double | getPointDy |
Returns the y coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode ( isManualControlPoints() returns true)
returns y-coordinates of control points too. |
com.anylogic.engine.internal.presentation.ISVGComponent | getSVGComponent() | |
double | getXMax() |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
double | getXMin() |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
double | getYMax() |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
double | getYMin() |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
boolean | isManualControlPoints() |
Returns
true if this curve uses manually specified control points
(which are specified in the dx and dy arrays) |
double | length() |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
void | postSVGShapeSpecificAttributes |
Posts general properties specific to a particular shape class.
|
Point | randomPointInside |
This method isn't currently supported by Curve, it throws
UnsupportedOperationException.Please consider using polyline instead of curve. |
void | setManualControlPoints |
Sets control points mode: manual or automatic.
In the manual mode curve uses control points specified in the dx and dy arrays |
void | setPoint |
Sets the coordinates of a particular point of the shape relative to the start point.
In case of manual control points mode ( isManualControlPoints() returns true)
sets coordinates of control points too. |
void | setPointDx |
Sets the x coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode ( isManualControlPoints() returns true)
sets x-coordinates of control points too. |
void | setPointDy |
Sets the y coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode ( isManualControlPoints() returns true)
sets y-coordinates of control points too. |
getFillColor, getFillTexture, getLineColor, getLineStyle, getLineTexture, getLineWidth, getPresentable, getZHeight, getZOffset, setContextReference_xjal, setFillColor, setFillColor, setLineColor, setLineColor, setLineStyle, setLineWidth, setZHeightcanHandleClick, getDrawMode, getScaleZ, getZ, setDrawMode, setPos, setPos, setPos, setScale, setScaleZ, setZexecuteUserAction, findSVGElement, getGroup, getGroupOrOwner, getInspect, getLevel, getName, getOrGenerateUSDId, getRotation, getScaleX, getScaleY, getSVGId, getUsdVersion, getX, getY, isJava2DSwingPresentation, isOnly3D, isPublic_xjal, isSVGPresentation, isVisible, isVisibleCurrently, onAggregatorVisibilityChanged, onClick, removeSVGFromOwner, removeSVGImage, resetSVGState, restoreOwner, setChangedUsdVersion, setInspect, setLevel, setNextChangedUsdVersion, setPublic_xjal, setVisible, setX, setY, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGPropertiespublic ShapeCurve()
Constructs a curve with default attributes.
@Deprecated public ShapeCurve(boolean ispublic, double x, double y, Color lineColor, Color fillColor, int npoints, double[] dx, double[] dy, boolean closed, double lineWidth, LineStyle lineStyle)
Deprecated.
use
#ShapeCurve(boolean, double, double, Object, Object, int, boolean, double[], double[], boolean, double, LineStyle)public ShapeCurve(boolean ispublic, double x, double y, Paint lineColor, Paint fillColor, int npoints, boolean manualControlPoints, double[] dx, double[] dy, boolean closed, double lineWidth, LineStyle lineStyle)
Constructs a 2D-only curve with specific attributes.
- Parameters:
ispublic- iftrue, the curve is visible on container's presentationx- the x coordinate of the curve start pointy- the y coordinate of the curve start pointlineColor- line color (orTexture) of the curvefillColor- fill color (orTexture) of the curvenpoints- the number of points in the curvedx- the array of (at least npoints) curve points x coordinates relative to the start point (ifcontrolPointsIncluded == true, with control points, in triplets: p0x, p0c1x, p0c2x, p1x, p1c1x, p1c2x... )dy- the array of (at least npoints) curve points y coordinates relative to the start point (ifcontrolPointsIncluded == true, with control points, in triplets: p0y, p0c1y, p0c2y, p1y, p1c1y, p1c2y... )manualControlPoints- iftruecurve is drawn using control points specified in thedxanddyarraysclosed- iftrue, the curve is drawn as closedlineWidth- the curve widthlineStyle- the curve stroke style (solid, dotted, dashed)
public boolean contains(double px, double py)
Description copied from class:
ShapePolyLineTests if the polygon (based on this polyline points) contains the point with coordinates (x,y).
(relative to this shape's container, i.e. in the same system with the coordinates of this shape,
x and y)
- Overrides:
containsin classShapePolyLine- Parameters:
px- the x coordinate relative to this shape's containerpy- the y coordinate relative to this shape's container- Returns:
trueif the shape contains the point with the given coordinates
public double length()
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
lengthin classShapePolyLine- Returns:
- the length of the polyline, respecting its closeness
public double getXMin()
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
getXMinin classShapePolyLine- Returns:
- the minimum x coordinate of the polyline
public double getXMax()
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
getXMaxin classShapePolyLine- Returns:
- the maximum x coordinate of the polyline
public double getYMin()
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
getYMinin classShapePolyLine- Returns:
- the minimum y coordinate of the polyline
public double getYMax()
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
getYMaxin classShapePolyLine- Returns:
- the maximum y coordinate of the polyline
public Point randomPointInside(Random rng)
This method isn't currently supported by Curve, it throws
Please consider using polyline instead of curve.
UnsupportedOperationException.Please consider using polyline instead of curve.
- Overrides:
randomPointInsidein classShapePolyLine- Parameters:
rng- the random number generator.- Returns:
- the randomly chosen point inside the polyline
public boolean isManualControlPoints()
Returns
true if this curve uses manually specified control points
(which are specified in the dx and dy arrays)- Returns:
trueif this curve uses manually specified control points (which are specified in thedxanddyarrays)
public void setManualControlPoints(boolean manualControlPoints)
Sets control points mode: manual or automatic.
In the manual mode curve uses control points specified in the
In the manual mode curve uses control points specified in the
dx and dy arrays- Parameters:
manualControlPoints-truefor manually specified control points,falsefor automatically calculated
public double getPointDx(int i)
Returns the x coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode (
In case of manual control points mode (
isManualControlPoints() returns true)
returns x-coordinates of control points too. Each node point of curve is followed
by 2 control points- Specified by:
getPointDxin interfacePath2D- Overrides:
getPointDxin classShapeMultiplePoints- Parameters:
i- the index of the point (starting from 0)- Returns:
- the x coordinate of the point relative to the start point
public double getPointDy(int i)
Returns the y coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode (
In case of manual control points mode (
isManualControlPoints() returns true)
returns y-coordinates of control points too. Each node point of curve is followed
by 2 control points- Specified by:
getPointDyin interfacePath2D- Overrides:
getPointDyin classShapeMultiplePoints- Parameters:
i- the index of the point (starting from 0)- Returns:
- the y coordinate of the point relative to the start point
public void setPointDx(int i, double ptdx)
Sets the x coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode (
In case of manual control points mode (
isManualControlPoints() returns true)
sets x-coordinates of control points too. Each node point of curve is followed
by 2 control points- Overrides:
setPointDxin classShapeMultiplePoints- Parameters:
i- the index of the point (starting from 0)ptdx- the new x coordinate of the point relative to the start point
public void setPointDy(int i, double ptdy)
Sets the y coordinate of a particular point of the shape relative to the start point.
In case of manual control points mode (
In case of manual control points mode (
isManualControlPoints() returns true)
sets y-coordinates of control points too. Each node point of curve is followed
by 2 control points- Overrides:
setPointDyin classShapeMultiplePoints- Parameters:
i- the index of the point (starting from 0)ptdy- the new y coordinate of the point relative to the start point
public void setPoint(int i, double ptdx, double ptdy)
Sets the coordinates of a particular point of the shape relative to the start point.
In case of manual control points mode (
In case of manual control points mode (
isManualControlPoints() returns true)
sets coordinates of control points too. Each node point of curve is followed
by 2 control points- Overrides:
setPointin classShapeMultiplePoints- Parameters:
i- the index of the point (starting from 0)ptdx- the new x coordinate of the point relative to the start pointptdy- the new y coordinate of the point relative to the start point
public final ShapeCurve clone()
Description copied from class:
ShapeCreates 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
- Overrides:
clonein classShapePolyLine
public void postSVGShapeSpecificAttributes(List<String> att, List<String> val, boolean publicOnly)
Description copied from class:
ShapePosts 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:
postSVGShapeSpecificAttributesin classShapePolyLine- Parameters:
att- attribute namesval- attribute valuespublicOnly- TODO
@AnyLogicInternalAPI public com.anylogic.engine.internal.presentation.ISVGComponent getSVGComponent()
- Specified by:
getSVGComponentin interfaceSVGElement- Overrides:
getSVGComponentin classShapePolyLine
#ShapeCurve(boolean, double, double, Object, Object, int, boolean, double[], double[], boolean, double, LineStyle)