|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.ibase.toolkit.PlotComponent org.rosuda.ibase.toolkit.PGSCanvas
public class PGSCanvas
PGScanvas - extends LayerCanvas
by adding generic functionality for
exporting the content to PGS metafile or PostScript format. Any implementing
class must use PoGraSS methods instead of Graphics.
Nested Class Summary | |
---|---|
class |
PGSCanvas.IDlgCL
|
Field Summary | |
---|---|
protected Axis |
ax
X-axis of the plot coordinates. beware that it may be null |
protected Axis |
ay
Y-axis of the plot coordinates. beware that it may be null |
protected boolean |
cancel
|
protected java.lang.String |
desc
description of this canvas. |
protected boolean |
inProgress
inProgress flag to avoid recursions in paint methods |
protected java.awt.Dialog |
intDlg
|
protected java.awt.Frame |
myFrame
frame that owns this canvas. can be null if none does. it is mainly used to identify current frame in calls to dialogs |
java.awt.print.PageFormat |
pageFormat
|
protected int |
paintLayerCounter
|
protected PlotManager |
pm
plot manager for any additional objects |
Fields inherited from class org.rosuda.ibase.toolkit.PlotComponent |
---|
AWTGrDevID, GrDevID, JOGLGrDevID, layers, SWINGGrDevID |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PGSCanvas()
equals to using PGSCanvas(-1, 1) |
|
PGSCanvas(int layers)
equals to using PGSCanvas(-1, layers) |
|
PGSCanvas(int gd,
int layers)
equals to using PGSCanvas(gd, layers, null, null) |
|
PGSCanvas(int gd,
int layers,
Axis x,
Axis y)
creates a new PoGraSS-capable driver consisting of layers to draw on, using ps plot component as its target, specified number of layers and the axes x and y. |
Method Summary | |
---|---|
protected void |
beginPaint(PoGraSS p)
before using paintPoGraSS(org.rosuda.pograss.PoGraSS) this method should be called to ensure that a consistent state while painting. |
void |
dispose()
|
protected void |
endPaint(PoGraSS p)
this methods finalizes painting tasks. |
protected void |
finalize()
|
void |
forcedFlush()
|
SVar |
getData(int id)
this method provides an API to fetch data contents of the plot. |
java.awt.Frame |
getFrame()
returns corresponding frame containing this canvas as set by setFrame(java.awt.Frame) |
static Notifier |
getGlobalNotifier()
returns the global notifier common to all PGSCanvas descendants. |
PlotManager |
getPlotManager()
get the PlotManager associated with this plot |
java.lang.String |
getTitle()
return canvas title |
Axis |
getXAxis()
|
Axis |
getYAxis()
|
protected void |
nextLayer(PoGraSS p)
|
void |
Notifying(NotifyMsg msg,
java.lang.Object o,
java.util.Vector path)
This method will be called when an even occured. |
void |
paintLayer(java.awt.Graphics g,
int layer)
paintBuffer simply calls paintPoGraSS(org.rosuda.pograss.PoGraSS) on the supplied Graphics . |
void |
paintPoGraSS(PoGraSS g)
abstract paint class to be implemented by any descendants. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pi)
|
java.lang.Object |
run(java.lang.Object o,
java.lang.String cmd)
default handing of commands "exportPGS" and "exportPS". |
void |
setFrame(java.awt.Frame owner)
set the corresponding frame that contains this canvas. |
void |
setOption(java.lang.String variable,
boolean value)
|
void |
setOption(java.lang.String variable,
double value)
|
void |
setOption(java.lang.String variable,
double[] values)
|
void |
setOption(java.lang.String variable,
int value)
|
void |
setOption(java.lang.String variable,
int[] values)
|
void |
setOption(java.lang.String variable,
java.lang.String value)
|
void |
setTitle(java.lang.String t)
set canvas title |
Methods inherited from class org.rosuda.ibase.toolkit.PlotComponent |
---|
addKeyListener, addMouseListener, addMouseMotionListener, getBounds, getComponent, getHeight, getLocation, getParent, getSize, getWidth, newQueryPopup, newQueryPopup, paintLayer, repaint, setBackground, setCursor, setSize, setSize, setToolTipText, setUpdateRoot |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.Frame myFrame
protected java.lang.String desc
protected PlotManager pm
protected boolean inProgress
protected Axis ax
null
protected Axis ay
null
protected boolean cancel
protected java.awt.Dialog intDlg
public java.awt.print.PageFormat pageFormat
protected int paintLayerCounter
Constructor Detail |
---|
public PGSCanvas(int gd, int layers, Axis x, Axis y)
null
then a plot component of the default type (see Common.defaultPlotComponentType) is created automatically. Axes can be null
if not used.
public PGSCanvas(int gd, int layers)
public PGSCanvas(int layers)
public PGSCanvas()
Method Detail |
---|
protected void finalize()
finalize
in class java.lang.Object
public static Notifier getGlobalNotifier()
public void paintLayer(java.awt.Graphics g, int layer)
paintPoGraSS(org.rosuda.pograss.PoGraSS)
on the supplied Graphics
.
Any further classes should override paintPoGraSS(org.rosuda.pograss.PoGraSS)
instead of
paintLayer(java.awt.Graphics, int)
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pi)
print
in interface java.awt.print.Printable
public void setFrame(java.awt.Frame owner)
public java.awt.Frame getFrame()
setFrame(java.awt.Frame)
public void setTitle(java.lang.String t)
public java.lang.String getTitle()
public void paintPoGraSS(PoGraSS g)
paintPoGraSS
in class PlotComponent
public PlotManager getPlotManager()
public void dispose()
public Axis getXAxis()
public Axis getYAxis()
public SVar getData(int id)
null
is returned.
protected void nextLayer(PoGraSS p)
protected void beginPaint(PoGraSS p)
paintPoGraSS(org.rosuda.pograss.PoGraSS)
this method should be called to ensure that a consistent state while painting. Currently the main goal of this function is to reset the paintLayerCounter.
beginPaint
in class PlotComponent
protected void endPaint(PoGraSS p)
paintPoGraSS(org.rosuda.pograss.PoGraSS)
is called directly this method should not be ommitted.
endPaint
in class PlotComponent
public void forcedFlush()
public java.lang.Object run(java.lang.Object o, java.lang.String cmd)
super.run(o,cmd)
to retain this functionality
run
in interface Commander
o
- origin of the commandcmd
- command string
public void Notifying(NotifyMsg msg, java.lang.Object o, java.util.Vector path)
Dependent
SMarker
and Axis
use this method of notification.
There's no generic class for implemention the notification-list yet.
Notifying
in interface Dependent
o
- Object that sent the notification. The actual content is implementation-dependent.path
- This parameter is null for non-cascaded notify - in that case further calls to NotifyAll are not allowed. Otherwise it contains a Vector with all objects notified so far during cascaded notify. To aviod cyclic notifications every instance must either reject cascaded notifications (i.e. no calls to NotifyAll at all) or check for occurence of itself in the chain before calling NotifyAll.
The only valid recursive calls in Notifying are NotifyAll(path) and NotifyAll(..,path), because only these two pass the "path" parameter to avoid cyclic loops.
public void setOption(java.lang.String variable, boolean value)
public void setOption(java.lang.String variable, int value)
public void setOption(java.lang.String variable, int[] values)
public void setOption(java.lang.String variable, double[] values)
public void setOption(java.lang.String variable, double value)
public void setOption(java.lang.String variable, java.lang.String value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |