|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JGamePlay
JGamePlay provides functionality that is used by the GUI based JGameFrame to display the game specific features. All a specific game needs to do in order to be used with the JGameFrame is to simply implement these simple functions. All the rest is then done by the JGameFrame. For the object that implements JGamePlay to work smoothly with JGameFrame, that object should also be serializable. If a given GamePlay has no special needs for displaying itself, it may suffice to simply use an instance of JDefaultGame to provide the wrapper that implements this interface. Note that a JGamePlay's container should not allow to directly perform a move on the embedded AutoPlay object; instead it should delegate the handling of a move to the GameGUI object that uses this JGamePlay.
JGameFrame,
GamePlay,
GameGUI,
JDefaultGame| Field Summary | |
|---|---|
static int |
gameFrameX
horizontal offset for positioning the game board |
static int |
gameFrameY
vertical offset for positioning the game board |
static int |
historyFrameX
horizontal offset for positioning the history moves |
static int |
historyFrameY
vertical offset for positioning the history moves |
static int |
legalMovesFrameX
horizontal offset for positioning the legal moves |
static int |
legalMovesFrameY
vertical offset for positioning the legal moves |
static String |
prototypeCellValue
used to size the legal, history and redo move list |
static int |
redoFrameX
horizontal offset for positioning the redo moves |
static int |
redoFrameY
vertical offset for positioning the redo moves |
static int |
windowHeight
height of the window |
static int |
windowLocationX
x-coorinate of the upper left window corner |
static int |
windowLocationY
y-coorinate of the upper left window corner |
static int |
windowWidth
width of the window |
| Method Summary | |
|---|---|
AutoPlay |
getAutoPlay()
AutoPlay() returns the underlying game - to allow the calling functions to perform operations on the game itself. |
Container |
getContainer(GameGUI frame)
getContainer() returns the GUI component used to display the game representation. |
String |
getDefaultFileExtension()
getDefaultFileExtension() defines the String used as a file type when saving files; it should correspond to getFileFlter. |
FileFilter |
getFileFilter()
getFileFilter() provides the option to filter for certain file types when saving or loading games. |
Container |
getHelp()
getHelp() is to return a component (such as JLabel, JTextArea, etc) that can be displayed if a user selects the game specific help menu from a JGameFrame. |
JMenu |
getMenu()
getMenu() provides the option to display a game specific menu within the overall JMenuBar of the JGameFrame. |
JGamePlay |
getNewGame()
getNewGame() will initialize a new game and return the JGamePlay wrapper associated with the new game. |
String |
getStatusMessage()
getStatusMessage () is used to display a game specific status message, giving some information about the running game. |
String |
getTitle()
getTitle() returns a string used in JGameFrame to be displayed in the title bar of the top JFrame. |
JGamePlay |
setGame(AutoPlay game)
setGame(AbstractGameBoard board) returns a JGamePlay object that embedds the given AutoPlay game. |
| Field Detail |
|---|
static final int windowLocationX
static final int windowLocationY
static final int windowWidth
static final int windowHeight
static final int legalMovesFrameX
static final int legalMovesFrameY
static final int historyFrameX
static final int historyFrameY
static final int redoFrameX
static final int redoFrameY
static final int gameFrameX
static final int gameFrameY
static final String prototypeCellValue
| Method Detail |
|---|
Container getContainer(GameGUI frame)
frame - the object to be used to alter the game status
by using the interfaceAutoPlay getAutoPlay()
FileFilter getFileFilter()
String getDefaultFileExtension()
JMenu getMenu()
JGamePlay getNewGame()
JGamePlay setGame(AutoPlay game)
throws GameRuntimeException
GameRuntimeExceptionString getTitle()
String getStatusMessage()
Container getHelp()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||