edu.kzoo.grid
Class ColorBlock

java.lang.Object
  |
  +--edu.kzoo.grid.GridObject
        |
        +--edu.kzoo.grid.ColorBlock

public class ColorBlock
extends GridObject

Grid Container Package:
A ColorBlock object encapsulates a color for a colored cell in a grid.

Version:
13 December 2003
Author:
Alyce Brady
See Also:
Grid, Location

Constructor Summary
ColorBlock(java.awt.Color colorValue)
          Constructs a color block with the specified color.
ColorBlock(java.awt.Color colorValue, Grid grid, Location loc)
          Constructs a color block with the specified color.
 
Method Summary
 java.awt.Color color()
          Gets color value for color block.
 java.lang.String toString()
          Returns a string representation of the color.
 
Methods inherited from class edu.kzoo.grid.GridObject
act, addToGrid, changeLocation, grid, isInAGrid, location, removeFromGrid, theGridObjectInvariantHolds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColorBlock

public ColorBlock(java.awt.Color colorValue)
Constructs a color block with the specified color.

Parameters:
colorValue - the color that fills this color block

ColorBlock

public ColorBlock(java.awt.Color colorValue,
                  Grid grid,
                  Location loc)
Constructs a color block with the specified color.

Parameters:
colorValue - the color that fills this color block
grid - the grid containing this color block
loc - the location of the color block in grid
Method Detail

color

public java.awt.Color color()
Gets color value for color block.


toString

public java.lang.String toString()
Returns a string representation of the color.

Overrides:
toString in class GridObject
Returns:
a string representation of this grid object