jrummikub.control
Class ApplicationControl

java.lang.Object
  extended by jrummikub.control.ApplicationControl

public class ApplicationControl
extends java.lang.Object

The application control controls the settings for a new games and create the game control


Field Summary
private  GameControl gameControl
           
private  LoginControl loginControl
           
private  NetworkControl networkControl
           
private  SaveControl saveControl
           
private  DedicatedServer server
           
private  SettingsControl settingsControl
           
private  Connection tempConnection
           
private  IView view
           
 
Constructor Summary
ApplicationControl(IView view)
          Creates a new application control
 
Method Summary
private  void abortControls()
          End all controls in case of e.g. quit event
private  void addGameControlListeners(GameControl gameControl)
          Adds events listeners to game control events
private  void addNewNetworkGameHandler()
           
private  void addQuitGameHandlers()
           
private  void addSaveLoadHandlers()
           
private  void createLoginControl(boolean reset)
          Create a new network login control
private  void createNetworkControl(LoginData loginData)
          Create a new network game control
 boolean isGameRunning()
          Checks if a game is currently running
private  void showQuitWarning()
           
private  void showRestartWarning()
           
 void startApplication()
          Starts the application by showing the game settings dialog panel
 boolean startDedicatedServer(java.lang.String password)
          Ensure the dedicated server is running
 void updateDedicatedServerPassword(LoginData loginData)
          If the login given is to our own dedicated server, update it's password to match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settingsControl

private SettingsControl settingsControl

loginControl

private LoginControl loginControl

networkControl

private NetworkControl networkControl

saveControl

private SaveControl saveControl

gameControl

private GameControl gameControl

tempConnection

private Connection tempConnection

server

private DedicatedServer server

view

private IView view
Constructor Detail

ApplicationControl

public ApplicationControl(IView view)
Creates a new application control

Parameters:
view - the view to use
Method Detail

addSaveLoadHandlers

private void addSaveLoadHandlers()

addNewNetworkGameHandler

private void addNewNetworkGameHandler()

addQuitGameHandlers

private void addQuitGameHandlers()

showRestartWarning

private void showRestartWarning()

showQuitWarning

private void showQuitWarning()

isGameRunning

public boolean isGameRunning()
Checks if a game is currently running

Returns:
true when a game is running

createLoginControl

private void createLoginControl(boolean reset)
Create a new network login control


abortControls

private void abortControls()
End all controls in case of e.g. quit event


startApplication

public void startApplication()
Starts the application by showing the game settings dialog panel


addGameControlListeners

private void addGameControlListeners(GameControl gameControl)
Adds events listeners to game control events

Parameters:
gameControl - of current game

createNetworkControl

private void createNetworkControl(LoginData loginData)
Create a new network game control

Parameters:
loginData - users login data for channel

startDedicatedServer

public boolean startDedicatedServer(java.lang.String password)
Ensure the dedicated server is running

Parameters:
password - password to use, if empty "jrummikub" is used
Returns:
whether the server could be started

updateDedicatedServerPassword

public void updateDedicatedServerPassword(LoginData loginData)
If the login given is to our own dedicated server, update it's password to match

Parameters:
loginData - login data of user trying to connect