edu.kzoo.grid.display
Class PictureBlockDisplay

java.lang.Object
  |
  +--edu.kzoo.grid.display.ScaledDisplay
        |
        +--edu.kzoo.grid.display.ScaledImageDisplay
              |
              +--edu.kzoo.grid.display.PictureBlockDisplay
All Implemented Interfaces:
GridObjectDisplay

public class PictureBlockDisplay
extends ScaledImageDisplay

Grid Display Package:
A PictureBlockDisplay object displays a PictureBlock object, or any object with a pictureIcon method, as a picture in a grid.

Version:
10 November 2004
Author:
Alyce Brady

Constructor Summary
PictureBlockDisplay()
          Constructs a display object that can display grid objects that have a pictureIcon method.
 
Method Summary
 void draw(GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
          Draws a unit-length object using an image.
 
Methods inherited from class edu.kzoo.grid.display.ScaledImageDisplay
getIcon, imageLoadedOK, setIcon
 
Methods inherited from class edu.kzoo.grid.display.ScaledDisplay
addDecorator, adjust, draw, removeDecorator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PictureBlockDisplay

public PictureBlockDisplay()
Constructs a display object that can display grid objects that have a pictureIcon method.

Method Detail

draw

public void draw(GridObject obj,
                 java.awt.Component comp,
                 java.awt.Graphics2D g2)
Draws a unit-length object using an image. This implementation draws the object by scaling the image provided to the constructor. It calls the adjust method to make further adjustments (for example, rotating and tinting the image) as appropriate. (Precondition: obj has a pictureIcon method.)

Overrides:
draw in class ScaledImageDisplay
Parameters:
obj - object we want to draw
comp - component on which to draw
g2 - drawing surface