Class GpadCurve

java.lang.Object
  |
  +--GpadCurve

public final class GpadCurve
extends java.lang.Object

The GpadCurve class represents a curve generation operation applied to the Paintlet canvas by a GraphicPad component. Curve types are defined as static integer constants. The GpadCurve object is passed as an argument to the gpApplyCurve method of the GpadComponent class.

Version:
1.19.1
Author:
Joseph E. Dever
See Also:
GpadComponent

Field Summary
static int HEIGHT
          The Paintlet canvas height.
static int MAXCURVES
          The maximum number of curves.
static int MAXKNOTS
          The maximum number of knots in the curve.
static int SPLINE
          Spline curve type.
static int WIDTH
          The Paintlet canvas width.
 
Constructor Summary
GpadCurve()
          Creates a new GpadCurve object.
 
Method Summary
 boolean getCascade()
          Gets the value of the cascade mode.
 int getCurveNum()
          Gets the number of curves this object generates.
 int getCurveType()
          Gets the curve type.
 int getKnotNum()
          Gets the number of knots in each spline curve.
 java.lang.String getKnotVal()
          Gets the knot type value.
 void setCascade(boolean b)
          Sets the curve generation mode to cascade when specified parameter is true.
 void setCurveNum(int i)
          Sets the number of generated curves to the specified value.
 void setCurveType(int type)
          Sets the curve type to the specified value.
 void setKnotNum(int i)
          Sets the number of knots to the specified value.
 void setKnotVal(java.lang.String s)
          Sets the knot values to the type specified in the parameter string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPLINE

public static final int SPLINE
Spline curve type.

WIDTH

public static final int WIDTH
The Paintlet canvas width.

HEIGHT

public static final int HEIGHT
The Paintlet canvas height.

MAXKNOTS

public static final int MAXKNOTS
The maximum number of knots in the curve.

MAXCURVES

public static final int MAXCURVES
The maximum number of curves.
Constructor Detail

GpadCurve

public GpadCurve()
Creates a new GpadCurve object. Default curve type is a spline with 15 random knots. The default number of generated curves is 12.
Method Detail

setCurveNum

public void setCurveNum(int i)
Sets the number of generated curves to the specified value. If the specified value is invalid, the number of curves defaults to 10.
Parameters:
i - the number of generated curves
See Also:
MAXCURVES, getCurveNum()

getCurveNum

public int getCurveNum()
Gets the number of curves this object generates.
Returns:
the number of curves this object generates
See Also:
setCurveNum(int)

setKnotNum

public void setKnotNum(int i)
Sets the number of knots to the specified value. If the specified value is invalid, the number of knots defaults to 15. Fewer knots will produce a smoother spline curve. Minimum value is 4 knots.
Parameters:
i - the number of knots
See Also:
MAXKNOTS, getKnotNum()

getKnotNum

public int getKnotNum()
Gets the number of knots in each spline curve.
Returns:
the number of knots
See Also:
setKnotNum(int)

setKnotVal

public void setKnotVal(java.lang.String s)
Sets the knot values to the type specified in the parameter string. Knot values can be rand for randomly generated values, or periodicKnots for periodic values. The periodic knots consist of repeating high and low values. The difference between the high and low value increases as the number of knots increase.
Parameters:
s - the type of knots
See Also:
setKnotNum(int)

getKnotVal

public java.lang.String getKnotVal()
Gets the knot type value. The knot value is either rand or periodicKnots.
Returns:
the knot type
See Also:
setKnotVal(String)

setCascade

public void setCascade(boolean b)
Sets the curve generation mode to cascade when specified parameter is true. Cascade mode produces periodic curves along the height of the canvas.
Parameters:
b - when true generates curves in a cascade

getCascade

public boolean getCascade()
Gets the value of the cascade mode.
Returns:
the cascade mode

setCurveType

public void setCurveType(int type)
Sets the curve type to the specified value. The only curve type defined is the spline curve.
Parameters:
type - the curve type
See Also:
SPLINE

getCurveType

public int getCurveType()
Gets the curve type. The only curve type defined is the spline curve.
Returns:
the curve type
See Also:
SPLINE