All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class taxman.ChoiceTable

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----taxman.GameTable
                                   |
                                   +----taxman.ChoiceTable

public class ChoiceTable
extends GameTable
This is the central choosing grid. It can handle mouse clicks and report them back to the Game control


Constructor Index

 o ChoiceTable(Color, Image, Game)
The constructor takes many parameters and builds up a table which can respond to user clicks.

Method Index

 o gameUpdate(Board, Minimax, int)
The standard update method from GameUpdate This one handles NEW_GAME, HUMAN_MOVE, CPU_MOVE, CPU_CHOSE, HUMAN_CHOSE.
 o mouseUp(Event, int, int)
Again, using the old event model.

Constructors

 o ChoiceTable
 public ChoiceTable(Color num_color,
                    Image backGround,
                    Game g)
The constructor takes many parameters and builds up a table which can respond to user clicks. The response is sent to the Controlling game object that is passed in.

Parameters:
num_color - The color of the numbers that are displayed
backGround - The background image for the number (can be null)
g - The game control object which can recieve numberChosen messages

Methods

 o gameUpdate
 public void gameUpdate(Board b,
                        Minimax m,
                        int flags)
The standard update method from GameUpdate This one handles NEW_GAME, HUMAN_MOVE, CPU_MOVE, CPU_CHOSE, HUMAN_CHOSE.

Parameters:
b - The current game board
m - The current minimax object
flags - Indicator of current state
Overrides:
gameUpdate in class GameTable
 o mouseUp
 public boolean mouseUp(Event evt,
                        int x,
                        int y)
Again, using the old event model. We use mouse up events to capture selection of numbers in the grid.

Parameters:
evt - the mouse event
x - the x location of the mouse
y - the y location of the mouse
Returns:
true to allow event propogation
Overrides:
mouseUp in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index