From c7ea22bb16f59420af8d48eaf0c459ff64fda474 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 18 Feb 2012 21:29:43 +0000 Subject: [PATCH] - CheckStyle. --- .../java/forge/control/home/ControlDraft.java | 4 ++-- .../java/forge/control/home/ControlQuest.java | 6 ++++-- .../forge/control/home/ControlSealed.java | 18 ++++++++-------- .../forge/control/home/ControlUtilities.java | 21 +++++++++++-------- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/main/java/forge/control/home/ControlDraft.java b/src/main/java/forge/control/home/ControlDraft.java index 52f88b3b308..1cadb81b7b4 100644 --- a/src/main/java/forge/control/home/ControlDraft.java +++ b/src/main/java/forge/control/home/ControlDraft.java @@ -183,9 +183,9 @@ public class ControlDraft { /** Updates deck list in view. */ public void updateHumanDecks() { - + List human = new ArrayList(); - for(DeckSet d : AllZone.getDecks().getDraft()) { + for (DeckSet d : AllZone.getDecks().getDraft()) { human.add(d.getHumanDeck()); } view.getLstHumanDecks().setDecks(human); diff --git a/src/main/java/forge/control/home/ControlQuest.java b/src/main/java/forge/control/home/ControlQuest.java index 11bb0785c93..8aa5e80cf30 100644 --- a/src/main/java/forge/control/home/ControlQuest.java +++ b/src/main/java/forge/control/home/ControlQuest.java @@ -399,9 +399,11 @@ public class ControlQuest { /** Resets decks, then retrieves and sets current deck. */ public void refreshDecks() { // Retrieve and set all decks - + List temp = new ArrayList(); - if (qData != null ) temp.addAll(qData.getMyDecks().values()); + if (qData != null) { + temp.addAll(qData.getMyDecks().values()); + } view.getLstDecks().setDecks(temp); // Look through list for preferred deck from prefs diff --git a/src/main/java/forge/control/home/ControlSealed.java b/src/main/java/forge/control/home/ControlSealed.java index d06a25a1520..fb7f9400738 100644 --- a/src/main/java/forge/control/home/ControlSealed.java +++ b/src/main/java/forge/control/home/ControlSealed.java @@ -174,21 +174,23 @@ public class ControlSealed { + ">> does not equal any of the sealedTypes."); } - if (sd.getCardpool().isEmpty()) + if (sd.getCardpool().isEmpty()) { return; - + } + final String sDeckName = JOptionPane.showInputDialog(null, ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SAVE_SEALED_MSG), ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SAVE_SEALED_TTL), - JOptionPane.QUESTION_MESSAGE); - - if ( StringUtils.isBlank(sDeckName) ) + JOptionPane.QUESTION_MESSAGE); + + if (StringUtils.isBlank(sDeckName)) { return; - + } + // May check for name uniqueness here final ItemPool sDeck = sd.getCardpool(); - + Deck deck = new Deck(sDeckName); deck.getSideboard().addAll(sDeck); @@ -200,11 +202,9 @@ public class ControlSealed { sealed.setHumanDeck(deck); sealed.addAiDeck(sd.buildAIDeck(sDeck.toForgeCardList())); AllZone.getDecks().getSealed().add(sealed); - view.getParentView().getUtilitiesController().showDeckEditor(GameType.Sealed, sealed); - } /** @return {@link forge.Command} What to do when the deck editor exits. */ diff --git a/src/main/java/forge/control/home/ControlUtilities.java b/src/main/java/forge/control/home/ControlUtilities.java index f2eb25c035c..b8de64bb76e 100644 --- a/src/main/java/forge/control/home/ControlUtilities.java +++ b/src/main/java/forge/control/home/ControlUtilities.java @@ -153,16 +153,19 @@ public class ControlUtilities { */ @SuppressWarnings("unchecked") public void showDeckEditor(GameType gt0, T d0) { - - DeckEditorBase editor = null; - if ( gt0 == GameType.Constructed) - editor = (DeckEditorBase) new DeckEditorConstructed(); - if ( gt0 == GameType.Draft) - editor = (DeckEditorBase) new DeckEditorLimited(AllZone.getDecks().getDraft()); - if ( gt0 == GameType.Sealed) - editor = (DeckEditorBase) new DeckEditorLimited(AllZone.getDecks().getSealed()); - + DeckEditorBase editor = null; + if (gt0 == GameType.Constructed) { + editor = (DeckEditorBase) new DeckEditorConstructed(); + } + if (gt0 == GameType.Draft) { + editor = (DeckEditorBase) new DeckEditorLimited(AllZone.getDecks().getDraft()); + } + if (gt0 == GameType.Sealed) { + editor = (DeckEditorBase) new DeckEditorLimited(AllZone.getDecks().getSealed()); + } + + final Command exit = new Command() { private static final long serialVersionUID = -9133358399503226853L;