public class VectorSet extends DataSet
Modifier and Type | Field and Description |
---|---|
static int |
MAXIMUM
A constant value flag used to specify if the max magnitude of the
vectors is going to be used as the scaling variable
|
static int |
MEAN
A constant value flag used to specify if the mean magnitude of the
vectors is going to be used as the scaling variable
|
static int |
MINIMUM
A constant value flag used to specify if the minimum magnitude of the
vectors is going to be used as the scaling variable
|
double |
scale
This is the scaling to be used when drawing vectors.
|
Constructor and Description |
---|
VectorSet()
Instantiate an empty data set.
|
VectorSet(double scale)
Instantiate an empty data set.
|
VectorSet(double[] d,
int n)
Instantiate a DataSet with the parsed data.
|
VectorSet(double[] d,
int n,
double scale)
Instantiate a DataSet with the parsed data.
|
Modifier and Type | Method and Description |
---|---|
void |
draw_data(Graphics g,
Rectangle bounds)
Draw the vectors at the data points.
|
double |
getScaleFactor()
return the current scaling factor.
|
void |
legend()
Draw a Vector legend in the graph window.
|
void |
legend(double x,
double y,
String text)
Define a Vector legend in the graph window
|
void |
legend(int x,
int y,
String text)
Define a Vector legend in the graph window
|
void |
legend(String text)
Define a Vector legend in the graph window.
|
void |
setScale(double scale)
Set the scaling to use when drawing vectors
|
void |
setScalingType(int type)
Set the scaling type to use when drawing vectors
|
append, dataPoints, delete, deleteData, getClosestPoint, getPoint, getXmax, getXmin, getYmax, getYmin, legendColor, legendFont
public static final int MEAN
public static final int MINIMUM
public static final int MAXIMUM
public double scale
public VectorSet() throws Exception
Exception
- A Generic exception if it fails to instantiate the
the class with the correct stride.public VectorSet(double[] d, int n) throws Exception
x,y,dx,dy,x,y,dx,dy,...Where (x,y) is the position of the tail and (dx,dy) is the relative position of the head. This means that the length of the data array is 4*n.
d
- Array containing the (x,y,dy,dx) vectors.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 VectorSet(double scale) throws Exception
s
- The scaling to use when plotting the vectors.Exception
- A Generic exception if it fails to instantiate the
the class with the correct stride.public VectorSet(double[] d, int n, double scale) throws Exception
d
- Array containing the (x,y,dy,dx) vectors.n
- Number of (x,y,dx,dy) vectors in the array.Exception
- A Generic exception if it fails to load the
parsed array into the class.public void setScale(double scale)
scale
- The scaling to employpublic void setScalingType(int type)
type
- Either MEAN, MAXIMUM or MINIMUM.public double getScaleFactor()
public void legend()
public void legend(String text)
text
- text to display in the legendpublic void legend(int x, int y, String text)
public void legend(double x, double y, String text)
Jas4pp 1.5 © Java Analysis Studio for Particle Physics