Class DoorCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----ImageCanvas
                           |
                           +----DoorCanvas

public class DoorCanvas
extends ImageCanvas

DoorCanvas adapts ImageCanvas for LetsMakeADealApplet. It stores the various door Images and maintains state.


Constructor Index

 o DoorCanvas()
Provided for convenience only.
 o DoorCanvas(ImageCanvasEventHandler, Image, Image, Image)
Creates a DoorCanvas.

Method Index

 o isBad()
Is this door the booby prize?
 o setBad()
Sets the DoorCanvas to the revealed booby prize state
 o setSelected()
Sets the DoorCanvas to the selected state
 o setUnselected()
Sets the DoorCanvas to the unselected state

Constructors

 o DoorCanvas
 public DoorCanvas()
Provided for convenience only. DoorCanvas should be initialized by calling a constructor with parameters.

 o DoorCanvas
 public DoorCanvas(ImageCanvasEventHandler handler,
                   Image unselected,
                   Image selected,
                   Image bad)
Creates a DoorCanvas.

Parameters:
handler - a callback that handles events from this object
unselected - unselected door Image
selected - selected door Image
bad - booby prize door Image

Methods

 o setUnselected
 public void setUnselected()
Sets the DoorCanvas to the unselected state

 o setSelected
 public void setSelected()
Sets the DoorCanvas to the selected state

 o setBad
 public void setBad()
Sets the DoorCanvas to the revealed booby prize state

 o isBad
 public boolean isBad()
Is this door the booby prize?