org.rosuda.ibase.toolkit
Class SWINGGraphicsDevice

java.lang.Object
  extended by org.rosuda.ibase.toolkit.SWINGGraphicsDevice
All Implemented Interfaces:
GraphicsDevice

public class SWINGGraphicsDevice
extends java.lang.Object
implements GraphicsDevice


Field Summary
 
Fields inherited from interface org.rosuda.ibase.toolkit.GraphicsDevice
AWTGrDevID, JOGLGrDevID, SWINGGrDevID
 
Constructor Summary
SWINGGraphicsDevice()
           
SWINGGraphicsDevice(int _layers)
           
 
Method Summary
 void addKeyListener(java.awt.event.KeyListener l)
           
 void addMouseListener(java.awt.event.MouseListener l)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
           
 java.awt.Rectangle getBounds()
           
 java.awt.Component getComponent()
           
 int getGrDevID()
           
 int getHeight()
           
 java.awt.Point getLocation()
           
 java.awt.Container getParent()
           
 java.awt.Dimension getSize()
           
 int getWidth()
           
 void paint(java.awt.Graphics g)
           
 void paintLayer(java.awt.Graphics g, int layer)
           
 void paintLayer(int layer)
           
 void repaint()
           
 void restoreUpdateRoot()
          restore update root to previous setting. usual procedure is to used following sequence: setUpdateRoot; repaint; restoreUpdateRoot;
 void setBackground(java.awt.Color c)
           
 void setCursor(java.awt.Cursor c)
           
 void setPCOwner(PlotComponent pc)
           
 void setSize(java.awt.Dimension d)
           
 void setSize(int w, int h)
           
 void setToolTipText(java.lang.String s)
           
 void setUpdateRoot(int ur)
          set update root layer, i.e. the first layer that has to be updated via paintLayer(java.awt.Graphics, int).
 void update(java.awt.Graphics g)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SWINGGraphicsDevice

public SWINGGraphicsDevice(int _layers)

SWINGGraphicsDevice

public SWINGGraphicsDevice()
Method Detail

setUpdateRoot

public void setUpdateRoot(int ur)
set update root layer, i.e. the first layer that has to be updated via paintLayer(java.awt.Graphics, int). Note that after resize full repaint of all layers is done but updateRoot is not changed. It is safe (and sensible) to set the update root higher than the last layer; this will cause full repaint only on resize. such behavior is useful when the underlying paint doesn't change except for resizes. common practice is to the update root to # of layers at the end of the paintLayer function and use setUpdateRoot in the remaining program only where content of the painted are has to be explicitely changed. also note that changing update root during the update itself has no effect on the current update.

Specified by:
setUpdateRoot in interface GraphicsDevice
Parameters:
ur - root layer, i.e. the layer to start repaining from

restoreUpdateRoot

public void restoreUpdateRoot()
restore update root to previous setting. usual procedure is to used following sequence: setUpdateRoot; repaint; restoreUpdateRoot;


paintLayer

public void paintLayer(java.awt.Graphics g,
                       int layer)

paintLayer

public void paintLayer(int layer)
Specified by:
paintLayer in interface GraphicsDevice

repaint

public void repaint()
Specified by:
repaint in interface GraphicsDevice

paint

public void paint(java.awt.Graphics g)
Specified by:
paint in interface GraphicsDevice

update

public void update(java.awt.Graphics g)
Specified by:
update in interface GraphicsDevice

setPCOwner

public void setPCOwner(PlotComponent pc)
Specified by:
setPCOwner in interface GraphicsDevice

getGrDevID

public int getGrDevID()
Specified by:
getGrDevID in interface GraphicsDevice

getComponent

public java.awt.Component getComponent()
Specified by:
getComponent in interface GraphicsDevice

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface GraphicsDevice

setSize

public void setSize(int w,
                    int h)
Specified by:
setSize in interface GraphicsDevice

getSize

public java.awt.Dimension getSize()
Specified by:
getSize in interface GraphicsDevice

setBackground

public void setBackground(java.awt.Color c)
Specified by:
setBackground in interface GraphicsDevice

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Specified by:
addMouseListener in interface GraphicsDevice

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Specified by:
addMouseMotionListener in interface GraphicsDevice

addKeyListener

public void addKeyListener(java.awt.event.KeyListener l)
Specified by:
addKeyListener in interface GraphicsDevice

getLocation

public java.awt.Point getLocation()
Specified by:
getLocation in interface GraphicsDevice

setCursor

public void setCursor(java.awt.Cursor c)
Specified by:
setCursor in interface GraphicsDevice

setSize

public void setSize(java.awt.Dimension d)
Specified by:
setSize in interface GraphicsDevice

getWidth

public int getWidth()
Specified by:
getWidth in interface GraphicsDevice

getHeight

public int getHeight()
Specified by:
getHeight in interface GraphicsDevice

getParent

public java.awt.Container getParent()
Specified by:
getParent in interface GraphicsDevice

setToolTipText

public void setToolTipText(java.lang.String s)