group1.view
Class View

java.lang.Object
  extended by group1.view.View
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class View
extends java.lang.Object
implements java.awt.event.ActionListener


Constructor Summary
View()
          Default constructor acceptingGameEvent is set to false
View(Game g)
          Constructor with a game parameter.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method is called by the timer.
 javax.swing.JFrame getMyFrame()
          THIS IS ONLY HERE FOR TESTING PURPOSES
 GamePanel getMyGamePanel()
          THIS IS ONLY HERE FOR TESTING PURPOSES
 void handleBuyMenuEvent(GameEvent e)
          The buyMenuEvent handler.
 void handleContinueMenuEvent(GameEvent e)
          The continueMenuEvent handler.
 void handleEndOfLevelEvent(GameEvent e)
          The endOfLevelEvent handler.
 void handleInGameEvent(GameEvent e)
          The inGameEvent handler.
 void handleInstructionsEvent(GameEvent e)
          The intructionsEvent handler.
 void handleJeffDiesEvent(GameEvent e)
          The jeffDiesEvent handler.
 void handleLoadEvent(GameEvent e)
          The loadEvent handler.
 void handleMainMenuEvent(GameEvent e)
          The mainMenuEvent handler.
 void handleNewGameEvent(GameEvent e)
          The newGameEvent handler.
 void handlePauseMenuEvent(GameEvent e)
          The pauseMenuEvent handler.
 void handleSaveEvent(GameEvent e)
          The saveEvent handler.
 void handleStartOfLevelEvent(GameEvent e)
          The startOfMenuEvent handler.
 void handleWeaponSwitchMenuEvent(GameEvent e)
          The weaponSwitchMenuEvent handler.
static void main(java.lang.String[] argc)
          For testing purposed only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

View

public View()
Default constructor acceptingGameEvent is set to false


View

public View(Game g)
Constructor with a game parameter. Assigns the game, initializes the GUI and some more set-up acceptingGameEvent is set to false

Parameters:
g - The game that the view will handle events from
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This method is called by the timer. Simply makes acceptingGameEvents true. With this boolean true, the handleInGameEvent method will process the event rather than ignore it.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

handleMainMenuEvent

public void handleMainMenuEvent(GameEvent e)
The mainMenuEvent handler.

Parameters:
e - contains all the info needed about the mainMenuEvent.

handlePauseMenuEvent

public void handlePauseMenuEvent(GameEvent e)
The pauseMenuEvent handler.

Parameters:
e - contains all the info needed about the pauseMenuEvent

handleBuyMenuEvent

public void handleBuyMenuEvent(GameEvent e)
The buyMenuEvent handler.

Parameters:
e - contains all the info needed about the buyMenuEvent

handleContinueMenuEvent

public void handleContinueMenuEvent(GameEvent e)
The continueMenuEvent handler.

Parameters:
e - contains all the info needed about the continueMenuEvent

handleWeaponSwitchMenuEvent

public void handleWeaponSwitchMenuEvent(GameEvent e)
The weaponSwitchMenuEvent handler.

Parameters:
e - contains all the info needed about the weaponSwitchMenuEvent

handleNewGameEvent

public void handleNewGameEvent(GameEvent e)
The newGameEvent handler.

Parameters:
e - contains all the info needed about the newGameEvent

handleSaveEvent

public void handleSaveEvent(GameEvent e)
The saveEvent handler.

Parameters:
e - contains all the info needed about the saveEvent

handleLoadEvent

public void handleLoadEvent(GameEvent e)
The loadEvent handler.

Parameters:
e - contains all the info needed about the loadEvent

handleInstructionsEvent

public void handleInstructionsEvent(GameEvent e)
The intructionsEvent handler.

Parameters:
e - contains all the info needed about the instructionsEvent

handleStartOfLevelEvent

public void handleStartOfLevelEvent(GameEvent e)
The startOfMenuEvent handler.

Parameters:
e - contains all the info needed about the startOfMenuEvent

handleEndOfLevelEvent

public void handleEndOfLevelEvent(GameEvent e)
The endOfLevelEvent handler.

Parameters:
e - contains all the info needed about the endOfLevelEvent

handleJeffDiesEvent

public void handleJeffDiesEvent(GameEvent e)
The jeffDiesEvent handler.

Parameters:
e - contains all the info needed about the jeffDiesEvent

handleInGameEvent

public void handleInGameEvent(GameEvent e)
The inGameEvent handler. The event is only processed if the boolean 'acceptingGameEvents' is set to true. This way the view can control the rate at which it processes events independently of the rate at which the model spits them out. Updates/scrolls the background. (unimplemented) Updates the gameObj set. Updates the score and HP.

Parameters:
e - contains all the info needed about the inGameEvent

getMyGamePanel

public GamePanel getMyGamePanel()
THIS IS ONLY HERE FOR TESTING PURPOSES

Returns:

getMyFrame

public javax.swing.JFrame getMyFrame()
THIS IS ONLY HERE FOR TESTING PURPOSES

Returns:

main

public static void main(java.lang.String[] argc)
For testing purposed only

Parameters:
argc - no arguments needed