Class ControlCurve
java.lang.Object
com.levigo.jadice.web.shared.model.settings.gradation.ControlCurve
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
NaturalCubicSpline1D
This class represents a curve defined by a sequence of control points. The actual implementation
of the curve is up to implementing subclasses.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Adds a control point to the end of the list.getControlPoint
(int n) Gets a specified control point.Returns a polygon constructed from the control points.abstract Polygon
getCurve()
int
Gets the number of control points.int
insertControlPoint
(int n, Point p) Inserts a control point at a given location.void
removeControlPoint
(int n) Removes the specified control point.void
setControlPoint
(int n, Point p) Sets the specified control point.
-
Field Details
-
points
The control points -
curveChanged
protected boolean curveChanged
-
-
Constructor Details
-
ControlCurve
public ControlCurve()
-
-
Method Details
-
addControlPoint
Adds a control point to the end of the list.- Parameters:
p
- The point to add.- Returns:
- The total number of control points.
-
insertControlPoint
Inserts a control point at a given location.- Parameters:
n
- The index where to insert the control point.p
- The point to add.- Returns:
- The total number of control points.
-
setControlPoint
Sets the specified control point.- Parameters:
n
- The index to replace the existing control point.p
- The point to set.
-
removeControlPoint
public void removeControlPoint(int n) Removes the specified control point.- Parameters:
n
- The index of the point to remove.
-
getControlPoint
Gets a specified control point.- Parameters:
n
- The index of the point in question.- Returns:
- The control point at the given index.
-
getPointCount
public int getPointCount()Gets the number of control points.- Returns:
- The total number of currently defined control points.
-
getCurve
-
getControlPoints
Returns a polygon constructed from the control points.- Returns:
- Polygon The polygon represented by the currently defined control points.
-