Holger's
Java API

com.antelmann.game.chess
Class JChess

java.lang.Object
  extended by com.antelmann.game.JDefaultGame
      extended by com.antelmann.game.chess.JChess
All Implemented Interfaces:
JGamePlay, ActionListener, EventListener

public class JChess
extends JDefaultGame
implements 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).

Author:
Holger Antelmann
See Also:
JGameFrame

Field Summary
 
Fields inherited from class com.antelmann.game.JDefaultGame
filter, frame, play
 
Fields inherited from interface com.antelmann.game.JGamePlay
gameFrameX, gameFrameY, historyFrameX, historyFrameY, legalMovesFrameX, legalMovesFrameY, prototypeCellValue, redoFrameX, redoFrameY, windowHeight, windowLocationX, windowLocationY, windowWidth
 
Constructor Summary
JChess()
           
JChess(ChessGame game, Player player1, Player player2, int level)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 Container getContainer(GameGUI frame)
          takes the toString() function of the GamePlay and turns it into formatted html, which is returned as a JLabel
 Container getHelp()
          returns null if not overridden
 JMenu getMenu()
          returns null if not overridden
 JGamePlay getNewGame()
          depends on a default constructor being accessible for the GamePlay object in question
 String getStatusMessage()
          indicates the number of moves performed, number of legal moves available, and indicates if someone won the game.
 String getTitle()
          returns getGameName() from the GamePlay object
 void setGraphics(ChessGraphics icons)
          This method allows to customize the images used for displaying the chess board.
 void setStandardGraphics()
           
 
Methods inherited from class com.antelmann.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()

JChess

public JChess(ChessGame game,
              Player player1,
              Player player2,
              int level)
Method Detail

getMenu

public JMenu getMenu()
Description copied from class: JDefaultGame
returns null if not overridden

Specified by:
getMenu in interface JGamePlay
Overrides:
getMenu in class JDefaultGame

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.

See Also:
setStandardGraphics(), ChessGraphics

getNewGame

public JGamePlay getNewGame()
Description copied from class: JDefaultGame
depends on a default constructor being accessible for the GamePlay object in question

Specified by:
getNewGame in interface JGamePlay
Overrides:
getNewGame in class JDefaultGame

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

getContainer

public Container getContainer(GameGUI frame)
Description copied from class: JDefaultGame
takes the toString() function of the GamePlay and turns it into formatted html, which is returned as a JLabel

Specified by:
getContainer in interface JGamePlay
Overrides:
getContainer in class JDefaultGame
Parameters:
frame - the object to be used to alter the game status by using the interface

getStatusMessage

public String getStatusMessage()
Description copied from class: JDefaultGame
indicates the number of moves performed, number of legal moves available, and indicates if someone won the game.

Specified by:
getStatusMessage in interface JGamePlay
Overrides:
getStatusMessage in class JDefaultGame

getHelp

public Container getHelp()
Description copied from class: JDefaultGame
returns null if not overridden

Specified by:
getHelp in interface JGamePlay
Overrides:
getHelp in class JDefaultGame

getTitle

public String getTitle()
Description copied from class: JDefaultGame
returns getGameName() from the GamePlay object

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


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads