All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class life.LifeDisplay

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

public class LifeDisplay
extends Applet
A LifeDisplay object displays a Life object.


Variable Index

 o backgroundColorChoice
 o cellColorChoice
 o delaySlider
 o drawButton
 o drawModeGroup
 o eraseButton
 o fComponentsAdjusted
 o generationLabel
 o gridDisplay
The GridDisplay used to display this LifeDisplay.
 o gridSizeChoice
 o label1
 o label2
 o label3
 o label4
 o label5
 o label6
 o label7
 o label8
 o randomizeButton
 o resetButton
 o shadesChoice
 o skipFrames
Should frames be skipped to maintain a constant frame display rate?
 o skipFramesCheckbox
 o startButton
 o stepButton
 o stopButton
 o theLife
The Life displayed by this LifeDisplay.
 o wraparoundCheckbox

Constructor Index

 o LifeDisplay()

Method Index

 o addNotify()
 o backgroundColorChoice_ItemStateChanged(ItemEvent)
Respond to Background Color selection.
 o cellColorChoice_ItemStateChanged(ItemEvent)
Respond to Cell Color selection.
 o delaySlider_actionPerformed(ActionEvent)
Respond to movement of Delay slider.
 o drawModeGroup_itemStateChanged(ItemEvent)
Respond to Draw Mode selection.
 o gridSizeChoice_ItemStateChanged(ItemEvent)
Respond to Grid Size selection.
 o init()
Initialize the applet.
 o paint(Graphics)
Paint method.
 o paintGridDisplay(boolean)
Display the Life.
 o randomizeButton_Action(ActionEvent)
Respond to Randomize button press.
 o resetButton_Action(ActionEvent)
Respond to Reset button press.
 o shadesChoice_ItemStateChanged(ItemEvent)
Respond to Shades selection.
 o skipFramesCheckbox_ItemStateChanged(ItemEvent)
Respond to Skip Frames button press.
 o startButton_Action(ActionEvent)
Respond to Start button press.
 o stepButton_Action(ActionEvent)
Respond to Step button press.
 o stop()
Stop the applet.
 o stopButton_Action(ActionEvent)
Respond to Stop button press.
 o stringToColor(String)
Convert a color's name to a Color.
 o update(Graphics)
Update method.
 o wraparoundCheckBox_ItemStateChanged(ItemEvent)
Respond to Wraparound button press.

Variables

 o theLife
 Life theLife
The Life displayed by this LifeDisplay.

 o gridDisplay
 GridDisplay gridDisplay
The GridDisplay used to display this LifeDisplay.

 o skipFrames
 boolean skipFrames
Should frames be skipped to maintain a constant frame display rate?

 o fComponentsAdjusted
 boolean fComponentsAdjusted
 o startButton
 Button startButton
 o stepButton
 Button stepButton
 o stopButton
 Button stopButton
 o delaySlider
 HorizontalSlider delaySlider
 o label1
 Label label1
 o cellColorChoice
 Choice cellColorChoice
 o label2
 Label label2
 o backgroundColorChoice
 Choice backgroundColorChoice
 o shadesChoice
 Choice shadesChoice
 o label3
 Label label3
 o wraparoundCheckbox
 Checkbox wraparoundCheckbox
 o label4
 Label label4
 o label5
 Label label5
 o gridSizeChoice
 Choice gridSizeChoice
 o drawModeGroup
 RadioButtonGroupPanel drawModeGroup
 o drawButton
 Checkbox drawButton
 o eraseButton
 Checkbox eraseButton
 o label6
 Label label6
 o label7
 Label label7
 o randomizeButton
 Button randomizeButton
 o resetButton
 Button resetButton
 o generationLabel
 Label generationLabel
 o label8
 Label label8
 o skipFramesCheckbox
 Checkbox skipFramesCheckbox

Constructors

 o LifeDisplay
 public LifeDisplay()

Methods

 o init
 public void init()
Initialize the applet.

Overrides:
init in class Applet
 o stop
 public void stop()
Stop the applet.

Overrides:
stop in class Applet
 o paintGridDisplay
 void paintGridDisplay(boolean paintAll)
Display the Life.

Parameters:
paintAll - True if all Cells should be painted, false if only those which have changed since the last generation should be painted.
 o paint
 public void paint(Graphics g)
Paint method.

Parameters:
g - Graphics context.
Overrides:
paint in class Container
 o update
 public void update(Graphics g)
Update method.

Parameters:
g - Graphics context.
Overrides:
update in class Container
 o addNotify
 public void addNotify()
Overrides:
addNotify in class Panel
 o startButton_Action
 void startButton_Action(ActionEvent event)
Respond to Start button press.

 o stopButton_Action
 void stopButton_Action(ActionEvent event)
Respond to Stop button press.

 o delaySlider_actionPerformed
 void delaySlider_actionPerformed(ActionEvent event)
Respond to movement of Delay slider.

 o resetButton_Action
 void resetButton_Action(ActionEvent event)
Respond to Reset button press.

 o randomizeButton_Action
 void randomizeButton_Action(ActionEvent event)
Respond to Randomize button press.

 o stringToColor
 Color stringToColor(String c)
Convert a color's name to a Color.

Parameters:
c - The name of the color.
 o cellColorChoice_ItemStateChanged
 void cellColorChoice_ItemStateChanged(ItemEvent event)
Respond to Cell Color selection.

 o backgroundColorChoice_ItemStateChanged
 void backgroundColorChoice_ItemStateChanged(ItemEvent event)
Respond to Background Color selection.

 o gridSizeChoice_ItemStateChanged
 void gridSizeChoice_ItemStateChanged(ItemEvent event)
Respond to Grid Size selection.

 o stepButton_Action
 void stepButton_Action(ActionEvent event)
Respond to Step button press.

 o skipFramesCheckbox_ItemStateChanged
 void skipFramesCheckbox_ItemStateChanged(ItemEvent event)
Respond to Skip Frames button press.

 o wraparoundCheckBox_ItemStateChanged
 void wraparoundCheckBox_ItemStateChanged(ItemEvent event)
Respond to Wraparound button press.

 o shadesChoice_ItemStateChanged
 void shadesChoice_ItemStateChanged(ItemEvent event)
Respond to Shades selection.

 o drawModeGroup_itemStateChanged
 void drawModeGroup_itemStateChanged(ItemEvent event)
Respond to Draw Mode selection.


All Packages  Class Hierarchy  This Package  Previous  Next  Index