ElVis Java Interface

sv.graph
Class Data1D

java.lang.Object
  extended bysv.graph.Data1D
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Data1DIndex

public class Data1D
extends java.lang.Object
implements java.io.Serializable

The Data1D class stores a dataset for f(x).

See Also:
Serialized Form

Field Summary
 int bytesRead
           
 float[] fx
           
 int highlightEnd
           
 int highlightStart
           
 int nPoints
           
 boolean selected
           
 int thickness
           
 float[] x
           
 
Constructor Summary
Data1D()
           
Data1D(java.lang.String name, int nPoints)
          Create the dataset.
Data1D(java.lang.String name, int nPoints, float[] x, float[] fx)
          Create the dataset.
 
Method Summary
 void addFx(float fxIn)
          Set the next f(x) value.
 void addPoints(Data1D d)
           
 void addX(float xIn)
          Set the next X value.
 double[] closestPoint(double[] xy)
           
 int closestXPoint(double[] xy)
           
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D.Float plotArea, float xMin, float xMax, float fxMin, float fxMax)
           
 void drawLine(boolean draw)
          Set whether a line is drawn between data points
 void drawMarker(boolean draw)
          Set whether a marker is drawn at each data point
 java.lang.Exception read(java.io.DataInputStream in)
           
 void setColor(java.awt.Color c)
           
 void setThickness(int t)
           
 double shortestYDistance(double[] xy)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float[] x

fx

public float[] fx

thickness

public int thickness

highlightStart

public int highlightStart

highlightEnd

public int highlightEnd

selected

public boolean selected

nPoints

public int nPoints

bytesRead

public int bytesRead
Constructor Detail

Data1D

public Data1D()

Data1D

public Data1D(java.lang.String name,
              int nPoints)
Create the dataset.

Parameters:
name - - The name of the dataset.
nPoints - - The number of points in the dataset.

Data1D

public Data1D(java.lang.String name,
              int nPoints,
              float[] x,
              float[] fx)
Create the dataset.

Parameters:
name - - The name of the dataset.
nPoints - - The number of points in the dataset.
x - - Array of X values.
fx - - Array of f(X) values.
Method Detail

addX

public void addX(float xIn)
Set the next X value.

Parameters:
xIn - - The next X value.

addFx

public void addFx(float fxIn)
Set the next f(x) value.

Parameters:
fxIn - - The next f(x) value.

drawMarker

public void drawMarker(boolean draw)
Set whether a marker is drawn at each data point

Parameters:
draw - - true: a marker is drawn; false: a marker is not drawn (default).

drawLine

public void drawLine(boolean draw)
Set whether a line is drawn between data points

Parameters:
draw - - true: a line is drawn (default); false: a line is not drawn.

addPoints

public void addPoints(Data1D d)

setColor

public void setColor(java.awt.Color c)

setThickness

public void setThickness(int t)

shortestYDistance

public double shortestYDistance(double[] xy)

closestPoint

public double[] closestPoint(double[] xy)

closestXPoint

public int closestXPoint(double[] xy)

read

public java.lang.Exception read(java.io.DataInputStream in)

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D.Float plotArea,
                 float xMin,
                 float xMax,
                 float fxMin,
                 float fxMax)

ElVis Java Interface