Class Decoder

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----Decoder

public class Decoder
extends Applet
implements DecoderConstants
The starting class of the Decoder applet, a variant of the popular game Mastermind. This class performs initialization and captures button clicks, but does not do much else.

See Also:
DimpleCanvas, MarbleCanvas

Constructor Index

 o Decoder()

Method Index

 o action(Event, Object)
Detects whether either button was pressed.
 o init()
 o paint(Graphics)
Due to the nature of the game, this paint function is rarely called except in the very beginning; most of the updating occurs in the canvases that make up individual components.
 o update(Graphics)
Repaints without clearing.

Constructors

 o Decoder
 public Decoder()

Methods

 o init
 public void init()
Overrides:
init in class Applet
 o paint
 public void paint(Graphics g)
Due to the nature of the game, this paint function is rarely called except in the very beginning; most of the updating occurs in the canvases that make up individual components. Therefore this has no double buffering, and some of the code -- resizing the buttons, for example -- is inefficient for the sake of an elegant effect.

Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Repaints without clearing.

Overrides:
update in class Component
 o action
 public boolean action(Event e,
                       Object o)
Detects whether either button was pressed.

Overrides:
action in class Component