|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.kzoo.grid.display.ScaledDisplay
Grid Display Package:
This abstract class provides common implementation code for
drawing a GridObject
object. The class will translate and
scale the graphics system as needed and then invoke its
abstract draw
method. Subclasses of this abstract class
define draw
to just display an object with a fixed size.
Constructor Summary | |
ScaledDisplay()
|
Method Summary | |
void |
addDecorator(DisplayDecorator d)
Add a Decorator to the display in order to add some functionality. |
void |
adjust(GridObject obj,
java.awt.Component comp,
java.awt.Graphics2D g2)
Adjusts the graphics system for drawing an object, as appropriate. |
abstract void |
draw(GridObject obj,
java.awt.Component comp,
java.awt.Graphics2D g2)
Draw the given GridObject object. |
void |
draw(GridObject obj,
java.awt.Component comp,
java.awt.Graphics2D g2,
java.awt.Rectangle rect)
Draw the given object. |
void |
removeDecorator(DisplayDecorator d)
Remove a Decorator from the display |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ScaledDisplay()
Method Detail |
public abstract void draw(GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
obj
- object we want to drawcomp
- component on which to drawg2
- drawing surfacepublic void draw(GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2, java.awt.Rectangle rect)
draw
in interface GridObjectDisplay
obj
- object we want to drawcomp
- component on which to drawg2
- drawing surfacerect
- rectangle in which to drawpublic void addDecorator(DisplayDecorator d)
d
- The decorator to addpublic void removeDecorator(DisplayDecorator d)
d
- The decorator to removepublic void adjust(GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |