|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectantichess.viewgui.ChessGUI
public class ChessGUI
ChessGUI is a GUI for displaying a game of Chess, Antichess, or any other chess game that uses a ChessBoard. Features supported by the ChessGUI: Starting new games of Chess or Antichess with human or AI players. A variety of times are available as well. @see NewGameWindow Saving a current AntichessGame in the format specified Loading an Antichess game in the format specified Pausing a game Ending a game early or resigning Setting options for the ChessBoardView including: showing legal moves once a piece has been selected disco mode While saving, loading, or creating a new game, the game is automatically paused. Upon exiting the game is not longer paused. ChessGUI has an icon stored in images/antichessicon.bmp if this file does not exist no special icon is loaded. For creating the ChessBoardView, ChessGUI relies on these files existing: images/RAntiking.gif images/RBishop.gif images/RKing.gif images/RKnight.gif images/RPawn.gif images/RQueen.gif images/RRook.gif images/WAntiking.gif images/WBishop.gif images/WKing.gif images/WKnight.gif images/WPawn.gif images/WQueen.gif images/WRook.gif images/board.gif and optionally: images/kitty.gif Most of the functionality is documented in the User Manual
clock
//GameClock for the game being displayed by the GUI
boardView
//ChessBoardView that is displaying the current game
master
//ControllerMaster that is running the current game
board
//ChessBoard that this ChessGUI is displaying
hasNotifiedGameOver
//boolean stores if we have notified that the game has ended
isPaused
//boolean stores if the game is currently paused
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
Handles these events for the ChessGUI: Exiting Saving Loading Starting a new game Pausing Ending the game Setting Possible Moves Visible Disco Mode For a better description of these see the specifications for the class. |
static ChessGUI |
createGUI(ChessBoard board,
GameClock gameClock,
ControllerMaster master)
Creates a ChessGUI suitable for Chess or Antichess playing on. |
void |
destroy()
Closes the GUI |
BoardView |
getBoardView()
|
void |
postRefresh()
ChessGUI is a BoardObserver so this method is called whenever the currentBoard deems it necesary. |
void |
run()
Calls showGUI(). |
void |
showGUI()
Shows this GUI. |
void |
switchViewedGame(ChessBoard newBoard,
GameClock clock)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void destroy()
public BoardView getBoardView()
public void switchViewedGame(ChessBoard newBoard, GameClock clock)
public void postRefresh()
postRefresh
in interface BoardObserver
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public static ChessGUI createGUI(ChessBoard board, GameClock gameClock, ControllerMaster master)
public void showGUI()
public void run()
run
in interface Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |