Package net.sf.colossus.gui
Class ClientGUI
java.lang.Object
net.sf.colossus.gui.ClientGUI
- All Implemented Interfaces:
IClientGUI
,GUICallbacks
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AutoInspector
private BattleBoard
private final List
<GUIBattleChit> private MasterBoard
private CreatureCollectionView
protected final Client
private static final int
private final Object
private Timer
private ConnectionLogWindow
private EngagementResults
private EventViewer
private boolean
private long
private int
private static final Logger
private LogWindow
(package private) String
private MovementDie
private Legion
Information on the current moving legion.private Negotiate
private int
private final Options
protected final IOracle
private final LinkedList
<ClientGUI.PendingMove> private PickCarry
private PreferencesWindow
(package private) boolean
private boolean
private int
private int
private int
private ReplyToProposal
private JFrame
the parent frame for secondary windowsprivate boolean
private StatusScreen
private final LinkedList
<Object> Stack of legion marker ID's, to allow multiple levels of undo for splits, moves, and recruits.private int
private WebClient
private final WhatNextManager
The object which handles what to do next when a game is going to end -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
acquireAngelCallback
(Legion legion, CreatureType angelType) void
actOnAddCreature
(Legion legion, CreatureType creature, String reason) void
void
void
actOnDidMove
(Legion legion, MasterHex startingHex, MasterHex currentHex, boolean teleport, CreatureType teleportingLord, boolean splitLegionHasForcedMove) void
actOnDidRecruit
(Legion legion, CreatureType recruit, List<CreatureType> recruiters, String reason) void
actOnDidSplit
(int turn, Legion parent, Legion child, MasterHex hex) void
void
void
void
void
void
void
void
void
actOnHitsSet
(BattleUnit target) void
void
void
void
void
actOnPlaceNewChit
(String imageName, BattleUnit battleUnit, BattleHex hex) void
void
actOnRemoveCreature
(Legion legion, CreatureType type, String reason) void
actOnRemoveCreaturePart2
(Legion legion) void
actOnRemoveLegion
(Legion legion) void
void
void
void
void
void
void
void
void
actOnTellBattleMove
(BattleHex startingHex, BattleHex endingHex, boolean rememberForUndo) void
actOnTellEngagementResults
(Legion winner, String method, int points, int turns) void
actOnTellGameOver
(String message, boolean disposeFollows) Update Board and Status screen to reflect the new game over state.void
actOnTellLegionLocation
(Legion legion, MasterHex hex) void
actOnTellMovementRoll
(int roll) void
void
actOnTellReplay
(int maxTurn) void
actOnTellStrikeResults
(boolean wasCarry, int strikeNumber, List<String> rolls, BattleCritter striker, BattleCritter target) void
actOnTurnOrPlayerChange
(Client client, int turnNr, Player player) void
actOnUndidMove
(Legion legion, MasterHex formerHex, MasterHex currentHex, boolean splitLegionHasForcedMove, boolean didTeleport) void
actOnUndidRecruitPart
(Legion legion, boolean wasReinforcement, int turnNumber) void
actOnUndidSplit
(Legion survivor, int turn) void
private void
addBattleChit
(GUIBattleChit battleChit) void
addPossibleRecruitChits
(LegionClientSide legion, Set<MasterHex> hexes) void
alignLegionsMaybe
(Legion legion) void
answerConcede
(Legion legion, boolean answer) void
answerFlee
(Legion ally, boolean answer) void
answerPickColor
(PlayerColor color) void
void
applyCarries
(BattleHex hex) (package private) void
askNewCloseQuitCancel
(JFrame frame, boolean fromBattleBoard) void
autoInspectorSetDubiousAsBlanks
(boolean newValue) void
bringUpPickColorDialog
(String playerName, List<PlayerColor> colorsLeft) (package private) void
When user requests it from File menu, this method here requests the server to send us a confirmation package, to confirm that connection is still alive and ok.boolean
Present a dialog allowing the player to enter via land or teleport.private void
void
private void
void
concede()
void
createPickMarkerDialog
(ClientGUI gui, Set<String> markerIds, Legion parent) void
void
didSummon
(Legion summoner, Legion donor, CreatureType summon) private void
private void
private void
private void
(package private) void
private void
void
private void
private void
private void
void
Dispose the PickCarryDialog, make sure that that is done inside the EDT (caused GUI to hang in 1.6.0_39 whereas in 1.6.0_38 it worked )-;private void
private void
void
doAcquireAngel
(Legion legion, List<CreatureType> recruits) void
doBattleMove
(int tag, BattleHex hex) void
void
boolean
private void
void
void
void
doPickCarries
(Client client, int carryDamage, Set<String> carryTargetDescriptions) void
doPickColor
(String playerName, List<PlayerColor> colorsLeft) doPickEntrySide
(MasterHex hex, Set<EntrySide> entrySides) void
doPickInitialMarker
(Set<String> markersAvailable) doPickLord
(List<CreatureType> lords) doPickRecruit
(Legion legion, String hexDescription) doPickRecruiter
(List<String> recruiters, String hexDescription, Legion legion) doPickSplitLegion
(Legion parent, String childMarker) void
doPickSplitMarker
(Legion parent, Set<String> markersAvailable) void
doPickStrikePenalty
(Client client, List<String> choices) void
doPickSummonAngel
(Legion legion, List<Legion> possibleDonors) private void
doSetWhatToDoNext
(WhatNextManager.WhatToDoNext whatToDoNext, boolean triggerQuitTimer) private void
doSetWhatToDoNext
(WhatNextManager.WhatToDoNext whatToDoNext, String loadFile) (package private) void
doShowMessageDialog
(String message) void
private void
private void
Ensure that setupClientGUI() is run inside the EDTvoid
eventViewerCancelReinforcement
(CreatureType recruit, int turnNr) void
eventViewerNewSplitEvent
(int turn, Legion parent, Legion child) void
eventViewerRevealCreatures
(Legion legion, List<CreatureType> creatures, String reason) void
eventViewerSetCreatureDead
(BattleUnit battleUnit) void
void
eventViewerUndoEvent
(Legion splitoff, Legion survivor, int turn) private void
finishServerConnectionCheck
(boolean success) Cleanup everything related to the serverConnectionCheck timer, and show a message telling whether it went ok or not.private String
getBattleUnitDescription
(BattleCritter battleUnit) getBoard()
getGame()
Get a list of all GUIBattleChits (on the current BattleMap)Find all GUIBattleChits that occupy a specified hex Note that this can be several for the offboard position(s)int
private JFrame
(package private) String
(package private) MovementDie
getMover()
int
private JFrame
int
boolean
int
void
private void
handleUndoRecruit
(Legion legion) This does the actual work for undoing a recruitvoid
boolean
hasBoard()
(package private) void
highlightBattleSite
(MasterHex battleSite) void
void
void
void
private void
private void
private void
void
boolean
isMyTurn()
boolean
(package private) boolean
(package private) boolean
private boolean
void
void
void
markLegionAsSkipRecruit
(Legion legion) TODO This is just a HACK.private void
markLegionAsSkipSplit
(Legion legion) void
void
menuLoadGame
(String filename) void
void
(package private) void
menuSaveGame
(String filename) private void
(package private) void
negotiateCallback
(Proposal proposal, boolean respawn) private Object
private void
postRecruitStuff
(Legion legion) Do what is needed after recruit (or mark as skip recruit): push to undo stack, update legions left to muster, hightlight remaining ones,(package private) void
pushUndoStack
(Object object) void
removeBattleChit
(BattleUnit battleUnit) void
void
void
replayTurnChange
(int nowTurn) void
TODO since we are doing Swing nowadays it would probably be much better to replace all this rescaling code with just usingAffineTransform
on the rightGraphics2D
instances.void
void
reset all strike numbers on chitsvoid
void
revealEngagedCreatures
(Legion legion, List<CreatureType> creatures, boolean isAttacker, String reason) void
Upon request with checkServerConnection, server sends a confirmation.void
setBoardActive
(boolean val) void
setChosenDevice
(GraphicsDevice chosen) void
void
setLookAndFeel
(String lfName) (package private) void
Add the marker to the end of the list and to the LegionInfo.void
setMoveCompleted
(Legion mover, MasterHex current, MasterHex target) void
setMovePending
(Legion mover, MasterHex currentHex, MasterHex targetHex) void
void
setMulliganOldRoll
(int movementRoll) void
setPreferencesCheckBoxValue
(String name, boolean value) void
setPreferencesRadioButtonValue
(String name, boolean value) void
setPreferencesWindowVisible
(boolean val) void
setStartedByWebClient
(boolean byWebClient) void
setStrikeNumbers
(BattleUnit striker, Set<BattleHex> targetHexes) void
Called via ensureEdtSetupClientGUI() when server sends all clients the initBoard command.private void
private void
void
private void
void
showConcede
(Client client, Legion ally, Legion enemy) void
This is for permanent, non-reversible closed connectionsvoid
void
void
showMarker
(Marker marker) void
showMessageDialogAndWait
(String message) void
showNegotiate
(Legion attacker, Legion defender) private void
showOrHideAutoInspector
(boolean bval) private void
showOrHideCaretaker
(boolean bval) private void
showOrHideConnectionLogWindow
(boolean show) private void
showOrHideLogWindow
(boolean show) void
void
void
Ensure that Player menu checkboxes reflect the correct state.void
tellEngagement
(Legion attacker, Legion defender, int turnNumber) void
tellProposal
(String proposalString) Inform this player about the other player's proposal.void
tellWhatsHappening
(String message) void
Timeout reached.void
void
void
(package private) void
void
undoBattleMove
(BattleHex hex) void
(package private) void
(package private) void
For the topmost item on undo stack, undo the done recruit, or reset the skipThisTime flag if set.(package private) void
void
undoRecruit
(Legion legion) For a specific clicked legion, undo the done recruit, or reset the skipThisTime flag if set.void
void
private void
void
private void
updateTreeAndPack
(Window window) private void
void
-
Field Details
-
LOGGER
-
CONN_CHECK_TIMEOUT
private static final int CONN_CHECK_TIMEOUT- See Also:
-
connectionCheckMutex
-
connectionCheckTimer
-
lastConnectionCheckPackageSent
private long lastConnectionCheckPackageSent -
board
-
statusScreen
-
caretakerDisplay
-
movementDie
-
engagementResults
-
autoInspector
-
eventViewer
-
preferencesWindow
-
logWindow
-
connectionLogWindow
-
pickCarryDialog
-
negotiate
-
replyToProposal
-
battleBoard
-
webClient
-
startedByWebClient
private boolean startedByWebClient -
whatNextManager
The object which handles what to do next when a game is going to end -
undoStack
Stack of legion marker ID's, to allow multiple levels of undo for splits, moves, and recruits. (for battle actions, the Strings are not actually marker ID's, it's battle hex ID's there instead). TODO it would probably be good to have a full Command pattern here, similar to Swing'sUndoManager
stuff. In the GUI client we could/should probably just use that. A list of objects (which are mostly the string identifiers of something) isn't that safe. -
pendingMoves
-
pendingMoveHexes
-
recoveredFromMoveNak
private boolean recoveredFromMoveNak -
battleChits
-
mover
Information on the current moving legion. -
secondaryParent
the parent frame for secondary windows -
replayLastTurn
private int replayLastTurn -
replayMaxTurn
private int replayMaxTurn -
viewMode
private int viewMode -
recruitChitMode
private int recruitChitMode -
legionMoveConfirmationMode
private int legionMoveConfirmationMode -
nextSplitClickMode
private int nextSplitClickMode -
gameOverMessageAlreadyShown
private boolean gameOverMessageAlreadyShown -
client
-
oracle
-
options
-
quitAlreadyTried
boolean quitAlreadyTried -
tellEngagementResultsAttackerStartingContents
-
tellEngagementResultsDefenderStartingContents
-
tellEngagementResultsAttackerLegionCertainities
-
tellEngagementResultsDefenderLegionCertainities
-
message
String message
-
-
Constructor Details
-
ClientGUI
-
-
Method Details
-
setStartedByWebClient
public void setStartedByWebClient(boolean byWebClient) - Specified by:
setStartedByWebClient
in interfaceIClientGUI
-
getStartedByWebClient
public boolean getStartedByWebClient() -
setWebClient
- Specified by:
setWebClient
in interfaceIClientGUI
-
setClientInWebClientNull
public void setClientInWebClientNull()- Specified by:
setClientInWebClientNull
in interfaceIClientGUI
-
getBoard
-
hasBoard
public boolean hasBoard()- Specified by:
hasBoard
in interfaceIClientGUI
-
getClient
-
getOracle
-
getGame
-
getGameClientSide
-
getOptions
-
isReplayOngoing
boolean isReplayOngoing() -
isRedoOngoing
boolean isRedoOngoing() -
handleWebClientRestore
public void handleWebClientRestore()- Specified by:
handleWebClientRestore
in interfaceIClientGUI
-
showWebClient
public void showWebClient()- Specified by:
showWebClient
in interfaceIClientGUI
-
initBoard
public void initBoard()- Specified by:
initBoard
in interfaceIClientGUI
-
actOnGameStartingFailed
public void actOnGameStartingFailed()- Specified by:
actOnGameStartingFailed
in interfaceIClientGUI
-
ensureEdtSetupClientGUI
private void ensureEdtSetupClientGUI()Ensure that setupClientGUI() is run inside the EDT -
setupClientGUI
public void setupClientGUI()Called via ensureEdtSetupClientGUI() when server sends all clients the initBoard command. -
setChosenDevice
- Specified by:
setChosenDevice
in interfaceIClientGUI
-
ensureEdtNewBattleBoard
private void ensureEdtNewBattleBoard() -
actOnInitBattle
public void actOnInitBattle()- Specified by:
actOnInitBattle
in interfaceIClientGUI
-
doNewBattleBoard
private void doNewBattleBoard() -
setStrikeNumbers
-
resetStrikeNumbers
public void resetStrikeNumbers()reset all strike numbers on chits- Specified by:
resetStrikeNumbers
in interfaceIClientGUI
-
updateStatusScreen
public void updateStatusScreen()- Specified by:
updateStatusScreen
in interfaceIClientGUI
-
askNewCloseQuitCancel
-
checkServerConnection
void checkServerConnection()When user requests it from File menu, this method here requests the server to send us a confirmation package, to confirm that connection is still alive and ok. -
initiateConnectionCheck
private void initiateConnectionCheck() -
serverConfirmsConnection
public void serverConfirmsConnection()Description copied from interface:IClientGUI
Upon request with checkServerConnection, server sends a confirmation. This method here processes the confirmation.- Specified by:
serverConfirmsConnection
in interfaceIClientGUI
-
timeoutAbortsConnectionCheck
public void timeoutAbortsConnectionCheck()Description copied from interface:IClientGUI
Timeout reached. Cancel timer and show error message- Specified by:
timeoutAbortsConnectionCheck
in interfaceIClientGUI
-
finishServerConnectionCheck
private void finishServerConnectionCheck(boolean success) Cleanup everything related to the serverConnectionCheck timer, and show a message telling whether it went ok or not. Called by either serverConfirmsConnection() or timeoutAbortsConnectionCheck(), which both synchronize on the connectionCheckMutex. -
doSetWhatToDoNext
-
doSetWhatToDoNext
-
setWhatToDoNextForClose
private void setWhatToDoNextForClose() -
setupPlayerLabel
private void setupPlayerLabel() -
highlightEngagements
public void highlightEngagements()- Specified by:
highlightEngagements
in interfaceIClientGUI
-
getPreferredParent
-
getViewMode
public int getViewMode()- Specified by:
getViewMode
in interfaceIClientGUI
-
getRecruitChitMode
public int getRecruitChitMode()- Specified by:
getRecruitChitMode
in interfaceIClientGUI
-
getLegionMoveConfirmationMode
public int getLegionMoveConfirmationMode()- Specified by:
getLegionMoveConfirmationMode
in interfaceIClientGUI
-
getNextSplitClickMode
public int getNextSplitClickMode()- Specified by:
getNextSplitClickMode
in interfaceIClientGUI
-
addPossibleRecruitChits
- Specified by:
addPossibleRecruitChits
in interfaceIClientGUI
-
setupGUIOptionListeners
private void setupGUIOptionListeners() -
initEventViewer
private void initEventViewer() -
eventViewerSetVisibleMaybe
public void eventViewerSetVisibleMaybe()- Specified by:
eventViewerSetVisibleMaybe
in interfaceIClientGUI
-
autoInspectorSetDubiousAsBlanks
public void autoInspectorSetDubiousAsBlanks(boolean newValue) - Specified by:
autoInspectorSetDubiousAsBlanks
in interfaceIClientGUI
-
engagementResultsMaybeShow
public void engagementResultsMaybeShow()- Specified by:
engagementResultsMaybeShow
in interfaceIClientGUI
-
actOnTellLegionLocation
- Specified by:
actOnTellLegionLocation
in interfaceIClientGUI
-
setMarker
Add the marker to the end of the list and to the LegionInfo. If it's already in the list, remove the earlier entry. -
actOnDidSplit
- Specified by:
actOnDidSplit
in interfaceIClientGUI
-
actOnDidSplitPart2
- Specified by:
actOnDidSplitPart2
in interfaceIClientGUI
-
actOnDoneWithMoves
public void actOnDoneWithMoves()- Specified by:
actOnDoneWithMoves
in interfaceIClientGUI
-
actOnDoneWithSplits
public void actOnDoneWithSplits()- Specified by:
actOnDoneWithSplits
in interfaceIClientGUI
-
actOnDidRecruit
public void actOnDidRecruit(Legion legion, CreatureType recruit, List<CreatureType> recruiters, String reason) - Specified by:
actOnDidRecruit
in interfaceIClientGUI
-
postRecruitStuff
Do what is needed after recruit (or mark as skip recruit): push to undo stack, update legions left to muster, hightlight remaining ones,- Parameters:
legion
-
-
actOnRemoveCreature
- Specified by:
actOnRemoveCreature
in interfaceIClientGUI
-
actOnRemoveCreaturePart2
- Specified by:
actOnRemoveCreaturePart2
in interfaceIClientGUI
-
actOnAddCreature
- Specified by:
actOnAddCreature
in interfaceIClientGUI
-
actOnUndidSplit
- Specified by:
actOnUndidSplit
in interfaceIClientGUI
-
actOnUndidRecruitPart
- Specified by:
actOnUndidRecruitPart
in interfaceIClientGUI
-
chooseWhetherToTeleport
public boolean chooseWhetherToTeleport()Description copied from interface:IClientGUI
Present a dialog allowing the player to enter via land or teleport. Return true if the player chooses to teleport.- Specified by:
chooseWhetherToTeleport
in interfaceIClientGUI
-
actOnDidMove
public void actOnDidMove(Legion legion, MasterHex startingHex, MasterHex currentHex, boolean teleport, CreatureType teleportingLord, boolean splitLegionHasForcedMove) - Specified by:
actOnDidMove
in interfaceIClientGUI
-
actOnUndidMove
public void actOnUndidMove(Legion legion, MasterHex formerHex, MasterHex currentHex, boolean splitLegionHasForcedMove, boolean didTeleport) - Specified by:
actOnUndidMove
in interfaceIClientGUI
-
actOnNoMoreEngagements
public void actOnNoMoreEngagements()- Specified by:
actOnNoMoreEngagements
in interfaceIClientGUI
-
alignLegionsMaybe
- Specified by:
alignLegionsMaybe
in interfaceIClientGUI
-
actOnRemoveLegion
- Specified by:
actOnRemoveLegion
in interfaceIClientGUI
-
actOnDoSummon
public void actOnDoSummon()- Specified by:
actOnDoSummon
in interfaceIClientGUI
-
setLookAndFeel
- Specified by:
setLookAndFeel
in interfaceIClientGUI
-
updateEverything
public void updateEverything()- Specified by:
updateEverything
in interfaceIClientGUI
-
updateTreeAndPack
-
replayTurnChange
public void replayTurnChange(int nowTurn) - Specified by:
replayTurnChange
in interfaceIClientGUI
-
actOnTellReplay
public void actOnTellReplay(int maxTurn) - Specified by:
actOnTellReplay
in interfaceIClientGUI
-
makeBoardRecreateMarkers
public void makeBoardRecreateMarkers() -
actOnTellRedoChange
public void actOnTellRedoChange()- Specified by:
actOnTellRedoChange
in interfaceIClientGUI
-
clearUndoStack
private void clearUndoStack() -
popUndoStack
-
pushUndoStack
-
isUndoStackEmpty
private boolean isUndoStackEmpty() -
eventViewerCancelReinforcement
- Specified by:
eventViewerCancelReinforcement
in interfaceIClientGUI
-
eventViewerSetCreatureDead
- Specified by:
eventViewerSetCreatureDead
in interfaceIClientGUI
-
eventViewerNewSplitEvent
- Specified by:
eventViewerNewSplitEvent
in interfaceIClientGUI
-
eventViewerUndoEvent
- Specified by:
eventViewerUndoEvent
in interfaceIClientGUI
-
setPreferencesCheckBoxValue
- Specified by:
setPreferencesCheckBoxValue
in interfaceIClientGUI
-
setPreferencesRadioButtonValue
- Specified by:
setPreferencesRadioButtonValue
in interfaceIClientGUI
-
initPreferencesWindow
private void initPreferencesWindow() -
setPreferencesWindowVisible
public void setPreferencesWindowVisible(boolean val) - Specified by:
setPreferencesWindowVisible
in interfaceIClientGUI
-
showMarker
-
showOrHideCaretaker
private void showOrHideCaretaker(boolean bval) -
showOrHideAutoInspector
private void showOrHideAutoInspector(boolean bval) -
showHexRecruitTree
-
didSummon
- Specified by:
didSummon
in interfaceIClientGUI
-
repaintBattleBoard
public void repaintBattleBoard()- Specified by:
repaintBattleBoard
in interfaceIClientGUI
-
repaintAllWindows
public void repaintAllWindows()- Specified by:
repaintAllWindows
in interfaceIClientGUI
-
rescaleAllWindows
public void rescaleAllWindows()Description copied from interface:IClientGUI
TODO since we are doing Swing nowadays it would probably be much better to replace all this rescaling code with just usingAffineTransform
on the rightGraphics2D
instances.- Specified by:
rescaleAllWindows
in interfaceIClientGUI
-
disposeInspector
public void disposeInspector()- Specified by:
disposeInspector
in interfaceIClientGUI
-
updateCreatureCountDisplay
public void updateCreatureCountDisplay()- Specified by:
updateCreatureCountDisplay
in interfaceIClientGUI
-
disposeMasterBoard
private void disposeMasterBoard() -
disposeBattleBoard
private void disposeBattleBoard() -
disposePickCarryDialog
public void disposePickCarryDialog()Dispose the PickCarryDialog, make sure that that is done inside the EDT (caused GUI to hang in 1.6.0_39 whereas in 1.6.0_38 it worked )-;- Specified by:
disposePickCarryDialog
in interfaceIClientGUI
-
actualDisposePickCarryDialog
public void actualDisposePickCarryDialog() -
disposeStatusScreen
private void disposeStatusScreen() -
disposeLogWindow
private void disposeLogWindow() -
disposeConnectionLogWindow
private void disposeConnectionLogWindow() -
disposeEventViewer
private void disposeEventViewer() -
disposePreferencesWindow
private void disposePreferencesWindow() -
disposeEngagementResults
void disposeEngagementResults() -
disposeCaretakerDisplay
private void disposeCaretakerDisplay() -
showNegotiate
- Specified by:
showNegotiate
in interfaceIClientGUI
-
respawnNegotiate
public void respawnNegotiate()- Specified by:
respawnNegotiate
in interfaceIClientGUI
-
showConcede
- Specified by:
showConcede
in interfaceIClientGUI
-
showFlee
- Specified by:
showFlee
in interfaceIClientGUI
-
myTurnNotificationActions
-
initShowEngagementResults
public void initShowEngagementResults()- Specified by:
initShowEngagementResults
in interfaceIClientGUI
-
tellEngagement
- Specified by:
tellEngagement
in interfaceIClientGUI
-
highlightBattleSite
-
actOnTellEngagementResults
- Specified by:
actOnTellEngagementResults
in interfaceIClientGUI
-
actOnEngagementCompleted
public void actOnEngagementCompleted()- Specified by:
actOnEngagementCompleted
in interfaceIClientGUI
-
setMulliganOldRoll
public void setMulliganOldRoll(int movementRoll) - Specified by:
setMulliganOldRoll
in interfaceIClientGUI
-
tellWhatsHappening
- Specified by:
tellWhatsHappening
in interfaceIClientGUI
-
actOnTellMovementRoll
public void actOnTellMovementRoll(int roll) - Specified by:
actOnTellMovementRoll
in interfaceIClientGUI
-
revealEngagedCreatures
public void revealEngagedCreatures(Legion legion, List<CreatureType> creatures, boolean isAttacker, String reason) - Specified by:
revealEngagedCreatures
in interfaceIClientGUI
-
eventViewerRevealCreatures
- Specified by:
eventViewerRevealCreatures
in interfaceIClientGUI
-
showOrHideLogWindow
private void showOrHideLogWindow(boolean show) -
showOrHideConnectionLogWindow
private void showOrHideConnectionLogWindow(boolean show) -
appendToConnectionLog
- Specified by:
appendToConnectionLog
in interfaceIClientGUI
-
actOnReconnectCompleted
public void actOnReconnectCompleted()- Specified by:
actOnReconnectCompleted
in interfaceIClientGUI
-
syncCheckboxes
public void syncCheckboxes()Ensure that Player menu checkboxes reflect the correct state. Copied the TODO below from the interface where it's now removed... TODO let the checkboxes have their own listeners instead. Or even better: use a binding framework. -
doAcquireAngel
- Specified by:
doAcquireAngel
in interfaceIClientGUI
-
setBoardActive
public void setBoardActive(boolean val) - Specified by:
setBoardActive
in interfaceIClientGUI
-
doPickSummonAngel
- Specified by:
doPickSummonAngel
in interfaceIClientGUI
-
doPickSplitLegion
- Specified by:
doPickSplitLegion
in interfaceIClientGUI
-
markLegionAsSkipSplit
-
resetAllLegionFlags
public void resetAllLegionFlags() -
isPickCarryOngoing
public boolean isPickCarryOngoing()- Specified by:
isPickCarryOngoing
in interfaceIClientGUI
-
doPickCarries
- Specified by:
doPickCarries
in interfaceIClientGUI
-
getPickCarryDialog
-
handlePickCarry
-
doPickColor
- Specified by:
doPickColor
in interfaceIClientGUI
-
bringUpPickColorDialog
-
doPickSplitMarker
- Specified by:
doPickSplitMarker
in interfaceIClientGUI
-
doPickInitialMarker
- Specified by:
doPickInitialMarker
in interfaceIClientGUI
-
createPickMarkerDialog
-
doPickRecruit
- Specified by:
doPickRecruit
in interfaceIClientGUI
-
markLegionAsSkipRecruit
TODO This is just a HACK. PickRecruit calls this to mark a legion as that user wants to not recruit anything this turn. Better would be, if that dialog could return a "NONE" CreatureType and the caller does the work cleanly... (postponed for now because the NONE-CreatureType would be so much work right now...)- Parameters:
legion
-
-
doPickRecruiter
- Specified by:
doPickRecruiter
in interfaceIClientGUI
-
doPickEntrySide
- Specified by:
doPickEntrySide
in interfaceIClientGUI
-
doPickLord
- Specified by:
doPickLord
in interfaceIClientGUI
-
doPickStrikePenalty
- Specified by:
doPickStrikePenalty
in interfaceIClientGUI
-
tellProposal
Description copied from interface:IClientGUI
Inform this player about the other player's proposal.- Specified by:
tellProposal
in interfaceIClientGUI
-
cleanupNegotiationDialogs
public void cleanupNegotiationDialogs()- Specified by:
cleanupNegotiationDialogs
in interfaceIClientGUI
-
actOnTurnOrPlayerChange
- Specified by:
actOnTurnOrPlayerChange
in interfaceIClientGUI
-
actOnGameStarting
public void actOnGameStarting()- Specified by:
actOnGameStarting
in interfaceIClientGUI
-
actOnSetupSplit
public void actOnSetupSplit()- Specified by:
actOnSetupSplit
in interfaceIClientGUI
-
validateLegions
private void validateLegions() -
actOnSetupMuster
public void actOnSetupMuster()- Specified by:
actOnSetupMuster
in interfaceIClientGUI
-
actOnSetupMove
public void actOnSetupMove()- Specified by:
actOnSetupMove
in interfaceIClientGUI
-
actOnSetupFight
public void actOnSetupFight()- Specified by:
actOnSetupFight
in interfaceIClientGUI
-
actOnSetupBattleFight
public void actOnSetupBattleFight()- Specified by:
actOnSetupBattleFight
in interfaceIClientGUI
-
actOnSetupBattleMove
public void actOnSetupBattleMove()- Specified by:
actOnSetupBattleMove
in interfaceIClientGUI
-
actOnTellBattleMove
public void actOnTellBattleMove(BattleHex startingHex, BattleHex endingHex, boolean rememberForUndo) - Specified by:
actOnTellBattleMove
in interfaceIClientGUI
-
actOnPendingBattleMoveOver
public void actOnPendingBattleMoveOver()- Specified by:
actOnPendingBattleMoveOver
in interfaceIClientGUI
-
actOnDoneWithBattleMoves
public void actOnDoneWithBattleMoves()- Specified by:
actOnDoneWithBattleMoves
in interfaceIClientGUI
-
actOnSetupBattleRecruit
public void actOnSetupBattleRecruit()- Specified by:
actOnSetupBattleRecruit
in interfaceIClientGUI
-
actOnSetupBattleSummon
public void actOnSetupBattleSummon()- Specified by:
actOnSetupBattleSummon
in interfaceIClientGUI
-
addBattleChit
-
getGUIBattleChits
Get a list of all GUIBattleChits (on the current BattleMap)- Returns:
- The list of GUIBattleChits
-
getGUIBattleChitsInHex
Find all GUIBattleChits that occupy a specified hex Note that this can be several for the offboard position(s)- Parameters:
hex
- The hex to give Chits for- Returns:
- A List of GUIBattleChits
-
getGUIBattleChit
-
actOnPlaceNewChit
- Specified by:
actOnPlaceNewChit
in interfaceIClientGUI
-
getBattleUnitDescription
-
actOnTellStrikeResults
public void actOnTellStrikeResults(boolean wasCarry, int strikeNumber, List<String> rolls, BattleCritter striker, BattleCritter target) - Specified by:
actOnTellStrikeResults
in interfaceIClientGUI
-
actOnHitsSet
- Specified by:
actOnHitsSet
in interfaceIClientGUI
-
highlightCrittersWithTargets
public void highlightCrittersWithTargets()- Specified by:
highlightCrittersWithTargets
in interfaceIClientGUI
-
actOnApplyCarries
- Specified by:
actOnApplyCarries
in interfaceIClientGUI
-
actOnCleanupBattle
public void actOnCleanupBattle()- Specified by:
actOnCleanupBattle
in interfaceIClientGUI
-
undoLastRecruit
void undoLastRecruit()For the topmost item on undo stack, undo the done recruit, or reset the skipThisTime flag if set. -
undoRecruit
For a specific clicked legion, undo the done recruit, or reset the skipThisTime flag if set.- Specified by:
undoRecruit
in interfaceIClientGUI
- Parameters:
legion
- The legion for which to undo the recruit
-
handleUndoRecruit
This does the actual work for undoing a recruit- Parameters:
legion
- The legion for which to undo the recruit
-
undoAllSplits
void undoAllSplits() -
undoLastSplit
void undoLastSplit() -
informSplitRequiredFirstRound
public void informSplitRequiredFirstRound()- Specified by:
informSplitRequiredFirstRound
in interfaceIClientGUI
-
undoLastMove
void undoLastMove() -
undoLastBattleMove
public void undoLastBattleMove()- Specified by:
undoLastBattleMove
in interfaceIClientGUI
-
undoAllBattleMoves
public void undoAllBattleMoves()- Specified by:
undoAllBattleMoves
in interfaceIClientGUI
-
undoAllMoves
public void undoAllMoves()- Specified by:
undoAllMoves
in interfaceIClientGUI
-
undoAllRecruits
public void undoAllRecruits()- Specified by:
undoAllRecruits
in interfaceIClientGUI
-
displayNoUndoWhilePendingMovesInfo
private void displayNoUndoWhilePendingMovesInfo() -
defaultCursor
public void defaultCursor()- Specified by:
defaultCursor
in interfaceIClientGUI
-
waitCursor
public void waitCursor()- Specified by:
waitCursor
in interfaceIClientGUI
-
doCleanupGUI
public void doCleanupGUI()- Specified by:
doCleanupGUI
in interfaceIClientGUI
-
disposeMovementDie
private void disposeMovementDie() -
getMovementDie
MovementDie getMovementDie() -
cleanupGUI
private void cleanupGUI() -
actOnTellGameOver
Update Board and Status screen to reflect the new game over state. Show the game over message, or store it to be shown later. If dispose will follow soon, don't show message immediately (to avoid having the user to have click two boxes), instead store it for later to be shown then together with the dispose dialog.- Specified by:
actOnTellGameOver
in interfaceIClientGUI
- Parameters:
message
- The message ("XXXX wins", or "Draw")disposeFollows
- If true, server will send a dispose message soon
-
getMessage
String getMessage() -
showMessageDialogAndWait
- Specified by:
showMessageDialogAndWait
in interfaceIClientGUI
-
doShowMessageDialog
-
doConfirmAndQuit
public void doConfirmAndQuit()- Specified by:
doConfirmAndQuit
in interfaceIClientGUI
-
showConnectionClosedMessage
public void showConnectionClosedMessage()This is for permanent, non-reversible closed connections- Specified by:
showConnectionClosedMessage
in interfaceIClientGUI
-
getMapOrBoardFrame
-
negotiateCallback
-
getOwningPlayer
-
getOwningPlayerName
-
isMyTurn
public boolean isMyTurn() -
getMover
-
setMover
-
doMove
-
actOnMoveNak
public void actOnMoveNak()- Specified by:
actOnMoveNak
in interfaceIClientGUI
-
setMovePending
- Specified by:
setMovePending
in interfaceIClientGUI
-
updatePendingText
private void updatePendingText() -
getPendingMoveHexes
-
getStillToMoveHexes
-
setMoveCompleted
- Specified by:
setMoveCompleted
in interfaceIClientGUI
-
removeBattleChit
- Specified by:
removeBattleChit
in interfaceIClientGUI
-
getCallbackHandler
-
answerPickColor
-
leaveCarryMode
public void leaveCarryMode()- Specified by:
leaveCarryMode
in interfaceGUICallbacks
-
applyCarries
- Specified by:
applyCarries
in interfaceGUICallbacks
-
acquireAngelCallback
- Specified by:
acquireAngelCallback
in interfaceGUICallbacks
-
answerFlee
- Specified by:
answerFlee
in interfaceGUICallbacks
-
answerConcede
- Specified by:
answerConcede
in interfaceGUICallbacks
-
doBattleMove
- Specified by:
doBattleMove
in interfaceGUICallbacks
-
undoBattleMove
- Specified by:
undoBattleMove
in interfaceGUICallbacks
-
strike
- Specified by:
strike
in interfaceGUICallbacks
-
doneWithBattleMoves
public void doneWithBattleMoves()- Specified by:
doneWithBattleMoves
in interfaceGUICallbacks
-
doneWithStrikes
public void doneWithStrikes()- Specified by:
doneWithStrikes
in interfaceGUICallbacks
-
concede
public void concede()- Specified by:
concede
in interfaceGUICallbacks
-