edu.kzoo.grid.display
Class RotatedDisplay
java.lang.Object
|
+--edu.kzoo.grid.display.ScaledDisplay
|
+--edu.kzoo.grid.display.RotatedDisplay
- All Implemented Interfaces:
- GridObjectDisplay
- public abstract class RotatedDisplay
- extends ScaledDisplay
Grid Display Package:
This abstract class provides common implementation code for
drawing a grid object. The class will translate, scale, and
rotate 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.
- Version:
- 13 December 2003
- Author:
- Alyce Brady (based on AbstractFishDisplay by Julie Zelenski)
Method Summary |
void |
adjust(GridObject obj,
java.awt.Component comp,
java.awt.Graphics2D g2)
Adjusts the graphics system for drawing a rotated object. |
static int |
adjustForDirection(GridObject obj,
java.awt.Graphics2D g2)
Adjusts the graphics system for drawing an object with direction. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RotatedDisplay
public RotatedDisplay()
adjust
public void adjust(GridObject obj,
java.awt.Component comp,
java.awt.Graphics2D g2)
- Adjusts the graphics system for drawing a rotated object.
(Precondition:
obj
has a direction
method.)
- Overrides:
adjust
in class ScaledDisplay
adjustForDirection
public static int adjustForDirection(GridObject obj,
java.awt.Graphics2D g2)
- Adjusts the graphics system for drawing an object with direction.
(Precondition:
obj
has a direction
method.)
- Parameters:
obj
- object we want to drawg2
- drawing surface