MAK RTIspy API Documentation for HLA 1.3
List of all members | 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:

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
inlineprivate
void ui.Board.addDisconnectFromGameButton ( JMenuBar  jMenuBar)
inlineprivate
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)
inlineprivate
void ui.Board.createScorePanel ( )
inlineprivate
void ui.Board.dispose ( )
inline
void ui.Board.endGameEarlyDueToPlayerLeaving ( ) throws Exception
inline
IShipController ui.Board.getControllerThread ( )
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.

IMakShooterRTI ui.Board.getMyRti ( )
inline

References ui.Board.myRti.

Ship ui.Board.getRightShip ( )
inline

Gets the right ship.

Returns
the right ship

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

Referenced by controllers.ShotManager.performIntenseDetonationCheck().

ShotIncrementingThread ui.Board.getShotIncrementingThread ( )
inline
Runnable ui.Board.getWaitingForPlayersThread ( )
inline
int ui.Board.getWins ( )
inline
Returns
the wins

References ui.Board.leftWins.

void ui.Board.initialize ( )
inlineprivate
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 ( )
inlineprivate

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
void ui.Board.myKeyboardHackForLinux ( )
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
inlineprivate
void ui.Board.performStartupStuff ( String  federationName,
String  federateName,
Color  color,
boolean  observer 
) throws Exception
inlineprivate
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
IShipController ui.Board.controllerThread
private
JButton ui.Board.disconnectFromGameButton
private
GraphicsPanel ui.Board.graphicsPanel
private
final String ui.Board.LABEL_WINS = "Score: "
staticprivate
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().

IMakShooterRTI ui.Board.myRti
private
int ui.Board.rightLoses
private
int ui.Board.rightWins
private
JPanel ui.Board.scorePanel
private
final long ui.Board.serialVersionUID = -8387568866044849612L
staticprivate

The Constant serialVersionUID.

ShotIncrementingThread ui.Board.shotIncrementingThread
private
JButton ui.Board.startNewGameMenuButton
private
Runnable ui.Board.waitingForPlayersThread
private

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

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)