public class RotatedDecorator extends java.lang.Object implements DisplayDecorator
RotatedDecoratorwill allow a display to change as the object it is associated with changes direction. The
GridObjectmust have a
directionmethod that returns a
Directionobject in order for the decorator to work.
|Constructor and Description|
Construct a new
|Modifier and Type||Method and Description|
Adjusts the graphics system for drawing an object with direction.
Apply the rotating aspect of the decoration.
public RotatedDecorator(Direction d)
RotatedDecoratorthat can be added to a
d- The origrinal direction the object is facing
public void decorate(GridObjectDisplay sd, GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
public static void adjustForDirection(GridObject obj, java.awt.Graphics2D g2)
obj- object we want to draw
g2- drawing surface