ifi.dsb
Class Curve

java.lang.Object
  extended byifi.dsb.Curve

public class Curve
extends java.lang.Object

Class to hold data-points and drawing options for a curve.

Author:
Svein Bøe, svein@ifi.uio.no, 2002 - 2003.
See Also:
CurveData, Axis, Graph, Plot2D

Constructor Summary
Curve(Graph graph)
          Constructs Curve object for a graph, without data.
Curve(Graph graph, CurveData xData, CurveData yData)
          Constructs Curve object for a graph, with data.
Curve(Plot2D plot)
          Constructs a Curve object, no data supplied.
Curve(Plot2D plot, CurveData xData, CurveData yData)
          Constructs Curve object for the graph in a plot, with data.
Curve(Plot2D plot, double[] xData, double[] yData)
          Constructs Curve object for the graph in a plot, with data.
Curve(Plot2D plot, double[] xData, double[] yData, int n)
          Constructs Curve object for the graph in a plot, with data.
 
Method Summary
 ifi.dsb.Marker getCircleMarker()
           
 ifi.dsb.Marker getCrossMarker()
           
 ifi.dsb.Line getDashDotLine()
           
 ifi.dsb.Line getDashedLine()
           
 ifi.dsb.Marker getDiamondMarker()
           
 ifi.dsb.Line getDottedLine()
           
 boolean getDrawLine()
          Return whether or not to draw a curve.
 boolean getDrawMarker()
          Return whether or not to draw a marker for each data point.
 Graph getGraph()
          Return graph in which this curve will be drawn.
 ifi.dsb.Line getLine()
          Return type of line.
 ifi.dsb.Line[] getLines()
          Return all possible lines.
 float getLineWidth()
          Return the line-width of a curve.
 ifi.dsb.Line getLongDashedLine()
           
 ifi.dsb.Marker getMarker()
          Return type of marker.
 float getMarkerLineWidth()
          Return the line-width of a marker.
 ifi.dsb.Marker[] getMarkers()
          Return all possible markers.
 float getMarkerSize()
          Return size of marker, in pixels.
 ifi.dsb.Line getSolidLine()
           
 ifi.dsb.Marker getSquareMarker()
           
 ifi.dsb.Marker getTriangleMarker()
           
 CurveData getXCurveData()
          Return reference to horizontal-coordinate curve-values.
 int getXIndMax()
          Return upper index bound of clipping range (extract) from horizontal data array.
 int getXIndMin()
          Return lower index bound of clipping range (extract) from horizontal data array.
 CurveData getYCurveData()
          Return reference to vertical-coordinate curve-values.
 int getYIndMax()
          Return upper index bound of clipping range (extract) from vertical data array.
 int getYIndMin()
          Return lower index bound of clipping range (extract) from vertical data array.
 void setCurveData(CurveData data)
          Set vertical CurveData.
 void setCurveData(CurveData xData, CurveData yData)
          Set horizontal and vertical CurveData.
 void setCurveData(double[] data)
          Set vertical CurveData.
 void setCurveData(double[] xData, double[] yData)
          Set horizontal and vertical CurveData.
 void setCurveData(double[] xData, double[] yData, int n)
          Set horizontal and vertical CurveData.
 void setDrawLine(boolean drawLine)
          Set whether or not to draw a curve.
 void setDrawMarker(boolean drawMarker)
          Set whether or not to draw a marker for each data point.
 void setLine(ifi.dsb.Line line)
          Set type of line.
 void setLineWidth(float lineWidth)
          Set the line-width of a curve.
 void setMarker(ifi.dsb.Marker marker)
          Set type of marker.
 void setMarkerLineWidth(float lineWidth)
          Set the line-width of a marker.
 void setMarkerSize(float size)
          Set size of marker, in pixels.
 void setXIndMax(int ind)
          Set upper index bound of clipping range (extract) from horizontal data array.
 void setXIndMin(int ind)
          Set lower index bound of clipping range (extract) from horizontal data array.
 void setYIndMax(int ind)
          Set upper index bound of clipping range (extract) from vertical data array.
 void setYIndMin(int ind)
          Set lower index bound of clipping range (extract) from vertical data array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curve

public Curve(Plot2D plot)
Constructs a Curve object, no data supplied.

See Also:
Curve(Plot2D, double[], double[], int)

Curve

public Curve(Plot2D plot,
             CurveData xData,
             CurveData yData)
Constructs Curve object for the graph in a plot, with data.

Parameters:
plot - Reference to plot.
See Also:
Curve(Graph, CurveData, CurveData)

Curve

public Curve(Plot2D plot,
             double[] xData,
             double[] yData)
Constructs Curve object for the graph in a plot, with data.

Parameters:
xData - Copied to internal storage.
yData - Copied to internal storage.
See Also:
Curve(Plot2D, double[], double[], int)

Curve

public Curve(Plot2D plot,
             double[] xData,
             double[] yData,
             int n)
Constructs Curve object for the graph in a plot, with data.

Parameters:
plot - Reference to plot.
xData - Copied to internal storage.
yData - Copied to internal storage.
n - At most this many values are used from xData and yData.

Curve

public Curve(Graph graph)
Constructs Curve object for a graph, without data.


Curve

public Curve(Graph graph,
             CurveData xData,
             CurveData yData)
Constructs Curve object for a graph, with data. The clipping range is reset to the entire axis range if axis extrema have not been set fixed (horizontal and vertical axis range are treated separately, and minimum and maximum are treated separately).

Parameters:
graph -
xData - Not copied
yData - Not copied
Method Detail

getGraph

public Graph getGraph()
Return graph in which this curve will be drawn.


setCurveData

public void setCurveData(CurveData data)
Set vertical CurveData. Not copied. Set vertical index interval to maximum if axis extrema have not been set fixed.


setCurveData

public void setCurveData(double[] data)
Set vertical CurveData. The data array is copied to an internal storage buffer.

See Also:
setCurveData(CurveData)

setCurveData

public void setCurveData(CurveData xData,
                         CurveData yData)
Set horizontal and vertical CurveData. Data not copied. Set horizontal and vertical index intervals to maximum if axis extrema have not been set fixed.


setCurveData

public void setCurveData(double[] xData,
                         double[] yData)
Set horizontal and vertical CurveData. The xData and yData arrays are copied to internal storage buffers.

See Also:
setCurveData(CurveData, CurveData)

setCurveData

public void setCurveData(double[] xData,
                         double[] yData,
                         int n)
Set horizontal and vertical CurveData. The xData and yData arrays are copied to internal storage buffers.

Parameters:
n - Number of samples to include from the data.
See Also:
setCurveData(CurveData, CurveData)

getXCurveData

public CurveData getXCurveData()
Return reference to horizontal-coordinate curve-values.


getYCurveData

public CurveData getYCurveData()
Return reference to vertical-coordinate curve-values.


getXIndMin

public int getXIndMin()
Return lower index bound of clipping range (extract) from horizontal data array.


setXIndMin

public void setXIndMin(int ind)
Set lower index bound of clipping range (extract) from horizontal data array.


getXIndMax

public int getXIndMax()
Return upper index bound of clipping range (extract) from horizontal data array.


setXIndMax

public void setXIndMax(int ind)
Set upper index bound of clipping range (extract) from horizontal data array.


getYIndMin

public int getYIndMin()
Return lower index bound of clipping range (extract) from vertical data array.


setYIndMin

public void setYIndMin(int ind)
Set lower index bound of clipping range (extract) from vertical data array.


getYIndMax

public int getYIndMax()
Return upper index bound of clipping range (extract) from vertical data array.


setYIndMax

public void setYIndMax(int ind)
Set upper index bound of clipping range (extract) from vertical data array.


getLineWidth

public float getLineWidth()
Return the line-width of a curve.


setLineWidth

public void setLineWidth(float lineWidth)
Set the line-width of a curve.


getMarkerLineWidth

public float getMarkerLineWidth()
Return the line-width of a marker.


setMarkerLineWidth

public void setMarkerLineWidth(float lineWidth)
Set the line-width of a marker.


getDrawLine

public boolean getDrawLine()
Return whether or not to draw a curve.


setDrawLine

public void setDrawLine(boolean drawLine)
Set whether or not to draw a curve.


getDrawMarker

public boolean getDrawMarker()
Return whether or not to draw a marker for each data point.


setDrawMarker

public void setDrawMarker(boolean drawMarker)
Set whether or not to draw a marker for each data point.


getMarkerSize

public float getMarkerSize()
Return size of marker, in pixels.


setMarkerSize

public void setMarkerSize(float size)
Set size of marker, in pixels.


getMarker

public ifi.dsb.Marker getMarker()
Return type of marker.


setMarker

public void setMarker(ifi.dsb.Marker marker)
Set type of marker.


getMarkers

public ifi.dsb.Marker[] getMarkers()
Return all possible markers.


getCrossMarker

public ifi.dsb.Marker getCrossMarker()

getSquareMarker

public ifi.dsb.Marker getSquareMarker()

getTriangleMarker

public ifi.dsb.Marker getTriangleMarker()

getCircleMarker

public ifi.dsb.Marker getCircleMarker()

getDiamondMarker

public ifi.dsb.Marker getDiamondMarker()

getLine

public ifi.dsb.Line getLine()
Return type of line.


setLine

public void setLine(ifi.dsb.Line line)
Set type of line.


getLines

public ifi.dsb.Line[] getLines()
Return all possible lines.


getSolidLine

public ifi.dsb.Line getSolidLine()

getDottedLine

public ifi.dsb.Line getDottedLine()

getDashedLine

public ifi.dsb.Line getDashedLine()

getLongDashedLine

public ifi.dsb.Line getLongDashedLine()

getDashDotLine

public ifi.dsb.Line getDashDotLine()