MAK RTIspy API Documentation for HLA 1516
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ui.Board Class Reference

The Class Board. More...

+ Inheritance diagram for ui.Board:
+ Collaboration diagram for ui.Board:

List of all members.

Public Member Functions

 Board (IMakShooterRTI myRti) throws HeadlessException
 Instantiates a new board.
void addKeyboardListenerToBoard (KeyListener ka)
 This is adds a keyListener to the board, and ensures that it will be focusable and requests focus for the board.
void addShip (Ship ship)
 Adds the ship.
void dispose ()
IShipController getControllerThread ()
Ship getLeftShip ()
 Gets the left ship.
int getLoses ()
IMakShooterRTI getMyRti ()
Ship getRightShip ()
 Gets the right ship.
ShotIncrementingThread getShotIncrementingThread ()
Runnable getWaitingForPlayersThread ()
int getWins ()
boolean isReadyToStartGame ()
 Checks if is ready to start game.
void myKeyboardHackForLinux ()
 This hack is necessary because there is an issue with linux, window focus, and keyboard listeners.
void endGameEarlyDueToPlayerLeaving () throws Exception
void reInitializeGame ()
void setControllerThread (IShipController controllerThread)
void setMyRti (IMakShooterRTI myRti)
void setShotIncrementingThread (ShotIncrementingThread shotIncrementingThread)
void setWaitingForPlayersThread (Runnable waitingForPlayersThread)
void setLeftWins (int wins)
void setLeftLoses (int loses)
void setRightLoses (int loses)
void setRightWins (int wins)
void updateBoardFromDetonation (E_Alignment alignment)
void modifyTitle (String titleAddition)

Private Member Functions

void addDisconnectFromGameButton (JMenuBar jMenuBar)
void addStartNewGameButton (JMenuBar jMenuBar)
void createScorePanel ()
 Creates the score panel.
void initialize ()
 Initialize.
JMenuBar makeMenu ()
 Make menu.
void performShutdownStuff () throws Exception
void performStartupStuff (String federationName, String federateName, Color color, boolean observer) throws Exception
void abandonGame () throws Exception

Private Attributes

JPanel contentPane
 The content pane.
IShipController controllerThread
JButton disconnectFromGameButton
GraphicsPanel graphicsPanel
 The graphics panel.
JLabel lblLeftWins
JLabel lblRightWins
int leftLoses = 0
 The loses.
int leftWins = 0
 The wins.
JMenuBar menu
IMakShooterRTI myRti
int rightLoses
int rightWins
JPanel scorePanel
ShotIncrementingThread shotIncrementingThread
JButton startNewGameMenuButton
Runnable waitingForPlayersThread

Static Private Attributes

static final String LABEL_WINS = "Score: "
static final long serialVersionUID = -8387568866044849612L
 The Constant serialVersionUID.

Detailed Description

The Class Board.

Author:
snandi

Constructor & Destructor Documentation

ui.Board.Board ( IMakShooterRTI  myRti) throws HeadlessException [inline]

Instantiates a new board.

Exceptions:
HeadlessExceptionthe headless exception

References ui.Board.initialize(), ui.Board.myRti, and ui.Board.setMyRti().


Member Function Documentation

void ui.Board.abandonGame ( ) throws Exception [inline, private]
void ui.Board.addDisconnectFromGameButton ( JMenuBar  jMenuBar) [inline, private]
void ui.Board.addKeyboardListenerToBoard ( KeyListener  ka) [inline]

This is adds a keyListener to the board, and ensures that it will be focusable and requests focus for the board.

Parameters:
ka

References ui.Board.myKeyboardHackForLinux().

Referenced by controllers.KeyboardShipController.KeyboardShipController().

void ui.Board.addShip ( Ship  ship) [inline]

Adds the ship.

Parameters:
shipthe ship

References ui.GraphicsPanel.addShip(), and ui.Board.graphicsPanel.

Referenced by ui.TestMain.main(), and federate.RTI1516e.Test.main().

void ui.Board.addStartNewGameButton ( JMenuBar  jMenuBar) [inline, private]
void ui.Board.createScorePanel ( ) [inline, private]
void ui.Board.dispose ( ) [inline]
Ship ui.Board.getLeftShip ( ) [inline]

Gets the left ship.

Returns:
the left ship

References ui.GraphicsPanel.getLeftShip(), and ui.Board.graphicsPanel.

Referenced by controllers.ShotManager.performIntenseDetonationCheck().

int ui.Board.getLoses ( ) [inline]
Returns:
the loses

References ui.Board.leftLoses.

References ui.Board.myRti.

Gets the right ship.

Returns:
the right ship

References ui.GraphicsPanel.getRightShip(), and ui.Board.graphicsPanel.

Referenced by controllers.ShotManager.performIntenseDetonationCheck().

Runnable ui.Board.getWaitingForPlayersThread ( ) [inline]
int ui.Board.getWins ( ) [inline]
Returns:
the wins

References ui.Board.leftWins.

void ui.Board.initialize ( ) [inline, private]
boolean ui.Board.isReadyToStartGame ( ) [inline]

Checks if is ready to start game.

Returns:
true, if is ready to start game

References ui.Board.graphicsPanel, and ui.GraphicsPanel.isReadyToStart().

Referenced by ui.TestMain.main().

JMenuBar ui.Board.makeMenu ( ) [inline, private]

Make menu.

Returns:
the j menu bar

References ui.Board.addDisconnectFromGameButton(), and ui.Board.addStartNewGameButton().

Referenced by ui.Board.initialize().

void ui.Board.modifyTitle ( String  titleAddition) [inline]

This hack is necessary because there is an issue with linux, window focus, and keyboard listeners.

Referenced by ui.Board.addKeyboardListenerToBoard(), and controllers.KeyboardShipController.run().

void ui.Board.performShutdownStuff ( ) throws Exception [inline, private]
void ui.Board.performStartupStuff ( String  federationName,
String  federateName,
Color  color,
boolean  observer 
) throws Exception [inline, private]
void ui.Board.reInitializeGame ( ) [inline]
void ui.Board.setControllerThread ( IShipController  controllerThread) [inline]
void ui.Board.setLeftLoses ( int  loses) [inline]
Parameters:
losesthe loses to set

Referenced by ui.Board.reInitializeGame(), and ui.Board.updateBoardFromDetonation().

void ui.Board.setLeftWins ( int  wins) [inline]
void ui.Board.setMyRti ( IMakShooterRTI  myRti) [inline]

References ui.Board.myRti.

Referenced by ui.Board.Board().

void ui.Board.setRightLoses ( int  loses) [inline]
Parameters:
losesthe loses to set

Referenced by ui.Board.reInitializeGame(), and ui.Board.updateBoardFromDetonation().

void ui.Board.setRightWins ( int  wins) [inline]
void ui.Board.setShotIncrementingThread ( ShotIncrementingThread  shotIncrementingThread) [inline]
void ui.Board.setWaitingForPlayersThread ( Runnable  waitingForPlayersThread) [inline]
void ui.Board.updateBoardFromDetonation ( E_Alignment  alignment) [inline]

Member Data Documentation

JPanel ui.Board.contentPane [private]
final String ui.Board.LABEL_WINS = "Score: " [static, private]
JLabel ui.Board.lblLeftWins [private]
JLabel ui.Board.lblRightWins [private]
int ui.Board.leftLoses = 0 [private]
int ui.Board.leftWins = 0 [private]
JMenuBar ui.Board.menu [private]

Referenced by ui.Board.initialize().

int ui.Board.rightLoses [private]
int ui.Board.rightWins [private]
JPanel ui.Board.scorePanel [private]
final long ui.Board.serialVersionUID = -8387568866044849612L [static, private]

The Constant serialVersionUID.


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)