org.moyoman.client.reference
Class GameManager

java.lang.Object
  |
  +--org.moyoman.client.reference.GameManager
All Implemented Interfaces:
IGUIConstants

public class GameManager
extends Object
implements IGUIConstants

Provides a manager for Moyoman Go games. This class acts as a delegate to Moyoman.

Since:
v0.03
Version:
v0.16
Author:
Jeffrey M. Thompson

Field Summary
private  ActionManager _actionManager
          The action manager.
private  GameEngineSwingWorker _engine
          Game engine thread.
private  GameRecord _gameRecord
          Game record.
private  boolean _isInteractive
          Interactive state flag.
private  IMoyoman _owner
          Owner.
private  PlayerManager _playerManager
          Player manager.
 
Fields inherited from interface org.moyoman.client.reference.util.IGUIConstants
DEBUG, DIRTY_PROPERTY, GAP, MARGIN, TRANSPARENT_COLOR
 
Constructor Summary
GameManager(IMoyoman owner)
          Construct this object.
 
Method Summary
 void checkActions()
          Check the actions for their enabled status.
 void clear()
          Clear all actions.
protected  EndOfGameListener createEndOfGameListener()
          Create a new end of game listener.
 void deleteActionPerformed(ActionEvent event)
          Perform the delete action.
protected  ActionManager getActionManager()
          Return the action manager, creating it if necessary.
 Action getDeleteAction()
          Return the delete action.
 GameEngineSwingWorker getEngine()
          Return the game engine.
 Action getNewAction()
          Return the new action.
 Action getOpenAction()
          Return the open action.
protected  int getQuitGameConfirmation()
          Return confirmation of a quit game action.
protected  Action getResumeAction()
          Return the resume action.
 Action getSaveAction()
          Return the save action.
 Action getShowOpenSourceHomeAction()
          Return the show open source home action.
 Action getShowWebHomePageAction()
          Return the show web home page action.
 boolean isInteractive()
          Return true if this is in interactive mode.
 void newActionPerformed(ActionEvent event)
          Perform the new action.
 void openActionPerformed(ActionEvent event)
          Perform the open action.
 void resumeActionPerformed(ActionEvent event)
          Perform the resume action.
 void saveActionPerformed(ActionEvent event)
          Perform the save action.
 void setInteractive(boolean isInteractive)
          Set the interactive state.
 void showOpenSourceHomeActionPerformed(ActionEvent event)
          Perform the show open source home action.
 void showWebHomePageActionPerformed(ActionEvent event)
          Perform the show web home page action.
protected  void startGameSwingWorkerFinished(String statusMessage, PlayerManager playerManager)
          Perform final actions on the event-dispatching thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_actionManager

private ActionManager _actionManager
The action manager.


_engine

private GameEngineSwingWorker _engine
Game engine thread.


_gameRecord

private GameRecord _gameRecord
Game record.


_owner

private IMoyoman _owner
Owner.


_playerManager

private PlayerManager _playerManager
Player manager.


_isInteractive

private boolean _isInteractive
Interactive state flag.

Constructor Detail

GameManager

public GameManager(IMoyoman owner)
Construct this object.

Parameters:
owner - The owner.
Since:
v0.03
Method Detail

getDeleteAction

public Action getDeleteAction()
Return the delete action.

Since:
v0.03

getEngine

public GameEngineSwingWorker getEngine()
Return the game engine.

Since:
v0.03

setInteractive

public void setInteractive(boolean isInteractive)
Set the interactive state.

Since:
v0.15

isInteractive

public boolean isInteractive()
Return true if this is in interactive mode.

Since:
v0.16

getNewAction

public Action getNewAction()
Return the new action.

Since:
v0.03

getOpenAction

public Action getOpenAction()
Return the open action.

Since:
v0.03

getSaveAction

public Action getSaveAction()
Return the save action.

Since:
v0.03

getShowOpenSourceHomeAction

public Action getShowOpenSourceHomeAction()
Return the show open source home action.

Since:
v0.15

getShowWebHomePageAction

public Action getShowWebHomePageAction()
Return the show web home page action.

Since:
v0.15

checkActions

public void checkActions()
Check the actions for their enabled status.

Since:
v0.03

clear

public void clear()
Clear all actions.

Since:
v0.15

deleteActionPerformed

public void deleteActionPerformed(ActionEvent event)
Perform the delete action.

Since:
v0.03

newActionPerformed

public void newActionPerformed(ActionEvent event)
Perform the new action.

Since:
v0.03

openActionPerformed

public void openActionPerformed(ActionEvent event)
Perform the open action.

Since:
v0.03

resumeActionPerformed

public void resumeActionPerformed(ActionEvent event)
Perform the resume action.

Since:
v0.03

saveActionPerformed

public void saveActionPerformed(ActionEvent event)
Perform the save action.

Since:
v0.03

showOpenSourceHomeActionPerformed

public void showOpenSourceHomeActionPerformed(ActionEvent event)
Perform the show open source home action.

Since:
v0.15

showWebHomePageActionPerformed

public void showWebHomePageActionPerformed(ActionEvent event)
Perform the show web home page action.

Since:
v0.15

getActionManager

protected ActionManager getActionManager()
Return the action manager, creating it if necessary.

Since:
v0.03

getQuitGameConfirmation

protected int getQuitGameConfirmation()
Return confirmation of a quit game action.

Returns:
JOptionPane.YES or JOptionPane.NO.

getResumeAction

protected Action getResumeAction()
Return the resume action.

Since:
v0.03

createEndOfGameListener

protected EndOfGameListener createEndOfGameListener()
Create a new end of game listener.

Since:
v0.03

startGameSwingWorkerFinished

protected void startGameSwingWorkerFinished(String statusMessage,
                                            PlayerManager playerManager)
Perform final actions on the event-dispatching thread.

Since:
v0.03