|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uchicago.src.sim.gui.Painter
Abstract class for local and remote painting objects that do the actual work of getting Displayables to paint themselves. Used by DisplaySurface.
LocalPainter| Field Summary | |
protected Color |
bgColor
|
protected BufferedImage |
buffImage
|
protected ArrayList |
displayables
|
protected Graphics2D |
g2
|
protected int |
height
|
protected float |
origHeight
|
protected float |
origWidth
|
protected SimGraphics |
simGraphics
|
protected DisplaySurface |
surface
|
protected Toolkit |
toolkit
|
protected int |
width
|
| Constructor Summary | |
Painter()
Creates a Painter. |
|
Painter(DisplaySurface s,
int w,
int h)
Creates a Painter using the specified displaySurface, and with the specified width and height. |
|
| Method Summary | |
void |
addDisplayable(Displayable d)
Adds a Displayable to the list of displayables to be displayed. |
protected void |
createBufferedImage()
Creates a BufferedImage for use by sub class painters. |
protected void |
createGraphics2D()
Creates and sets the drawing context. |
void |
dispose()
Disposes of the graphics object |
abstract void |
drawRect(Graphics g,
int left,
int top,
int width,
int height)
|
abstract void |
eraseRect(Graphics g)
|
void |
finalize()
|
Image |
getCurrentImage()
Gets the current BufferedImage |
Graphics2D |
getGraphics()
Gets the graphics context on which to draw. |
void |
init(DisplaySurface s,
int w,
int h)
Associates this Painter with the specified DisplaySurface and initializes the width and height. |
abstract void |
paint(Graphics g)
Paints the displayables. |
protected void |
paintBackground()
Paints the background to the currently specified color. |
void |
removeDisplayable(Displayable d)
Removes a Displayable to the list of displayables to be displayed. |
void |
reSize(int newWidth,
int newHeight)
Resizes the buffered image on which all drawing is done to the specified newWidth and height |
void |
setBackgroundColor(Color c)
Sets the background color. |
abstract void |
takeSnapshot(DataOutputStream os)
Takes a snapshot of the current screen image. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected DisplaySurface surface
protected BufferedImage buffImage
protected Graphics2D g2
protected int width
protected int height
protected float origWidth
protected float origHeight
protected ArrayList displayables
protected SimGraphics simGraphics
protected Toolkit toolkit
protected Color bgColor
| Constructor Detail |
public Painter()
public Painter(DisplaySurface s,
int w,
int h)
s - the displaySurface associated with this Painterw - the width of the painterh - the height of the painter| Method Detail |
public void init(DisplaySurface s,
int w,
int h)
s - the displaySurface associated with this Painterw - the width of the painterh - the height of the painterprotected void createBufferedImage()
public void reSize(int newWidth,
int newHeight)
newWidth - the newWidth of the new buffered imagenewHeight - the height of the new buffered imageprotected void createGraphics2D()
public void addDisplayable(Displayable d)
d - the displayable to addpublic void removeDisplayable(Displayable d)
d - the displayable to removepublic Graphics2D getGraphics()
public abstract void paint(Graphics g)
public abstract void drawRect(Graphics g,
int left,
int top,
int width,
int height)
public abstract void eraseRect(Graphics g)
public void finalize()
finalize in class Objectpublic void dispose()
public void setBackgroundColor(Color c)
protected void paintBackground()
public abstract void takeSnapshot(DataOutputStream os)
public Image getCurrentImage()
|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||