Modifier and Type | Field and Description |
---|---|
boolean |
clipping
Boolean to control clipping of the data window.
|
Graph2D |
g2d
The Graphics canvas that is driving the whole show.
|
static int |
LINE
A constant value flag used to specify that a straight line segment
is to join the data points.
|
Color |
linecolor
The color of the straight line segments
|
int |
linestyle
The linestyle to employ when joining the data points with
straight line segments.
|
int |
marker
The index of the marker to use at the data points.
|
Color |
markercolor
The marker color
|
double |
markerscale
The scaling factor for the marker.
|
static int |
NOLINE
A constant value flag used to specify no straight line segment
is to join the data points
|
Axis |
xaxis
The Axis object the X data is attached to.
|
double |
xmax
The current plottable X maximum of the data.
|
double |
xmin
The current plottable X minimum of the data.
|
Axis |
yaxis
The Axis object the Y data is attached to.
|
double |
ymax
The current plottable Y maximum of the data.
|
double |
ymin
The current plottable Y minimum of the data.
|
Constructor and Description |
---|
DataSet()
Instantiate an empty data set.
|
DataSet(double[] d,
int n)
Instantiate a DataSet with the parsed data.
|
DataSet(double[] d,
int n,
int s)
Instantiate a DataSet with the parsed data.
|
DataSet(int stride)
Instantiate an empty data set.
|
Modifier and Type | Method and Description |
---|---|
void |
append(double[] d,
int n)
Append data to the data set.
|
int |
dataPoints()
Return the number of data points in the DataSet
|
void |
delete(int start,
int end)
Delete data from the data set (start and end are inclusive).
|
void |
deleteData()
Delete all the data from the data set.
|
void |
draw_data(Graphics g,
Rectangle bounds)
Draw the straight line segments and/or the markers at the
data points.
|
double[] |
getClosestPoint(double x,
double y)
Return the data point that is closest to the parsed (x,y) position
|
double[] |
getPoint(int index)
get the data point at the parsed index.
|
double |
getXmax()
return the data X maximum.
|
double |
getXmin()
return the data X minimum.
|
double |
getYmax()
return the data Y maximum.
|
double |
getYmin()
return the data Y minimum.
|
void |
legend(double x,
double y,
String text)
Define a data legend in the graph window
|
void |
legend(int x,
int y,
String text)
Define a data legend in the graph window
|
void |
legendColor(Color c)
Set the color for the legend text
|
void |
legendFont(Font f)
Set the font to be used in the legend
|
public static final int NOLINE
public static final int LINE
public int linestyle
public Color linecolor
public int marker
Markers
public Color markercolor
public double markerscale
public Axis xaxis
Axis
public double xmax
public double xmin
public double ymax
public double ymin
public boolean clipping
public DataSet()
public DataSet(int stride) throws Exception
stride
- the stride of the data set. The default stride is 2.Exception
public DataSet(double[] d, int n) throws Exception
d
- Array containing the (x,y) data pairs.n
- Number of (x,y) data pairs in the array.Exception
- A Generic exception if it fails to load the
parsed array into the class.public DataSet(double[] d, int n, int s) throws Exception
d
- Array containing the (x,y) data pairs.n
- Number of (x,y) data pairs in the array.s
- The stride of the data.Exception
- A Generic exception if it fails to load the
parsed array into the class.public void append(double[] d, int n) throws Exception
d
- Array containing (x,y) pairs to appendn
- Number of (x,y) data pairs in the array.Exception
- A generic exception if it fails to load the
parsed array into the class.public void delete(int start, int end)
start
- The start (x,y) pair index.end
- The end (x,y) pair index.public void deleteData()
public void draw_data(Graphics g, Rectangle bounds)
g
- Graphics statebounds
- The data window to draw intopublic double getXmax()
public double getXmin()
public double getYmax()
public double getYmin()
public void legend(int x, int y, String text)
x
- pixel position of the legend.y
- pixel position of the legend.text
- text to display in the legendpublic void legend(double x, double y, String text)
x
- data position of the legend.y
- data position of the legend.text
- text to display in the legendpublic void legendFont(Font f)
f
- fontpublic void legendColor(Color c)
c
- colorpublic int dataPoints()
public double[] getPoint(int index)
index
- Data point indexpublic double[] getClosestPoint(double x, double y)
x
- y
- (x,y) position in data space.Jas4pp 1.5 © Java Analysis Studio for Particle Physics