rl.leviathan.client.game.ui
Class LeviathanGamePanel

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 rl.client.game.ui.GamePanel
                      extended by rl.leviathan.client.game.ui.LeviathanGamePanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, GameClientBoardListener, GameClientElementListener, CombatUnitSelectionListener, GameBoardPanelListener, LeviathanGameListener, LeviathanTurnListener, CapitalShipMovementDialogListener

public class LeviathanGamePanel
extends GamePanel
implements GameClientBoardListener, LeviathanGameListener, LeviathanTurnListener, java.awt.event.ActionListener, java.beans.PropertyChangeListener, CapitalShipMovementDialogListener

See Also:
Serialized Form

Nested Class Summary
static class LeviathanGamePanel.PanelMode
           
 
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)  javax.swing.JMenuItem m_PlaceGameElementMenuItem
           
(package private)  javax.swing.JMenuItem m_PlaceUnitMenuItem
           
(package private)  javax.swing.JMenuItem m_RemoveGameElementMenuItem
           
(package private)  javax.swing.JMenuItem m_RemoveUnitMenuItem
           
(package private) static long serialVersionUID
           
 
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
LeviathanGamePanel(LeviathanGameClient gameClient)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void centerMapOnPoint(java.awt.Point p)
           
 void clearStatusMessage()
           
 void contextMenuRequested(java.awt.Point p)
           
 void disconnected()
           
 void elementCompletedFiring(GameElementIdentifier source, boolean roundComplete)
           
 void elementCompletedPointDefence(GameElementIdentifier source, boolean roundComplete)
           
 void elementDamaged(GameElement element)
          Called when an element has been damaged
 void elementDestroyed(GameElement element)
          Called when an element has been damaged and destroyed
 void elementFiring(GameElementIdentifier source, GameElementIdentifier target, Coordinate sourceCoord, Coordinate targetCoord)
           
 void elementLocationRemoved(GameElement element)
           
 void elementNonVisibleLocationSet(GameElement element, Location location, Affiliation aff)
           
 void elementsToFire(java.util.Vector<GameElementIdentifier> elements)
           
 void elementsToFirePointDefence(java.util.Vector<GameElementIdentifier> elements)
           
 void elementToMove(GameElementIdentifier element)
           
 void elementVisibleLocationSet(GameElement element, Location location, Affiliation aff)
           
 void gameBoard(Board board, java.lang.String themeName)
           
 javax.swing.JPopupMenu getDeploymentContextMenu()
           
 javax.swing.JPopupMenu getGameContextMenu()
           
 void initiativeLoser()
           
 void initiativeWinner()
           
protected  boolean isElementLocatedAt(GameElement element, Coordinate coord)
           
 void notifyMovementOrderSequenceChanged(GameElement element, java.util.Vector<Location> locations)
           
 void phaseChange(java.lang.String phaseName, java.lang.String subPhaseName)
          Controls the UI behaviour dependent upon the current game phase
 void playerFiringAttempts(java.util.Vector<FireAttemptRecord> attempts)
          called to notify the player of the results of the fire attempts
 void playerPointDefenceAttempts(java.util.Vector<PointDefenceAttemptRecord> attempts)
          called to notify the player of the results of the fire attempts
 void powerAllocationRequired(java.util.Vector<GameElementIdentifier> elements)
           
 void powerAllocationSet(CapitalShipPowerAllocation cspa)
           
 void propertyChange(java.beans.PropertyChangeEvent pce)
           
 void selectedLocation(boolean mergeSelection)
           
 void selectElementToMove(java.util.Vector<GameElementIdentifier> elements)
           
 void selectMovementTeamOrder()
           
 void setAdministrator(boolean admin)
           
 void setGameMode()
           
 void setPanelMode(LeviathanGamePanel.PanelMode mode)
           
 void setStatusMessage(java.lang.String message)
           
 void turnCompleted(int turnNumber)
           
 void turnDetails(int turnNumber, java.lang.String phaseName, java.lang.String subPhaseName)
           
 void turnStarted(int turnNumber)
           
 void validFiringTargets(java.util.Vector<GameElementIdentifier> elements)
           
 void validPointDefenceTargets(java.util.Vector<GameElementIdentifier> elements)
           
 
Methods inherited from class rl.client.game.ui.GamePanel
addElementLocation, elementsDeselected, elementsSelected, gameElementLocationRemoved, gameElementNonVisibleLocationSet, gameElementVisibleLocationSet, getActiveFrame, getAffiliatedElements, getAffiliatedElements, getAffiliationForLocation, getCurrentGameElement, getCurrentGameElements, getElementLocationAffiliations, getElementsForLocation, getGameBoardPanel, getLocationForElement, getSelectedElements, hideGlassPane, isAffiliated, mergeSelectedElements, removeElementLocation, setCurrentGameElement, setSelectedElements, showGlassPane
 
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

m_PlaceUnitMenuItem

javax.swing.JMenuItem m_PlaceUnitMenuItem

m_RemoveUnitMenuItem

javax.swing.JMenuItem m_RemoveUnitMenuItem

m_PlaceGameElementMenuItem

javax.swing.JMenuItem m_PlaceGameElementMenuItem

m_RemoveGameElementMenuItem

javax.swing.JMenuItem m_RemoveGameElementMenuItem
Constructor Detail

LeviathanGamePanel

public LeviathanGamePanel(LeviathanGameClient gameClient)
Method Detail

setAdministrator

public void setAdministrator(boolean admin)

disconnected

public void disconnected()

setGameMode

public void setGameMode()
Specified by:
setGameMode in class GamePanel

gameBoard

public void gameBoard(Board board,
                      java.lang.String themeName)
Specified by:
gameBoard in interface GameClientBoardListener

setStatusMessage

public void setStatusMessage(java.lang.String message)
Specified by:
setStatusMessage in class GamePanel

clearStatusMessage

public void clearStatusMessage()
Specified by:
clearStatusMessage in class GamePanel

contextMenuRequested

public void contextMenuRequested(java.awt.Point p)
Specified by:
contextMenuRequested in interface GameBoardPanelListener
Specified by:
contextMenuRequested in class GamePanel

centerMapOnPoint

public void centerMapOnPoint(java.awt.Point p)
Specified by:
centerMapOnPoint in interface GameBoardPanelListener
Specified by:
centerMapOnPoint in class GamePanel

selectedLocation

public void selectedLocation(boolean mergeSelection)
Specified by:
selectedLocation in interface GameBoardPanelListener
Specified by:
selectedLocation in class GamePanel

getDeploymentContextMenu

public javax.swing.JPopupMenu getDeploymentContextMenu()

isElementLocatedAt

protected boolean isElementLocatedAt(GameElement element,
                                     Coordinate coord)

getGameContextMenu

public javax.swing.JPopupMenu getGameContextMenu()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

elementVisibleLocationSet

public void elementVisibleLocationSet(GameElement element,
                                      Location location,
                                      Affiliation aff)
Specified by:
elementVisibleLocationSet in class GamePanel

elementNonVisibleLocationSet

public void elementNonVisibleLocationSet(GameElement element,
                                         Location location,
                                         Affiliation aff)
Specified by:
elementNonVisibleLocationSet in class GamePanel

elementLocationRemoved

public void elementLocationRemoved(GameElement element)
Specified by:
elementLocationRemoved in class GamePanel

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent pce)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

initiativeWinner

public void initiativeWinner()
Specified by:
initiativeWinner in interface LeviathanGameListener

initiativeLoser

public void initiativeLoser()
Specified by:
initiativeLoser in interface LeviathanGameListener

selectMovementTeamOrder

public void selectMovementTeamOrder()
Specified by:
selectMovementTeamOrder in interface LeviathanGameListener

powerAllocationRequired

public void powerAllocationRequired(java.util.Vector<GameElementIdentifier> elements)
Specified by:
powerAllocationRequired in interface LeviathanGameListener

powerAllocationSet

public void powerAllocationSet(CapitalShipPowerAllocation cspa)
Specified by:
powerAllocationSet in interface LeviathanGameListener

turnDetails

public void turnDetails(int turnNumber,
                        java.lang.String phaseName,
                        java.lang.String subPhaseName)
Specified by:
turnDetails in interface LeviathanTurnListener

turnStarted

public void turnStarted(int turnNumber)
Specified by:
turnStarted in interface LeviathanTurnListener

turnCompleted

public void turnCompleted(int turnNumber)
Specified by:
turnCompleted in interface LeviathanTurnListener

phaseChange

public void phaseChange(java.lang.String phaseName,
                        java.lang.String subPhaseName)
Controls the UI behaviour dependent upon the current game phase

Specified by:
phaseChange in interface LeviathanTurnListener

selectElementToMove

public void selectElementToMove(java.util.Vector<GameElementIdentifier> elements)
Specified by:
selectElementToMove in interface LeviathanGameListener

elementToMove

public void elementToMove(GameElementIdentifier element)
Specified by:
elementToMove in interface LeviathanGameListener

notifyMovementOrderSequenceChanged

public void notifyMovementOrderSequenceChanged(GameElement element,
                                               java.util.Vector<Location> locations)
Specified by:
notifyMovementOrderSequenceChanged in interface CapitalShipMovementDialogListener

elementsToFire

public void elementsToFire(java.util.Vector<GameElementIdentifier> elements)
Specified by:
elementsToFire in interface LeviathanGameListener

validFiringTargets

public void validFiringTargets(java.util.Vector<GameElementIdentifier> elements)
Specified by:
validFiringTargets in interface LeviathanGameListener

elementFiring

public void elementFiring(GameElementIdentifier source,
                          GameElementIdentifier target,
                          Coordinate sourceCoord,
                          Coordinate targetCoord)
Specified by:
elementFiring in interface LeviathanGameListener

elementCompletedFiring

public void elementCompletedFiring(GameElementIdentifier source,
                                   boolean roundComplete)
Specified by:
elementCompletedFiring in interface LeviathanGameListener

playerFiringAttempts

public void playerFiringAttempts(java.util.Vector<FireAttemptRecord> attempts)
called to notify the player of the results of the fire attempts

Specified by:
playerFiringAttempts in interface LeviathanGameListener

playerPointDefenceAttempts

public void playerPointDefenceAttempts(java.util.Vector<PointDefenceAttemptRecord> attempts)
called to notify the player of the results of the fire attempts

Specified by:
playerPointDefenceAttempts in interface LeviathanGameListener

elementsToFirePointDefence

public void elementsToFirePointDefence(java.util.Vector<GameElementIdentifier> elements)
Specified by:
elementsToFirePointDefence in interface LeviathanGameListener

validPointDefenceTargets

public void validPointDefenceTargets(java.util.Vector<GameElementIdentifier> elements)
Specified by:
validPointDefenceTargets in interface LeviathanGameListener

elementCompletedPointDefence

public void elementCompletedPointDefence(GameElementIdentifier source,
                                         boolean roundComplete)
Specified by:
elementCompletedPointDefence in interface LeviathanGameListener

setPanelMode

public void setPanelMode(LeviathanGamePanel.PanelMode mode)

elementDamaged

public void elementDamaged(GameElement element)
Description copied from interface: LeviathanGameListener
Called when an element has been damaged

Specified by:
elementDamaged in interface LeviathanGameListener

elementDestroyed

public void elementDestroyed(GameElement element)
Description copied from interface: LeviathanGameListener
Called when an element has been damaged and destroyed

Specified by:
elementDestroyed in interface LeviathanGameListener