|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectview.PlotData
public class PlotData
Abstract class contains data for plot programs. Nr is an unique integer used for internal identification, the double array cor[] contains the raw coordinate data, while Xcor and Ycor are the on screen coordinates. Coordinate errors go into err[], length of error-bar in x (y) direction is Xerr, Yerr. The class is constructed with the cor[] (and err[]). Abstract static method calcCoordinates knows how to convert cor[] into xcor, ycor; it expects the drawable canvas size (Dimension object) as an argument. The approbiate method calcErrorBars can convert err[] into error bar sizes. Null values in Pixel or Error codes a necesarry update. Zeros in errorbars mean no errorbar present The boolean isActive, isChosen, onScreen default to t f f and code wether a point is active, is highlighted, and is visible on the Canvas. If the Vector lineWith is given, a desired straight line connection with the plotData objects identified with its elements is indicated. A point is added to the Vector via a call to the connectWith(plotData) method. Method filter sets this Object inactive, if its coordinates are outside a given range. Method getDistance(Point) returns the (rectangular) pixel distance between this object and the given point.
| Field Summary | |
|---|---|
double[] |
cor
|
static Color |
DEFAULT
|
static Color |
DEFLINE
|
static int |
DEFSIZE
|
double[] |
err
|
Dimension |
ErrorBar
|
protected Color |
Highlight
|
boolean |
isActive
|
boolean |
isChosen
|
protected Color |
LineColor
|
protected boolean |
lineVisible
|
protected Vector |
lineWith
|
protected int |
Number
|
boolean |
onScreen
|
Point |
Pixel
|
protected ScreenPixel |
screen
|
protected Color |
Simple
|
int |
Size
|
| Constructor Summary | |
|---|---|
protected |
PlotData()
|
protected |
PlotData(int num)
|
|
PlotData(int num,
double[] x)
|
|
PlotData(int num,
double[] x,
double[] error)
|
| Method Summary | |
|---|---|
Object |
clone()
|
void |
connectWith(PlotData neighbour)
Adds a point to the lineWith vector. |
void |
decrease()
A method defined by the Zoomable interface. |
void |
draw(Graphics dis)
Basic method for drawing the pixel to the screen. |
PlotData |
duplicate()
|
boolean |
equals(Object test)
Two plotDatas are equal if their Number is equal. |
boolean |
filter(double[] cormin,
double[] validrange)
Decides wether this plotData is within the bounds defined by the two arguments in the following way: If validrange[i] is < 0, no bounds are applied to coordinate i, otherwise this can only be active, if it i'th coordinate >= cormin[i] && <= cormin[i]+validrange[i]. |
static PlotData |
getClosest(Vector alldata,
Point click)
Returns the plotData object located closest to the click point. |
ScreenPixel |
getConverter()
|
double |
getDistance(Point click)
Returns the distance in pixel between this object and the querried point. |
Color |
getHighlightColor()
|
boolean |
getLine()
A method defined by the Lineable interface. |
Color |
getLineColor()
|
int |
getNumber()
Returns the unique number of the plotdata. |
Color |
getSimpleColor()
|
void |
increase()
A method defined by the Zoomable interface. |
static boolean |
isInside(Point pix,
Dimension canvas)
Returns true, if the point pix is within the box canvas. |
void |
line(Graphics dis)
Method that connnects this point with the ones stored in lineWith. |
void |
print(Graphics dis)
Overrride this, if your printout should differ from the on-screen image. |
void |
setActive()
|
void |
setChosen()
|
void |
setColor(Color simple,
Color highlight)
|
void |
setConverter(ScreenPixel calc)
|
void |
setCoordinate(double[] coord)
|
void |
setError(double[] error)
|
void |
setInactive()
|
void |
setLine(boolean line)
A method defined by the Lineable interface. |
void |
setLineColor(Color linecol)
|
void |
symbol(Graphics dis)
Draws the specific symbol on position Pixel. |
boolean |
toggle()
|
boolean |
toggleChosen()
|
void |
toggleLine()
A method defined by the Lineable interface. |
String |
toMessage()
Returns a message representation of this plotData. |
String |
toString()
The base class returns only the screen coordinates. |
void |
unsetChosen()
|
void |
updateCoordinates(Dimension canvassize)
Calls the methods of screen to convert cor, err into pixel values. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Color DEFAULT
public static final Color DEFLINE
public static final int DEFSIZE
protected int Number
public double[] cor
public double[] err
public Point Pixel
public Dimension ErrorBar
public int Size
public boolean isActive
public boolean isChosen
public boolean onScreen
protected boolean lineVisible
protected Vector lineWith
protected Color LineColor
protected Color Simple
protected Color Highlight
protected ScreenPixel screen
| Constructor Detail |
|---|
protected PlotData()
protected PlotData(int num)
public PlotData(int num,
double[] x)
public PlotData(int num,
double[] x,
double[] error)
| Method Detail |
|---|
public PlotData duplicate()
public Object clone()
clone in class Objectpublic ScreenPixel getConverter()
public void setConverter(ScreenPixel calc)
public void setError(double[] error)
public void setCoordinate(double[] coord)
public boolean toggle()
public void setActive()
public void setInactive()
public boolean toggleChosen()
public void setChosen()
public void unsetChosen()
public void setColor(Color simple,
Color highlight)
public void setLineColor(Color linecol)
public Color getSimpleColor()
public Color getHighlightColor()
public Color getLineColor()
public int getNumber()
public static boolean isInside(Point pix,
Dimension canvas)
public boolean filter(double[] cormin,
double[] validrange)
public double getDistance(Point click)
public void updateCoordinates(Dimension canvassize)
public void draw(Graphics dis)
public void print(Graphics dis)
public void symbol(Graphics dis)
public void line(Graphics dis)
public void connectWith(PlotData neighbour)
public static PlotData getClosest(Vector alldata,
Point click)
public boolean equals(Object test)
equals in class Objectpublic String toString()
toString in class Objectpublic String toMessage()
public void increase()
Zoomable interface. Subclasses that
want to implement this interface can simply implement it without
supplying a body to it if this implementation suits their need.
public void decrease()
Zoomable interface. Subclasses that
want to implement this interface can simply implement it without
supplying a body to it if this implementation suits their need.
public void setLine(boolean line)
Lineable interface. Subclasses that
want to implement this interface can simply implement it without
supplying a body to it if this implementation suits their need.
public boolean getLine()
Lineable interface. Subclasses that
want to implement this interface can simply implement it without
supplying a body to it if this implementation suits their need.
public void toggleLine()
Lineable interface. Subclasses that
want to implement this interface can simply implement it without
supplying a body to it if this implementation suits their need.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||