rl.centurion.client.game.ui
Class CenturionGamePanel

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.centurion.client.game.ui.CenturionGamePanel
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, CenturionGameListener, CenturionTurnListener, InfantrySquadMovementDialogListener, VehicleMovementDialogListener, GameClientBoardListener, GameClientElementListener, CombatUnitSelectionListener, GameBoardPanelListener

public class CenturionGamePanel
extends GamePanel
implements GameClientBoardListener, CenturionGameListener, CenturionTurnListener, java.awt.event.ActionListener, java.beans.PropertyChangeListener, VehicleMovementDialogListener, InfantrySquadMovementDialogListener

See Also:
Serialized Form

Nested Class Summary
static class CenturionGamePanel.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) 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
CenturionGamePanel(CenturionGameClient gameClient)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void centerMapOnPoint(java.awt.Point p)
           
 void clearStatusMessage()
           
 void commanderToBeSelected(java.util.Vector<Commander> comms)
           
 void contextMenuRequested(java.awt.Point p)
           
 void disconnected()
           
 void doCommandPointAllocation()
           
 void elementCompletedFiring(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)
           
 void elementLocationRemoved(GameElement element)
           
 void elementMoved(GameElementIdentifier element)
           
 void elementNonVisibleLocationSet(GameElement element, Location location, Affiliation aff)
           
 void elementPainted(SuccessfulPaint sp)
           
 void elementPainting(GameElementIdentifier source, GameElementIdentifier target, boolean roundComplete)
           
 void elementsToFire(java.util.Vector<GameElementIdentifier> elements)
           
 void elementsToMove(java.util.Vector<GameElementIdentifier> elements)
           
 void elementsToPaint(java.util.Vector<GameElementIdentifier> elements)
           
 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 opportunityFire(GameElement firer, GameElement target)
          Called when player must allocate fire against a target as a part of Opportunity Fire
 void opportunityFireResponsesRequired(java.util.HashMap<GameElementIdentifier,java.util.Vector<GameElementIdentifier>> ofr)
          Called when player must make a choice about elements that have declared Opportunity Fire
 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 playerPaintingAttempts(java.util.Vector<FireAttemptRecord> attempts)
           
 void pointDefenceAllocation(PointDefenceAllocation pda)
          Called when player must make an allocation of point defence against missile fire
 void propertyChange(java.beans.PropertyChangeEvent pce)
           
 void selectedLocation(boolean mergeSelection)
           
 void selectMovementTeamOrder()
           
 void selectPlayerToFire(java.util.Vector<Player> players)
           
 void selectPlayerToPaint(java.util.Vector<Player> players)
           
 void selectUnitToMove(java.util.Vector<UnitIdentifier> units)
           
 void setAdministrator(boolean admin)
           
 void setGameMode()
           
 void setPanelMode(CenturionGamePanel.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 validPaintTargets(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
Constructor Detail

CenturionGamePanel

public CenturionGamePanel(CenturionGameClient gameClient)
Method Detail

setAdministrator

public void setAdministrator(boolean admin)

disconnected

public void disconnected()

setPanelMode

public void setPanelMode(CenturionGamePanel.PanelMode mode)

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()

getGameContextMenu

public javax.swing.JPopupMenu getGameContextMenu()

isElementLocatedAt

protected boolean isElementLocatedAt(GameElement element,
                                     Coordinate coord)

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

doCommandPointAllocation

public void doCommandPointAllocation()
Specified by:
doCommandPointAllocation in interface CenturionGameListener

initiativeWinner

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

initiativeLoser

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

selectMovementTeamOrder

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

commanderToBeSelected

public void commanderToBeSelected(java.util.Vector<Commander> comms)
Specified by:
commanderToBeSelected in interface CenturionGameListener

selectUnitToMove

public void selectUnitToMove(java.util.Vector<UnitIdentifier> units)
Specified by:
selectUnitToMove in interface CenturionGameListener

elementsToMove

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

elementMoved

public void elementMoved(GameElementIdentifier element)
Specified by:
elementMoved in interface CenturionGameListener

selectPlayerToPaint

public void selectPlayerToPaint(java.util.Vector<Player> players)
Specified by:
selectPlayerToPaint in interface CenturionGameListener

elementsToPaint

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

validPaintTargets

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

elementPainting

public void elementPainting(GameElementIdentifier source,
                            GameElementIdentifier target,
                            boolean roundComplete)
Specified by:
elementPainting in interface CenturionGameListener

elementPainted

public void elementPainted(SuccessfulPaint sp)
Specified by:
elementPainted in interface CenturionGameListener

playerPaintingAttempts

public void playerPaintingAttempts(java.util.Vector<FireAttemptRecord> attempts)
Specified by:
playerPaintingAttempts in interface CenturionGameListener

selectPlayerToFire

public void selectPlayerToFire(java.util.Vector<Player> players)
Specified by:
selectPlayerToFire in interface CenturionGameListener

elementsToFire

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

validFiringTargets

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

elementFiring

public void elementFiring(GameElementIdentifier source,
                          GameElementIdentifier target)
Specified by:
elementFiring in interface CenturionGameListener

elementCompletedFiring

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

playerFiringAttempts

public void playerFiringAttempts(java.util.Vector<FireAttemptRecord> attempts)
Description copied from interface: CenturionGameListener
called to notify the player of the results of the fire attempts

Specified by:
playerFiringAttempts in interface CenturionGameListener

pointDefenceAllocation

public void pointDefenceAllocation(PointDefenceAllocation pda)
Description copied from interface: CenturionGameListener
Called when player must make an allocation of point defence against missile fire

Specified by:
pointDefenceAllocation in interface CenturionGameListener

opportunityFireResponsesRequired

public void opportunityFireResponsesRequired(java.util.HashMap<GameElementIdentifier,java.util.Vector<GameElementIdentifier>> ofr)
Description copied from interface: CenturionGameListener
Called when player must make a choice about elements that have declared Opportunity Fire

Specified by:
opportunityFireResponsesRequired in interface CenturionGameListener

opportunityFire

public void opportunityFire(GameElement firer,
                            GameElement target)
Description copied from interface: CenturionGameListener
Called when player must allocate fire against a target as a part of Opportunity Fire

Specified by:
opportunityFire in interface CenturionGameListener
Parameters:
firer - the element engaging in opportunity fire
target - the target of the opportunity fire

turnDetails

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

turnStarted

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

turnCompleted

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

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 CenturionTurnListener

notifyMovementOrderSequenceChanged

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

elementDamaged

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

Specified by:
elementDamaged in interface CenturionGameListener

elementDestroyed

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

Specified by:
elementDestroyed in interface CenturionGameListener