Minnow Project

Class MinnowDisplay

MinnowDisplay

public class MinnowDisplay

Minnow Program:
A MinnowDisplay draws a minnow.

Version:
1 September 2002

Constructor Summary
MinnowDisplay()
          Constructs an object that knows how to draw minnows.
 
Method Summary
 void draw(Locatable obj, java.awt.Component comp, java.awt.Graphics2D g2, java.awt.Rectangle rect)
          Draw the given object.
 void draw(Minnow minnow, java.awt.Component comp, java.awt.Graphics2D g2)
          Draws the given Minnow.
 

Constructor Detail

MinnowDisplay

public MinnowDisplay()
Constructs an object that knows how to draw minnows.
Method Detail

draw

public void draw(Minnow minnow,
                 java.awt.Component comp,
                 java.awt.Graphics2D g2)
Draws the given Minnow. Fills a simple fish with gradient paint using the paths created in the construtor. The Minnow is drawn facing North in a cell of size (1,1) centered around (0,0) on the drawing surface. (All scaling/rotating has been done beforehand).
Parameters:
minnow - minnow we want to draw
comp - component on which to draw
g2 - drawing surface

draw

public void draw(Locatable obj,
                 java.awt.Component comp,
                 java.awt.Graphics2D g2,
                 java.awt.Rectangle rect)
Draw the given object. Scales and rotates the coordinate appropriately then invokes the simple draw method above that is only responsible for drawing a unit-length Minnow facing North. (Precondition: obj is a Minnow.)
Parameters:
obj - object we want to draw
comp - component on which to draw
g2 - drawing surface
rect - rectangle in which to draw

Minnow Project

Copyright© 2002-2003 Alyce Brady