All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class figPac.fCurve

java.lang.Object
   |
   +----figPac.fCurve

public class fCurve
extends Object
implements fElement, fInteractive, ItemListener
Each instance of the class fCurve represents a parametrized curve. For the algorithm used to plot the curve, see the method drawgfx.


Variable Index

 o CLOSED
 o defaultFillColor
The default color used to fill the curve on the screen.
 o defaultPsFillColor
The default PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
 o defaultPsFillGray
Controls the default density used to fill the curve in postscript.
 o fillColor
The color used to fill the curve on the screen.
 o FILLED
 o maxN
The maximum number of line segments to be drawn.
 o minN
The minimum number of line segments to be drawn.
 o OPEN
 o psFillColor
The PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".
 o psFillGray
Controls the density used to fill the curve in postscript.
 o psStep
A segment longer than step (in points) is not drawn in PostScript if the change in the value of the parameter between the ends of the segment is the minimum allowed.
 o psTolerance
The maximum distance (in points) between the center of a chord drawn in PostScript and the center of the corresponding arc.
 o S_VALUED
 o step
A segment longer than step (in pixels) is not drawn to screen if the change in the value of the parameter between the ends of the segment is the minimum allowed.
 o tmax
The final value of the parameter.
 o tmin
The initial value of the parameter.
 o tolerance
The maximum distance (in pixels) between the center of a chord drawn to screen and the center of the corresponding arc.
 o type
The type determines whether the curve is plotted as an open or closed path and whether or not it is filled.
 o V_VALUED

Constructor Index

 o fCurve()
 o fCurve(S2S)
Creates the curve y=F(x).
 o fCurve(S2S, double, double)
Creates the curve y=F(x) with x running from the second to the third arguments.
 o fCurve(S2S, double, double, long)
Creates the curve y=F(x) with the initial and final values of x given by the second and third arguments; the final argument determines whether or not the curve is to be closed and/or filled.
 o fCurve(S2S, long)
Creates the curve y=F(x).
 o fCurve(S2V)
Creates a curve parametrized by the argument with the parameter running from 0 to 1.
 o fCurve(S2V, double, double)
Creates a curve parametrized by the first argument whose initial and final parameter values are given by the second and third arguments.
 o fCurve(S2V, double, double, long)
Creates a curve parametrized by the first argument whose initial and final parameter values are given by the second and third arguments; the final argument determines whether or not the curve is to be closed and/or filled.
 o fCurve(S2V, long)
Creates a curve parametrized by the first argument.
 o fCurve(String, int, double, double, long)
Creates a curve specified by a String that can be parsed by fnPac to give the equation of the curve.

Method Index

 o configure(String, double)
 o configure(String, double[])
 o configure(String, String)
 o drawgfx(Figure, Hashtable, V2V)
Draws to the screen a polygonal line approximating the curve.
 o drawps(Figure, Hashtable, V2V)
 o endEdit()
 o endEditAndDelete()
 o itemStateChanged(ItemEvent)
 o startEdit(figEdit)
 o toString()

Variables

 o tmin
 public double tmin
The initial value of the parameter. It defaults to -infinity for curves of the form y=F(x) and to 0 for parametrized curves.

 o tmax
 public double tmax
The final value of the parameter. It defaults to infinity for curves of the form y=F(x) and to 1 for parametrized curves.

 o minN
 public int minN
The minimum number of line segments to be drawn. Defaults to 10.

 o maxN
 public int maxN
The maximum number of line segments to be drawn. Defaults to 3000.

 o tolerance
 public double tolerance
The maximum distance (in pixels) between the center of a chord drawn to screen and the center of the corresponding arc. Defaults to .5.

 o psTolerance
 public double psTolerance
The maximum distance (in points) between the center of a chord drawn in PostScript and the center of the corresponding arc. Defaults to .1.

 o step
 public double step
A segment longer than step (in pixels) is not drawn to screen if the change in the value of the parameter between the ends of the segment is the minimum allowed. Defaults to 10.

 o psStep
 public double psStep
A segment longer than step (in points) is not drawn in PostScript if the change in the value of the parameter between the ends of the segment is the minimum allowed. Defaults to 5.

 o OPEN
 public static long OPEN
 o CLOSED
 public static long CLOSED
 o FILLED
 public static long FILLED
 o type
 public long type
The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the curve add fCurve.FILLED.

 o defaultFillColor
 public Color defaultFillColor
The default color used to fill the curve on the screen.

 o fillColor
 public Color fillColor
The color used to fill the curve on the screen.

 o defaultPsFillGray
 public double defaultPsFillGray
Controls the default density used to fill the curve in postscript. Black=0, white=1.

 o psFillGray
 public double psFillGray
Controls the density used to fill the curve in postscript. Black=0, white=1.

 o defaultPsFillColor
 public String defaultPsFillColor
The default PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".

 o psFillColor
 public String psFillColor
The PostScript command used to color in the curve in PostScript when the fEnv variable useColorPs is "true".

 o S_VALUED
 public int S_VALUED
 o V_VALUED
 public int V_VALUED

Constructors

 o fCurve
 public fCurve(S2S F,
               double xmin,
               double xmax,
               long type)
Creates the curve y=F(x) with the initial and final values of x given by the second and third arguments; the final argument determines whether or not the curve is to be closed and/or filled.

Parameters:
F - The S2S (scalar to scalar) function specifying the curve.
xmin - The minimum value of x.
xmax - The maximum value of x.
type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the curve add fCurve.FILLED.
 o fCurve
 public fCurve(S2S F)
Creates the curve y=F(x).

 o fCurve
 public fCurve(S2S F,
               double xmin,
               double xmax)
Creates the curve y=F(x) with x running from the second to the third arguments.

 o fCurve
 public fCurve(S2S F,
               long type)
Creates the curve y=F(x). The second argument determines whether or not the curve is to be closed and/or filled. If usr2dvc is invertible x runs from the larger of its two x values at the left hand corners of the figure to the smaller of its two values at the right hand corners of the figure.

 o fCurve
 public fCurve(S2V XY,
               double tmin,
               double tmax,
               long type)
Creates a curve parametrized by the first argument whose initial and final parameter values are given by the second and third arguments; the final argument determines whether or not the curve is to be closed and/or filled.

Parameters:
XY - The S2V (scalar to vector) function parametrizing the curve.
tmin - The minimum parameter value.
tmax - The maximum parameter value.
type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the curve add fCurve.FILLED.
 o fCurve
 public fCurve(S2V XY)
Creates a curve parametrized by the argument with the parameter running from 0 to 1.

 o fCurve
 public fCurve(S2V XY,
               double tmin,
               double tmax)
Creates a curve parametrized by the first argument whose initial and final parameter values are given by the second and third arguments.

 o fCurve
 public fCurve(S2V XY,
               long type)
Creates a curve parametrized by the first argument. The second argument determines whether or not the curve is to be closed and/or filled. The parameter runs from 0 to 1.

 o fCurve
 public fCurve()
 o fCurve
 public fCurve(String functionCode,
               int SorVvalued,
               double tmin,
               double tmax,
               long type)
Creates a curve specified by a String that can be parsed by fnPac to give the equation of the curve.

Parameters:
functionCode - A string that can be parsed by fnPac to give the equation of the curve.
sOrVvalued - Should be set to fCurve.S_VALUED for an S2S curve and to fCurve.V_VALUED for an S2V curve.
tmin - The minimum parameter value.
tmax - The maximum parameter value.
type - The type determines whether the curve is plotted as an open or closed path and whether or not it is filled. To determine the value of type, start with type=0. If you wish to have the curve itself plotted add either fCurve.OPEN or fCurve.CLOSED. In the latter case, a line segment from the last point to the first point is plotted in addition to the curve itself. If you wish to fill the curve add fCurve.FILLED.

Methods

 o drawgfx
 public void drawgfx(Figure fig,
                     Hashtable env,
                     V2V usr2pxl)
Draws to the screen a polygonal line approximating the curve. The following automatic step size adjustment algorithm is used to plot a parametric curve (x(t),y(t)) with parameter running from tmin to tmax. First it tries using minN steps all of size (tmax-tmin)/minN. Then, it recursively tests all steps (t_1,t_2) as follows. If the midpoint of the straight line joining (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is closer than tolerance pixels from ( x((t_1+t_2)/2), y((t_1+t_2)/2) ), the straight line from (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is plotted. Otherwise, the step is divided in two by adding the midpoint, unless t_2-t_1 is smaller than 2(tmax-tmin)/maxN. For these minimal time steps, the distance from (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is computed. If the distance is smaller than step pixels, the straight line from (x(t_1),y(t_1)) to (x(t_2),y(t_2)) is plotted. Otherwise, nothing is plotted for the interval (t_1,t_2), under the assumption that the curve has a discontinuity in this interval.

 o drawps
 public String drawps(Figure fig,
                      Hashtable env,
                      V2V usr2ps)
 o startEdit
 public void startEdit(figEdit applet)
 o endEdit
 public void endEdit()
 o endEditAndDelete
 public void endEditAndDelete()
 o itemStateChanged
 public void itemStateChanged(ItemEvent evt)
 o configure
 public void configure(String name,
                       String Value)
 o configure
 public void configure(String name,
                       double Value)
 o configure
 public void configure(String name,
                       double Value[])
 o toString
 public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index