java.lang.Object
com.levigo.jadice.web.shared.model.settings.gradation.ControlCurve
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NaturalCubicSpline1D

public abstract class ControlCurve extends Object implements Serializable
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 Details

    • points

      protected Polygon points
      The control points
    • curveChanged

      protected boolean curveChanged
  • Constructor Details

    • ControlCurve

      public ControlCurve()
  • Method Details

    • addControlPoint

      public int addControlPoint(Point p)
      Adds a control point to the end of the list.
      Parameters:
      p - The point to add.
      Returns:
      The total number of control points.
    • insertControlPoint

      public int insertControlPoint(int n, Point p)
      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

      public void setControlPoint(int n, Point p)
      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

      public Point getControlPoint(int n)
      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

      public abstract Polygon getCurve()
    • getControlPoints

      public Polygon getControlPoints()
      Returns a polygon constructed from the control points.
      Returns:
      Polygon The polygon represented by the currently defined control points.