plugins.big.bigsnakeutils.icy.gui.curve
Class Curve

java.lang.Object
  extended by plugins.big.bigsnakeutils.icy.gui.curve.Curve
Direct Known Subclasses:
PolynomialCurve

public abstract class Curve
extends java.lang.Object

Abstract class describing a curve. The curve is defined by a set of control points.

Version:
May 3, 2014
Author:
Julien Jacquemot

Constructor Summary
Curve()
           
 
Method Summary
abstract  void clear()
          Remove all the control points except the first and the last ones.
abstract  Curve clone()
           
 int count()
          Returns the number of control points.
 boolean equals(java.lang.Object object)
           
 java.awt.geom.Point2D getControlPoint(int index)
          Returns the control point for the given index.
 java.util.Vector<java.awt.geom.Point2D> getControlPoints()
          Returns the list of the control points.
 void insertControlPoint(int index, double x, double y)
          Inserts a control point at the given index.
abstract  void insertControlPoint(int index, java.awt.geom.Point2D point)
          Inserts a control point at the given index.
abstract  void removeControlPoint(int index)
          Removes a control point.
 void setControlPoint(int index, double x, double y)
          Set the control point for the given index.
abstract  void setControlPoint(int index, java.awt.geom.Point2D point)
          Set the control point for the given index.
abstract  void setControlPoints(java.util.Vector<java.awt.geom.Point2D> points)
          Set the list of the control points.
abstract  double valueAt(double x)
          Returns the value of the curve for the abscissa x.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curve

public Curve()
Method Detail

getControlPoints

public java.util.Vector<java.awt.geom.Point2D> getControlPoints()
Returns the list of the control points.


setControlPoints

public abstract void setControlPoints(java.util.Vector<java.awt.geom.Point2D> points)
Set the list of the control points.


insertControlPoint

public abstract void insertControlPoint(int index,
                                        java.awt.geom.Point2D point)
Inserts a control point at the given index.

Throws:
java.lang.IllegalArgumentException - if the abscissa of the first point isn't zero or if the abscissa of the last point isn't one.
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

insertControlPoint

public void insertControlPoint(int index,
                               double x,
                               double y)
Inserts a control point at the given index.

Throws:
java.lang.IllegalArgumentException - if the abscissa of the first point isn't zero or if the abscissa of the last point isn't one.
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

removeControlPoint

public abstract void removeControlPoint(int index)
Removes a control point.

Throws:
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

getControlPoint

public java.awt.geom.Point2D getControlPoint(int index)
Returns the control point for the given index.

Throws:
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

setControlPoint

public abstract void setControlPoint(int index,
                                     java.awt.geom.Point2D point)
Set the control point for the given index.

Throws:
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

setControlPoint

public void setControlPoint(int index,
                            double x,
                            double y)
Set the control point for the given index.

Throws:
java.lang.ArrayIndexOutOfBoundsException - if ( index < 0 ) or ( index > count() )

clear

public abstract void clear()
Remove all the control points except the first and the last ones.


count

public int count()
Returns the number of control points.


valueAt

public abstract double valueAt(double x)
Returns the value of the curve for the abscissa x.


equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

clone

public abstract Curve clone()
Overrides:
clone in class java.lang.Object