FaultInOurPong  1
view.GameView Class Reference

Public Member Functions

 GameView ()
 Constructor for the view. More...
 
void display ()
 displays the welcome page. More...
 
Welcome getWelcome ()
 gets welcome page window More...
 
Mode getmode ()
 gets game mode page window More...
 
PongGameDisplay getGame ()
 gets game window More...
 
Tutorial getTutorial ()
 gets tutorial page window More...
 
void createGame ()
 create the game for display More...
 
JFrame getGameFrame ()
 gets game object More...
 
void noFileAvailMessage ()
 display message for error loading game record More...
 
void cannotLoadMessage ()
 display message for error loading game More...
 
void gameOver (int whichplayer)
 display message for game over More...
 
void tutorialPage (ImageIcon img)
 create tutorial page More...
 
int getFrameWidth ()
 gets width of the window More...
 
int getFrameHeight ()
 gets height of the window More...
 

Private Attributes

Welcome welcome
 
Mode mode
 
PongGameDisplay ponggame
 
Tutorial tutorial
 
JFrame gameFrame
 
final int FRAMEWIDTH = 700
 
final int FRAMEHEIGHT = 500
 

Constructor & Destructor Documentation

§ GameView()

view.GameView.GameView ( )

Constructor for the view.

declares all other windows

  • Pass in different windows to this view interface
  • Wait for further invocation

Member Function Documentation

§ cannotLoadMessage()

void view.GameView.cannotLoadMessage ( )

display message for error loading game

create a frame for display

§ createGame()

void view.GameView.createGame ( )

create the game for display

create a frame under set dimension for the game

§ display()

void view.GameView.display ( )

displays the welcome page.

sets the visibility of the window to be true.

§ gameOver()

void view.GameView.gameOver ( int  whichplayer)

display message for game over

Parameters
whichplayeris the indicator for the player
  • If the computer wins, display winning message for the computer
  • If the player wins, display winning message for the player

§ getFrameHeight()

int view.GameView.getFrameHeight ( )

gets height of the window

Returns
FRAMEHEIGHT

§ getFrameWidth()

int view.GameView.getFrameWidth ( )

gets width of the window

Returns
FRAMEWIDTH

§ getGame()

PongGameDisplay view.GameView.getGame ( )

gets game window

Returns
game window object

§ getGameFrame()

JFrame view.GameView.getGameFrame ( )

gets game object

Returns
game object

§ getmode()

Mode view.GameView.getmode ( )

gets game mode page window

Returns
game mode page object

§ getTutorial()

Tutorial view.GameView.getTutorial ( )

gets tutorial page window

Returns
tutorial page object

§ getWelcome()

Welcome view.GameView.getWelcome ( )

gets welcome page window

Returns
welcome page object

§ noFileAvailMessage()

void view.GameView.noFileAvailMessage ( )

display message for error loading game record

create a frame for display

§ tutorialPage()

void view.GameView.tutorialPage ( ImageIcon  img)

create tutorial page

Parameters
imgis the image for display

Member Data Documentation

§ FRAMEHEIGHT

final int view.GameView.FRAMEHEIGHT = 500
private

§ FRAMEWIDTH

final int view.GameView.FRAMEWIDTH = 700
private

Constant declarations for the view

§ gameFrame

JFrame view.GameView.gameFrame
private

§ mode

Mode view.GameView.mode
private

§ ponggame

PongGameDisplay view.GameView.ponggame
private

§ tutorial

Tutorial view.GameView.tutorial
private

§ welcome

Welcome view.GameView.welcome
private

Variable declarations to store different pages

  • welcome page
  • game mode page
  • tutorial page
  • game page

The documentation for this class was generated from the following file: