org.rosuda.javaGD
Class JavaGD

java.lang.Object
  extended by org.rosuda.javaGD.GDInterface
      extended by org.rosuda.javaGD.JavaGD
All Implemented Interfaces:
java.awt.event.WindowListener, java.util.EventListener

public class JavaGD
extends GDInterface
implements java.awt.event.WindowListener

JavaGD is an implementation of the GDInterface protocol which displays the R graphics in an AWT window (via GDCanvas). It can be used as an example gfor implementing custom display classes which can then be used by JavaGD. Three sample back-ends are included in the JavaGD sources: GDCanvas (AWT), JGDPanel (Swing) and JGDBufferedPanel (Swing with cached update).


Field Summary
 java.awt.Frame f
          frame containing the graphics canvas
 
Fields inherited from class org.rosuda.javaGD.GDInterface
active, c, holding, ls, open
 
Constructor Summary
JavaGD()
          default, public constructor - creates a new JavaGD instance.
 
Method Summary
 void gdActivate()
          the device became active (current)
 void gdClose()
          close the display
 void gdDeactivate()
          the device became inactive (i.e. another device is now current)
 void gdNewPage(int devNr)
          create a new, blank page
 void gdOpen(double w, double h)
          creates a new graphics window containing a canvas
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          listener response to "Close" - effectively invokes dev.off() on the device
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class org.rosuda.javaGD.GDInterface
executeDevOff, gdCircle, gdClip, gdcSetColor, gdcSetFill, gdcSetFont, gdcSetLine, gdFlush, gdHold, gdLine, gdLocator, gdMetricInfo, gdMode, gdNewPage, gdPath, gdPolygon, gdPolyline, gdRaster, gdRect, gdSize, gdStrWidth, gdText, getDeviceNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f

public java.awt.Frame f
frame containing the graphics canvas

Constructor Detail

JavaGD

public JavaGD()
default, public constructor - creates a new JavaGD instance. The actual window (and canvas) is not created until gdOpen(double, double) is called.

Method Detail

gdOpen

public void gdOpen(double w,
                   double h)
creates a new graphics window containing a canvas

Overrides:
gdOpen in class GDInterface
Parameters:
w - width of the canvas
h - height of the canvas

gdActivate

public void gdActivate()
Description copied from class: GDInterface
the device became active (current)

Overrides:
gdActivate in class GDInterface

gdClose

public void gdClose()
Description copied from class: GDInterface
close the display

Overrides:
gdClose in class GDInterface

gdDeactivate

public void gdDeactivate()
Description copied from class: GDInterface
the device became inactive (i.e. another device is now current)

Overrides:
gdDeactivate in class GDInterface

gdNewPage

public void gdNewPage(int devNr)
Description copied from class: GDInterface
create a new, blank page

Overrides:
gdNewPage in class GDInterface
Parameters:
devNr - device number assigned to this device by R

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
listener response to "Close" - effectively invokes dev.off() on the device

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener