edu.kzoo.grid.display
Class ScaledImageTintDecorator

java.lang.Object
  |
  +--edu.kzoo.grid.display.ScaledImageTintDecorator
All Implemented Interfaces:
DisplayDecorator

public class ScaledImageTintDecorator
extends java.lang.Object
implements DisplayDecorator

Grid Display Package:
A tinting decorator for a ScaledImageDisplay. The associated object must have a color method. (Precondition: the GridObjectDisplay object to which this decorator is applied must be a ScaledImageDisplay and the grid objects it displays must have a color method.)

Version:
28 July 2004
Author:
Joel Booth

Constructor Summary
ScaledImageTintDecorator()
           
 
Method Summary
 void decorate(GridObjectDisplay disp, GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
          Decorate the ScaledImageDisplay so that it appears tinted.
 void tint(ScaledImageDisplay imageDisplay, GridObject obj, java.awt.Component comp, java.awt.Graphics2D g2)
          Adjusts the graphics system to use an object's color to tint an image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaledImageTintDecorator

public ScaledImageTintDecorator()
Method Detail

decorate

public void decorate(GridObjectDisplay disp,
                     GridObject obj,
                     java.awt.Component comp,
                     java.awt.Graphics2D g2)
Decorate the ScaledImageDisplay so that it appears tinted.

Specified by:
decorate in interface DisplayDecorator

tint

public void tint(ScaledImageDisplay imageDisplay,
                 GridObject obj,
                 java.awt.Component comp,
                 java.awt.Graphics2D g2)
Adjusts the graphics system to use an object's color to tint an image. (Precondition: obj has a color method.)

Parameters:
obj - object we want to draw
comp - the component we're drawing on
g2 - drawing surface