On Fri, 13 Sep 2013 21:57:53 +0930 "Michael T. Pope" <[email protected]> wrote: > The next obvious category are dialogs that do not really need to be modal. > Many of the uses of showConfirmDialog are asking pretty critical > questions (e.g. reconnect, quit, etc). These could be vanilla > JOptionPanes.
Thinking further about dialog modality, IMHO the main justification is for
non-modal is that some decisions plausibly require you to look around the map
etc to gather the information you need. Similarly we have multi-item dialogs
(e.g. the EndTurnDialog) which might need to wait while you check on several
things.
Conversely, I think it is safe, desirable even, to make pre-game
dialogs modal, not to mention debug dialogs, and perhaps the map
editor cases. Otherwise, I think modal dialogs are preferrable for
really clear decisions, especially where the player is likely to
already have a clear idea of what is right (e.g. The "abandon colony"
dialog --- it is usually a case of "oops, lets not do that" or "yes, I
am done with this place"). The other concern is the potential for
confusion if we leave a dialog waiting while the user does something
else that invalidates the dialog's prerequisites --- the server will
(should:-) detect the problem and the user will probably get the
"server can not do that" error.
What remains is unclear. We already have some special cases in
InGameInputHandler where the dialog lives in a SwingTask (which is
Runnable), and perhaps could be run in a Thread or converted to use a
continuation passing style like the existing new land name/new region
name code. IGIH is confusing, showing clear signs of being hacked on
my someone with limited understanding (me), and could do with some
attention.
Anyway here is my categorization. Comments appreciated, especially
for the "unclear" category.
Cheers,
Mike Pope
** Dialogs that are better modal
* EditOptionDialog extends FreeColDialog<Boolean>
Canvas.showEditOptionDialog
GUI.showEditOptionDialog
ListOptionUI.ListOptionUI
ListOptionUI.ListOptionUI
Modal: Setting options is pre-game or user preferences.
* EditSettlementDialog extends FreeColDialog<IndianSettlement>
Canvas.showEditSettlementDialog
CanvasMapEditorMouseListener.mousePressed
Modal: Map editor.
* LoadingSavegameDialog extends FreeColDialog<Boolean>
Canvas.showLoadingSavegameDialog
GUI.showLoadingSavegameDialog
ConnectController.startSavedGame
Modal: Pre-game or ends the current game.
* OptionsDialog extends FreeColDialog<OptionGroup>
DifficultyDialog extends OptionsDialog
Canvas.showDifficultyDialog
GUI.showDifficultyDialog
NewPanel.actionPerformed
ShowDifficultyAction.actionPerformed
ClientOptionsDialog extends OptionsDialog
Canvas.showClientOptionsDialog
GUI.showClientOptionsDialog
PreferencesAction.actionPerformed
GameOptionsDialog extends OptionsDialog
Canvas.showGameOptionsDialog
GUI.showGameOptionsDialog
StartGamePanel.actionPerformed
ShowGameOptionsAction.actionPerformed
MapGeneratorOptionsDialog extends OptionsDialog
Canvas.showMapGeneratorOptionsDialog
GUI.showMapGeneratorOptionsDialog
StartGamePanel.actionPerformed
ShowMapGeneratorOptionsAction.actionPerformed
MapEditorController.newMap
Modal: Options processing usually pre-game.
* ParametersDialog extends FreeColDialog<Parameters>
Canvas.showParametersDialog
GUI.showParametersDialog
DetermineHighSeasAction.actionPerformed
Modal: High seas distances input from the map editor.
* RiverStyleDialog extends FreeColDialog<String>
Canvas.showRiverStyleDialog
CanvasMapEditorMouseListener.mousePressed
Modal: Map editor, can always cancel and try again.
* ScaleMapSizeDialog extends FreeColDialog<Dimension>
Canvas.showScaleMapSizeDialog
GUI.showScaleMapSizeDialog
ScaleMapAction.actionPerformed
Modal: Map editor action.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
GUI.showChoiceDialog
DebugUtils.addBuildings
DebugUtils.addNewUnitToTile
DebugUtils.addUnitGoods
DebugUtils.changeOwnership
DebugUtils.changeOwnership
DebugUtils.changeRole
DebugUtils.setColonyGoods
DebugUtils.setRumourType
Canvas.showChooseFoundingFatherDialog
Canvas.showChooseMonarchActionDialog
Modal: Debug actions.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
GUI.showChoiceDialog
MapEditorTransformPanel.ResourceTransform.transform
Modal: Map editor.
* FreeColDialog.createLoadDialog
Canvas.showLoadDialog (variants)
GUI.showLoadDialog (variants)
OptionsDialog.actionPerformed
FileOptionUI.FileOptionUI
MapEditorController.loadGame
InGameController.loadGame
Modal: These are big decisions.
* FreeColDialog.createMapSizeDialog
Canvas.showMapSizeDialog
GUI.showMapSizeDialog
NewEmptyMapAction.actionPerformed
Modal: Map editor action.
* FreeColDialog.createSaveDialog
Canvas.showSaveDialog (variants)
GUI.showSaveDialog (variants)
OptionsDialog.actionPerformed
MapEditorController.saveGame
InGameController.saveGame
Modal: These are big decisions.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showSimpleChoiceDialog
GUI.showSimpleChoiceDialog
ConnectController.joinMultiplayerGame
Modal: Pre-game.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
DebugUtils.stepRNG
Model: Debug action.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
FreeColClient.newGame
FreeColClient.askToQuit
FreeColClient.retire
ShowMainAction.actionPerformed
InGameInputHandler.reconnect
InGameInputHandler.setDead
ConnectController.unblockServer
InGameController.loadGame
InGameController.saveGame
Modal: Big decisions.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
EditSettlementDialog.actionPerformed
Modal: Map editor.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
ColonyPanel.closeColonyPanel
Modal: Abandon colony? Very clear decision.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.clearOrders
Modal: Confirm cancel pioneering work. Usually deliberate or a
mistake.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.clearSpeciality
Modal: Confirm clear speciality. Either deliberate or a mistake.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.disbandActiveUnit
Modal: Confirm disband. Either deliberate or a mistake.
* FreeColDialog.createInputDialog
Canvas.showInputDialog
GUI.showInputDialog
DebugUtils.addGold
DebugUtils.addImmigration
DebugUtils.addLiberty
DebugUtils.addUnitGoods
DebugUtils.setColonyGoods
DebugUtils.skipTurns
Modal: Debug actions.
* FreeColDialog.createInputDialog
Canvas.showInputDialog
GUI.showInputDialog
InGameController.buildColony
InGameController.rename
Modal: Choosing the colony/unit name. See no reason to look away here.
** Dialogs that should be non-modal
* CaptureGoodsDialog extends FreeColDialog<List<Goods>>
Canvas.showCaptureGoodsDialog
GUI.showCaptureGoodsDialog
InGameInputHandler.LootCargoSwingTask.doNoResultWork
Non-Modal: Want to see which goods are usable nearby, or at European
prices, etc.
* ChooseFoundingFatherDialog extends FreeColDialog<FoundingFather>
Canvas.showChooseFoundingFatherDialog
GUI.showChooseFoundingFatherDialog
InGameInputHandler.chooseFoundingFather
Non-Modal: Already special, this is in InGameInputHandler and the
server tolerates non-response.
* ConfirmDeclarationDialog extends FreeColDialog<List<String>>
Canvas.showConfirmDeclarationDialog
GUI.showConfirmDeclarationDialog
InGameController.declareIndependence
Non-Modal: You want to be sure that everything is ready for this one!
* DumpCargoDialog extends FreeColDialog<List<Goods>>
Canvas.showDumpCargoDialog
GUI.showDumpCargoDialog
InGameController.unload
Non-Modal: Want to decide which goods are least valuable.
* EmigrationDialog extends FreeColDialog<Integer>
Canvas.showEmigrationDialog
GUI.showEmigrationDialog
InGameInputHandler.fountainOfYouth
InGameController.setCurrentPlayer
Non-Modal: Want to review units present and choose the most useful one.
The case in IGC might be able to move to IGIH.
* FindSettlementDialog<T> extends FreeColDialog<T>
Canvas.showFindSettlementDialog
GUI.showFindSettlementDialog
FindSettlementAction.actionPerformed
Non-Modal: Want to look inside various settlements, or at Europe.
* MonarchPanel extends FreeColDialog<Boolean>
Canvas.showMonarchPanelDialog
GUI.showMonarchPanelDialog
DebugMenu.buildDebugMenu
InGameInputHandler.monarchAction
InGameInputHandler.ShowMonarchPanelSwingTask.doWork
Non-modal: Has to be, we want to support the trick where you move the
goods-to-be-boycotted away. Already handled specially in IGIH.
* NegotiationDialog extends FreeColDialog<DiplomaticTrade>
Canvas.showNegotiationDialog
GUI.showNegotiationDialog
InGameInputHandler.diplomacy
InGameController.moveTradeColony
Non-Modal: Want to check what resources are needed or which colonies can
be traded.
* PreCombatDialog extends FreeColDialog<Boolean>
Canvas.showPreCombatDialog
GUI.showPreCombatDialog
InGameController.confirmPreCombat
Non-Modal: Want to review defences before provoking a fight.
* RecruitDialog extends FreeColDialog<Integer>
Canvas.showEuropeDialog
GUI.showEuropeDialog
EuropePanel.actionPerformed
Non-Modal: Want to review units present and choose the most useful one.
* SelectDestinationDialog extends FreeColDialog<Location>
Canvas.showSelectDestinationDialog
GUI.showSelectDestinationDialog
EuropePanel.DestinationPanel.add
InGameController.selectDestination
Non-Modal: Want to review destination state.
* TradeRouteDialog extends FreeColDialog<Boolean>
Canvas.showTradeRouteDialog
GUI.showTradeRouteDialog
TradeRouteAction.actionPerformed
InGameController.assignTradeRoute
Non-Modal: Want to look around at where the route should go and what it
should collect.
* TradeRouteInputDialog extends FreeColDialog<Boolean>
Canvas.showTradeRouteInputDialog
GUI.showTradeRouteInputDialog
TradeRouteDialog.TradeRouteDialog
Non-modal: Resource allocation to trade routes needs thought.
* TrainDialog extends FreeColDialog<Integer>
Canvas.showEuropeDialog
GUI.showEuropeDialog
EuropePanel.actionPerformed
Non-Modal: Want to review units present and determine which is best to
train.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showArmedUnitIndianSettlementDialog
Non-modal: Might provoke a war here.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showBoycottedGoodsDialog
Non-modal: Need to check goods levels.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showBuyDialog
Non-modal: Want to check what goods are needed nearby.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showClaimDialog
Non-Modal: This might provoke native attack, may need to check defenses.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showScoutForeignColonyDialog
Non-Modal: Negotiate, spy or attack? Might be a hard call to make.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showScoutIndianSettlementDialog
Non-Modal: Speak, tribute or attack? Usually clear, but probably
should be the same as the previous case.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showSimpleChoiceDialog
GUI.showSimpleChoiceDialog
InGameController.attemptBuyFromSettlement
InGameController.attemptSellToSettlement
InGameController.attemptGiftToSettlement
Non-Modal: Which goods? Might need some thought.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showSimpleChoiceDialog
GUI.showSimpleChoiceDialog
InGameController.moveUseMissionary
Non-Modal: This is the choice of which enemy to incite against. It
might be a hard choice.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameInputHandler.NewLandNameSwingTask.doNoResultWork
InGameInputHandler.ShowConfirmDialogSwingTask.doWork
Non-Modal: These are grafted onto other events, so someone has to
wait. Already specially handled in IGIH.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.confirmHostileAction
Non-Modal: Warning about attacking when not at war. Might need to
think about this.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.unloadUnitAtStop
Non-Modal: Overflow the warehouse? Want to check other
destinations?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.checkCashInTreasureTrain
Non-Modal: Want to see if there is a galleon available to avoid
paying the fee.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.moveLearnSkill
Non-Modal: Confirm learn a skill from the natives. Want to check
skills present.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.payArrears
Non-Modal: Want to check the goods presence.
* FreeColDialog.createInputDialog
Canvas.showInputDialog
GUI.showInputDialog
InGameInputHandler.NewLandNameSwingTask.doNoResultWork
InGameInputHandler.NewRegionNameSwingTask.doNoResultWork
Non-Modal: As above in createConfirmDialog.
** Unclear cases
* EndTurnDialog extends FreeColDialog<Boolean>
Canvas.showEndTurnDialog
GUI.showEndTurnDialog
InGameController.endTurn
I would like to click through the multiple units and see
what the problem is. Should the dialog remain present or not?
* SelectAmountDialog extends FreeColDialog<Integer>
Canvas.showSelectAmountDialog
GUI.showSelectAmountDialog
QuickActionMenu.promptForAmount
DefaultTransferHandler.getAmount
Usually run out of the ColonyPanel, and I tend to have a
good idea of what amount is wanted before bringing up this panel.
* WarehouseDialog extends FreeColDialog<Boolean>
Canvas.showWarehouseDialog
GUI.showWarehouseDialog
ColonyPanel.actionPerformed
Run out of ColonyPanel, often with a clear idea of what is
to be done.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
GUI.showChoiceDialog
InGameController.moveDisembark
InGameController.moveEmbark
The decision to dis/embark has been made, it is merely the
detail of which unit to disembark or embark on to be decided.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showIndianSettlementTradeDialog
Buy, sell or gift? Usually a clear choice.
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showSellDialog
Accept, haggle or cancel? Just might want to check something...
* FreeColDialog.createChoiceDialog
Canvas.showChoiceDialog
Canvas.showUseMissionaryDialog
Establish/denounce or incite is usually a clear choice.
* FreeColDialog.createConfirmDialog
Canvas.showModelMessages
When showing a message from Europe/Colony/WorkLocation this is the
choice to bring up a panel showing the source.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
EuropePanel.DestinationPanel.add
The "leave colonists behind" decision.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
ColonyPanel.closeColonyPanel
Colony is now too small for the current buildable.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
GUI.tryLeaveColony
Abandon education and leave the colony?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.work
Leave school and stop teaching?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameInputHandler.indianDemand
Player response to native demand. It would be really good to block
for a response here because this is blocking the server (waiting
in askTimeout). OTOH the player might want to look around the
other colonies to see if the tribute can be spared.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.buildColonyShowWarnings
Build a colony with warnings?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.moveDisembark
Disembark single unit or not?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.moveExplore
InGameController.moveExplore
Explore LCR or not, and accept/decline strange mounds.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.moveHighSeas
Confirm move to the high seas?
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.moveUseMissionary
Confirm the payment to incite.
* FreeColDialog.createConfirmDialog
Canvas.showConfirmDialog (and variants)
GUI.showConfirmDialog (and variants)
InGameController.payForBuilding
Confirm pay for building.
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________ Freecol-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freecol-developers
