rename showComponent to waitForInput

master
melvin 2013-04-28 21:06:09 +08:00
parent 6373e137fd
commit 6c64b08695
9 changed files with 14 additions and 15 deletions

View File

@ -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<MayChoicePanel>() {
final MayChoicePanel kickerPanel = controller.waitForInput(new Callable<MayChoicePanel>() {
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();

View File

@ -129,7 +129,7 @@ public class MagicColorChoice extends MagicChoice {
final MagicSource source) throws UndoClickedException {
controller.disableActionButton(false);
final ColorChoicePanel choicePanel = controller.showComponent(new Callable<ColorChoicePanel>() {
final ColorChoicePanel choicePanel = controller.waitForInput(new Callable<ColorChoicePanel>() {
public ColorChoicePanel call() {
return new ColorChoicePanel(controller,source);
}

View File

@ -150,7 +150,7 @@ public class MagicKickerChoice extends MagicChoice {
final int count;
if (maximumCount>1) {
// Multiple kickers.
final MultiKickerChoicePanel kickerPanel = controller.showComponent(new Callable<MultiKickerChoicePanel>() {
final MultiKickerChoicePanel kickerPanel = controller.waitForInput(new Callable<MultiKickerChoicePanel>() {
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<MayChoicePanel>() {
final MayChoicePanel kickerPanel = controller.waitForInput(new Callable<MayChoicePanel>() {
public MayChoicePanel call() {
return new MayChoicePanel(controller,source,"You may pay the kicker "+cost.getText()+'.');
}

View File

@ -153,7 +153,7 @@ public class MagicMayChoice extends MagicChoice {
}
controller.disableActionButton(false);
final MayChoicePanel choicePanel = controller.showComponent(new Callable<MayChoicePanel>() {
final MayChoicePanel choicePanel = controller.waitForInput(new Callable<MayChoicePanel>() {
public MayChoicePanel call() {
return new MayChoicePanel(controller,source,getDescription());
}

View File

@ -86,8 +86,7 @@ public class MagicMulliganChoice extends MagicChoice {
return new Object[]{NO_CHOICE};
}
controller.disableActionButton(false);
final MayChoicePanel choicePanel =
controller.showComponent(new Callable<MayChoicePanel>() {
final MayChoicePanel choicePanel = controller.waitForInput(new Callable<MayChoicePanel>() {
public MayChoicePanel call() {
return new MayChoicePanel(controller,source,"You may take a mulligan.");
}

View File

@ -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<ManaCostXChoicePanel>() {
final ManaCostXChoicePanel choicePanel = controller.waitForInput(new Callable<ManaCostXChoicePanel>() {
public ManaCostXChoicePanel call() {
return new ManaCostXChoicePanel(controller,source,maximumX);
}

View File

@ -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<PlayChoicePanel>() {
final PlayChoicePanel choicePanel = controller.waitForInput(new Callable<PlayChoicePanel>() {
public PlayChoicePanel call() {
return new PlayChoicePanel(controller,activationSource,results);
}

View File

@ -82,7 +82,7 @@ public class MagicSimpleMayChoice extends MagicChoice {
new Object[]{YES_CHOICE};
}
controller.disableActionButton(false);
final MayChoicePanel choicePanel = controller.showComponent(new Callable<MayChoicePanel>() {
final MayChoicePanel choicePanel = controller.waitForInput(new Callable<MayChoicePanel>() {
public MayChoicePanel call() {
return new MayChoicePanel(controller,source,getDescription());
}

View File

@ -365,7 +365,7 @@ public class GameController {
});
}
public <E extends JComponent> E showComponent(final Callable<E> func) throws UndoClickedException {
public <E extends JComponent> E waitForInput(final Callable<E> func) throws UndoClickedException {
final LinkedList<E> results = new LinkedList<E>();
invokeAndWait(new Runnable() {
public void run() {