org.jscience.computing.game.chess
Class JChess

java.lang.Object
  extended by org.jscience.computing.game.JDefaultGame
      extended by org.jscience.computing.game.chess.JChess
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, JGamePlay

public class JChess
extends JDefaultGame
implements java.awt.event.ActionListener

Implements the GUI wrapper around ChessGame to use with JGameFrame. This class features easy customization of the appearance of the chess figures with a call to the method setGraphics (ChessGraphics icons).

See Also:
JGameFrame

Field Summary
 
Fields inherited from class org.jscience.computing.game.JDefaultGame
filter, frame, play
 
Fields inherited from interface org.jscience.computing.game.JGamePlay
gameFrameX, gameFrameY, historyFrameX, historyFrameY, legalMovesFrameX, legalMovesFrameY, prototypeCellValue, redoFrameX, redoFrameY, windowHeight, windowLocationX, windowLocationY, windowWidth
 
Constructor Summary
JChess()
          Creates a new JChess object.
JChess(ChessGame game, Player player1, Player player2, int level)
          Creates a new JChess object.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          DOCUMENT ME!
 java.awt.Container getContainer(GameGUI frame)
          DOCUMENT ME!
 java.awt.Container getHelp()
          DOCUMENT ME!
 javax.swing.JMenu getMenu()
          DOCUMENT ME!
 JGamePlay getNewGame()
          DOCUMENT ME!
 java.lang.String getStatusMessage()
          DOCUMENT ME!
 java.lang.String getTitle()
          DOCUMENT ME!
 void setGraphics(ChessGraphics icons)
          This method allows to customize the images used for displaying the chess board.
 void setStandardGraphics()
           
 
Methods inherited from class org.jscience.computing.game.JDefaultGame
getAutoPlay, getDefaultFileExtension, getFileFilter, setFileFilter, setGame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JChess

public JChess()
Creates a new JChess object.


JChess

public JChess(ChessGame game,
              Player player1,
              Player player2,
              int level)
Creates a new JChess object.

Parameters:
game - DOCUMENT ME!
player1 - DOCUMENT ME!
player2 - DOCUMENT ME!
level - DOCUMENT ME!
Method Detail

getMenu

public javax.swing.JMenu getMenu()
DOCUMENT ME!

Specified by:
getMenu in interface JGamePlay
Overrides:
getMenu in class JDefaultGame
Returns:
DOCUMENT ME!

setStandardGraphics

public void setStandardGraphics()
See Also:
setGraphics(ChessGraphics)

setGraphics

public void setGraphics(ChessGraphics icons)
This method allows to customize the images used for displaying the chess board.

Parameters:
icons - DOCUMENT ME!
See Also:
setStandardGraphics(), ChessGraphics

getNewGame

public JGamePlay getNewGame()
DOCUMENT ME!

Specified by:
getNewGame in interface JGamePlay
Overrides:
getNewGame in class JDefaultGame
Returns:
DOCUMENT ME!

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
DOCUMENT ME!

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - DOCUMENT ME!
Throws:
java.lang.Error - DOCUMENT ME!

getContainer

public java.awt.Container getContainer(GameGUI frame)
DOCUMENT ME!

Specified by:
getContainer in interface JGamePlay
Overrides:
getContainer in class JDefaultGame
Parameters:
frame - DOCUMENT ME!
Returns:
DOCUMENT ME!

getStatusMessage

public java.lang.String getStatusMessage()
DOCUMENT ME!

Specified by:
getStatusMessage in interface JGamePlay
Overrides:
getStatusMessage in class JDefaultGame
Returns:
DOCUMENT ME!

getHelp

public java.awt.Container getHelp()
DOCUMENT ME!

Specified by:
getHelp in interface JGamePlay
Overrides:
getHelp in class JDefaultGame
Returns:
DOCUMENT ME!

getTitle

public java.lang.String getTitle()
DOCUMENT ME!

Specified by:
getTitle in interface JGamePlay
Overrides:
getTitle in class JDefaultGame
Returns:
DOCUMENT ME!
See Also:
GamePlay.getGameName()