|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xj.anylogic.engine.presentation.Shape
com.xj.anylogic.engine.presentation.ShapeLineFill
com.xj.anylogic.engine.presentation.ShapeMultiplePoints
com.xj.anylogic.engine.presentation.ShapePolyLine
com.xj.anylogic.engine.presentation.ShapeCurve
public class ShapeCurve
Persistent curve shape.
| Field Summary |
|---|
| Fields inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
UNKNOWN_NAME |
| Constructor Summary | |
|---|---|
ShapeCurve()
Constructs a curve with default attributes. |
|
ShapeCurve(boolean ispublic,
double x,
double y,
java.awt.Color lineColor,
java.awt.Color fillColor,
int npoints,
boolean manualControlPoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
Constructs a curve with specific attributes. |
|
ShapeCurve(boolean ispublic,
double x,
double y,
java.awt.Color lineColor,
java.awt.Color fillColor,
int npoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
Deprecated. use ShapeCurve(boolean, double, double, Object, Object, int, boolean, double[], double[], boolean, double, int) |
|
ShapeCurve(boolean ispublic,
double x,
double y,
java.lang.Object lineColor,
java.lang.Object fillColor,
int npoints,
boolean manualControlPoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
Constructs a curve with specific attributes. |
|
| Method Summary | |
|---|---|
ShapeCurve |
clone()
Creates and returns a copy of this shape (i.e. new shape instance). |
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. in the same system with the coordinates of this shape, x and y) |
void |
draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
Draws the curve in a given context |
double |
getPointDx(int i)
Returns the x coordinate of a particular point of the shape relative to the start point. |
double |
getPointDy(int i)
Returns the y coordinate of a particular point of the shape relative to the start point. |
double |
getXMax()
This method isn't currently supported by Curve, it throws UnsupportedOperationException. |
double |
getXMin()
This method isn't currently supported by Curve, it throws UnsupportedOperationException. |
double |
getYMax()
This method isn't currently supported by Curve, it throws UnsupportedOperationException. |
double |
getYMin()
This method isn't currently supported by Curve, it throws UnsupportedOperationException. |
boolean |
isManualControlPoints()
Returns true if this curve uses manually specified control points
(which are specified in the dx and dy arrays) |
boolean |
onClickAt(double px,
double py,
boolean publicOnly)
Tests if the curve contains the point with the given coordinates and, if yes, executes the shape's reaction on click at that point. |
Point |
randomPointInside()
This method isn't currently supported by Curve, it throws UnsupportedOperationException. |
void |
setManualControlPoints(boolean manualControlPoints)
Sets control points mode: manual or automatic. |
void |
setPoint(int i,
double ptdx,
double ptdy)
Sets the coordinates of a particular point of the shape relative to the start point. |
void |
setPointDx(int i,
double ptdx)
Sets the x coordinate of a particular point of the shape relative to the start point. |
void |
setPointDy(int i,
double ptdy)
Sets the y coordinate of a particular point of the shape relative to the start point. |
| Methods inherited from class com.xj.anylogic.engine.presentation.ShapePolyLine |
|---|
length, randomPointInside, setRotation, setScale, setScale, setScaleX, setScaleY |
| Methods inherited from class com.xj.anylogic.engine.presentation.ShapeMultiplePoints |
|---|
getNPoints, isClosed, setClosed, setNPoints |
| Methods inherited from class com.xj.anylogic.engine.presentation.ShapeLineFill |
|---|
getFillColor, getFillTexture, getLineColor, getLineStyle, getLineTexture, getLineWidth, setFillColor, setFillColor, setLineColor, setLineColor, setLineStyle, setLineWidth |
| Methods inherited from class com.xj.anylogic.engine.presentation.Shape |
|---|
canHandleClick, getGroup, getName, getPresentable, getRotation, getScaleX, getScaleY, getX, getY, isVisible, onClick, restoreOwner, setPos, setVisible, setX, setY |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.xj.anylogic.engine.Path2D |
|---|
getX, getY |
| Constructor Detail |
|---|
public ShapeCurve()
@Deprecated
public ShapeCurve(boolean ispublic,
double x,
double y,
java.awt.Color lineColor,
java.awt.Color fillColor,
int npoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
ShapeCurve(boolean, double, double, Object, Object, int, boolean, double[], double[], boolean, double, int)
public ShapeCurve(boolean ispublic,
double x,
double y,
java.awt.Color lineColor,
java.awt.Color fillColor,
int npoints,
boolean manualControlPoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
ispublic - if true, 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 of the curvefillColor - fill color 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 (if controlPointsIncluded == 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 (if controlPointsIncluded == true, with control points, in triplets: p0y, p0c1y, p0c2y, p1y, p1c1y, p1c2y... )manualControlPoints - if true curve is drawn using control points specified in the dx and dy arraysclosed - if true, the curve is drawn as closedlineWidth - the curve widthlineStyle - the curve stroke style (solid, dotted, dashed)
public ShapeCurve(boolean ispublic,
double x,
double y,
java.lang.Object lineColor,
java.lang.Object fillColor,
int npoints,
boolean manualControlPoints,
double[] dx,
double[] dy,
boolean closed,
double lineWidth,
int lineStyle)
ispublic - if true, 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 (or Texture) of the curvefillColor - fill color (or Texture) 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 (if controlPointsIncluded == 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 (if controlPointsIncluded == true, with control points, in triplets: p0y, p0c1y, p0c2y, p1y, p1c1y, p1c2y... )manualControlPoints - if true curve is drawn using control points specified in the dx and dy arraysclosed - if true, the curve is drawn as closedlineWidth - the curve widthlineStyle - the curve stroke style (solid, dotted, dashed)| Method Detail |
|---|
public boolean onClickAt(double px,
double py,
boolean publicOnly)
onClickAt in class ShapePolyLinepx - the x coordinate of the clickpy - the y coordinate of the clickpublicOnly - if true, not public shape returns false
public boolean contains(double px,
double py)
Shape
contains in class ShapePolyLinepx - the x coordinate relative to this shape's containerpy - the y coordinate relative to this shape's container
public void draw(Panel panel,
java.awt.Graphics2D g,
java.awt.geom.AffineTransform xform,
boolean publicOnly)
draw in class ShapePolyLinepanel - the panel where the drawing is doneg - the graphics where the drawing takes placexform - the "original" transform that must be restored before drawingpublicOnly - if true, the shape is only drawn if it is publicpublic double getXMin()
UnsupportedOperationException.
getXMin in class ShapePolyLinepublic double getXMax()
UnsupportedOperationException.
getXMax in class ShapePolyLinepublic double getYMin()
UnsupportedOperationException.
getYMin in class ShapePolyLinepublic double getYMax()
UnsupportedOperationException.
getYMax in class ShapePolyLinepublic Point randomPointInside()
UnsupportedOperationException.
randomPointInside in class ShapePolyLinepublic boolean isManualControlPoints()
true if this curve uses manually specified control points
(which are specified in the dx and dy arrays)
true if this curve uses manually specified control points
(which are specified in the dx and dy arrays)public void setManualControlPoints(boolean manualControlPoints)
dx and dy arrays
manualControlPoints - true for manually specified control
points, false for automatically calculatedpublic double getPointDx(int i)
isManualControlPoints() returns true)
returns x-coordinates of control points too. Each node point of curve is followed
by 2 control points
getPointDx in interface Path2DgetPointDx in class ShapeMultiplePointsi - the index of the point (starting from 0)
public double getPointDy(int i)
isManualControlPoints() returns true)
returns y-coordinates of control points too. Each node point of curve is followed
by 2 control points
getPointDy in interface Path2DgetPointDy in class ShapeMultiplePointsi - the index of the point (starting from 0)
public void setPointDx(int i,
double ptdx)
isManualControlPoints() returns true)
sets x-coordinates of control points too. Each node point of curve is followed
by 2 control points
setPointDx in class ShapeMultiplePointsi - 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)
isManualControlPoints() returns true)
sets y-coordinates of control points too. Each node point of curve is followed
by 2 control points
setPointDy in class ShapeMultiplePointsi - 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)
isManualControlPoints() returns true)
sets coordinates of control points too. Each node point of curve is followed
by 2 control points
setPoint in class ShapeMultiplePointsi - 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 pointpublic final ShapeCurve clone()
Shape
clone in class ShapePolyLine
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||