|
Game of Life 1.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
org.bitstorm.gameoflife.GameOfLifeControls
GUI-controls of the Game of Life. It contains controls like Shape, zoom and speed selector, next and start/stop-button. It is a seperate class, so it can be replaced by another implementation for e.g. mobile phones or PDA's. Communicates via the GameOfLifeControlsListener.
| Nested Class Summary |
| Nested classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
static java.lang.String |
BIG
|
static java.lang.String |
FAST
|
private java.awt.Label |
genLabel
|
private java.lang.String |
genLabelText
|
static java.lang.String |
HYPER
|
private java.util.Vector |
listeners
|
static java.lang.String |
MEDIUM
|
private java.awt.Button |
nextButton
|
private java.lang.String |
nextLabelText
|
private java.awt.Choice |
shapesChoice
|
static int |
SIZE_BIG
|
static int |
SIZE_MEDIUM
|
static int |
SIZE_SMALL
|
static java.lang.String |
SLOW
|
static java.lang.String |
SMALL
|
private java.lang.String |
startLabelText
|
private java.awt.Button |
startstopButton
|
private java.lang.String |
stopLabelText
|
private java.awt.Choice |
zoomChoice
|
| Fields inherited from class java.awt.Panel |
|
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
GameOfLifeControls()
Contructs the controls. |
|
| Method Summary | |
void |
addGameOfLifeControlsListener(GameOfLifeControlsListener listener)
Add listener for this control |
void |
nextButtonClicked()
Called when the next-button is clicked. |
void |
removeGameOfLifeControlsListener(GameOfLifeControlsListener listener)
Remove listener from this control |
void |
setGeneration(int generations)
Set the number of generations in the control bar. |
void |
setZoom(java.lang.String n)
Called when a new cell size from the zoom pull down is selected. |
void |
shapeSelected(java.lang.String shapeName)
Called when a new shape from the shape pull down is selected. |
void |
speedChanged(int speed)
Called when a new speed from the speed pull down is selected. |
void |
start()
Start-button is activated. |
void |
startStopButtonClicked()
Called when the start/stop-button is clicked. |
void |
stop()
Stop-button is activated. |
void |
zoomChanged(int zoom)
Called when a new zoom from the zoom pull down is selected. |
| Methods inherited from class java.awt.Panel |
addNotify, getAccessibleContext |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.awt.Label genLabel
private final java.lang.String genLabelText
private final java.lang.String nextLabelText
private final java.lang.String startLabelText
private final java.lang.String stopLabelText
public static final java.lang.String SLOW
public static final java.lang.String FAST
public static final java.lang.String HYPER
public static final java.lang.String BIG
public static final java.lang.String MEDIUM
public static final java.lang.String SMALL
public static final int SIZE_BIG
public static final int SIZE_MEDIUM
public static final int SIZE_SMALL
private java.awt.Button startstopButton
private java.awt.Button nextButton
private java.util.Vector listeners
private java.awt.Choice shapesChoice
private java.awt.Choice zoomChoice
| Constructor Detail |
public GameOfLifeControls()
| Method Detail |
public void addGameOfLifeControlsListener(GameOfLifeControlsListener listener)
listener - Listener objectpublic void removeGameOfLifeControlsListener(GameOfLifeControlsListener listener)
listener - Listener objectpublic void setGeneration(int generations)
generations - number of generationspublic void start()
public void stop()
public void startStopButtonClicked()
public void nextButtonClicked()
public void speedChanged(int speed)
public void zoomChanged(int zoom)
public void shapeSelected(java.lang.String shapeName)
public void setZoom(java.lang.String n)
|
Game of Life 1.5 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This API descibes the Game of Life program, written by Edwin Martin. The source code is available online too.
Copyright 1996-2004 Edwin Martin <edwin@bitstorm.org>.