From 6c64b08695f323ba994bdc6177ce20f9c750b545 Mon Sep 17 00:00:00 2001 From: melvin Date: Sun, 28 Apr 2013 21:06:09 +0800 Subject: [PATCH] rename showComponent to waitForInput --- src/magic/model/choice/MagicBuybackChoice.java | 10 +++++----- src/magic/model/choice/MagicColorChoice.java | 2 +- src/magic/model/choice/MagicKickerChoice.java | 4 ++-- src/magic/model/choice/MagicMayChoice.java | 2 +- src/magic/model/choice/MagicMulliganChoice.java | 3 +-- src/magic/model/choice/MagicPayManaCostChoice.java | 2 +- src/magic/model/choice/MagicPlayChoice.java | 2 +- src/magic/model/choice/MagicSimpleMayChoice.java | 2 +- src/magic/ui/GameController.java | 2 +- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/magic/model/choice/MagicBuybackChoice.java b/src/magic/model/choice/MagicBuybackChoice.java index 03c3d1dfd5..18d6153049 100644 --- a/src/magic/model/choice/MagicBuybackChoice.java +++ b/src/magic/model/choice/MagicBuybackChoice.java @@ -102,13 +102,13 @@ public class MagicBuybackChoice extends MagicChoice { boolean isYesClicked = false; if (new MagicPayManaCostResultBuilder(game,player,cost.getBuilderCost()).hasResults()) { - final MayChoicePanel kickerPanel = - controller.showComponent(new Callable() { + final MayChoicePanel kickerPanel = controller.waitForInput(new Callable() { public MayChoicePanel call() { return new MayChoicePanel( - controller, - source, - "You may pay the buyback " + cost.getText() + '.'); + controller, + source, + "You may pay the buyback " + cost.getText() + '.' + ); } }); isYesClicked = kickerPanel.isYesClicked(); diff --git a/src/magic/model/choice/MagicColorChoice.java b/src/magic/model/choice/MagicColorChoice.java index 6dba7ccdb8..5219f272c6 100644 --- a/src/magic/model/choice/MagicColorChoice.java +++ b/src/magic/model/choice/MagicColorChoice.java @@ -129,7 +129,7 @@ public class MagicColorChoice extends MagicChoice { final MagicSource source) throws UndoClickedException { controller.disableActionButton(false); - final ColorChoicePanel choicePanel = controller.showComponent(new Callable() { + final ColorChoicePanel choicePanel = controller.waitForInput(new Callable() { public ColorChoicePanel call() { return new ColorChoicePanel(controller,source); } diff --git a/src/magic/model/choice/MagicKickerChoice.java b/src/magic/model/choice/MagicKickerChoice.java index 08edf0a1c1..c2711a1334 100644 --- a/src/magic/model/choice/MagicKickerChoice.java +++ b/src/magic/model/choice/MagicKickerChoice.java @@ -150,7 +150,7 @@ public class MagicKickerChoice extends MagicChoice { final int count; if (maximumCount>1) { // Multiple kickers. - final MultiKickerChoicePanel kickerPanel = controller.showComponent(new Callable() { + final MultiKickerChoicePanel kickerPanel = controller.waitForInput(new Callable() { public MultiKickerChoicePanel call() { return new MultiKickerChoicePanel(controller,source,cost,maximumCount,replicate); } @@ -158,7 +158,7 @@ public class MagicKickerChoice extends MagicChoice { count=kickerPanel.getKickerCount(); } else if (maximumCount==1) { // Single kicker. - final MayChoicePanel kickerPanel = controller.showComponent(new Callable() { + final MayChoicePanel kickerPanel = controller.waitForInput(new Callable() { public MayChoicePanel call() { return new MayChoicePanel(controller,source,"You may pay the kicker "+cost.getText()+'.'); } diff --git a/src/magic/model/choice/MagicMayChoice.java b/src/magic/model/choice/MagicMayChoice.java index 3c9d17bd83..e85f961921 100644 --- a/src/magic/model/choice/MagicMayChoice.java +++ b/src/magic/model/choice/MagicMayChoice.java @@ -153,7 +153,7 @@ public class MagicMayChoice extends MagicChoice { } controller.disableActionButton(false); - final MayChoicePanel choicePanel = controller.showComponent(new Callable() { + final MayChoicePanel choicePanel = controller.waitForInput(new Callable() { public MayChoicePanel call() { return new MayChoicePanel(controller,source,getDescription()); } diff --git a/src/magic/model/choice/MagicMulliganChoice.java b/src/magic/model/choice/MagicMulliganChoice.java index 37907fd569..3d8814f551 100644 --- a/src/magic/model/choice/MagicMulliganChoice.java +++ b/src/magic/model/choice/MagicMulliganChoice.java @@ -86,8 +86,7 @@ public class MagicMulliganChoice extends MagicChoice { return new Object[]{NO_CHOICE}; } controller.disableActionButton(false); - final MayChoicePanel choicePanel = - controller.showComponent(new Callable() { + final MayChoicePanel choicePanel = controller.waitForInput(new Callable() { public MayChoicePanel call() { return new MayChoicePanel(controller,source,"You may take a mulligan."); } diff --git a/src/magic/model/choice/MagicPayManaCostChoice.java b/src/magic/model/choice/MagicPayManaCostChoice.java index 48a245556b..ac136f69d0 100644 --- a/src/magic/model/choice/MagicPayManaCostChoice.java +++ b/src/magic/model/choice/MagicPayManaCostChoice.java @@ -112,7 +112,7 @@ public class MagicPayManaCostChoice extends MagicChoice { final int x; if (cost.hasX()) { final int maximumX=player.getMaximumX(game,cost); - final ManaCostXChoicePanel choicePanel = controller.showComponent(new Callable() { + final ManaCostXChoicePanel choicePanel = controller.waitForInput(new Callable() { public ManaCostXChoicePanel call() { return new ManaCostXChoicePanel(controller,source,maximumX); } diff --git a/src/magic/model/choice/MagicPlayChoice.java b/src/magic/model/choice/MagicPlayChoice.java index 9da3f58a86..4802438846 100644 --- a/src/magic/model/choice/MagicPlayChoice.java +++ b/src/magic/model/choice/MagicPlayChoice.java @@ -177,7 +177,7 @@ public class MagicPlayChoice extends MagicChoice { return new Object[]{results.get(0)}; } else { controller.setSourceCardDefinition(activationSource); - final PlayChoicePanel choicePanel = controller.showComponent(new Callable() { + final PlayChoicePanel choicePanel = controller.waitForInput(new Callable() { public PlayChoicePanel call() { return new PlayChoicePanel(controller,activationSource,results); } diff --git a/src/magic/model/choice/MagicSimpleMayChoice.java b/src/magic/model/choice/MagicSimpleMayChoice.java index 8881b90c01..c9fe7e0a15 100644 --- a/src/magic/model/choice/MagicSimpleMayChoice.java +++ b/src/magic/model/choice/MagicSimpleMayChoice.java @@ -82,7 +82,7 @@ public class MagicSimpleMayChoice extends MagicChoice { new Object[]{YES_CHOICE}; } controller.disableActionButton(false); - final MayChoicePanel choicePanel = controller.showComponent(new Callable() { + final MayChoicePanel choicePanel = controller.waitForInput(new Callable() { public MayChoicePanel call() { return new MayChoicePanel(controller,source,getDescription()); } diff --git a/src/magic/ui/GameController.java b/src/magic/ui/GameController.java index d544148527..4b069380bc 100644 --- a/src/magic/ui/GameController.java +++ b/src/magic/ui/GameController.java @@ -365,7 +365,7 @@ public class GameController { }); } - public E showComponent(final Callable func) throws UndoClickedException { + public E waitForInput(final Callable func) throws UndoClickedException { final LinkedList results = new LinkedList(); invokeAndWait(new Runnable() { public void run() {