de.tabacha.cgo.gui
Class CgoRootPane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JRootPane
                  extended byde.tabacha.cgo.gui.CgoRootPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, Constants, java.util.EventListener, GameListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class CgoRootPane
extends javax.swing.JRootPane
implements Constants, GameListener, java.awt.event.ActionListener

Root pane for conwaygo with menu bar, board, etc.
$Id: CgoRootPane.java,v 1.35 2004/12/23 21:42:44 mk Exp $

Version:
$Revision: 1.35 $
See Also:
Serialized Form
Threadsafe?
false except for the methods that implements GameListener, for these methods are called by another thread than the awt event queue.

Nested Class Summary
 
Nested classes inherited from class javax.swing.JRootPane
javax.swing.JRootPane.AccessibleJRootPane, javax.swing.JRootPane.RootLayout
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Fields inherited from class javax.swing.JRootPane
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, defaultPressAction, defaultReleaseAction, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, glassPane, INFORMATION_DIALOG, layeredPane, menuBar, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOG
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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 de.tabacha.cgo.Constants
BALL, COL_COUNT, DCOL, DOWN, DROW, E, EMPTY, FIRST_DIRECTION, KICK_OFF_FIELD, LAST_DIRECTION, N, NE, NW, OPPOSITE, PIECE, ROW_COUNT, S, SE, SW, UP, UPSIDEDOWN, W
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CgoRootPane()
          Constructor.
CgoRootPane(boolean applet)
          Constructor.
 
Method Summary
 void abortGame()
          Aborts the game.
 void actionPerformed(java.awt.event.ActionEvent ae)
          Listen to menu item selections (except for engine selections).
 void gameAborted(GameEvent e)
          Signals that the game has been aborted.
 void gameEnded(GameEvent e)
          Signals that the game is over.
 void gameStarted(GameEvent e)
          Signals that a game has been started.
 BackgroundGame getGame()
          Returns the model of this delegate.
 void hasMoved(GameEvent e)
          Signals that a move has been done.
 void playerChanged(GameEvent e)
          Signals that one of the players has changed.
 void quit()
          Closes conwaygo by disposing/destroying the parent.
protected  void renewStatusText()
          Writes appropriate text in the status line at the bottom.
 void setStatusText(java.lang.String text)
          Sets the text to show in the status line.
 void showAbout()
          Shows a small dialog window with version information.
 void showEngineInfo(Engine engine)
          Displays an window with information about an engine.
 void showGUIOptions()
          Shows the dialog to configure the GUI.
 void showHelp(java.lang.String basename, java.lang.String suffix)
          Displays a help resource in a separate frame.
 void startGame()
          Starts game play.
 
Methods inherited from class javax.swing.JRootPane
addImpl, addNotify, createContentPane, createGlassPane, createLayeredPane, createRootLayout, getAccessibleContext, getContentPane, getDefaultButton, getGlassPane, getJMenuBar, getLayeredPane, getMenuBar, getUI, getUIClassID, getWindowDecorationStyle, isOptimizedDrawingEnabled, isValidateRoot, paramString, removeNotify, setContentPane, setDefaultButton, setGlassPane, setJMenuBar, setLayeredPane, setMenuBar, setUI, setWindowDecorationStyle, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CgoRootPane

public CgoRootPane()
Constructor.


CgoRootPane

public CgoRootPane(boolean applet)
Constructor.

Parameters:
applet - true when this root pane is part of an applet.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Listen to menu item selections (except for engine selections).

Specified by:
actionPerformed in interface java.awt.event.ActionListener

gameStarted

public void gameStarted(GameEvent e)
Description copied from interface: GameListener
Signals that a game has been started.

Specified by:
gameStarted in interface GameListener
Threadsafe?
true

gameAborted

public void gameAborted(GameEvent e)
Description copied from interface: GameListener
Signals that the game has been aborted.

Specified by:
gameAborted in interface GameListener
Threadsafe?
true

gameEnded

public void gameEnded(GameEvent e)
Description copied from interface: GameListener
Signals that the game is over. (If it has been aborted, this method will not be called.)

Specified by:
gameEnded in interface GameListener
Threadsafe?
true

hasMoved

public void hasMoved(GameEvent e)
Description copied from interface: GameListener
Signals that a move has been done.

Specified by:
hasMoved in interface GameListener
Threadsafe?
true

playerChanged

public void playerChanged(GameEvent e)
Description copied from interface: GameListener
Signals that one of the players has changed. No guarantee that other classes allow a player to be changed during the game.

Specified by:
playerChanged in interface GameListener
Threadsafe?
true

getGame

public BackgroundGame getGame()
Returns the model of this delegate.


setStatusText

public void setStatusText(java.lang.String text)
Sets the text to show in the status line.


renewStatusText

protected void renewStatusText()
Writes appropriate text in the status line at the bottom.


startGame

public void startGame()
Starts game play.


abortGame

public void abortGame()
Aborts the game.


quit

public void quit()
Closes conwaygo by disposing/destroying the parent. Game is aborted beforehand.


showGUIOptions

public void showGUIOptions()
Shows the dialog to configure the GUI.


showAbout

public void showAbout()
Shows a small dialog window with version information.


showEngineInfo

public void showEngineInfo(Engine engine)
Displays an window with information about an engine.


showHelp

public void showHelp(java.lang.String basename,
                     java.lang.String suffix)
Displays a help resource in a separate frame.