|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.graphics.java2d.Painter
Paints the graphical systems. There are two different general ways to do this: paint in the normal graphics thread of Java; or paint on a buffered image that is then drawn on the screen in this graphics thread. Currently, the first method is used. However, to ensure fast switching and changeability, there are two drawing methods: one that has a graphics object as a parameter, and one that doesn't. This last one does _nothing_ currently. Still, whenever you want to redraw some part of the system, determine its shape and call - in this order - repaintSystem() and updateScreen(). At least, that's the _normal_ way of doing it ;-) All important methods are synchronized; this prevents e.g. the clipping shape from being changed while the painting is still in progress.
Constructor Summary | |
Painter(GraphicHolder graphicHolder)
Constructor. |
Method Summary | |
void |
addClippingShape(Shape shape)
Adds another shape to the clipping shape. |
protected void |
clearBackground()
Clears the background of the system. |
protected void |
clearBackground(Graphics2D graphics)
Clears the background of the system, using a specified graphics object |
protected void |
drawGraphicalSystem()
Draws the graphical system. |
protected void |
drawGraphicalSystem(Graphics2D graphics)
Draws the graphical system, using a specified graphics object |
Shape |
getClippingShape()
Return the current clipping shape |
void |
repaintSystem()
Repaints the graphical system, using the current clipping shape. |
void |
repaintSystem(Graphics2D graphics)
Repaints the graphical system, using the current clipping shape and the given graphics object. |
void |
setBGColor(Color color)
Sets the background color |
void |
setClippingShape(Shape shape)
Defines the clipping shape. |
void |
updateScreen()
Initiates a repainting of the screen. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Painter(GraphicHolder graphicHolder)
graphicHolder
- the object holding the graphicMethod Detail |
public void setClippingShape(Shape shape)
shape
- the clipping shapepublic void addClippingShape(Shape shape)
shape
- the additional clipping shapepublic Shape getClippingShape()
public void repaintSystem()
public void repaintSystem(Graphics2D graphics)
graphics
- the graphicspublic void setBGColor(Color color)
color
- the colorpublic void updateScreen()
protected void clearBackground()
protected void clearBackground(Graphics2D graphics)
graphics
- the graphicsprotected void drawGraphicalSystem()
protected void drawGraphicalSystem(Graphics2D graphics)
graphics
- the graphics
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |