megamek.client.ui.swing
Class BoardView1

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by megamek.client.ui.swing.BoardView1
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.Scrollable, MechDisplayListener, IBoardView, BoardListener, IPreferenceChangeListener

public class BoardView1
extends javax.swing.JPanel
implements IBoardView, javax.swing.Scrollable, BoardListener, java.awt.event.MouseListener, MechDisplayListener, IPreferenceChangeListener

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

See Also:
Serialized Form

Nested Class Summary
protected  class BoardView1.RedrawWorker
          the old redrawworker converted to a runnable which is called now and then from the event thread
(package private)  class BoardView1.Sprite
          Everything in the main map view is either the board or it's a sprite displayed on top of the board.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  java.util.ArrayList<megamek.client.ui.swing.BoardView1.AttackSprite> attackSprites
           
protected  java.util.ArrayList<BoardViewListener> boardListeners
           
(package private)  java.util.ArrayList<IDisplayable> displayables
           
(package private)  java.awt.Polygon[] facingPolys
           
(package private)  IGame game
           
(package private)  java.awt.Dimension hex_size
           
(package private)  java.awt.Polygon hexPoly
           
(package private)  java.awt.Polygon[] movementPolys
           
protected  BoardView1.RedrawWorker redrawWorker
           
(package private)  float scale
           
(package private)  TilesetManager tileManager
           
 int zoomIndex
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BoardView1(IGame game)
          Construct a new board view for the specified game
 
Method Summary
 void addAttack(AttackAction aa)
          Adds an attack to the sprite list.
 void addBoardViewListener(BoardViewListener listener)
          Adds the specified board listener to receive board events from this board.
 void addC3Link(Entity e)
          Adds a c3 line to the sprite list.
 void addDisplayable(IDisplayable disp)
           
 void addFlyOverPath(Entity e)
          add a fly over path to the sprite list
(package private)  void addMovingUnit(Entity entity, java.util.Vector<UnitLocation> movePath)
           
(package private)  void boardChanged()
           
 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 c)
           
 void clearAllAttacks()
          Clears out all attacks that were being drawn
 void clearAllMoveVectors()
          Clears out all movement vectors that were being drawn
 void clearC3Networks()
           
 void clearFlyOverPaths()
           
 void clearMovementData()
          Clears current movement data from the screen
(package private)  void clearSprites()
           
 void cursor(Coords coords)
          Determines if this Board contains the Coords, and if so, "cursors" that Coords.
 void cursor(int x, int y)
          "Cursors" the specified Coords.
(package private)  boolean doMoveUnits(long idleTime)
           
 void drawMovementData(Entity entity, MovePath md)
          Clears the old movement data and draws the new.
 void drawRuler(Coords s, Coords e, java.awt.Color sc, java.awt.Color ec)
           
protected  void firstLOSHex(Coords c)
           
 java.awt.Component getComponent()
           
(package private)  Coords getCoordsAt(java.awt.Point p)
          Returns the coords at the specified point
 java.awt.Image getEntireBoardImage()
          This method creates an image the size of the entire board (all mapsheets), draws the hexes onto it, and returns that image.
 Coords getFirstLOS()
           
(package private)  java.awt.Point getHexLocation(Coords c)
           
 Coords getHighlighted()
           
 Coords getLastCursor()
           
 Player getLocalPlayer()
           
 java.awt.Dimension getPreferredScrollableViewportSize()
           
 java.awt.Dimension getPreferredSize()
           
(package private)  java.awt.Image getScaledImage(java.awt.Image base)
          Manages a cache of scaled images.
 int getScrollableBlockIncrement(java.awt.Rectangle arg0, int arg1, int arg2)
           
 boolean getScrollableTracksViewportHeight()
           
 boolean getScrollableTracksViewportWidth()
           
 int getScrollableUnitIncrement(java.awt.Rectangle arg0, int arg1, int arg2)
           
 Coords getSelected()
           
 TilesetManager getTilesetManager()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
          The text to be displayed when the mouse is at a certain point TODO: just use a StringBuffer...
 void hideTooltip()
           
 void highlight(Coords coords)
          Determines if this Board contains the Coords, and if so, highlights that Coords.
 void highlight(int x, int y)
          Highlights the specified Coords.
 void initPolys()
          Initializes the various overlay polygons with their vertices.
 boolean isMovingUnits()
           
 boolean isTileImagesLoaded()
          Determine if the tile manager's images have been loaded.
 void markDeploymentHexesFor(Entity ce)
          Specifies that this should mark the deployment hexes for a player.
 void mouseAction(Coords coords, int mtype, int modifiers)
          Notifies listeners about the specified mouse action.
 void mouseAction(int x, int y, int mtype, int modifiers)
          Determines if this Board contains the (x, y) Coords, and if so, notifies listeners about the specified mouse action.
 void mouseClicked(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
           
 void mouseExited(java.awt.event.MouseEvent me)
           
 void mousePressed(java.awt.event.MouseEvent me)
           
 void mouseReleased(java.awt.event.MouseEvent me)
           
 void paintComponent(java.awt.Graphics g)
          Draw the screen!
 void preferenceChange(PreferenceChangeEvent e)
           
 void processBoardViewEvent(BoardViewEvent event)
          Notifies attached board listeners of the event.
(package private)  void redrawAllEntities()
          Clears all old entity sprites out of memory and sets up new ones.
 void redrawEntity(Entity entity)
          Clears the sprite for an entity and prepares it to be re-drawn.
 void redrawMovingEntity(Entity entity, Coords position, int facing)
           
 void refreshAttacks()
          Clears out all attacks and re-adds the ones in the current game.
 void refreshDisplayables()
          refresh the IDisplayables
 void refreshMinefields()
           
 void refreshMoveVectors()
           
 void refreshMoveVectors(Entity en, MovePath md, java.awt.Color col)
           
 void removeAttacksFor(Entity e)
          Removes all attack sprites from a certain entity
 void removeBoardViewListener(BoardViewListener listener)
          Removes the specified board listener.
 void removeDisplayable(IDisplayable disp)
           
protected  void scheduleRedraw()
           
protected  void scheduleRedrawTimer()
          this should only be called once!!
protected  void secondLOSHex(Coords c2, Coords c1)
           
 void select(Coords coords)
          Determines if this Board contains the Coords, and if so, "selects" that Coords.
 void select(int x, int y)
          "Selects" the specified Coords.
 void setFirstLOS(Coords firstLOS)
           
 void setHighlighted(Coords highlighted)
           
 void setLastCursor(Coords lastCursor)
           
 void setLocalPlayer(Player p)
           
 void setSelected(Coords selected)
           
 void setUseLOSTool(boolean use)
           
 void showPopup(java.lang.Object popup, Coords c)
           
 boolean toggleIsometric()
           
protected  void updateBoard()
           
 void updateEcmList()
           
 void WeaponSelected(MechDisplayEvent b)
          Sent when user selects a weapon in the weapon panel.
 void zoomIn()
          Increases zoomIndex and refreshes the map.
 void zoomOut()
          Decreases zoomIndex and refreshes the map.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface megamek.client.ui.IBoardView
addKeyListener
 

Field Detail

zoomIndex

public int zoomIndex

hex_size

java.awt.Dimension hex_size

game

IGame game

attackSprites

java.util.ArrayList<megamek.client.ui.swing.BoardView1.AttackSprite> attackSprites

tileManager

TilesetManager tileManager

hexPoly

java.awt.Polygon hexPoly

facingPolys

java.awt.Polygon[] facingPolys

movementPolys

java.awt.Polygon[] movementPolys

scale

float scale

displayables

java.util.ArrayList<IDisplayable> displayables

boardListeners

protected transient java.util.ArrayList<BoardViewListener> boardListeners

redrawWorker

protected final BoardView1.RedrawWorker redrawWorker
Constructor Detail

BoardView1

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

Throws:
java.io.IOException
Method Detail

scheduleRedrawTimer

protected void scheduleRedrawTimer()
this should only be called once!! this will cause a timer to schedule constant screen updates every 20 milliseconds!


scheduleRedraw

protected void scheduleRedraw()

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.

addMovingUnit

void addMovingUnit(Entity entity,
                   java.util.Vector<UnitLocation> movePath)

addDisplayable

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

removeDisplayable

public void removeDisplayable(IDisplayable disp)

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the screen!

Overrides:
paintComponent in class javax.swing.JComponent

getEntireBoardImage

public java.awt.Image getEntireBoardImage()
This method creates an image the size of the entire board (all mapsheets), draws the hexes onto it, and returns that image.


getHexLocation

java.awt.Point getHexLocation(Coords c)

drawRuler

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

getCoordsAt

Coords getCoordsAt(java.awt.Point p)
Returns the coords at the specified point


redrawMovingEntity

public void redrawMovingEntity(Entity entity,
                               Coords position,
                               int facing)

isMovingUnits

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

redrawEntity

public void redrawEntity(Entity entity)
Clears the sprite for an entity and prepares it to be re-drawn. Replaces the old sprite with the new! Try to prevent annoying ConcurrentModificationExceptions

Specified by:
redrawEntity in interface IBoardView

redrawAllEntities

void redrawAllEntities()
Clears all old entity sprites out of memory and sets up new ones.


centerOnHex

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

drawMovementData

public void drawMovementData(Entity entity,
                             MovePath md)
Clears the old movement data and draws the new. Since it's less expensive to check for and reuse old step sprites than to make a whole new one, we do that.

Specified by:
drawMovementData in interface IBoardView

clearMovementData

public void clearMovementData()
Clears current movement data from the screen

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 ce)
Specifies that this should mark the deployment hexes for a player. If the player is set to null, no hexes will be marked.

Specified by:
markDeploymentHexesFor in interface IBoardView

addFlyOverPath

public void addFlyOverPath(Entity e)
add a fly over path to the sprite list


addC3Link

public void addC3Link(Entity e)
Adds a c3 line to the sprite list.


addAttack

public void addAttack(AttackAction aa)
Adds an attack to the sprite list.

Specified by:
addAttack in interface IBoardView

removeAttacksFor

public void removeAttacksFor(Entity e)
Removes all attack sprites from a certain entity

Specified by:
removeAttacksFor in interface IBoardView

refreshAttacks

public void refreshAttacks()
Clears out all attacks and re-adds the ones in the current game.

Specified by:
refreshAttacks in interface IBoardView

refreshMoveVectors

public void refreshMoveVectors()

refreshMoveVectors

public void refreshMoveVectors(Entity en,
                               MovePath md,
                               java.awt.Color col)

clearC3Networks

public void clearC3Networks()

clearFlyOverPaths

public void clearFlyOverPaths()

clearAllAttacks

public void clearAllAttacks()
Clears out all attacks that were being drawn


clearAllMoveVectors

public void clearAllMoveVectors()
Clears out all movement vectors that were being drawn


firstLOSHex

protected void firstLOSHex(Coords c)

secondLOSHex

protected void secondLOSHex(Coords c2,
                            Coords c1)

initPolys

public void initPolys()
Initializes the various overlay polygons with their vertices.


doMoveUnits

boolean doMoveUnits(long idleTime)

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

isTileImagesLoaded

public boolean isTileImagesLoaded()
Determine if the tile manager's images have been loaded.

Returns:
true if all images have been loaded. false if more need to be loaded.

setUseLOSTool

public void setUseLOSTool(boolean use)

getTilesetManager

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

setLastCursor

public void setLastCursor(Coords lastCursor)
Parameters:
lastCursor - The lastCursor to set.

getLastCursor

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

setHighlighted

public void setHighlighted(Coords highlighted)
Parameters:
highlighted - The highlighted to set.

getHighlighted

public Coords getHighlighted()
Returns:
Returns the highlighted.

setSelected

public void setSelected(Coords selected)
Parameters:
selected - The selected to set.

getSelected

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

setFirstLOS

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

getFirstLOS

public Coords getFirstLOS()
Returns:
Returns the firstLOS.

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.

select

public void select(int x,
                   int y)
"Selects" the specified Coords.

Parameters:
x - the x coordinate.
y - the y coordinate.

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.

highlight

public void highlight(int x,
                      int y)
Highlights the specified Coords.

Parameters:
x - the x coordinate.
y - the y coordinate.

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.

cursor

public void cursor(int x,
                   int y)
"Cursors" the specified Coords.

Parameters:
x - the x coordinate.
y - the y coordinate.

checkLOS

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

mouseAction

public void mouseAction(int x,
                        int y,
                        int mtype,
                        int modifiers)
Determines if this Board contains the (x, y) Coords, and if so, notifies listeners about the specified mouse action.


mouseAction

public void mouseAction(Coords coords,
                        int mtype,
                        int modifiers)
Notifies listeners about the specified mouse action.

Parameters:
coords - the Coords.

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

boardChanged

void boardChanged()

clearSprites

void clearSprites()

updateBoard

protected void updateBoard()

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

updateEcmList

public void updateEcmList()

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle arg0,
                                       int arg1,
                                       int arg2)
Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle arg0,
                                      int arg1,
                                      int arg2)
Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
The text to be displayed when the mouse is at a certain point TODO: just use a StringBuffer... This is copied from the AWT version

Overrides:
getToolTipText in class javax.swing.JComponent

getComponent

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

refreshDisplayables

public void refreshDisplayables()
refresh the IDisplayables

Specified by:
refreshDisplayables in interface IBoardView

showPopup

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

refreshMinefields

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

zoomIn

public void zoomIn()
Increases zoomIndex and refreshes the map.

Specified by:
zoomIn in interface IBoardView

zoomOut

public void zoomOut()
Decreases zoomIndex and refreshes the map.

Specified by:
zoomOut in interface IBoardView

hideTooltip

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

getScaledImage

java.awt.Image getScaledImage(java.awt.Image base)
Manages a cache of scaled images.


toggleIsometric

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