|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.ibase.toolkit.PlotObject
public class PlotObject
Plot objects are basic building blocks to add graphical objects to iPlots. This class provides an basis on which all other plot objects must be based.
Some important notes for developers designing plot objects:
draw(org.rosuda.pograss.PoGraSS)
and follow the rules stated there.
Field Summary | |
---|---|
static int |
CS_ABS
coordinates system: absolute display coordinates (i.e. no transformation) |
static int |
CS_REL
coordinates system: relative. 0 corresponds to the left/top edge of the data space and 1 corresponds to the right/bottom edge. |
static int |
CS_VAR
coordinates system: variable space (i.e. |
Constructor Summary | |
---|---|
PlotObject(PlotManager p)
|
Method Summary | |
---|---|
void |
dispose()
|
void |
draw(PoGraSS g)
all subclasses should override this method. |
PlotColor |
gerDrawColor()
get drawing color |
PlotColor |
gerFillColor()
get fill color |
int |
getLayer()
|
int |
getXPos(double v)
maps plot object X coordinate to a graphical coordinate which can be used in the draw(org.rosuda.pograss.PoGraSS) method. |
int |
getYPos(double v)
maps plot object Y coordinate to a graphical coordinate which can be used in the draw(org.rosuda.pograss.PoGraSS) method. |
boolean |
isVisible()
visibility |
void |
setClip(boolean cl)
set clipping flag. if set to true then the object shouldn't plot outside the data area. |
void |
setCoordinates(int ct)
set a common coordinate system for both axes (see CS_xxx constants for details) |
void |
setCoordinates(int cx,
int cy)
set one coordinate system for each axis separately |
void |
setDrawColor(PlotColor c)
set draw color of the object. |
void |
setFillColor(PlotColor c)
set fill color of the object. |
void |
setLayer(int l)
move the object to another layer |
void |
setVisible(boolean vis)
set visibility. if set to false the object won't be painted |
java.lang.String |
toString()
toString is rather useful for debugging purposes |
void |
update()
causes the entire plot object system to be updated (redraws only the layer of this object and above). by default is simply calls the PlotManager.update() method with the layer of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CS_ABS
public static final int CS_VAR
Axis
objects are used for direct transformation)
public static final int CS_REL
Constructor Detail |
---|
public PlotObject(PlotManager p)
Method Detail |
---|
public void dispose()
public void draw(PoGraSS g)
getXPos(double)
and getYPos(double)
to map to screen coordinates whenever possible.clip
flag. getXPos(double)
and getYPos(double)
DON'T perform clipping. This is on purpose to avoid mistakes where clipping one coordinate influences the other one (compare clipping of a rectangle (independent) and a line (dependent))col
attribute if relevant. You're free to define other colors, but there should be one main color which is set by #setColor
.
g
- graphics context for paintingpublic void setDrawColor(PlotColor c)
c
- color to usepublic void setFillColor(PlotColor c)
c
- color to usepublic boolean isVisible()
public void setVisible(boolean vis)
false
the object won't be painted
public void setCoordinates(int ct)
ct
- coordinate system specification - one of the CS_xxx constantspublic void setCoordinates(int cx, int cy)
cx
- coordinate system specification for the X axis - must be one of the CS_xxx constantscy
- coordinate system specification for the Y axis - must be one of the CS_xxx constantspublic int getXPos(double v)
draw(org.rosuda.pograss.PoGraSS)
method.
v
- value to convert
public int getYPos(double v)
draw(org.rosuda.pograss.PoGraSS)
method.
v
- value to convert
public void setClip(boolean cl)
true
then the object shouldn't plot outside the data area.
cl
- clipping flagpublic PlotColor gerDrawColor()
public PlotColor gerFillColor()
public void setLayer(int l)
public int getLayer()
public void update()
PlotManager.update()
method with the layer of the object.
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |