vooga.arcade
Class VoogaGUI

java.lang.Object
  extended by vooga.arcade.VoogaGUI
All Implemented Interfaces:
IVoogaGUI
Direct Known Subclasses:
UserProfileTest

public class VoogaGUI
extends java.lang.Object
implements IVoogaGUI

View for the Class's VOOGA program. Contains constructor to build full pane with components and methods to show messages.

Author:
Vijay Ram, Ron Murhammer, Lindsay Kubasik

Constructor Summary
VoogaGUI()
          The "controller" class for the arcade.
 
Method Summary
 void addArcadeEventListener(IArcadeEventListener listener)
          This method is used to add a listener to all of the arcade's events.
 boolean canGameRun()
          Returns a boolean saying whether a game can run or not.
 int createNewFrame(java.lang.String frameTitle)
          This method will open a new window with the given title and place the component in the center panel with the given tab title.
 void fireArcadeEvent(ArcadeEvent e)
          Allows others to fire an arcade event.
 ArcadeFrame getFrame(int frameID)
          Get the ArcadeFrame given its ID.
 VoogaUser getUser()
          Returns the current user
 void hideArcade()
          This method is called to log a user out.
 void removeFrame(int ID)
          This method removes the frame with the given title.
 void setGameRunningStatus(boolean isGameRunning)
          Used to store whether or not a game is running.
 void showArcade(VoogaUser user)
          This method is called after a user is verified.
 void showErrorMessage(java.lang.String s)
          This method will show the error message in a popup box to the user.
 java.lang.String showInputDialog(java.lang.String message)
          This method will show a popup box where you can propt a user for input.
 void showMessage(java.lang.String s)
          This method will show the message in a popup box to the user.
 void startLoginProcess()
          Fires the event to start the login process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VoogaGUI

public VoogaGUI()
The "controller" class for the arcade. Creates the lobby window with a GameChooser panel and empty side panels to which elements can be added. This lobby window will also contain a menu with generic options and a toolbar with a button to show/hide side panels.

Method Detail

addArcadeEventListener

public void addArcadeEventListener(IArcadeEventListener listener)
Description copied from interface: IVoogaGUI
This method is used to add a listener to all of the arcade's events. When the arcade fires an event, it will call all of its listeners and provide info about the event. Each listener then can determine what it needs to do by examining the info. An example of a listener can be seen in the ArcadeListener class which implements the IArcadeListener interface. It is used by the arcade to process the various events which it fires.

Specified by:
addArcadeEventListener in interface IVoogaGUI
Parameters:
listener - is a listener which extends the IArcadeListener interface

fireArcadeEvent

public void fireArcadeEvent(ArcadeEvent e)
Description copied from interface: IVoogaGUI
Allows others to fire an arcade event.

Specified by:
fireArcadeEvent in interface IVoogaGUI

showArcade

public void showArcade(VoogaUser user)
Description copied from interface: IVoogaGUI
This method is called after a user is verified. It shows the main arcade screen where users can select games and many other functions.

Specified by:
showArcade in interface IVoogaGUI

hideArcade

public void hideArcade()
Description copied from interface: IVoogaGUI
This method is called to log a user out. It hides the main arcade screen where users can select games and many other functions.

Specified by:
hideArcade in interface IVoogaGUI

createNewFrame

public int createNewFrame(java.lang.String frameTitle)
Description copied from interface: IVoogaGUI
This method will open a new window with the given title and place the component in the center panel with the given tab title.

Specified by:
createNewFrame in interface IVoogaGUI
Returns:
the frame's ID so that it can be used to communicate with the created frame

removeFrame

public void removeFrame(int ID)
Description copied from interface: IVoogaGUI
This method removes the frame with the given title.

Specified by:
removeFrame in interface IVoogaGUI

showMessage

public void showMessage(java.lang.String s)
Description copied from interface: IVoogaGUI
This method will show the message in a popup box to the user.

Specified by:
showMessage in interface IVoogaGUI

showErrorMessage

public void showErrorMessage(java.lang.String s)
Description copied from interface: IVoogaGUI
This method will show the error message in a popup box to the user.

Specified by:
showErrorMessage in interface IVoogaGUI

getFrame

public ArcadeFrame getFrame(int frameID)
Description copied from interface: IVoogaGUI
Get the ArcadeFrame given its ID.

Specified by:
getFrame in interface IVoogaGUI

showInputDialog

public java.lang.String showInputDialog(java.lang.String message)
Description copied from interface: IVoogaGUI
This method will show a popup box where you can propt a user for input.

Specified by:
showInputDialog in interface IVoogaGUI
Returns:

startLoginProcess

public void startLoginProcess()
Fires the event to start the login process


setGameRunningStatus

public void setGameRunningStatus(boolean isGameRunning)
Used to store whether or not a game is running.

Parameters:
isGameRunning -

canGameRun

public boolean canGameRun()
Returns a boolean saying whether a game can run or not. Takes into account if a game is running already, and whether or not the user cares.


getUser

public VoogaUser getUser()
Returns the current user

Returns:
VoogaUser