megamek.client.ui.AWT.boardview3d
Class BoardView3D

java.lang.Object
  extended by Canvas3D
      extended by megamek.client.ui.AWT.boardview3d.BoardView3D
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, MechDisplayListener, IBoardView, BoardListener, GameListener, IPreferenceChangeListener

public class BoardView3D
extends Canvas3D
implements IBoardView, BoardListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, MechDisplayListener, IPreferenceChangeListener, GameListener

Displays the board; lets the user scroll around and select points on it.


Field Summary
(package private)  boolean dragged
           
(package private) static long serialVersionUID
           
 
Constructor Summary
BoardView3D(IGame game)
          Construct a new board view for the specified game
 
Method Summary
 void addAttack(AttackAction aa)
           
 void addBoardViewListener(BoardViewListener listener)
          Adds the specified board listener to receive board events from this board.
 void addDisplayable(IDisplayable disp)
           
 void boardChangedAllHexes(BoardEvent b)
          Sent when all hexes on the board changed
 void boardChangedHex(BoardEvent b)
          Sent when Hex on the Board changed
 void boardNewBoard(BoardEvent b)
          Sent when Board completely changed
 void centerOnHex(Coords c)
           
 void checkLOS(Coords coords)
           
 void clearMovementData()
           
 void cursor(Coords coords)
          Determines if this Board contains the Coords, and if so, "cursors" that Coords.
 void drawMovementData(Entity entity, MovePath md)
           
 void drawRuler(Coords s, Coords e, java.awt.Color sc, java.awt.Color ec)
           
 void gameBoardChanged(GameBoardChangeEvent e)
           
 void gameBoardNew(GameBoardNewEvent e)
           
 void gameEnd(GameEndEvent e)
           
 void gameEntityChange(GameEntityChangeEvent e)
           
 void gameEntityNew(GameEntityNewEvent e)
           
 void gameEntityNewOffboard(GameEntityNewOffboardEvent e)
           
 void gameEntityRemove(GameEntityRemoveEvent e)
           
 void gameMapQuery(GameMapQueryEvent e)
           
 void gameNewAction(GameNewActionEvent e)
           
 void gamePhaseChange(GamePhaseChangeEvent e)
           
 void gamePlayerChange(GamePlayerChangeEvent e)
           
 void gamePlayerChat(GamePlayerChatEvent e)
           
 void gamePlayerConnected(GamePlayerConnectedEvent e)
           
 void gamePlayerDisconnected(GamePlayerDisconnectedEvent e)
           
 void gameReport(GameReportEvent e)
           
 void gameSettingsChange(GameSettingsChangeEvent e)
           
 void gameTurnChange(GameTurnChangeEvent e)
           
 java.awt.Component getComponent()
           
 Coords getLastCursor()
           
 Player getLocalPlayer()
           
 Coords getSelected()
           
 TilesetManager getTilesetManager()
           
 void hideTooltip()
           
 void highlight(Coords coords)
          Determines if this Board contains the Coords, and if so, highlights that Coords.
 boolean isMovingUnits()
           
 void markDeploymentHexesFor(Entity en)
           
 void mouseClicked(java.awt.event.MouseEvent me)
           
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
           
 void mouseExited(java.awt.event.MouseEvent me)
           
 void mouseMoved(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void postRender()
           
 void preferenceChange(PreferenceChangeEvent e)
           
 void processBoardViewEvent(BoardViewEvent event)
          Notifies attached board listeners of the event.
 void redrawEntity(Entity entity)
           
 void refreshAttacks()
           
 void refreshDisplayables()
           
 void refreshMinefields()
           
 void removeAttacksFor(Entity entity)
           
 void removeBoardViewListener(BoardViewListener listener)
          Removes the specified board listener.
 void select(Coords coords)
          Determines if this Board contains the Coords, and if so, "selects" that Coords.
 void setFirstLOS(Coords c)
           
 void setLocalPlayer(Player p)
           
(package private)  java.lang.String setView(int index)
           
 void showPopup(java.lang.Object popup, Coords c)
           
 boolean toggleIsometric()
           
 void WeaponSelected(MechDisplayEvent b)
          Sent when user selects a weapon in the weapon panel.
 void zoomIn()
           
 void zoomOut()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface megamek.client.ui.IBoardView
addKeyListener
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

dragged

boolean dragged
Constructor Detail

BoardView3D

public BoardView3D(IGame game)
            throws java.io.IOException
Construct a new board view for the specified game

Parameters:
game -
Throws:
java.io.IOException
Method Detail

setView

java.lang.String setView(int index)

preferenceChange

public void preferenceChange(PreferenceChangeEvent e)
Specified by:
preferenceChange in interface IPreferenceChangeListener

addBoardViewListener

public void addBoardViewListener(BoardViewListener listener)
Adds the specified board listener to receive board events from this board.

Specified by:
addBoardViewListener in interface IBoardView
Parameters:
listener - the board listener.
See Also:
BoardViewListener

removeBoardViewListener

public void removeBoardViewListener(BoardViewListener listener)
Removes the specified board listener.

Specified by:
removeBoardViewListener in interface IBoardView
Parameters:
listener - the board listener.

processBoardViewEvent

public void processBoardViewEvent(BoardViewEvent event)
Notifies attached board listeners of the event.

Specified by:
processBoardViewEvent in interface IBoardView
Parameters:
event - the board event.

addDisplayable

public void addDisplayable(IDisplayable disp)
Specified by:
addDisplayable in interface IBoardView

postRender

public void postRender()

showPopup

public void showPopup(java.lang.Object popup,
                      Coords c)
Specified by:
showPopup in interface IBoardView

hideTooltip

public void hideTooltip()
Specified by:
hideTooltip in interface IBoardView

isMovingUnits

public boolean isMovingUnits()
Specified by:
isMovingUnits in interface IBoardView

redrawEntity

public void redrawEntity(Entity entity)
Specified by:
redrawEntity in interface IBoardView

centerOnHex

public void centerOnHex(Coords c)
Specified by:
centerOnHex in interface IBoardView

drawMovementData

public void drawMovementData(Entity entity,
                             MovePath md)
Specified by:
drawMovementData in interface IBoardView

clearMovementData

public void clearMovementData()
Specified by:
clearMovementData in interface IBoardView

setLocalPlayer

public void setLocalPlayer(Player p)
Specified by:
setLocalPlayer in interface IBoardView

getLocalPlayer

public Player getLocalPlayer()
Specified by:
getLocalPlayer in interface IBoardView

markDeploymentHexesFor

public void markDeploymentHexesFor(Entity en)
Specified by:
markDeploymentHexesFor in interface IBoardView

addAttack

public void addAttack(AttackAction aa)
Specified by:
addAttack in interface IBoardView

removeAttacksFor

public void removeAttacksFor(Entity entity)
Specified by:
removeAttacksFor in interface IBoardView

refreshAttacks

public void refreshAttacks()
Specified by:
refreshAttacks in interface IBoardView

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent me)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

drawRuler

public void drawRuler(Coords s,
                      Coords e,
                      java.awt.Color sc,
                      java.awt.Color ec)
Specified by:
drawRuler in interface IBoardView

getLastCursor

public Coords getLastCursor()
Specified by:
getLastCursor in interface IBoardView
Returns:
Returns the lastCursor.

getSelected

public Coords getSelected()
Specified by:
getSelected in interface IBoardView
Returns:
Returns the selected.

setFirstLOS

public void setFirstLOS(Coords c)
Specified by:
setFirstLOS in interface IBoardView
Parameters:
c - The firstLOS to set.

select

public void select(Coords coords)
Determines if this Board contains the Coords, and if so, "selects" that Coords.

Specified by:
select in interface IBoardView
Parameters:
coords - the Coords.

highlight

public void highlight(Coords coords)
Determines if this Board contains the Coords, and if so, highlights that Coords.

Specified by:
highlight in interface IBoardView
Parameters:
coords - the Coords.

cursor

public void cursor(Coords coords)
Determines if this Board contains the Coords, and if so, "cursors" that Coords.

Specified by:
cursor in interface IBoardView
Parameters:
coords - the Coords.

checkLOS

public void checkLOS(Coords coords)
Specified by:
checkLOS in interface IBoardView

boardNewBoard

public void boardNewBoard(BoardEvent b)
Description copied from interface: BoardListener
Sent when Board completely changed

Specified by:
boardNewBoard in interface BoardListener
Parameters:
b - an event containing information about the change

boardChangedHex

public void boardChangedHex(BoardEvent b)
Description copied from interface: BoardListener
Sent when Hex on the Board changed

Specified by:
boardChangedHex in interface BoardListener
Parameters:
b - an event containing information about the change

boardChangedAllHexes

public void boardChangedAllHexes(BoardEvent b)
Description copied from interface: BoardListener
Sent when all hexes on the board changed

Specified by:
boardChangedAllHexes in interface BoardListener
Parameters:
b - an event containing information about the change

gameEntityNew

public void gameEntityNew(GameEntityNewEvent e)
Specified by:
gameEntityNew in interface GameListener

gameEntityRemove

public void gameEntityRemove(GameEntityRemoveEvent e)
Specified by:
gameEntityRemove in interface GameListener

gameEntityChange

public void gameEntityChange(GameEntityChangeEvent e)
Specified by:
gameEntityChange in interface GameListener

gameNewAction

public void gameNewAction(GameNewActionEvent e)
Specified by:
gameNewAction in interface GameListener

gameBoardNew

public void gameBoardNew(GameBoardNewEvent e)
Specified by:
gameBoardNew in interface GameListener

gameBoardChanged

public void gameBoardChanged(GameBoardChangeEvent e)
Specified by:
gameBoardChanged in interface GameListener

gamePhaseChange

public void gamePhaseChange(GamePhaseChangeEvent e)
Specified by:
gamePhaseChange in interface GameListener

WeaponSelected

public void WeaponSelected(MechDisplayEvent b)
Description copied from interface: MechDisplayListener
Sent when user selects a weapon in the weapon panel.

Specified by:
WeaponSelected in interface MechDisplayListener
Parameters:
b - an event

zoomIn

public void zoomIn()
Specified by:
zoomIn in interface IBoardView

zoomOut

public void zoomOut()
Specified by:
zoomOut in interface IBoardView

getComponent

public java.awt.Component getComponent()
Specified by:
getComponent in interface IBoardView

getTilesetManager

public TilesetManager getTilesetManager()
Specified by:
getTilesetManager in interface IBoardView

refreshMinefields

public void refreshMinefields()
Specified by:
refreshMinefields in interface IBoardView

refreshDisplayables

public void refreshDisplayables()
Specified by:
refreshDisplayables in interface IBoardView

gamePlayerConnected

public void gamePlayerConnected(GamePlayerConnectedEvent e)
Specified by:
gamePlayerConnected in interface GameListener

gamePlayerDisconnected

public void gamePlayerDisconnected(GamePlayerDisconnectedEvent e)
Specified by:
gamePlayerDisconnected in interface GameListener

gamePlayerChange

public void gamePlayerChange(GamePlayerChangeEvent e)
Specified by:
gamePlayerChange in interface GameListener

gamePlayerChat

public void gamePlayerChat(GamePlayerChatEvent e)
Specified by:
gamePlayerChat in interface GameListener

gameTurnChange

public void gameTurnChange(GameTurnChangeEvent e)
Specified by:
gameTurnChange in interface GameListener

gameReport

public void gameReport(GameReportEvent e)
Specified by:
gameReport in interface GameListener

gameEnd

public void gameEnd(GameEndEvent e)
Specified by:
gameEnd in interface GameListener

gameSettingsChange

public void gameSettingsChange(GameSettingsChangeEvent e)
Specified by:
gameSettingsChange in interface GameListener

gameMapQuery

public void gameMapQuery(GameMapQueryEvent e)
Specified by:
gameMapQuery in interface GameListener

gameEntityNewOffboard

public void gameEntityNewOffboard(GameEntityNewOffboardEvent e)
Specified by:
gameEntityNewOffboard in interface GameListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

toggleIsometric

public boolean toggleIsometric()
Specified by:
toggleIsometric in interface IBoardView