|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.game.JDefaultGame
public class JDefaultGame
JDefaultGame provides a basic wrapper for GamePlay objects for implementing the JGamePlay interface. JDefaultGame enables any GamePlay to be played with a JGameFrame if the game has no specific requirements for its display (or you can extend this class to ease the implementation of the interface). JDefaultGame relies on proper toString() methods to be set for the game and its moves; it further requires that a default constructor with no arguments is accessible from this class. Also, the GamePlay and all its associated objects must be serializable for game saving/loading.
JGameFrame,
JGamePlay| Field Summary | |
|---|---|
protected ExtensionFileFilter |
filter
DOCUMENT ME! |
protected GameGUI |
frame
DOCUMENT ME! |
protected AutoPlay |
play
DOCUMENT ME! |
| Fields inherited from interface org.jscience.computing.game.JGamePlay |
|---|
gameFrameX, gameFrameY, historyFrameX, historyFrameY, legalMovesFrameX, legalMovesFrameY, prototypeCellValue, redoFrameX, redoFrameY, windowHeight, windowLocationX, windowLocationY, windowWidth |
| Constructor Summary | |
|---|---|
JDefaultGame(GamePlay game)
Creates a new JDefaultGame object. |
|
JDefaultGame(GamePlay game,
Player[] player,
int level,
ExtensionFileFilter filter)
Creates a new JDefaultGame object. |
|
| Method Summary | |
|---|---|
AutoPlay |
getAutoPlay()
DOCUMENT ME! |
java.awt.Container |
getContainer(GameGUI frame)
takes the toString() function of the GamePlay and turns it into formatted html, which is returned as a JLabel |
java.lang.String |
getDefaultFileExtension()
DOCUMENT ME! |
javax.swing.filechooser.FileFilter |
getFileFilter()
DOCUMENT ME! |
java.awt.Container |
getHelp()
returns null if not overwritten |
javax.swing.JMenu |
getMenu()
returns null if not overwritten |
JGamePlay |
getNewGame()
depends on a default constructor being accessible for the GamePlay object in question |
java.lang.String |
getStatusMessage()
indicates the number of moves performed, number of legal moves available, and indicates if someone won the game. |
java.lang.String |
getTitle()
returns getGameName() from the GamePlay object |
protected void |
setFileFilter(ExtensionFileFilter filter)
DOCUMENT ME! |
JGamePlay |
setGame(AutoPlay play)
DOCUMENT ME! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GameGUI frame
protected AutoPlay play
protected ExtensionFileFilter filter
| Constructor Detail |
|---|
public JDefaultGame(GamePlay game)
game - DOCUMENT ME!
public JDefaultGame(GamePlay game,
Player[] player,
int level,
ExtensionFileFilter filter)
game - DOCUMENT ME!player - DOCUMENT ME!level - DOCUMENT ME!filter - DOCUMENT ME!| Method Detail |
|---|
public java.awt.Container getContainer(GameGUI frame)
getContainer in interface JGamePlayframe - DOCUMENT ME!
public AutoPlay getAutoPlay()
getAutoPlay in interface JGamePlaypublic javax.swing.filechooser.FileFilter getFileFilter()
getFileFilter in interface JGamePlayprotected void setFileFilter(ExtensionFileFilter filter)
filter - DOCUMENT ME!public java.lang.String getDefaultFileExtension()
getDefaultFileExtension in interface JGamePlaypublic javax.swing.JMenu getMenu()
getMenu in interface JGamePlaypublic JGamePlay getNewGame()
getNewGame in interface JGamePlayjava.lang.RuntimeException - DOCUMENT ME!
public JGamePlay setGame(AutoPlay play)
throws GameRuntimeException
setGame in interface JGamePlayplay - DOCUMENT ME!
GameRuntimeException - DOCUMENT ME!public java.lang.String getTitle()
getTitle in interface JGamePlayGamePlay.getGameName()public java.lang.String getStatusMessage()
getStatusMessage in interface JGamePlaypublic java.awt.Container getHelp()
getHelp in interface JGamePlay
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||