Class BoardView
java.lang.Object
megamek.client.ui.clientGUI.boardview.AbstractBoardView
megamek.client.ui.clientGUI.boardview.BoardView
- All Implemented Interfaces:
MouseListener,EventListener,IBoardView,KeyBindReceiver,BoardListener,IPreferenceChangeListener
public final class BoardView
extends AbstractBoardView
implements BoardListener, MouseListener, IPreferenceChangeListener, KeyBindReceiver
Displays the board; lets the user scroll around and select points on it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]static final intintstatic final intfinal Gamestatic final intstatic final intThis value is the vertical pixel offset for each hex elevation that is used to draw isometric modebooleanKeeps track of whether all deployment zones should be shown in the Arty Auto Hit Designation phaseintbooleanFields inherited from class megamek.client.ui.clientGUI.boardview.AbstractBoardView
allSprites, boardId, boardViewListeners, localPlayer, overlays -
Constructor Summary
ConstructorsConstructorDescriptionBoardView(Game game, MegaMekController controller, ClientGUI clientgui, int boardId) Construct a new board view for the specified game -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAttack(AttackAction attackAction) Adds an attack to the sprite list.voidAdds a c3 line to the sprite list.voidaddFlyOverPath(Entity entity) add a fly over path to the sprite listvoidaddHexDrawPlugin(HexDrawPlugin plugin) voidaddSprites(Collection<? extends Sprite> sprites) Adds the given collection ofSpriteto be shown on this BoardView to its set of sprites.voidaddStrafingCoords(Coords coords) voidboardChangedAllHexes(BoardEvent boardEvent) Sent when all hexes on the board changed.voidboardChangedHex(BoardEvent boardEvent) Sent when a single hex on the Board changed.voidboardNewBoard(BoardEvent boardEvent) Sent when the Board is completely changed.voidCenters the board on the position of the given unit.voidcenterOnHex(Coords coords) Notifies this BoardView to center itself on the given Coords.voidcenterOnPointRel(double xRelative, double yRelative) Centers the board to a pointvoidCenters the board on the position of the selected unit, if any.Displays a dialog and changes the theme of all board hexes to the user-chosen theme.voidCheck to see if the HexImageCache should be cleared because of field-of-view changes.voidvoidClears out all attacks that were being drawnvoidClears out all movement vectors that were being drawnvoidvoidvoidvoidclearHexImageCache(Set<Coords> setCoords) Clear a specific list of Coords from the hex image cache.voidClears current movement data from the screenvoidvoidRemoves all sprites from this BoardView.voidcreateShadowMask(Image image) voidcursor(int x, int y) "Cursors" the specified Coords.voidDetermines if this Board contains the Coords, and if so, "cursors" that Coords.voiddispose()Frees the resources thisBoardViewuses and removes listeners.voidThis method should be overridden to do the actual drawing of the board image into the provided Graphics.voiddrawHexBorder(Graphics2D graphics2D, Color color, double padding, double lineWidth) voiddrawHexBorder(Graphics2D graphics2D, Point point, Color col, double pad, double lineWidth) voiddrawMovementData(Entity entity, MovePath movePath) Clears the old movement data and draws the new.voidgetBoard()Returns the pixel size of the entire board if drawn at the current zoom level.getCentreHexLocation(Coords coords) getCentreHexLocation(Coords coords, boolean ignoreElevation) booleangetComponent(boolean scrollBars) getCoordsAt(Point point) Returns the entity that is currently being deployedgetEntireBoardImage(boolean ignoreUnits, boolean useBaseZoom) Returns an image of the entire board.getEntitiesFlyingOver(Coords coords) Shape[]getHexLocation(Coords coords) static PolygonShape[]intgetNightDarkenedColor(int rgb) Given an int-packed RGB value, apply a modifier for the light level and return the result.getPanel()floatgetScale()getScaledImage(Image base, boolean useCache) Return a scaled version of the input.intgetScrollableBlockIncrement(Rectangle rectangle, int arg1, int arg2) Override this to provide a return value exactly as the Scrollable interface method of the same name.intgetScrollableUnitIncrement(Rectangle rectangle, int arg1, int arg2) Override this to provide a return value exactly as the Scrollable interface method of the same name.Mounted<?> returns the weapon selected in the mek display, or null if none selected, or it is not artillery or null if the selected entity is not ownedintdouble[]Returns the currently visible area of the board.voidhighlight(int x, int y) Highlights the specified Coords.voidDetermines if this Board contains the Coords, and if so, highlights that Coords.voidhighlightSelectedEntities(List<Entity> entities) Highlights multiple entities on the board view.voidhighlightSelectedEntity(Entity entity) voidInitializes the various overlay polygons with their vertices.booleanbooleanisOnThisBord(BoardLocation boardLocation) booleanisOnThisBord(Targetable targetable) booleanReturns true when thisBoardViewis showing some animation and should not be centered on another hex or be hidden right now.booleanvoidSpecifies that this should mark the deployment hexes for a player.voidmouseAction(int x, int y, int mouseActionType, int modifiers, int mouseButton) Determines if this Board contains the (x, y) Coords, and if so, notifies listeners about the specified mouse action.voidmouseAction(Coords coords, int eventType, int modifiers, int mouseButton) Notifies listeners about the specified mouse action.voidvoidmouseEntered(MouseEvent mouseEvent) voidmouseExited(MouseEvent mouseEvent) voidmousePressed(MouseEvent mouseEvent) voidmouseReleased(MouseEvent mouseEvent) voidvoidClears all old entity sprites out of memory and sets up new ones.voidredrawEntity(Entity entity) Clears the sprite for an entity and prepares it to be re-drawn.voidredrawMovingEntity(Entity entity, Coords position, int facing, int elevation) voidClears out all attacks and re-adds the ones in the current game.voidvoidrefreshMoveVectors(Entity entity, MovePath movePath, Color color) voidremoveAttacksFor(Entity entity) Removes all attack sprites from a certain entityvoidremoveSprites(Collection<? extends Sprite> sprites) Removes the given collection ofSpritefrom this BoardView's set of sprites.voidrepaint()Schedules a repaint of the BoardView.voidselect(int x, int y) "Selects" the specified Coords.voidDetermines if this Board contains the Coords, and if so, "selects" that Coords.voidselectEntity(Entity entity) voidsetChatterBoxActive(boolean chatterBoxActive) voidSets the demolition charge hexes to highlight (selected in the Detonate Charges dialog).voidsetDisplayInvalidFields(boolean displayInvalidFields) Sets this BoardView to show or hide a warning in fields (hexes) that contain invalid information such as terrains that cannot be used together in a single hex.voidsetFirstLOS(Coords firstLOS) voidsetHighlightColor(Color color) voidsetHighlightedEntityHexes(List<Coords> hexes) Sets the hexes to highlight with white borders (for Nova CEWS network dialog).voidsetLastCursor(Coords lastCursor) voidsetLocalPlayer(int playerId) voidsetSelected(Coords selected) voidsetShouldIgnoreKeys(boolean shouldIgnoreKeys) voidsetShowLobbyPlayerDeployment(boolean showLobbyPlayerDeployment) voidsetStrafingCoords(Collection<Coords> coords) voidsetTooltipProvider(BoardViewTooltipProvider provider) Adds the given BoardViewTooltipProvider to this BoardView to provide the tooltips that are shown, replacing the previous BoardViewTooltipProvider, if any.voidsetUseLosTool(boolean use) booleanbooleanbooleanThis method should return true when this KeyBindReceiver is in a state to receive the keybind and may react to it, false otherwise.voidshowPopup(JPopupMenu popUp, Coords coords) voidvoidvoidvoidvoidvoidUpdates maps that determine how to shade hexes affected by E(C)CM.voidvoidzoomIn()Zooms in the board (shows less of it at bigger size), if the maximum zoom has not been reached already.voidzoomOut()Zooms out the board (shows more of it at smaller size), if the minimum zoom has not been reached already.voidToggles between two Zoom levels.voidReset the zoom level to the BASE_ZOOM_INDEXMethods inherited from class megamek.client.ui.clientGUI.boardview.AbstractBoardView
addBoardViewListener, addOverlay, getAllSprites, getBoardId, getLocalPlayer, processBoardViewEvent, removeBoardViewListener, removeOverlay, setLocalPlayerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.client.ui.clientGUI.boardview.IBoardView
addSprite, clearMarkedHexes, displayInvalidFields, refreshDisplayables, removeSprite
-
Field Details
-
HEX_DIAG
public static final int HEX_DIAG -
ISOMETRIC_OFFSET
public static final int ISOMETRIC_OFFSETThis value is the vertical pixel offset for each hex elevation that is used to draw isometric mode- See Also:
-
allDirections
public static final int[] allDirections -
DROP_SHADOW_DISTANCE
public int DROP_SHADOW_DISTANCE -
zoomIndex
public int zoomIndex -
zoomOverview
public boolean zoomOverview -
C3_LINE_WIDTH
public static final int C3_LINE_WIDTH- See Also:
-
FLY_OVER_LINE_WIDTH
public static final int FLY_OVER_LINE_WIDTH- See Also:
-
game
-
showAllDeployment
public boolean showAllDeploymentKeeps track of whether all deployment zones should be shown in the Arty Auto Hit Designation phase
-
-
Constructor Details
-
BoardView
public BoardView(Game game, MegaMekController controller, @Nullable ClientGUI clientgui, int boardId) throws IOException Construct a new board view for the specified game- Throws:
IOException
-
-
Method Details
-
shouldReceiveKeyCommands
public boolean shouldReceiveKeyCommands()Description copied from interface:KeyBindReceiverThis method should return true when this KeyBindReceiver is in a state to receive the keybind and may react to it, false otherwise. This should return false when the receiver is hidden, inactive or behind a modal dialog. It should return true when it would be expected to act on a keybind, i.e. when it has the appearance of being in focus.When this method returns false, this receiver will not be counted as having consumed the key press.
- Specified by:
shouldReceiveKeyCommandsin interfaceKeyBindReceiver- Returns:
- True when the receiver is in a state to receive the keybind and may react to it. False otherwise.
-
preferenceChange
- Specified by:
preferenceChangein interfaceIPreferenceChangeListener
-
draw
Description copied from interface:IBoardViewThis method should be overridden to do the actual drawing of the board image into the provided Graphics.- Specified by:
drawin interfaceIBoardView- Parameters:
graphics- The Graphics object to draw the board onto
-
clearShadowMap
public void clearShadowMap() -
drawHexBorder
-
drawHexBorder
public void drawHexBorder(Graphics2D graphics2D, Point point, Color col, double pad, double lineWidth) -
getSelectedArtilleryWeapon
returns the weapon selected in the mek display, or null if none selected, or it is not artillery or null if the selected entity is not owned -
getEntireBoardImage
Description copied from interface:IBoardViewReturns an image of the entire board. Depending on parameters, the board may contain any currently present units or other game objects, and it may be drawn at zoom 1 or the current zoom level.- Specified by:
getEntireBoardImagein interfaceIBoardView- Parameters:
ignoreUnits- If true, no units are drawn, only the boarduseBaseZoom- If true, zoom = 1 is used, otherwise the current board zoom- Returns:
- an image of the whole board
-
getNightDarkenedColor
public int getNightDarkenedColor(int rgb) Given an int-packed RGB value, apply a modifier for the light level and return the result.- Parameters:
rgb- int-packed ARGB value.- Returns:
- An int-packed ARGB value, which is an adjusted value of the input, based on the light level
-
getHexLocation
-
getCentreHexLocation
-
getCentreHexLocation
-
drawRuler
-
getRulerStart
-
getRulerEnd
-
getCoordsAt
- Specified by:
getCoordsAtin interfaceIBoardView- Returns:
- the coords at the specified point in the BoardView's image area. The point may be given e.g. as part of a MouseEvent.
-
setTooltipProvider
Description copied from interface:IBoardViewAdds the given BoardViewTooltipProvider to this BoardView to provide the tooltips that are shown, replacing the previous BoardViewTooltipProvider, if any.- Specified by:
setTooltipProviderin interfaceIBoardView- Parameters:
provider- The BoardViewTooltipProvider- See Also:
-
redrawMovingEntity
-
isMovingUnits
public boolean isMovingUnits() -
redrawEntity
Clears the sprite for an entity and prepares it to be re-drawn. Replaces the old sprite with the new! Takes a reference to the Entity object before changes, in case it contained important state information, like DropShips taking off (airborne DropShips lose their secondary hexes). Try to prevent annoying ConcurrentModificationExceptions -
redrawAllEntities
public void redrawAllEntities()Clears all old entity sprites out of memory and sets up new ones. -
centerOnSelected
public void centerOnSelected()Centers the board on the position of the selected unit, if any. Uses smooth centering if activated in the client settings. -
centerOn
Centers the board on the position of the given unit. Uses smooth centering if activated in the client settings. The given entity may be null, in which case nothing happens.- Parameters:
entity- The unit to center on.
-
centerOnHex
Description copied from interface:IBoardViewNotifies this BoardView to center itself on the given Coords. Override this to be safe for null Coords.- Specified by:
centerOnHexin interfaceIBoardView- Parameters:
coords- The coordinates to center on
-
stopSoftCentering
public void stopSoftCentering() -
centerOnPointRel
public void centerOnPointRel(double xRelative, double yRelative) Centers the board to a point- Parameters:
xRelative- the x position relative to board width.yRelative- the y position relative to board height. Both xRelative and yRelative should be between 0 and 1. The method will clip both values to this range.
-
getVisibleArea
public double[] getVisibleArea()Returns the currently visible area of the board.- Returns:
- an array of 4 double values indicating the relative size, where the first two values indicate the x and y position of the upper left corner of the visible area and the second two values the x and y position of the lower right corner. So when the whole board is visible, the values should be 0, 0, 1, 1. When the lower right corner of the board is visible and 90% of width and height: 0.1, 0.1, 1, 1 Due to board padding the values can be outside [0;1]
-
drawMovementData
Clears the old movement data and draws the new. -
clearMovementData
public void clearMovementData()Clears current movement data from the screen -
addStrafingCoords
-
setStrafingCoords
-
clearStrafingCoords
public void clearStrafingCoords() -
getClientgui
-
getScale
public float getScale() -
getHexSize
-
getTileManager
-
getFacingPolys
-
getMovementPolys
-
getUpArrow
-
getDownArrow
-
markDeploymentHexesFor
Specifies that this should mark the deployment hexes for a player. If the player is set to null, no hexes will be marked. -
getDeployingEntity
Returns the entity that is currently being deployed -
addFlyOverPath
add a fly over path to the sprite list -
getEntitiesFlyingOver
- Parameters:
coords- the given coords- Returns:
- any entities flying over the given coords
-
addC3Link
Adds a c3 line to the sprite list. -
addAttack
Adds an attack to the sprite list. -
removeAttacksFor
Removes all attack sprites from a certain entity -
refreshAttacks
public void refreshAttacks()Clears out all attacks and re-adds the ones in the current game. -
refreshMoveVectors
public void refreshMoveVectors() -
refreshMoveVectors
-
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 -
initPolys
public void initPolys()Initializes the various overlay polygons with their vertices. -
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
isTileImagesLoaded
public boolean isTileImagesLoaded()- Returns:
- True if all hex tile images have been loaded and the board can be successfully drawn
-
setUseLosTool
public void setUseLosTool(boolean use) - Specified by:
setUseLosToolin interfaceIBoardView
-
getTilesetManager
-
setLastCursor
- Parameters:
lastCursor- The lastCursor to set.
-
getLastCursor
- Returns:
- Returns the lastCursor.
-
setSelected
- Parameters:
selected- The selected to set.
-
getSelected
- Returns:
- Returns the selected.
-
setFirstLOS
- Parameters:
firstLOS- The firstLOS to set.
-
getFirstLOS
- Returns:
- Returns the firstLOS.
-
select
Determines if this Board contains the Coords, and if so, "selects" that Coords.- Specified by:
selectin interfaceIBoardView- 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
Determines if this Board contains the Coords, and if so, highlights that Coords.- Specified by:
highlightin interfaceIBoardView- Parameters:
coords- the Coords.
-
setHighlightColor
- Parameters:
color- The new colour of the highlight cursor.
-
highlight
public void highlight(int x, int y) Highlights the specified Coords.- Parameters:
x- the x coordinate.y- the y coordinate.
-
highlightSelectedEntity
-
highlightSelectedEntities
Highlights multiple entities on the board view. All entities in the provided list will be highlighted. All other entities will be unhighlighted.- Parameters:
entities- List of entities to highlight (can be empty to clear all highlights)
-
setHighlightedEntityHexes
Sets the hexes to highlight with white borders (for Nova CEWS network dialog). Draws white hexagon borders around the specified hex coordinates.- Parameters:
hexes- List of hex coordinates to highlight (can be empty to clear all highlights)
-
setDemolitionChargeHighlightHexes
Sets the demolition charge hexes to highlight (selected in the Detonate Charges dialog). These are drawn with a bold yellow/black hazard outline when the matching client setting is on, otherwise with the plain highlight.- Parameters:
hexes- List of hex coordinates to highlight (can be empty to clear all highlights)
-
cursor
Determines if this Board contains the Coords, and if so, "cursors" that Coords.- Specified by:
cursorin interfaceIBoardView- 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
-
mouseAction
public void mouseAction(int x, int y, int mouseActionType, int modifiers, int mouseButton) Determines if this Board contains the (x, y) Coords, and if so, notifies listeners about the specified mouse action. -
mouseAction
Notifies listeners about the specified mouse action.- Parameters:
coords- - coords the Coords.eventType- - Board view event typemodifiers- - mouse event modifiers mask such as SHIFT_DOWN_MASK etc.mouseButton- - mouse button associated with this event 0 = no button 1 = Button 1 2 = Button 2
-
boardNewBoard
Description copied from interface:BoardListenerSent when the Board is completely changed. The board's size may have changed.- Specified by:
boardNewBoardin interfaceBoardListener- Parameters:
boardEvent- an event containing information about the change
-
boardChangedHex
Description copied from interface:BoardListenerSent when a single hex on the Board changed.- Specified by:
boardChangedHexin interfaceBoardListener- Parameters:
boardEvent- an event containing information about the change
-
boardChangedAllHexes
Description copied from interface:BoardListenerSent when all hexes on the board changed.- Specified by:
boardChangedAllHexesin interfaceBoardListener- Parameters:
boardEvent- an event containing information about the change
-
clearSprites
public void clearSprites()Description copied from class:AbstractBoardViewRemoves all sprites from this BoardView. This includes (possibly) sprites for units, attacks etc. Note that this is not communicated to the SpriteHandlers.- Overrides:
clearSpritesin classAbstractBoardView
-
updateBoard
public void updateBoard() -
selectEntity
- Parameters:
entity- the BoardView's currently selected entity
-
updateEcmList
public void updateEcmList()Updates maps that determine how to shade hexes affected by E(C)CM. This is expensive, so precalculate only when entity changes occur -
getComponent
- Specified by:
getComponentin interfaceIBoardView- Returns:
- a JScrollPane containing the board's panel.
-
setDisplayInvalidFields
public void setDisplayInvalidFields(boolean displayInvalidFields) Description copied from interface:IBoardViewSets this BoardView to show or hide a warning in fields (hexes) that contain invalid information such as terrains that cannot be used together in a single hex. Usually this warning is shown in the board editor but not in a game.- Specified by:
setDisplayInvalidFieldsin interfaceIBoardView- Parameters:
displayInvalidFields- True when the invalid marker should be shown
-
setLocalPlayer
public void setLocalPlayer(int playerId) Description copied from interface:IBoardViewSets theBoardViewto use the given player ID as the player in whose client thisBoardViewis shown. This may affect what is shown and what is hidden in thisBoardView; it will also affect what is considered an enemy and ally.- Specified by:
setLocalPlayerin interfaceIBoardView- Parameters:
playerId- The local player's ID as stored in the game.
-
getComponent
-
showPopup
-
zoomIn
public void zoomIn()Description copied from interface:IBoardViewZooms in the board (shows less of it at bigger size), if the maximum zoom has not been reached already.- Specified by:
zoomInin interfaceIBoardView
-
zoomOut
public void zoomOut()Description copied from interface:IBoardViewZooms out the board (shows more of it at smaller size), if the minimum zoom has not been reached already.- Specified by:
zoomOutin interfaceIBoardView
-
zoomReset
public void zoomReset()Reset the zoom level to the BASE_ZOOM_INDEX- Specified by:
zoomResetin interfaceIBoardView
-
zoomOverviewToggle
public void zoomOverviewToggle()Description copied from interface:IBoardViewToggles between two Zoom levels.- Specified by:
zoomOverviewTogglein interfaceIBoardView
-
getScaledImage
Return a scaled version of the input. If the useCache flag is set, the scaled image will be stored in an image cache for later retrieval.- Parameters:
base- The image to get a scaled copy of. The current zoom level is used to determine the scale.useCache- This flag determines whether the scaled image should be stored in a cache for later retrieval.
-
toggleIsometric
public void toggleIsometric() -
updateEntityLabels
public void updateEntityLabels() -
createShadowMask
-
getChatterBoxActive
public boolean getChatterBoxActive()- Returns:
- Returns true if the BoardView has an active chatter box else false.
-
setChatterBoxActive
public void setChatterBoxActive(boolean chatterBoxActive) - Parameters:
chatterBoxActive- whether the BoardView has an active chatter box or not.
-
setShouldIgnoreKeys
public void setShouldIgnoreKeys(boolean shouldIgnoreKeys) -
clearHexImageCache
public void clearHexImageCache() -
clearHexImageCache
Clear a specific list of Coords from the hex image cache.- Parameters:
setCoords- Set ofCoordsto remove
-
checkFoVHexImageCacheClear
public void checkFoVHexImageCacheClear()Check to see if the HexImageCache should be cleared because of field-of-view changes. -
getHexPoly
-
changeTheme
Displays a dialog and changes the theme of all board hexes to the user-chosen theme. -
getDisplayablesRect
-
shouldFovHighlight
public boolean shouldFovHighlight() -
shouldFovDarken
public boolean shouldFovDarken() -
setShowLobbyPlayerDeployment
public void setShowLobbyPlayerDeployment(boolean showLobbyPlayerDeployment) -
getPanel
- Specified by:
getPanelin interfaceIBoardView- Returns:
- The JPanel that contains this BoardView.
-
getBoardSize
Description copied from interface:IBoardViewReturns the pixel size of the entire board if drawn at the current zoom level. This should not include any padding, just the board itself.- Specified by:
getBoardSizein interfaceIBoardView- Returns:
- The pixel size of the entire board at the current zoom level
-
getAnimatedImages
- Specified by:
getAnimatedImagesin interfaceIBoardView- Returns:
- A set of hashCodes of those image that are animated (such as animated tileset images) and therefore should prevent the hex image from being cached.
-
getScrollableUnitIncrement
Description copied from interface:IBoardViewOverride this to provide a return value exactly as the Scrollable interface method of the same name.- Specified by:
getScrollableUnitIncrementin interfaceIBoardView- See Also:
-
getScrollableBlockIncrement
Description copied from interface:IBoardViewOverride this to provide a return value exactly as the Scrollable interface method of the same name.- Specified by:
getScrollableBlockIncrementin interfaceIBoardView- See Also:
-
dispose
public void dispose()Description copied from interface:IBoardViewFrees the resources thisBoardViewuses and removes listeners. Call when thisBoardViewis not used anymore. TheBoardViewwill no longer be functional after calling this method. When overriding this method, include a call to super.dispose().- Specified by:
disposein interfaceIBoardView- Overrides:
disposein classAbstractBoardView
-
getTurnDetailsOverlay
- Returns:
- The TurnDetailsOverlay if this BoardView has one.
-
getSelectedEntity
- Returns:
- The unit currently shown in the Unit Display. Note: This can be a unit than the one that is selected to move or fire.
-
getFovHighlighting
-
getIsoWreckSprites
-
getAttackSprites
-
repaint
public void repaint()Description copied from interface:IBoardViewSchedules a repaint of the BoardView.- Specified by:
repaintin interfaceIBoardView- See Also:
-
addSprites
Description copied from interface:IBoardViewAdds the given collection ofSpriteto be shown on this BoardView to its set of sprites.- Specified by:
addSpritesin interfaceIBoardView- Overrides:
addSpritesin classAbstractBoardView- Parameters:
sprites- the Sprites to show
-
removeSprites
Description copied from interface:IBoardViewRemoves the given collection ofSpritefrom this BoardView's set of sprites.- Specified by:
removeSpritesin interfaceIBoardView- Overrides:
removeSpritesin classAbstractBoardView- Parameters:
sprites- the Sprites to remove
-
getBoard
- Returns:
- This BoardView's displayed board.
-
isOnThisBord
- Returns:
- True when the given Targetable is not null and is on this board as given by its boardId. Does *not* require the targetable to have a non-null position or a position contained within the board, nor is the targetable's deployment status checked.
-
isOnThisBord
- Returns:
- True when the given boardLocation is on this board according to its boardId only. Does *not* test the position of the boardLocation.
- See Also:
-
isShowingAnimation
public boolean isShowingAnimation()Description copied from interface:IBoardViewReturns true when thisBoardViewis showing some animation and should not be centered on another hex or be hidden right now. An example is showing a unit's move animation.- Specified by:
isShowingAnimationin interfaceIBoardView- Returns:
- True when this
BoardViewis in the process of showing some animation
-
suspendTooltip
public void suspendTooltip() -
activateTooltip
public void activateTooltip() -
toggleShowDeployment
public void toggleShowDeployment() -
addHexDrawPlugin
-
getVerticalOffset
public int getVerticalOffset()- Returns:
- The currently used hex elevation vertical offset; when isometric mode is off, this is 0.
-