|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.game.JDefaultGame
com.antelmann.game.chess.JChess
public class JChess
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).
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 |
|---|
public JChess()
public JChess(ChessGame game,
Player player1,
Player player2,
int level)
| Method Detail |
|---|
public JMenu getMenu()
JDefaultGame
getMenu in interface JGamePlaygetMenu in class JDefaultGamepublic void setStandardGraphics()
setGraphics(ChessGraphics)public void setGraphics(ChessGraphics icons)
setStandardGraphics(),
ChessGraphicspublic JGamePlay getNewGame()
JDefaultGame
getNewGame in interface JGamePlaygetNewGame in class JDefaultGamepublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic Container getContainer(GameGUI frame)
JDefaultGame
getContainer in interface JGamePlaygetContainer in class JDefaultGameframe - the object to be used to alter the game status
by using the interfacepublic String getStatusMessage()
JDefaultGame
getStatusMessage in interface JGamePlaygetStatusMessage in class JDefaultGamepublic Container getHelp()
JDefaultGame
getHelp in interface JGamePlaygetHelp in class JDefaultGamepublic String getTitle()
JDefaultGame
getTitle in interface JGamePlaygetTitle in class JDefaultGameGamePlay.getGameName()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||