uchicago.src.sim.gui
Class LocalPainter
java.lang.Object
uchicago.src.sim.gui.Painter
uchicago.src.sim.gui.LocalPainter
public class LocalPainter
- extends Painter
Used by DisplaySurface to do the actual painting of displayables. A
typical user should never use this class directly.
- Version:
- $Revision: 1.8 $ $Date: 2004/11/03 19:50:59 $
- Author:
- Nick Collier
| Fields inherited from class uchicago.src.sim.gui.Painter |
bgColor, buffImage, displayables, g2, height, orderedDisplayables, origHeight, origWidth, simGraphics, surface, toolkit, width |
|
Constructor Summary |
LocalPainter()
Creates a LocalPainter. |
LocalPainter(DisplaySurface s,
int w,
int h)
Creates a LocalPainter using the specified displaySurface, and with
the specified width and height. |
|
Method Summary |
void |
drawRect(java.awt.Graphics g,
int x,
int y,
int rectWidth,
int rectHeight)
|
void |
eraseRect(java.awt.Graphics g)
|
void |
paint(java.awt.Graphics g)
Paints all the displayables on the screen in the order they were
added to the display surface |
void |
takeSnapshot(java.io.DataOutputStream os)
Takes a snapshot of the current screen image and writes it to the
specified output stream |
| Methods inherited from class uchicago.src.sim.gui.Painter |
addDisplayable, addDisplayable, createBufferedImage, createGraphics2D, dispose, finalize, getCurrentImage, getGraphics, init, paintBackground, removeDisplayable, reSize, setBackgroundColor |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
firstDraw
protected boolean firstDraw
origImage
protected java.awt.image.BufferedImage origImage
prevX
protected int prevX
prevY
protected int prevY
prevWidth
protected int prevWidth
prevHeight
protected int prevHeight
eraseBox
protected boolean eraseBox
LocalPainter
public LocalPainter()
- Creates a LocalPainter. Before this LocalPainter can be used
its init method must be called. This will done automatically by
the DisplaySurface if this LocalPainter is an argument to a DisplaySurface's
constructor.
LocalPainter
public LocalPainter(DisplaySurface s,
int w,
int h)
- Creates a LocalPainter using the specified displaySurface, and with
the specified width and height.
- Parameters:
s - the displaySurface associated with this LocalPainterw - the width of the painterh - the height of the painter
eraseRect
public void eraseRect(java.awt.Graphics g)
- Specified by:
eraseRect in class Painter
drawRect
public void drawRect(java.awt.Graphics g,
int x,
int y,
int rectWidth,
int rectHeight)
- Specified by:
drawRect in class Painter
paint
public void paint(java.awt.Graphics g)
- Paints all the displayables on the screen in the order they were
added to the display surface
- Specified by:
paint in class Painter
takeSnapshot
public void takeSnapshot(java.io.DataOutputStream os)
- Takes a snapshot of the current screen image and writes it to the
specified output stream
- Specified by:
takeSnapshot in class Painter
- Parameters:
os - the OutputStream to write the snapshot to