Package com.storedobject.chart
Class BezierCurve
java.lang.Object
com.storedobject.chart.AbstractPart
com.storedobject.chart.Shape
com.storedobject.chart.BezierCurve
- All Implemented Interfaces:
Component,ComponentPart,ComponentProperty,HasPosition,VisibleProperty
Defines Bezier curve that can be added to
SOChart.- Author:
- Syam
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.chart.Shape
Shape.Point, Shape.Style -
Constructor Summary
ConstructorsConstructorDescriptionBezierCurve(Shape.Point from, Shape.Point to, Shape.Point controlPoint) Construct a quadratic Bezier curve.BezierCurve(Shape.Point from, Shape.Point to, Shape.Point controlPoint1, Shape.Point controlPoint2) Construct a cubic Bezier curve. -
Method Summary
Modifier and TypeMethodDescriptionvoidEncode the JSON string with the properties of this.final Shape.PointGet the control point for the quadratic Bezier curve.final Shape.PointGet the first control point for the cubic Bezier curve.final Shape.PointGet the second control point for the cubic Bezier curve.final Shape.PointgetFrom()Get the "from" point.final Shape.PointgetTo()Get the "to" point.protected final StringgetType()Get the type of this shape.voidsetControlPoint(Shape.Point controlPoint) Set the control point for the quadratic Bezier curve.voidsetControlPoint1(Shape.Point controlPoint) Set the first control point for the cubic Bezier curve.voidsetControlPoint2(Shape.Point controlPoint) Set the second control point for the cubic Bezier curve.voidsetFrom(Shape.Point from) Set the "from" point.voidsetTo(Shape.Point to) Set the "to" point.Methods inherited from class com.storedobject.chart.Shape
encode, encodePoint, encodePoint, encodeShape, getPosition, getStyle, isDraggable, isVisible, setDraggable, setPosition, setPosition, setPosition, setStyle, setVisible, validateMethods inherited from class com.storedobject.chart.AbstractPart
equals, getId, getLabelTag, getName, getSerial, getZ, hashCode, hasId, setSerial, setZMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.chart.ComponentPart
className, getId, getName, getRenderingIndex, getSerial, setName, setRenderingIndex, setSerialMethods inherited from interface com.storedobject.chart.VisibleProperty
hide, show
-
Constructor Details
-
BezierCurve
Construct a quadratic Bezier curve.- Parameters:
from- Point from.to- Point to.controlPoint- Control point.
-
BezierCurve
public BezierCurve(Shape.Point from, Shape.Point to, Shape.Point controlPoint1, Shape.Point controlPoint2) Construct a cubic Bezier curve.- Parameters:
from- Point from.to- Point to.controlPoint1- First control point.controlPoint2- Second control point.
-
-
Method Details
-
getType
-
encodeJSON
Description copied from interface:ComponentPropertyEncode the JSON string with the properties of this.- Specified by:
encodeJSONin interfaceComponentProperty- Overrides:
encodeJSONin classShape- Parameters:
sb- Encoded JSON string to be appended to this.
-
getFrom
-
setFrom
-
getTo
-
setTo
-
getControlPoint1
Get the first control point for the cubic Bezier curve.- Returns:
- First control point.
-
setControlPoint1
Set the first control point for the cubic Bezier curve.- Parameters:
controlPoint- First control point.
-
getControlPoint2
Get the second control point for the cubic Bezier curve.- Returns:
- Second control point.
-
setControlPoint2
Set the second control point for the cubic Bezier curve. If this is set to null, the curve will become quadratic.- Parameters:
controlPoint- Second control point.
-
getControlPoint
Get the control point for the quadratic Bezier curve.- Returns:
- Control point.
-
setControlPoint
Set the control point for the quadratic Bezier curve. If this is set to null, the curve will become a straight line.- Parameters:
controlPoint- Second control point.
-