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...
 
JButton getPause ()
 
JButton getResume ()
 
JButton getSave ()
 
JButton getExit ()
 
JPanel getGameOptionPanel ()
 
void addButton (JPanel panel, JButton button, JButton prefer)
 
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, double time)
 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
 
JButton pause
 
JButton resume
 
JButton save
 
JButton exit
 
JPanel gameOptions
 

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

§ addButton()

void view.GameView.addButton ( JPanel  panel,
JButton  button,
JButton  prefer 
)

§ 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,
double  time 
)

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

§ getExit()

JButton view.GameView.getExit ( )

§ 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

§ getGameOptionPanel()

JPanel view.GameView.getGameOptionPanel ( )

§ getmode()

Mode view.GameView.getmode ( )

gets game mode page window

Returns
game mode page object

§ getPause()

JButton view.GameView.getPause ( )

§ getResume()

JButton view.GameView.getResume ( )

§ getSave()

JButton view.GameView.getSave ( )

§ 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

§ exit

JButton view.GameView.exit
private

§ 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

§ gameOptions

JPanel view.GameView.gameOptions
private

§ mode

Mode view.GameView.mode
private

§ pause

JButton view.GameView.pause
private

Set up buttons on the game panel

§ ponggame

PongGameDisplay view.GameView.ponggame
private

§ resume

JButton view.GameView.resume
private

§ save

JButton view.GameView.save
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: