Class GridPlotter

java.lang.Object
  |
  +--GridPlotter
All Implemented Interfaces:
edu.kzoo.grid.gui.GridChangeListener

public class GridPlotter
extends java.lang.Object
implements edu.kzoo.grid.gui.GridChangeListener

Grid Plotter:
The GridPlotter class provides methods for drawing in a grid by placing color blocks in its cells. Each drawing method should take zero arguments, should have a void return type, and should have a name that conforms to the on...ButtonClick format. (This restriction allows the GridPlotterGUI to recognize drawing methods, for which it automatically generates buttons.)

Version:
Appropriate Date
Author:
Your Name (based on a template provided by Alyce Brady)

Constructor Summary
GridPlotter(GridPlotterGUI disp, edu.kzoo.grid.gui.nuggets.ColorChoiceMenu colorChooser)
          Constructs an object that could draw in a grid.
 
Method Summary
 void onClearGridButtonClick()
          Removes all objects from the grid.
 void onColMajorFillButtonClick()
          Fills in all the cells of the grid using a column-major traversal.
 void onRowMajorFillButtonClick()
          Fills in all the cells of the grid using a row-major traversal.
 void reactToNewGrid(edu.kzoo.grid.Grid grid)
          Sets the grid in which to draw.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridPlotter

public GridPlotter(GridPlotterGUI disp,
                   edu.kzoo.grid.gui.nuggets.ColorChoiceMenu colorChooser)
Constructs an object that could draw in a grid.

Parameters:
disp - an object that knows how to display a grid
colorChooser - a menu for choosing the color block color
Method Detail

reactToNewGrid

public void reactToNewGrid(edu.kzoo.grid.Grid grid)
Sets the grid in which to draw.

Specified by:
reactToNewGrid in interface edu.kzoo.grid.gui.GridChangeListener

onClearGridButtonClick

public void onClearGridButtonClick()
Removes all objects from the grid.


onRowMajorFillButtonClick

public void onRowMajorFillButtonClick()
Fills in all the cells of the grid using a row-major traversal.


onColMajorFillButtonClick

public void onColMajorFillButtonClick()
Fills in all the cells of the grid using a column-major traversal.