From 1a651d02176806effb34e6da77edde16bf3d6980 Mon Sep 17 00:00:00 2001 From: jendave Date: Thu, 3 Nov 2011 16:16:33 +0000 Subject: [PATCH] changed Constants and NewConstants from Interfaces to static classes. --- src/main/java/forge/AllZone.java | 6 +- src/main/java/forge/CardReader.java | 3 +- src/main/java/forge/Constant.java | 108 +-- src/main/java/forge/CopyFiles.java | 2 +- src/main/java/forge/GuiDisplay.java | 65 +- src/main/java/forge/GuiDisplayUtil.java | 3 +- .../java/forge/GuiDownloadPicturesLQ.java | 7 +- .../java/forge/GuiDownloadQuestImages.java | 17 +- .../java/forge/GuiDownloadSetPicturesLQ.java | 7 +- src/main/java/forge/GuiDownloader.java | 25 +- src/main/java/forge/GuiImportPicture.java | 8 +- .../GuiMigrateLocalMWSSetPicturesHQ.java | 9 +- src/main/java/forge/ImageCache.java | 6 +- src/main/java/forge/MenuItemHowToPlay.java | 8 +- src/main/java/forge/NameChanger.java | 6 +- .../abilityfactory/AbilityFactoryClash.java | 6 +- .../card/cardfactory/AbstractCardFactory.java | 2 +- src/main/java/forge/error/ErrorViewer.java | 20 +- .../gui/deckeditor/DeckEditorCommonMenu.java | 2 +- .../forge/gui/deckeditor/DeckEditorDraft.java | 3 +- .../forge/gui/deckeditor/DeckEditorQuest.java | 3 +- .../java/forge/properties/NewConstants.java | 614 +++++++++--------- .../java/forge/quest/data/ReadPriceList.java | 6 +- .../quest/gui/bazaar/QuestBazaarStall.java | 3 +- .../java/forge/view/swing/OldGuiNewGame.java | 78 +-- src/test/java/forge/BoosterDraftTest.java | 60 +- src/test/java/forge/BoosterDraft_1Test.java | 12 +- src/test/java/forge/CardColorTest.java | 20 +- src/test/java/forge/CardReaderTest.java | 105 +-- src/test/java/forge/GameActionTest.java | 30 +- src/test/java/forge/GuiBoosterDraftTest.java | 20 +- .../java/forge/GuiDownloadPicturesLQTest.java | 10 +- .../forge/GuiDownloadSetPicturesLQTest.java | 8 +- .../GuiMigrateLocalMWSSetPicturesHQTest.java | 10 +- .../java/forge/GuiMultipleBlockers4Test.java | 10 +- .../java/forge/GuiProgressBarWindowTest.java | 21 +- src/test/java/forge/GuiQuestOptionsTest.java | 13 +- src/test/java/forge/PanelTest.java | 60 +- src/test/java/forge/PhaseTest.java | 13 +- src/test/java/forge/RunTest.java | 359 +++++----- src/test/java/forge/TinyTest.java | 4 +- .../card/cardFactory/CardFactoryTest.java | 95 ++- .../card/cardFactory/CardFactoryUtilTest.java | 34 +- 43 files changed, 998 insertions(+), 903 deletions(-) diff --git a/src/main/java/forge/AllZone.java b/src/main/java/forge/AllZone.java index ccf27892278..0611ec64ab3 100644 --- a/src/main/java/forge/AllZone.java +++ b/src/main/java/forge/AllZone.java @@ -28,7 +28,7 @@ import forge.quest.gui.main.QuestEventManager; * @author Forge * @version $Id$ */ -public final class AllZone implements NewConstants { +public final class AllZone { // only for testing, should read decks from local directory // public static final IO IO = new IO("all-decks"); @@ -283,7 +283,7 @@ public final class AllZone implements NewConstants { if (cardFactory == null) { // setCardFactory(new // LazyCardFactory(ForgeProps.getFile(CARDSFOLDER))); - setCardFactory(new PreloadingCardFactory(ForgeProps.getFile(CARDSFOLDER))); + setCardFactory(new PreloadingCardFactory(ForgeProps.getFile(NewConstants.CARDSFOLDER))); } return cardFactory; } @@ -553,7 +553,7 @@ public final class AllZone implements NewConstants { */ public static DeckManager getDeckManager() { if (deckManager == null) { - deckManager = new DeckManager(ForgeProps.getFile(NEW_DECKS)); + deckManager = new DeckManager(ForgeProps.getFile(NewConstants.NEW_DECKS)); } return deckManager; } diff --git a/src/main/java/forge/CardReader.java b/src/main/java/forge/CardReader.java index 3618497b6ca..5472b396081 100644 --- a/src/main/java/forge/CardReader.java +++ b/src/main/java/forge/CardReader.java @@ -31,7 +31,6 @@ import forge.card.CardRules; import forge.card.CardRulesReader; import forge.card.trigger.TriggerHandler; import forge.error.ErrorViewer; -import forge.properties.NewConstants; import forge.view.FView; /** @@ -42,7 +41,7 @@ import forge.view.FView; * @author Forge * @version $Id$ */ -public class CardReader implements Runnable, NewConstants { +public class CardReader implements Runnable { // NOPMD by Braids on 8/18/11 10:55 // PM private static final String CARD_FILE_DOT_EXTENSION = ".txt"; // NOPMD by diff --git a/src/main/java/forge/Constant.java b/src/main/java/forge/Constant.java index 91db0f5a469..2168f96ee66 100644 --- a/src/main/java/forge/Constant.java +++ b/src/main/java/forge/Constant.java @@ -14,15 +14,15 @@ import forge.game.GameType; * @author Forge * @version $Id$ */ -public interface Constant { +public final class Constant { /** Constant ProgramName="Forge - http://cardforge.org". */ - String PROGRAM_NAME = "Forge - http://cardforge.org"; + public static final String PROGRAM_NAME = "Forge - http://cardforge.org"; // used to pass information between the GUI screens /** * The Class Runtime. */ - public abstract class Runtime { + public static class Runtime { /** The Constant HumanDeck. */ public static final Deck[] HUMAN_DECK = new Deck[1]; @@ -110,52 +110,52 @@ public interface Constant { /** * The Interface Phase. */ - public interface Phase { + public static class Phase { /** The Constant Untap. */ - String UNTAP = "Untap"; + public static final String UNTAP = "Untap"; /** The Constant Upkeep. */ - String UPKEEP = "Upkeep"; + public static final String UPKEEP = "Upkeep"; /** The Constant Draw. */ - String DRAW = "Draw"; + public static final String DRAW = "Draw"; /** The Constant Main1. */ - String MAIN1 = "Main1"; + public static final String MAIN1 = "Main1"; /** The Constant Combat_Begin. */ - String COMBAT_BEGIN = "BeginCombat"; + public static final String COMBAT_BEGIN = "BeginCombat"; /** The Constant Combat_Declare_Attackers. */ - String COMBAT_DECLARE_ATTACKERS = "Declare Attackers"; + public static final String COMBAT_DECLARE_ATTACKERS = "Declare Attackers"; /** The Constant Combat_Declare_Attackers_InstantAbility. */ - String COMBAT_DECLARE_ATTACKERS_INSTANT_ABILITY = "Declare Attackers - Play Instants and Abilities"; + public static final String COMBAT_DECLARE_ATTACKERS_INSTANT_ABILITY = "Declare Attackers - Play Instants and Abilities"; /** The Constant Combat_Declare_Blockers. */ - String COMBAT_DECLARE_BLOCKERS = "Declare Blockers"; + public static final String COMBAT_DECLARE_BLOCKERS = "Declare Blockers"; /** The Constant Combat_Declare_Blockers_InstantAbility. */ - String COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY = "Declare Blockers - Play Instants and Abilities"; + public static final String COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY = "Declare Blockers - Play Instants and Abilities"; /** The Constant Combat_Damage. */ - String COMBAT_DAMAGE = "Combat Damage"; + public static final String COMBAT_DAMAGE = "Combat Damage"; /** The Constant Combat_FirstStrikeDamage. */ - String COMBAT_FIRST_STRIKE_DAMAGE = "First Strike Damage"; + public static final String COMBAT_FIRST_STRIKE_DAMAGE = "First Strike Damage"; /** The Constant Combat_End. */ - String COMBAT_END = "EndCombat"; + public static final String COMBAT_END = "EndCombat"; /** The Constant Main2. */ - String MAIN2 = "Main2"; + public static final String MAIN2 = "Main2"; /** The Constant End_Of_Turn. */ - String END_OF_TURN = "End of Turn"; + public static final String END_OF_TURN = "End of Turn"; /** The Constant Cleanup. */ - String CLEANUP = "Cleanup"; + public static final String CLEANUP = "Cleanup"; } /** @@ -226,122 +226,122 @@ public interface Constant { /** * The Interface Color. */ - public interface Color { + public static class Color { /** The Black. */ - String BLACK = "black"; + public static final String BLACK = "black"; /** The Blue. */ - String BLUE = "blue"; + public static final String BLUE = "blue"; /** The Green. */ - String GREEN = "green"; + public static final String GREEN = "green"; /** The Red. */ - String RED = "red"; + public static final String RED = "red"; /** The White. */ - String WHITE = "white"; + public static final String WHITE = "white"; /** The Colorless. */ - String COLORLESS = "colorless"; + public static final String COLORLESS = "colorless"; // color order "wubrg" /** The Colors. */ - String[] COLORS = { WHITE, BLUE, BLACK, RED, GREEN, COLORLESS }; + public static final String[] COLORS = { WHITE, BLUE, BLACK, RED, GREEN, COLORLESS }; /** The only colors. */ - String[] ONLY_COLORS = { WHITE, BLUE, BLACK, RED, GREEN }; + public static final String[] ONLY_COLORS = { WHITE, BLUE, BLACK, RED, GREEN }; /** The Snow. */ - String SNOW = "snow"; + public static final String SNOW = "snow"; /** The Mana colors. */ - String[] MANA_COLORS = { WHITE, BLUE, BLACK, RED, GREEN, COLORLESS, SNOW }; + public static final String[] MANA_COLORS = { WHITE, BLUE, BLACK, RED, GREEN, COLORLESS, SNOW }; /** The loaded. */ - boolean[] LOADED = { false }; + public static final boolean[] LOADED = { false }; // public static final Constant_StringHashMap[] LandColor = new // Constant_StringHashMap[1]; /** The Basic lands. */ - String[] BASIC_LANDS = { "Plains", "Island", "Swamp", "Mountain", "Forest" }; + public static final String[] BASIC_LANDS = { "Plains", "Island", "Swamp", "Mountain", "Forest" }; } /** * The Interface Quest. */ - public interface Quest { + public static class Quest { /** The fantasy quest. */ - boolean[] FANTASY_QUEST = new boolean[1]; + public static final boolean[] FANTASY_QUEST = new boolean[1]; // public static final Quest_Assignment[] qa = new Quest_Assignment[1]; /** The human list. */ - CardList[] HUMAN_LIST = new CardList[1]; + public static final CardList[] HUMAN_LIST = new CardList[1]; /** The computer list. */ - CardList[] COMPUTER_LIST = new CardList[1]; + public static final CardList[] COMPUTER_LIST = new CardList[1]; /** The human life. */ - int[] HUMAN_LIFE = new int[1]; + public static final int[] HUMAN_LIFE = new int[1]; /** The computer life. */ - int[] COMPUTER_LIFE = new int[1]; + public static final int[] COMPUTER_LIFE = new int[1]; /** The opp icon name. */ - String[] OPP_ICON_NAME = new String[1]; + public static final String[] OPP_ICON_NAME = new String[1]; } /** * The Interface CardTypes. */ - public interface CardTypes { + public static class CardTypes { /** The loaded. */ - boolean[] LOADED = { false }; + public static final boolean[] LOADED = { false }; /** The card types. */ - ConstantStringArrayList[] CARD_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] CARD_TYPES = new ConstantStringArrayList[1]; /** The super types. */ - ConstantStringArrayList[] SUPER_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] SUPER_TYPES = new ConstantStringArrayList[1]; /** The basic types. */ - ConstantStringArrayList[] BASIC_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] BASIC_TYPES = new ConstantStringArrayList[1]; /** The land types. */ - ConstantStringArrayList[] LAND_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] LAND_TYPES = new ConstantStringArrayList[1]; /** The creature types. */ - ConstantStringArrayList[] CREATURE_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] CREATURE_TYPES = new ConstantStringArrayList[1]; /** The instant types. */ - ConstantStringArrayList[] INSTANT_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] INSTANT_TYPES = new ConstantStringArrayList[1]; /** The sorcery types. */ - ConstantStringArrayList[] SORCERY_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] SORCERY_TYPES = new ConstantStringArrayList[1]; /** The enchantment types. */ - ConstantStringArrayList[] ENCHANTMENT_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] ENCHANTMENT_TYPES = new ConstantStringArrayList[1]; /** The artifact types. */ - ConstantStringArrayList[] ARTIFACT_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] ARTIFACT_TYPES = new ConstantStringArrayList[1]; /** The walker types. */ - ConstantStringArrayList[] WALKER_TYPES = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] WALKER_TYPES = new ConstantStringArrayList[1]; } /** * The Interface Keywords. */ - public interface Keywords { + public static class Keywords { /** The loaded. */ - boolean[] LOADED = { false }; + public static final boolean[] LOADED = { false }; /** The Non stacking list. */ - ConstantStringArrayList[] NON_STACKING_LIST = new ConstantStringArrayList[1]; + public static final ConstantStringArrayList[] NON_STACKING_LIST = new ConstantStringArrayList[1]; } } // Constant diff --git a/src/main/java/forge/CopyFiles.java b/src/main/java/forge/CopyFiles.java index 5cdb499b623..74d05fe3bd7 100644 --- a/src/main/java/forge/CopyFiles.java +++ b/src/main/java/forge/CopyFiles.java @@ -23,7 +23,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class CopyFiles extends SwingWorker implements NewConstants { +public class CopyFiles extends SwingWorker { private final List fileList; diff --git a/src/main/java/forge/GuiDisplay.java b/src/main/java/forge/GuiDisplay.java index df9e8daca4b..9c57fd9b036 100644 --- a/src/main/java/forge/GuiDisplay.java +++ b/src/main/java/forge/GuiDisplay.java @@ -93,6 +93,10 @@ import forge.item.CardPrinted; import forge.properties.ForgePreferences; import forge.properties.ForgeProps; import forge.properties.NewConstants; +import forge.properties.NewConstants.Lang.GuiDisplay.ComputerHand; +import forge.properties.NewConstants.Lang.GuiDisplay.ComputerLibrary; +import forge.properties.NewConstants.Lang.GuiDisplay.HumanHand; +import forge.properties.NewConstants.Lang.GuiDisplay.HumanLibrary; /** *

@@ -102,8 +106,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class GuiDisplay extends JFrame implements CardContainer, Display, NewConstants, NewConstants.Gui.GuiDisplay, - NewConstants.Lang.GuiDisplay { +public class GuiDisplay extends JFrame implements CardContainer, Display { /** Constant serialVersionUID=4519302185194841060L. */ private static final long serialVersionUID = 4519302185194841060L; @@ -177,9 +180,9 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon *

*/ private void setupActions() { - humanGraveyardAction = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Graveyard), HUMAN_GRAVEYARD); - humanRemovedACtion = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Exile), HUMAN_REMOVED); - humanFlashbackAction = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Graveyard), HUMAN_FLASHBACK) { + humanGraveyardAction = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Graveyard), NewConstants.Lang.GuiDisplay.HUMAN_GRAVEYARD); + humanRemovedACtion = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Exile), NewConstants.Lang.GuiDisplay.HUMAN_REMOVED); + humanFlashbackAction = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Graveyard), NewConstants.Lang.GuiDisplay.HUMAN_FLASHBACK) { private static final long serialVersionUID = 8120331222693706164L; @@ -195,11 +198,11 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon } }; computerGraveyardAction = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Graveyard), - COMPUTER_GRAVEYARD); - computerRemovedAction = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Exile), COMPUTER_REMOVED); + NewConstants.Lang.GuiDisplay.COMPUTER_GRAVEYARD); + computerRemovedAction = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Exile), NewConstants.Lang.GuiDisplay.COMPUTER_REMOVED); concedeAction = new ConcedeAction(); - humanDecklistAction = new DeckListAction(HUMAN_DECKLIST); + humanDecklistAction = new DeckListAction(NewConstants.Lang.GuiDisplay.HUMAN_DECKLIST); } /** @@ -216,7 +219,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon computerGraveyardAction, computerRemovedAction, new JSeparator(), playsoundCheckboxForMenu, new JSeparator(), ErrorViewer.ALL_THREADS_ACTION, concedeAction }; - JMenu gameMenu = new JMenu(ForgeProps.getLocalized(MenuBar.Menu.TITLE)); + JMenu gameMenu = new JMenu(ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.MenuBar.Menu.TITLE)); for (Object o : obj) { if (o instanceof ForgeAction) { gameMenu.add(((ForgeAction) o).setupButton(new JMenuItem())); @@ -230,7 +233,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon } // Phase Menu Creation - JMenu gamePhases = new JMenu(ForgeProps.getLocalized(MenuBar.PHASE.TITLE)); + JMenu gamePhases = new JMenu(ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.MenuBar.PHASE.TITLE)); JMenuItem aiLabel = new JMenuItem("Computer"); JMenuItem humanLabel = new JMenuItem("Human"); @@ -244,7 +247,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon } // Dev Mode Creation - JMenu devMenu = new JMenu(ForgeProps.getLocalized(MenuBar.DEV.TITLE)); + JMenu devMenu = new JMenu(ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.MenuBar.DEV.TITLE)); devMenu.setEnabled(Constant.Runtime.DEV_MODE[0]); @@ -256,7 +259,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon ComputerLibrary.BASE); Action viewHumanLibrary = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Library), HumanLibrary.BASE); - ForgeAction generateMana = new ForgeAction(MANAGEN) { + ForgeAction generateMana = new ForgeAction(NewConstants.Lang.GuiDisplay.MANAGEN) { private static final long serialVersionUID = 7171104690016706405L; public void actionPerformed(final ActionEvent arg0) { @@ -265,7 +268,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon }; // + Battlefield setup + - ForgeAction setupBattleField = new ForgeAction(SETUPBATTLEFIELD) { + ForgeAction setupBattleField = new ForgeAction(NewConstants.Lang.GuiDisplay.SETUPBATTLEFIELD) { private static final long serialVersionUID = -6660930759092583160L; public void actionPerformed(final ActionEvent arg0) { @@ -275,7 +278,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // - Battlefield setup - // DevMode Tutor - ForgeAction tutor = new ForgeAction(TUTOR) { + ForgeAction tutor = new ForgeAction(NewConstants.Lang.GuiDisplay.TUTOR) { private static final long serialVersionUID = 2003222642609217705L; public void actionPerformed(final ActionEvent arg0) { @@ -285,7 +288,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // end DevMode Tutor // DevMode AddCounter - ForgeAction addCounter = new ForgeAction(ADDCOUNTER) { + ForgeAction addCounter = new ForgeAction(NewConstants.Lang.GuiDisplay.ADDCOUNTER) { private static final long serialVersionUID = 3136264111882855268L; public void actionPerformed(final ActionEvent arg0) { @@ -295,7 +298,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // end DevMode AddCounter // DevMode Tap - ForgeAction tapPerm = new ForgeAction(TAPPERM) { + ForgeAction tapPerm = new ForgeAction(NewConstants.Lang.GuiDisplay.TAPPERM) { private static final long serialVersionUID = -6092045653540313527L; public void actionPerformed(final ActionEvent arg0) { @@ -305,7 +308,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // end DevMode Tap // DevMode Untap - ForgeAction untapPerm = new ForgeAction(UNTAPPERM) { + ForgeAction untapPerm = new ForgeAction(NewConstants.Lang.GuiDisplay.UNTAPPERM) { private static final long serialVersionUID = 5425291996157256656L; public void actionPerformed(final ActionEvent arg0) { @@ -315,7 +318,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // end DevMode Untap // DevMode UnlimitedLand - ForgeAction unlimitedLand = new ForgeAction(NOLANDLIMIT) { + ForgeAction unlimitedLand = new ForgeAction(NewConstants.Lang.GuiDisplay.NOLANDLIMIT) { private static final long serialVersionUID = 2184353891062202796L; public void actionPerformed(final ActionEvent arg0) { @@ -325,7 +328,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // end DevMode UnlimitedLand // DevMode SetLife - ForgeAction setLife = new ForgeAction(SETLIFE) { + ForgeAction setLife = new ForgeAction(NewConstants.Lang.GuiDisplay.SETLIFE) { private static final long serialVersionUID = -1750588303928974918L; public void actionPerformed(final ActionEvent arg0) { @@ -674,7 +677,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon AllZone.getComputerPlayer().updateObservers(); if (AllZone.getQuestData() != null) { - File base = ForgeProps.getFile(IMAGE_ICON); + File base = ForgeProps.getFile(NewConstants.IMAGE_ICON); String iconName = ""; if (Constant.Quest.OPP_ICON_NAME[0] != null) { iconName = Constant.Quest.OPP_ICON_NAME[0]; @@ -860,7 +863,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon */ private void initComponents() { // Preparing the Frame - setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME)); + setTitle(ForgeProps.getLocalized(NewConstants.Lang.PROGRAM_NAME)); if (!Singletons.getModel().getPreferences().isLafFonts()) { setFont(new Font("Times New Roman", 0, 16)); } @@ -882,7 +885,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // Write the layout to the new file, usually // res/gui/display_new_layout.xml - File f = ForgeProps.getFile(LAYOUT_NEW); + File f = ForgeProps.getFile(NewConstants.Gui.GuiDisplay.LAYOUT_NEW); Node layout = pane.getMultiSplitLayout().getModel(); @@ -914,7 +917,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon // Try to load the latest saved layout, usually // res/gui/display_new_layout.xml - final File file = ForgeProps.getFile(LAYOUT_NEW); + final File file = ForgeProps.getFile(NewConstants.Gui.GuiDisplay.LAYOUT_NEW); try { model = loadModel(xstream, file); @@ -950,7 +953,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon if (model == null) { System.err.println("XMLDecoder failed; using default layout."); - final File defaultFile = ForgeProps.getFile(LAYOUT); + final File defaultFile = ForgeProps.getFile(NewConstants.Gui.GuiDisplay.LAYOUT); try { model = loadModel(xstream, defaultFile); @@ -1231,7 +1234,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon oppIconLifePanel.add(oppLifeLabel); JPanel oppPanel = new JPanel(); - oppPanel.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(COMPUTER_TITLE))); + oppPanel.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.COMPUTER_TITLE))); oppPanel.setLayout(new BorderLayout()); oppPanel.add(oppNumbersPanel, BorderLayout.WEST); // oppPanel.add(oppIconLabel, BorderLayout.CENTER); @@ -1261,7 +1264,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon JScrollPane combatPane = new JScrollPane(combatArea); - combatPane.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(COMBAT))); + combatPane.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.COMBAT))); pane.add(new ExternalPanel(combatPane), "combat"); } @@ -1342,7 +1345,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon playerNumbersPanel.add(playerFBValue); JPanel playerPanel = new JPanel(); - playerPanel.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(HUMAN_TITLE))); + playerPanel.setBorder(new TitledBorder(new EtchedBorder(), ForgeProps.getLocalized(NewConstants.Lang.GuiDisplay.HUMAN_TITLE))); playerPanel.setLayout(new BorderLayout()); playerPanel.add(playerNumbersPanel, BorderLayout.WEST); playerPanel.add(playerLifeLabel, BorderLayout.EAST); @@ -1647,7 +1650,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon private static final long serialVersionUID = -6976695235601916762L; public ConcedeAction() { - super(CONCEDE); + super(NewConstants.Lang.GuiDisplay.CONCEDE); } public void actionPerformed(final ActionEvent e) { @@ -1723,7 +1726,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon public TriggerReactionMenu() { super(); - ForgeAction actAccept = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSACCEPT) { + ForgeAction actAccept = new ForgeAction(NewConstants.Lang.GuiDisplay.Trigger.ALWAYSACCEPT) { private static final long serialVersionUID = -3734674058185367612L; @Override @@ -1732,7 +1735,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon } }; - ForgeAction actDecline = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSDECLINE) { + ForgeAction actDecline = new ForgeAction(NewConstants.Lang.GuiDisplay.Trigger.ALWAYSDECLINE) { private static final long serialVersionUID = -1983295769159971502L; @Override @@ -1741,7 +1744,7 @@ public class GuiDisplay extends JFrame implements CardContainer, Display, NewCon } }; - ForgeAction actAsk = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSASK) { + ForgeAction actAsk = new ForgeAction(NewConstants.Lang.GuiDisplay.Trigger.ALWAYSASK) { private static final long serialVersionUID = 5045255351332940821L; @Override diff --git a/src/main/java/forge/GuiDisplayUtil.java b/src/main/java/forge/GuiDisplayUtil.java index 3ef5cada832..621948877f6 100644 --- a/src/main/java/forge/GuiDisplayUtil.java +++ b/src/main/java/forge/GuiDisplayUtil.java @@ -31,7 +31,6 @@ import forge.card.mana.ManaPool; import forge.card.spellability.AbilityMana; import forge.gui.GuiUtils; import forge.gui.game.CardPanel; -import forge.properties.NewConstants; /** *

@@ -41,7 +40,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public final class GuiDisplayUtil implements NewConstants { +public final class GuiDisplayUtil { private GuiDisplayUtil() { throw new AssertionError(); diff --git a/src/main/java/forge/GuiDownloadPicturesLQ.java b/src/main/java/forge/GuiDownloadPicturesLQ.java index b17e7f3921e..9a29776d10e 100644 --- a/src/main/java/forge/GuiDownloadPicturesLQ.java +++ b/src/main/java/forge/GuiDownloadPicturesLQ.java @@ -7,6 +7,7 @@ import java.util.List; import javax.swing.JFrame; import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -41,10 +42,10 @@ public class GuiDownloadPicturesLQ extends GuiDownloader { */ protected final DownloadObject[] getNeededImages() { // read token names and urls - DownloadObject[] cardTokenLQ = readFileWithNames(TOKEN_IMAGES, ForgeProps.getFile(IMAGE_TOKEN)); + DownloadObject[] cardTokenLQ = readFileWithNames(NewConstants.TOKEN_IMAGES, ForgeProps.getFile(NewConstants.IMAGE_TOKEN)); ArrayList cList = new ArrayList(); - String base = ForgeProps.getFile(IMAGE_BASE).getPath(); + String base = ForgeProps.getFile(NewConstants.IMAGE_BASE).getPath(); for (Card c : AllZone.getCardFactory()) { cList.addAll(createDLObjects(c, base)); if (c.hasAlternateState()) { @@ -67,7 +68,7 @@ public class GuiDownloadPicturesLQ extends GuiDownloader { } // add missing tokens to the list of things to download - File filebase = ForgeProps.getFile(IMAGE_TOKEN); + File filebase = ForgeProps.getFile(NewConstants.IMAGE_TOKEN); for (int i = 0; i < cardTokenLQ.length; i++) { file = new File(filebase, cardTokenLQ[i].getName()); if (!file.exists()) { diff --git a/src/main/java/forge/GuiDownloadQuestImages.java b/src/main/java/forge/GuiDownloadQuestImages.java index b70d3a60792..40c56a4d25f 100644 --- a/src/main/java/forge/GuiDownloadQuestImages.java +++ b/src/main/java/forge/GuiDownloadQuestImages.java @@ -6,6 +6,7 @@ import java.util.ArrayList; import javax.swing.JFrame; import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -40,14 +41,14 @@ public class GuiDownloadQuestImages extends GuiDownloader { */ protected final DownloadObject[] getNeededImages() { // read all card names and urls - DownloadObject[] questOpponents = readFile(Quest.OPPONENT_ICONS, ForgeProps.getFile(Quest.OPPONENT_DIR)); - DownloadObject[] boosterImages = readFile(PICS_BOOSTER_IMAGES, ForgeProps.getFile(PICS_BOOSTER)); - DownloadObject[] petIcons = readFileWithNames(Quest.PET_SHOP_ICONS, ForgeProps.getFile(IMAGE_ICON)); - DownloadObject[] questPets = readFileWithNames(Quest.PET_TOKEN_IMAGES, ForgeProps.getFile(IMAGE_TOKEN)); + DownloadObject[] questOpponents = readFile(NewConstants.Quest.OPPONENT_ICONS, ForgeProps.getFile(NewConstants.Quest.OPPONENT_DIR)); + DownloadObject[] boosterImages = readFile(NewConstants.PICS_BOOSTER_IMAGES, ForgeProps.getFile(NewConstants.PICS_BOOSTER)); + DownloadObject[] petIcons = readFileWithNames(NewConstants.Quest.PET_SHOP_ICONS, ForgeProps.getFile(NewConstants.IMAGE_ICON)); + DownloadObject[] questPets = readFileWithNames(NewConstants.Quest.PET_TOKEN_IMAGES, ForgeProps.getFile(NewConstants.IMAGE_TOKEN)); ArrayList urls = new ArrayList(); File file; - File dir = ForgeProps.getFile(Quest.OPPONENT_DIR); + File dir = ForgeProps.getFile(NewConstants.Quest.OPPONENT_DIR); for (int i = 0; i < questOpponents.length; i++) { file = new File(dir, questOpponents[i].getName().replace("%20", " ")); if (!file.exists()) { @@ -55,7 +56,7 @@ public class GuiDownloadQuestImages extends GuiDownloader { } } - dir = ForgeProps.getFile(PICS_BOOSTER); + dir = ForgeProps.getFile(NewConstants.PICS_BOOSTER); for (int i = 0; i < boosterImages.length; i++) { file = new File(dir, boosterImages[i].getName().replace("%20", " ")); if (!file.exists()) { @@ -63,7 +64,7 @@ public class GuiDownloadQuestImages extends GuiDownloader { } } - dir = ForgeProps.getFile(IMAGE_ICON); + dir = ForgeProps.getFile(NewConstants.IMAGE_ICON); for (int i = 0; i < petIcons.length; i++) { file = new File(dir, petIcons[i].getName().replace("%20", " ")); if (!file.exists()) { @@ -71,7 +72,7 @@ public class GuiDownloadQuestImages extends GuiDownloader { } } - dir = ForgeProps.getFile(IMAGE_TOKEN); + dir = ForgeProps.getFile(NewConstants.IMAGE_TOKEN); for (int i = 0; i < questPets.length; i++) { file = new File(dir, questPets[i].getName().replace("%20", " ")); if (!file.exists()) { diff --git a/src/main/java/forge/GuiDownloadSetPicturesLQ.java b/src/main/java/forge/GuiDownloadSetPicturesLQ.java index edf7f093d44..d5fe07d2b9b 100644 --- a/src/main/java/forge/GuiDownloadSetPicturesLQ.java +++ b/src/main/java/forge/GuiDownloadSetPicturesLQ.java @@ -11,6 +11,7 @@ import forge.card.CardSet; import forge.item.CardDb; import forge.item.CardPrinted; import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** *

@@ -45,10 +46,10 @@ public class GuiDownloadSetPicturesLQ extends GuiDownloader { */ protected final DownloadObject[] getNeededImages() { // read token names and urls - DownloadObject[] cardTokenLQ = readFileWithNames(TOKEN_IMAGES, ForgeProps.getFile(IMAGE_TOKEN)); + DownloadObject[] cardTokenLQ = readFileWithNames(NewConstants.TOKEN_IMAGES, ForgeProps.getFile(NewConstants.IMAGE_TOKEN)); ArrayList cList = new ArrayList(); - File base = ForgeProps.getFile(IMAGE_BASE); + File base = ForgeProps.getFile(NewConstants.IMAGE_BASE); String urlBase = "http://cardforge.org/fpics/"; for (CardPrinted c : CardDb.instance().getAllCards()) { String setCode3 = c.getSet(); @@ -72,7 +73,7 @@ public class GuiDownloadSetPicturesLQ extends GuiDownloader { // add missing tokens to the list of things to download File file; - File filebase = ForgeProps.getFile(IMAGE_TOKEN); + File filebase = ForgeProps.getFile(NewConstants.IMAGE_TOKEN); for (int i = 0; i < cardTokenLQ.length; i++) { file = new File(filebase, cardTokenLQ[i].getName()); if (!file.exists()) { diff --git a/src/main/java/forge/GuiDownloader.java b/src/main/java/forge/GuiDownloader.java index 190983d5037..495c28c232a 100644 --- a/src/main/java/forge/GuiDownloader.java +++ b/src/main/java/forge/GuiDownloader.java @@ -53,8 +53,7 @@ import forge.properties.NewConstants; * * @author Forge */ -public abstract class GuiDownloader extends DefaultBoundedRangeModel implements Runnable, NewConstants, - NewConstants.Lang.GuiDownloadPictures { +public abstract class GuiDownloader extends DefaultBoundedRangeModel implements Runnable { private static final long serialVersionUID = -8596808503046590349L; @@ -141,12 +140,12 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements cards = getNeededImages(); if (cards.length == 0) { - JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(NO_MORE)); + JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.NO_MORE)); return; } - addr = new JTextField(ForgeProps.getLocalized(PROXY_ADDRESS)); - port = new JTextField(ForgeProps.getLocalized(PROXY_PORT)); + addr = new JTextField(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.PROXY_ADDRESS)); + port = new JTextField(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.PROXY_PORT)); bar = new JProgressBar(this); JPanel p0 = new JPanel(); @@ -154,8 +153,8 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements // Proxy Choice ButtonGroup bg = new ButtonGroup(); - String[] labels = { ForgeProps.getLocalized(NO_PROXY), ForgeProps.getLocalized(HTTP_PROXY), - ForgeProps.getLocalized(SOCKS_PROXY) }; + String[] labels = { ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.NO_PROXY), ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.HTTP_PROXY), + ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.SOCKS_PROXY) }; for (int i = 0; i < TYPES.length; i++) { JRadioButton rb = new JRadioButton(labels[i]); rb.addChangeListener(new ProxyHandler(i)); @@ -171,7 +170,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements p0.add(port); // Start - final JButton b = new JButton(ForgeProps.getLocalized(Buttons.START)); + final JButton b = new JButton(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.START)); b.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { @@ -194,7 +193,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements bar.setPreferredSize(d); // JOptionPane - close = new JButton(ForgeProps.getLocalized(Buttons.CANCEL)); + close = new JButton(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CANCEL)); Object[] options = { b, close }; dlg = new JOptionPane(p0, DEFAULT_OPTION, PLAIN_MESSAGE, null, options, options[1]); @@ -288,7 +287,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements sb.append(String.format("0:%02d remaining.", t2Go / 1000)); } } else { - sb.append(String.format(ForgeProps.getLocalized(BAR_CLOSE), card, cards.length)); + sb.append(String.format(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.BAR_CLOSE), card, cards.length)); } bar.setString(sb.toString()); @@ -308,7 +307,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements * @return a {@link javax.swing.JDialog} object. */ private JDialog getDlg(final JFrame frame) { - final JDialog dlg = this.dlg.createDialog(frame, ForgeProps.getLocalized(TITLE)); + final JDialog dlg = this.dlg.createDialog(frame, ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.TITLE)); close.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { dlg.setVisible(false); @@ -348,7 +347,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements p = new Proxy(TYPES[type], new InetSocketAddress(addr.getText(), parseInt(port.getText()))); } catch (Exception ex) { ErrorViewer - .showError(ex, ForgeProps.getLocalized(Errors.PROXY_CONNECT), addr.getText(), port.getText()); + .showError(ex, ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Errors.PROXY_CONNECT), addr.getText(), port.getText()); return; } } @@ -417,7 +416,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements } } // for } - close.setText(ForgeProps.getLocalized(Buttons.CLOSE)); + close.setText(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CLOSE)); } // run /** diff --git a/src/main/java/forge/GuiImportPicture.java b/src/main/java/forge/GuiImportPicture.java index 92b46197e0b..037e090186a 100644 --- a/src/main/java/forge/GuiImportPicture.java +++ b/src/main/java/forge/GuiImportPicture.java @@ -35,7 +35,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class GuiImportPicture extends JDialog implements NewConstants { +public class GuiImportPicture extends JDialog { /** Constant serialVersionUID=-4191539152208389089L. */ private static final long serialVersionUID = -4191539152208389089L; private JPanel jContentPane = null; @@ -110,7 +110,7 @@ public class GuiImportPicture extends JDialog implements NewConstants { jLabelHDDFree = new JLabel(); jLabelHDDFree.setBounds(new Rectangle(15, 119, 177, 16)); - File file = ForgeProps.getFile(IMAGE_BASE); + File file = ForgeProps.getFile(NewConstants.IMAGE_BASE); long freeSpace = file.getFreeSpace(); freeSpaceM = freeSpace / 1024 / 1024; @@ -200,7 +200,7 @@ public class GuiImportPicture extends JDialog implements NewConstants { start = fName.indexOf("full"); fName = fName.substring(0, start - 1) + fName.substring(start + 4, fName.length() - 4); fName = GuiDisplayUtil.cleanString(fName) + ".jpg"; - File file = new File(ForgeProps.getFile(IMAGE_BASE), fName); + File file = new File(ForgeProps.getFile(NewConstants.IMAGE_BASE), fName); if (!file.exists()) { filesForCopy = filesForCopy + 1; filesToCopySize = filesToCopySize + listFiles.get(i).length(); @@ -294,7 +294,7 @@ public class GuiImportPicture extends JDialog implements NewConstants { start = fName.indexOf("full"); fName = fName.substring(0, start - 1) + fName.substring(start + 4, fName.length() - 4); fName = GuiDisplayUtil.cleanString(fName) + ".jpg"; - File file = new File(ForgeProps.getFile(IMAGE_BASE), fName); + File file = new File(ForgeProps.getFile(NewConstants.IMAGE_BASE), fName); if (!file.exists()) { filesForCopy = filesForCopy + 1; filesToCopySize = filesToCopySize + listFiles.get(i).length(); diff --git a/src/main/java/forge/GuiMigrateLocalMWSSetPicturesHQ.java b/src/main/java/forge/GuiMigrateLocalMWSSetPicturesHQ.java index f6fc20ffa5d..11b169ea839 100644 --- a/src/main/java/forge/GuiMigrateLocalMWSSetPicturesHQ.java +++ b/src/main/java/forge/GuiMigrateLocalMWSSetPicturesHQ.java @@ -52,8 +52,7 @@ import forge.properties.NewConstants.Lang.GuiDownloadPictures; * @author Forge * @version $Id$ */ -public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeModel implements Runnable, - NewConstants, NewConstants.Lang.GuiDownloadPictures { +public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeModel implements Runnable { /** Constant serialVersionUID=-7890794857949935256L. */ private static final long serialVersionUID = -7890794857949935256L; @@ -181,7 +180,7 @@ public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeMo this.bar.setPreferredSize(d); // JOptionPane - this.close = new JButton(ForgeProps.getLocalized(Buttons.CANCEL)); + this.close = new JButton(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CANCEL)); final Object[] options = { b, this.close }; this.dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[1]); @@ -342,7 +341,7 @@ public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeMo p = new Proxy(GuiMigrateLocalMWSSetPicturesHQ.TYPES[this.type], new InetSocketAddress( this.addr.getText(), Integer.parseInt(this.port.getText()))); } catch (final Exception ex) { - ErrorViewer.showError(ex, ForgeProps.getLocalized(Errors.PROXY_CONNECT), this.addr.getText(), + ErrorViewer.showError(ex, ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Errors.PROXY_CONNECT), this.addr.getText(), this.port.getText()); // throw new // RuntimeException("Gui_DownloadPictures : error 1 - " +ex); @@ -427,7 +426,7 @@ public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeMo } } // for } - this.close.setText(ForgeProps.getLocalized(Buttons.CLOSE)); + this.close.setText(ForgeProps.getLocalized(NewConstants.Lang.GuiDownloadPictures.Buttons.CLOSE)); } // run /** diff --git a/src/main/java/forge/ImageCache.java b/src/main/java/forge/ImageCache.java index 8772f7a50a1..c30d7bef38a 100644 --- a/src/main/java/forge/ImageCache.java +++ b/src/main/java/forge/ImageCache.java @@ -41,7 +41,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class ImageCache implements NewConstants { +public class ImageCache { /** Constant imageCache. */ private static final Map IMAGE_CACHE; /** Constant FULL_SIZE. */ @@ -88,9 +88,9 @@ public class ImageCache implements NewConstants { File path; if (key.endsWith(TOKEN)) { key = key.substring(0, key.length() - TOKEN.length()); - path = ForgeProps.getFile(IMAGE_TOKEN); + path = ForgeProps.getFile(NewConstants.IMAGE_TOKEN); } else { - path = ForgeProps.getFile(IMAGE_BASE); + path = ForgeProps.getFile(NewConstants.IMAGE_BASE); } File file = null; diff --git a/src/main/java/forge/MenuItemHowToPlay.java b/src/main/java/forge/MenuItemHowToPlay.java index 88d1a16ae80..651ca7221d0 100644 --- a/src/main/java/forge/MenuItemHowToPlay.java +++ b/src/main/java/forge/MenuItemHowToPlay.java @@ -19,7 +19,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class MenuItemHowToPlay extends JMenuItem implements NewConstants.Lang.HowTo { +public class MenuItemHowToPlay extends JMenuItem { /** Constant serialVersionUID=5552000208438248428L. */ private static final long serialVersionUID = 5552000208438248428L; @@ -29,11 +29,11 @@ public class MenuItemHowToPlay extends JMenuItem implements NewConstants.Lang.Ho *

*/ public MenuItemHowToPlay() { - super(ForgeProps.getLocalized(TITLE)); + super(ForgeProps.getLocalized(NewConstants.Lang.HowTo.TITLE)); this.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent a) { - String text = ForgeProps.getLocalized(MESSAGE); + String text = ForgeProps.getLocalized(NewConstants.Lang.HowTo.MESSAGE); JTextArea area = new JTextArea(text, 25, 40); area.setWrapStyleWord(true); @@ -42,7 +42,7 @@ public class MenuItemHowToPlay extends JMenuItem implements NewConstants.Lang.Ho area.setOpaque(false); - JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(TITLE), + JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(NewConstants.Lang.HowTo.TITLE), JOptionPane.INFORMATION_MESSAGE); } }); diff --git a/src/main/java/forge/NameChanger.java b/src/main/java/forge/NameChanger.java index 94ae581ca71..037ac3f928f 100644 --- a/src/main/java/forge/NameChanger.java +++ b/src/main/java/forge/NameChanger.java @@ -26,7 +26,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class NameChanger implements NewConstants { +public class NameChanger { private Map mutatedMap = new TreeMap(); private Map originalMap = new TreeMap(); @@ -215,7 +215,7 @@ public class NameChanger implements NewConstants { @SuppressWarnings("unused") private void readFile() { try { - BufferedReader in = new BufferedReader(new FileReader(ForgeProps.getFile(NAME_MUTATOR))); + BufferedReader in = new BufferedReader(new FileReader(ForgeProps.getFile(NewConstants.NAME_MUTATOR))); String line = in.readLine(); @@ -232,7 +232,7 @@ public class NameChanger implements NewConstants { // ~ (could be cleaner...) try { - BufferedReader in = new BufferedReader(new FileReader(ForgeProps.getFile(NAME_MUTATOR))); + BufferedReader in = new BufferedReader(new FileReader(ForgeProps.getFile(NewConstants.NAME_MUTATOR))); String line; diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java index aa1aedf2068..078abe07b16 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java @@ -448,7 +448,7 @@ public final class AbilityFactoryClash { *

* * @param af - * a {@link forge.card.abilityFactory.AbilityFactory} object. + * a {@link forge.card.abilityfactory.AbilityFactory} object. * @return a {@link forge.card.spellability.SpellAbility} object. * @since 1.1.7 */ @@ -486,7 +486,7 @@ public final class AbilityFactoryClash { *

* * @param af - * a {@link forge.card.abilityFactory.AbilityFactory} object. + * a {@link forge.card.abilityfactory.AbilityFactory} object. * @return a {@link forge.card.spellability.SpellAbility} object. * @since 1.1.7 */ @@ -519,7 +519,7 @@ public final class AbilityFactoryClash { *

* * @param af - * a {@link forge.card.abilityFactory.AbilityFactory} object. + * a {@link forge.card.abilityfactory.AbilityFactory} object. * @return a {@link forge.card.spellability.SpellAbility} object. * @since 1.1.7 */ diff --git a/src/main/java/forge/card/cardfactory/AbstractCardFactory.java b/src/main/java/forge/card/cardfactory/AbstractCardFactory.java index d6cea386334..668519237a5 100644 --- a/src/main/java/forge/card/cardfactory/AbstractCardFactory.java +++ b/src/main/java/forge/card/cardfactory/AbstractCardFactory.java @@ -68,7 +68,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public abstract class AbstractCardFactory implements NewConstants, CardFactoryInterface { +public abstract class AbstractCardFactory implements CardFactoryInterface { /** * This maps card name Strings to Card instances. The Card instances have no * owner, and lack abilities. diff --git a/src/main/java/forge/error/ErrorViewer.java b/src/main/java/forge/error/ErrorViewer.java index 4d3094bd303..d84bcee026a 100644 --- a/src/main/java/forge/error/ErrorViewer.java +++ b/src/main/java/forge/error/ErrorViewer.java @@ -34,7 +34,7 @@ import forge.properties.NewConstants; * @author Clemens Koza * @version V1.0 02.08.2009 */ -public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer { +public class ErrorViewer { /** Constant NAME_OS="os.name". */ private static final String NAME_OS = "os.name"; /** Constant VERSION_OS="os.version". */ @@ -166,11 +166,11 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer // Button is not modified, String gets the automatic listener to hide // the dialog final Object[] options = { new JButton(new BugzAction(area)), new JButton(new SaveAction(area)), - ForgeProps.getLocalized(ErrorViewer.BUTTON_CLOSE), new JButton(new ExitAction()) }; + ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.BUTTON_CLOSE), new JButton(new ExitAction()) }; final JOptionPane pane = new JOptionPane(new JScrollPane(area), JOptionPane.ERROR_MESSAGE, JOptionPane.DEFAULT_OPTION, null, options, options[1]); - ErrorViewer.dlg = pane.createDialog(null, ForgeProps.getLocalized(ErrorViewer.TITLE)); + ErrorViewer.dlg = pane.createDialog(null, ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.TITLE)); ErrorViewer.dlg.setResizable(true); ErrorViewer.dlg.setVisible(true); ErrorViewer.dlg.dispose(); @@ -192,7 +192,7 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer } ex.printStackTrace(); - pw.printf(ForgeProps.getLocalized(ErrorViewer.MESSAGE), + pw.printf(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.MESSAGE), ForgeProps.getProperty(NewConstants.HOW_TO_REPORT_BUGS_URL), message != null ? message : ex.getMessage(), Singletons.getModel().getBuildInfo().toPrettyString(), System.getProperty(ErrorViewer.NAME_OS), System.getProperty(ErrorViewer.VERSION_OS), @@ -213,7 +213,7 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer private static void printError(final PrintWriter pw, final String message) { System.err.println(message); - pw.printf(ForgeProps.getLocalized(ErrorViewer.MESSAGE), + pw.printf(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.MESSAGE), ForgeProps.getProperty(NewConstants.HOW_TO_REPORT_BUGS_URL), message, Singletons.getModel() .getBuildInfo().toPrettyString(), System.getProperty(ErrorViewer.NAME_OS), System.getProperty(ErrorViewer.VERSION_OS), System.getProperty(ErrorViewer.ARCHITECTURE_OS), @@ -237,7 +237,7 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer private final JTextArea area; public SaveAction(final JTextArea areaParam) { - super(ForgeProps.getLocalized(ErrorViewer.BUTTON_SAVE)); + super(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.BUTTON_SAVE)); this.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)); this.area = areaParam; } @@ -265,7 +265,7 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer bw.write(this.area.getText()); bw.close(); } catch (final IOException ex) { - ErrorViewer.showError(ex, ForgeProps.getLocalized(ERRORS.SAVE_MESSAGE)); + ErrorViewer.showError(ex, ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.ERRORS.SAVE_MESSAGE)); } } } @@ -296,7 +296,7 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer private static final long serialVersionUID = 276202595758381626L; public ExitAction() { - super(ForgeProps.getLocalized(ErrorViewer.BUTTON_EXIT)); + super(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.BUTTON_EXIT)); } @Override @@ -310,12 +310,12 @@ public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer private static final long serialVersionUID = 5638147106706803363L; public ShowAllThreadsAction() { - super(ForgeProps.getLocalized(ErrorViewer.SHOW_ERROR)); + super(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.SHOW_ERROR)); } @Override public void actionPerformed(final ActionEvent e) { - ErrorViewer.showErrorAllThreads(ForgeProps.getLocalized(ERRORS.SHOW_MESSAGE)); + ErrorViewer.showErrorAllThreads(ForgeProps.getLocalized(NewConstants.Lang.ErrorViewer.ERRORS.SHOW_MESSAGE)); } } } diff --git a/src/main/java/forge/gui/deckeditor/DeckEditorCommonMenu.java b/src/main/java/forge/gui/deckeditor/DeckEditorCommonMenu.java index ac4261b01b9..6efddf0db23 100644 --- a/src/main/java/forge/gui/deckeditor/DeckEditorCommonMenu.java +++ b/src/main/java/forge/gui/deckeditor/DeckEditorCommonMenu.java @@ -41,7 +41,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public final class DeckEditorCommonMenu extends JMenuBar implements NewConstants { +public final class DeckEditorCommonMenu extends JMenuBar { /** Constant serialVersionUID=-4037993759604768755L. */ private static final long serialVersionUID = -4037993759604768755L; diff --git a/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java b/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java index 713357f7112..e3ed5e26ca1 100644 --- a/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java +++ b/src/main/java/forge/gui/deckeditor/DeckEditorDraft.java @@ -34,7 +34,6 @@ import forge.item.InventoryItem; import forge.item.ItemPool; import forge.item.ItemPoolView; import forge.properties.ForgeProps; -import forge.properties.NewConstants; import forge.properties.NewConstants.Lang.GuiBoosterDraft; import forge.view.swing.GuiHomeScreen; import forge.view.swing.OldGuiNewGame; @@ -47,7 +46,7 @@ import forge.view.swing.OldGuiNewGame; * @author Forge * @version $Id$ */ -public class DeckEditorDraft extends DeckEditorBase implements NewConstants, NewConstants.Lang.GuiBoosterDraft { +public class DeckEditorDraft extends DeckEditorBase { /** * Constant serialVersionUID=-6055633915602448260L. */ diff --git a/src/main/java/forge/gui/deckeditor/DeckEditorQuest.java b/src/main/java/forge/gui/deckeditor/DeckEditorQuest.java index 654fc387acd..77063df98a3 100644 --- a/src/main/java/forge/gui/deckeditor/DeckEditorQuest.java +++ b/src/main/java/forge/gui/deckeditor/DeckEditorQuest.java @@ -26,7 +26,6 @@ import forge.item.CardPrinted; import forge.item.InventoryItem; import forge.item.ItemPool; import forge.item.ItemPoolView; -import forge.properties.NewConstants; import forge.quest.data.QuestData; //import forge.quest.data.QuestBoosterPack; @@ -39,7 +38,7 @@ import forge.quest.data.QuestData; * @author Forge * @version $Id$ */ -public final class DeckEditorQuest extends DeckEditorBase implements NewConstants { +public final class DeckEditorQuest extends DeckEditorBase { /** Constant serialVersionUID=152061168634545L. */ private static final long serialVersionUID = 152061168634545L; diff --git a/src/main/java/forge/properties/NewConstants.java b/src/main/java/forge/properties/NewConstants.java index bcd1cdffe15..8c2adff163d 100644 --- a/src/main/java/forge/properties/NewConstants.java +++ b/src/main/java/forge/properties/NewConstants.java @@ -12,206 +12,206 @@ package forge.properties; * @author Clemens Koza * @version V0.0 22.08.2009 */ -public interface NewConstants { +public final class NewConstants { // General properties /** * Constant * HOW_TO_REPORT_BUGS_URL = "program/howToReportBugsURL". */ - String HOW_TO_REPORT_BUGS_URL = "program/howToReportBugsURL"; + public static final String HOW_TO_REPORT_BUGS_URL = "program/howToReportBugsURL"; /** Constant SHOW2CDECK="showdeck/2color". */ - String SHOW2CDECK = "showdeck/2color"; + public static final String SHOW2CDECK = "showdeck/2color"; /** Constant DECKS="decks". */ - String DECKS = "decks"; + public static final String DECKS = "decks"; /** Constant BOOSTER_DECKS="booster-decks". */ - String BOOSTER_DECKS = "booster-decks"; + public static final String BOOSTER_DECKS = "booster-decks"; /** Constant NEW_DECKS="decks-dir". */ - String NEW_DECKS = "decks-dir"; + public static final String NEW_DECKS = "decks-dir"; /** Constant TOKENS="tokens". */ - String TOKENS = "tokens"; + public static final String TOKENS = "tokens"; /** Constant CARD_PICTURES="card-pictures". */ - String CARD_PICTURES = "card-pictures"; + public static final String CARD_PICTURES = "card-pictures"; /** Constant CARD_PICTURES_A="card-pictures_a". */ - String CARD_PICTURES_A = "card-pictures_a"; + public static final String CARD_PICTURES_A = "card-pictures_a"; /** Constant CARD_PICTURES_B="card-pictures_b". */ - String CARD_PICTURES_B = "card-pictures_b"; + public static final String CARD_PICTURES_B = "card-pictures_b"; /** Constant CARD_PICTURES_C="card-pictures_c". */ - String CARD_PICTURES_C = "card-pictures_c"; + public static final String CARD_PICTURES_C = "card-pictures_c"; /** Constant CARD_PICTURES_D="card-pictures_d". */ - String CARD_PICTURES_D = "card-pictures_d"; + public static final String CARD_PICTURES_D = "card-pictures_d"; /** Constant CARD_PICTURES_E="card-pictures_e". */ - String CARD_PICTURES_E = "card-pictures_e"; + public static final String CARD_PICTURES_E = "card-pictures_e"; /** Constant CARD_PICTURES_F="card-pictures_f". */ - String CARD_PICTURES_F = "card-pictures_f"; + public static final String CARD_PICTURES_F = "card-pictures_f"; /** Constant CARD_PICTURES_G="card-pictures_g". */ - String CARD_PICTURES_G = "card-pictures_g"; + public static final String CARD_PICTURES_G = "card-pictures_g"; /** Constant CARD_PICTURES_H="card-pictures_h". */ - String CARD_PICTURES_H = "card-pictures_h"; + public static final String CARD_PICTURES_H = "card-pictures_h"; /** Constant CARD_PICTURES_I="card-pictures_i". */ - String CARD_PICTURES_I = "card-pictures_i"; + public static final String CARD_PICTURES_I = "card-pictures_i"; /** Constant CARD_PICTURES_J="card-pictures_j". */ - String CARD_PICTURES_J = "card-pictures_j"; + public static final String CARD_PICTURES_J = "card-pictures_j"; /** Constant CARD_PICTURES_K="card-pictures_k". */ - String CARD_PICTURES_K = "card-pictures_k"; + public static final String CARD_PICTURES_K = "card-pictures_k"; /** Constant CARD_PICTURES_L="card-pictures_l". */ - String CARD_PICTURES_L = "card-pictures_l"; + public static final String CARD_PICTURES_L = "card-pictures_l"; /** Constant CARD_PICTURES_M="card-pictures_m". */ - String CARD_PICTURES_M = "card-pictures_m"; + public static final String CARD_PICTURES_M = "card-pictures_m"; /** Constant CARD_PICTURES_N="card-pictures_n". */ - String CARD_PICTURES_N = "card-pictures_n"; + public static final String CARD_PICTURES_N = "card-pictures_n"; /** Constant CARD_PICTURES_O="card-pictures_o". */ - String CARD_PICTURES_O = "card-pictures_o"; + public static final String CARD_PICTURES_O = "card-pictures_o"; /** Constant CARD_PICTURES_P="card-pictures_p". */ - String CARD_PICTURES_P = "card-pictures_p"; + public static final String CARD_PICTURES_P = "card-pictures_p"; /** Constant CARD_PICTURES_Q="card-pictures_q". */ - String CARD_PICTURES_Q = "card-pictures_q"; + public static final String CARD_PICTURES_Q = "card-pictures_q"; /** Constant CARD_PICTURES_R="card-pictures_r". */ - String CARD_PICTURES_R = "card-pictures_r"; + public static final String CARD_PICTURES_R = "card-pictures_r"; /** Constant CARD_PICTURES_S="card-pictures_s". */ - String CARD_PICTURES_S = "card-pictures_s"; + public static final String CARD_PICTURES_S = "card-pictures_s"; /** Constant CARD_PICTURES_T="card-pictures_t". */ - String CARD_PICTURES_T = "card-pictures_t"; + public static final String CARD_PICTURES_T = "card-pictures_t"; /** Constant CARD_PICTURES_U="card-pictures_u". */ - String CARD_PICTURES_U = "card-pictures_u"; + public static final String CARD_PICTURES_U = "card-pictures_u"; /** Constant CARD_PICTURES_V="card-pictures_v". */ - String CARD_PICTURES_V = "card-pictures_v"; + public static final String CARD_PICTURES_V = "card-pictures_v"; /** Constant CARD_PICTURES_W="card-pictures_w". */ - String CARD_PICTURES_W = "card-pictures_w"; + public static final String CARD_PICTURES_W = "card-pictures_w"; /** Constant CARD_PICTURES_X="card-pictures_x". */ - String CARD_PICTURES_X = "card-pictures_x"; + public static final String CARD_PICTURES_X = "card-pictures_x"; /** Constant CARD_PICTURES_Y="card-pictures_y". */ - String CARD_PICTURES_Y = "card-pictures_y"; + public static final String CARD_PICTURES_Y = "card-pictures_y"; /** Constant CARD_PICTURES_Z="card-pictures_z". */ - String CARD_PICTURES_Z = "card-pictures_z"; + public static final String CARD_PICTURES_Z = "card-pictures_z"; /** Constant CARD_PICTURES_OTHER="card-pictures_other". */ - String CARD_PICTURES_OTHER = "card-pictures_other"; + public static final String CARD_PICTURES_OTHER = "card-pictures_other"; /** Constant CARD_PICTURES_TOKEN_HQ="card-pictures_token_hq". */ - String CARD_PICTURES_TOKEN_HQ = "card-pictures_token_hq"; + public static final String CARD_PICTURES_TOKEN_HQ = "card-pictures_token_hq"; /** Constant TOKEN_IMAGES="token-images". */ - String TOKEN_IMAGES = "token-images"; + public static final String TOKEN_IMAGES = "token-images"; /** Constant CARDS="cards". */ - String CARDS = "cards"; + public static final String CARDS = "cards"; /** Constant CARDSFOLDER="cardsfolder". */ - String CARDSFOLDER = "cardsfolder"; + public static final String CARDSFOLDER = "cardsfolder"; /** Constant REMOVED="removed-cards". */ - String REMOVED = "removed-cards"; + public static final String REMOVED = "removed-cards"; /** Constant NAME_MUTATOR="name-mutator". */ - String NAME_MUTATOR = "name-mutator"; + public static final String NAME_MUTATOR = "name-mutator"; /** Constant BOOSTERDATA="boosterdata". */ - String BOOSTERDATA = "boosterdata"; + public static final String BOOSTERDATA = "boosterdata"; /** The MT g_ data. */ - String MTG_DATA = "mtg-data"; + public static final String MTG_DATA = "mtg-data"; /** The SYMBOL s_ small. */ - String SYMBOLS_SMALL = "symbols/small"; + public static final String SYMBOLS_SMALL = "symbols/small"; /** Constant IMAGE_BASE="image/base". */ - String IMAGE_BASE = "image/base"; + public static final String IMAGE_BASE = "image/base"; /** Constant IMAGE_TOKEN="image/token". */ - String IMAGE_TOKEN = "image/token"; + public static final String IMAGE_TOKEN = "image/token"; /** Constant IMAGE_ICON="image/icon". */ - String IMAGE_ICON = "image/icon"; + public static final String IMAGE_ICON = "image/icon"; /** Constant PICS_BOOSTER="pics/booster". */ - String PICS_BOOSTER = "pics/booster"; + public static final String PICS_BOOSTER = "pics/booster"; /** Constant PICS_BOOSTER_IMAGES="pics/booster/images". */ - String PICS_BOOSTER_IMAGES = "pics/booster/images"; + public static final String PICS_BOOSTER_IMAGES = "pics/booster/images"; /** Constant SOUND_BASE="sound/base". */ - String SOUND_BASE = "sound/base"; + public static final String SOUND_BASE = "sound/base"; /** * These properties are for a regular game. */ - public interface Regular { + public static class Regular { /** Property path for a common card. */ - String COMMON = "regular/common"; + public static final String COMMON = "regular/common"; /** Property path for an uncommon card. */ - String UNCOMMON = "regular/uncommon"; + public static final String UNCOMMON = "regular/uncommon"; /** Property path for a rare card. */ - String RARE = "regular/rare"; + public static final String RARE = "regular/rare"; } /** * These properties are for a booster draft. */ - public interface Draft { + public static class Draft { /** Property path for a common card. */ - String COMMON = "draft/common"; + public static final String COMMON = "draft/common"; /** Property path for an uncommon card. */ - String UNCOMMON = "draft/uncommon"; + public static final String UNCOMMON = "draft/uncommon"; /** Property path for a rare card. */ - String RARE = "draft/rare"; + public static final String RARE = "draft/rare"; } /** * These properties are for a quest game. */ - public interface Quest { + public static class Quest { /** Property path for a common card. */ - String COMMON = "quest/common"; + public static final String COMMON = "quest/common"; /** Property path for an uncommon card. */ - String UNCOMMON = "quest/uncommon"; + public static final String UNCOMMON = "quest/uncommon"; /** Property path for a rare card. */ - String RARE = "quest/rare"; + public static final String RARE = "quest/rare"; /** The PRICE. */ - String PRICE = "quest/price"; + public static final String PRICE = "quest/price"; /** The BOOSTE r_ price. */ - String BOOSTER_PRICE = "quest/boosterprice"; + public static final String BOOSTER_PRICE = "quest/boosterprice"; /** The DATA. */ - String DATA = "quest/data"; + public static final String DATA = "quest/data"; /** The PREFS. */ - String PREFS = "quest/prefs"; + public static final String PREFS = "quest/prefs"; /** The DECKS. */ - String DECKS = "quest/decks-dir"; + public static final String DECKS = "quest/decks-dir"; /** The XMLDATA. */ - String XMLDATA = "quest/data-xml"; + public static final String XMLDATA = "quest/data-xml"; /** The OPPONEN t_ icons. */ - String OPPONENT_ICONS = "quest/opponent/icons"; + public static final String OPPONENT_ICONS = "quest/opponent/icons"; /** The OPPONEN t_ dir. */ - String OPPONENT_DIR = "image/icon"; + public static final String OPPONENT_DIR = "image/icon"; /** The PE t_ sho p_ icons. */ - String PET_SHOP_ICONS = "quest/pet/icons"; + public static final String PET_SHOP_ICONS = "quest/pet/icons"; /** The PE t_ toke n_ images. */ - String PET_TOKEN_IMAGES = "quest/pet/tokens"; + public static final String PET_TOKEN_IMAGES = "quest/pet/tokens"; } /** * These are GUI-related properties. */ - public interface Gui { + public static class Gui { /** * The Interface GuiDisplay. */ - public interface GuiDisplay { + public static class GuiDisplay { /** The LAYOUT. */ - String LAYOUT = "gui/Display"; + public static final String LAYOUT = "gui/Display"; /** The LAYOU t_ new. */ - String LAYOUT_NEW = "gui/Display/new"; + public static final String LAYOUT_NEW = "gui/Display/new"; } /** * The Interface GuiDeckEditor. */ - public interface GuiDeckEditor { + public static class GuiDeckEditor { /** The LAYOUT. */ - String LAYOUT = "gui/DeckEditor"; + public static final String LAYOUT = "gui/DeckEditor"; } } @@ -219,659 +219,659 @@ public interface NewConstants { /** * These are localization properties. */ - public interface Lang { + public static class Lang { /** The PROGRA m_ name. */ - String PROGRAM_NAME = "%s/program/name"; + public static final String PROGRAM_NAME = "%s/program/name"; /** The LANGUAGE. */ - String LANGUAGE = "lang"; + public static final String LANGUAGE = "lang"; /** * The Interface HowTo. */ - public interface HowTo { + public static class HowTo { /** The TITLE. */ - String TITLE = "%s/HowTo/title"; + public static final String TITLE = "%s/HowTo/title"; /** The MESSAGE. */ - String MESSAGE = "%s/HowTo/message"; + public static final String MESSAGE = "%s/HowTo/message"; } /** * The Interface ErrorViewer. */ - public interface ErrorViewer { + public static class ErrorViewer { /** The SHO w_ error. */ - String SHOW_ERROR = "%s/ErrorViewer/show"; + public static final String SHOW_ERROR = "%s/ErrorViewer/show"; /** The TITLE. */ - String TITLE = "%s/ErrorViewer/title"; + public static final String TITLE = "%s/ErrorViewer/title"; /** The MESSAGE. */ - String MESSAGE = "%s/ErrorViewer/message"; + public static final String MESSAGE = "%s/ErrorViewer/message"; /** The BUTTO n_ save. */ - String BUTTON_SAVE = "%s/ErrorViewer/button/save"; + public static final String BUTTON_SAVE = "%s/ErrorViewer/button/save"; /** The BUTTO n_ close. */ - String BUTTON_CLOSE = "%s/ErrorViewer/button/close"; + public static final String BUTTON_CLOSE = "%s/ErrorViewer/button/close"; /** The BUTTO n_ exit. */ - String BUTTON_EXIT = "%s/ErrorViewer/button/exit"; + public static final String BUTTON_EXIT = "%s/ErrorViewer/button/exit"; /** * The Interface ERRORS. */ - public interface ERRORS { + public static class ERRORS { /** The SAV e_ message. */ - String SAVE_MESSAGE = "%s/ErrorViewer/errors/save/message"; + public static final String SAVE_MESSAGE = "%s/ErrorViewer/errors/save/message"; /** The SHO w_ message. */ - String SHOW_MESSAGE = "%s/ErrorViewer/errors/show/message"; + public static final String SHOW_MESSAGE = "%s/ErrorViewer/errors/show/message"; } } /** * The Interface Gui_BoosterDraft. */ - public interface GuiBoosterDraft { + public static class GuiBoosterDraft { /** The CLOS e_ message. */ - String CLOSE_MESSAGE = "%s/BoosterDraft/close/message"; + public static final String CLOSE_MESSAGE = "%s/BoosterDraft/close/message"; /** The SAV e_ message. */ - String SAVE_MESSAGE = "%s/BoosterDraft/save/message"; + public static final String SAVE_MESSAGE = "%s/BoosterDraft/save/message"; /** The SAV e_ title. */ - String SAVE_TITLE = "%s/BoosterDraft/save/title"; + public static final String SAVE_TITLE = "%s/BoosterDraft/save/title"; /** The RENAM e_ message. */ - String RENAME_MESSAGE = "%s/BoosterDraft/rename/message"; + public static final String RENAME_MESSAGE = "%s/BoosterDraft/rename/message"; /** The RENAM e_ title. */ - String RENAME_TITLE = "%s/BoosterDraft/rename/title"; + public static final String RENAME_TITLE = "%s/BoosterDraft/rename/title"; /** The SAV e_ draf t_ message. */ - String SAVE_DRAFT_MESSAGE = "%s/BoosterDraft/saveDraft/message"; + public static final String SAVE_DRAFT_MESSAGE = "%s/BoosterDraft/saveDraft/message"; /** The SAV e_ draf t_ title. */ - String SAVE_DRAFT_TITLE = "%s/BoosterDraft/saveDraft/title"; + public static final String SAVE_DRAFT_TITLE = "%s/BoosterDraft/saveDraft/title"; } /** * The Interface GuiDisplay. */ - public interface GuiDisplay { + public static class GuiDisplay { /** * The Interface MENU_BAR. */ - public interface MenuBar { + public static class MenuBar { /** * The Interface MENU. */ - public interface Menu { + public static class Menu { /** The TITLE. */ - String TITLE = "%s/Display/menu/title"; + public static final String TITLE = "%s/Display/menu/title"; } /** * The Interface PHASE. */ - public interface PHASE { + public static class PHASE { /** The TITLE. */ - String TITLE = "%s/Display/phase/title"; + public static final String TITLE = "%s/Display/phase/title"; } /** * The Interface DEV. */ - public interface DEV { + public static class DEV { /** The TITLE. */ - String TITLE = "%s/Display/dev/title"; + public static final String TITLE = "%s/Display/dev/title"; } } /** The HUMA n_ title. */ - String HUMAN_TITLE = "%s/Display/human/title"; + public static final String HUMAN_TITLE = "%s/Display/human/title"; /** The HUMA n_ decklist. */ - String HUMAN_DECKLIST = "%s/Display/human/decklist"; + public static final String HUMAN_DECKLIST = "%s/Display/human/decklist"; /** * The Interface HUMAN_HAND. */ - public interface HumanHand { + public static class HumanHand { /** The TITLE. */ - String TITLE = "%s/Display/human/hand/title"; + public static final String TITLE = "%s/Display/human/hand/title"; } /** * The Interface HUMAN_LIBRARY. */ - public interface HumanLibrary { + public static class HumanLibrary { /** The BASE. */ - String BASE = "%s/Display/human/library"; + public static final String BASE = "%s/Display/human/library"; /** The TITLE. */ - String TITLE = "%s/Display/human/library/title"; + public static final String TITLE = "%s/Display/human/library/title"; /** The MENU. */ - String MENU = "%s/Display/human/library/menu"; + public static final String MENU = "%s/Display/human/library/menu"; /** The BUTTON. */ - String BUTTON = "%s/Display/human/library/button"; + public static final String BUTTON = "%s/Display/human/library/button"; } /** The HUMA n_ graveyard. */ - String HUMAN_GRAVEYARD = "%s/Display/human/graveyard"; + public static final String HUMAN_GRAVEYARD = "%s/Display/human/graveyard"; /** * The Interface HUMAN_GRAVEYARD. */ - public interface HumanGraveyard { + public static class HumanGraveyard { /** The TITLE. */ - String TITLE = "%s/Display/human/graveyard/title"; + public static final String TITLE = "%s/Display/human/graveyard/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/human/graveyard/button"; + public static final String BUTTON = "%s/Display/human/graveyard/button"; /** The MENU. */ - String MENU = "%s/Display/human/graveyard/menu"; + public static final String MENU = "%s/Display/human/graveyard/menu"; } /** The HUMA n_ removed. */ - String HUMAN_REMOVED = "%s/Display/human/removed"; + public static final String HUMAN_REMOVED = "%s/Display/human/removed"; /** * The Interface HUMAN_REMOVED. */ - public interface HumanRemoved { + public static class HumanRemoved { /** The TITLE. */ - String TITLE = "%s/Display/human/removed/title"; + public static final String TITLE = "%s/Display/human/removed/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/human/removed/button"; + public static final String BUTTON = "%s/Display/human/removed/button"; /** The MENU. */ - String MENU = "%s/Display/human/removed/menu"; + public static final String MENU = "%s/Display/human/removed/menu"; } /** The COMBAT. */ - String COMBAT = "%s/Display/combat/title"; + public static final String COMBAT = "%s/Display/combat/title"; /** The HUMA n_ flashback. */ - String HUMAN_FLASHBACK = "%s/Display/human/flashback"; + public static final String HUMAN_FLASHBACK = "%s/Display/human/flashback"; /** * The Interface HUMAN_FLASHBACK. */ - public interface HumanFlashback { + public static class HumanFlashback { /** The TITLE. */ - String TITLE = "%s/Display/human/flashback/title"; + public static final String TITLE = "%s/Display/human/flashback/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/human/flashback/button"; + public static final String BUTTON = "%s/Display/human/flashback/button"; /** The MENU. */ - String MENU = "%s/Display/human/flashback/menu"; + public static final String MENU = "%s/Display/human/flashback/menu"; } /** The COMPUTE r_ title. */ - String COMPUTER_TITLE = "%s/Display/computer/title"; + public static final String COMPUTER_TITLE = "%s/Display/computer/title"; /** * The Interface COMPUTER_HAND. */ - public interface ComputerHand { + public static class ComputerHand { /** The BASE. */ - String BASE = "%s/Display/computer/hand"; + public static final String BASE = "%s/Display/computer/hand"; /** The TITLE. */ - String TITLE = "%s/Display/computer/hand/title"; + public static final String TITLE = "%s/Display/computer/hand/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/computer/hand/button"; + public static final String BUTTON = "%s/Display/computer/hand/button"; /** The MENU. */ - String MENU = "%s/Display/computer/hand/menu"; + public static final String MENU = "%s/Display/computer/hand/menu"; } /** * The Interface COMPUTER_LIBRARY. */ - public interface ComputerLibrary { + public static class ComputerLibrary { /** The BASE. */ - String BASE = "%s/Display/computer/library"; + public static final String BASE = "%s/Display/computer/library"; /** The TITLE. */ - String TITLE = "%s/Display/computer/library/title"; + public static final String TITLE = "%s/Display/computer/library/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/computer/library/button"; + public static final String BUTTON = "%s/Display/computer/library/button"; /** The MENU. */ - String MENU = "%s/Display/computer/library/menu"; + public static final String MENU = "%s/Display/computer/library/menu"; } /** The COMPUTE r_ graveyard. */ - String COMPUTER_GRAVEYARD = "%s/Display/computer/graveyard"; + public static final String COMPUTER_GRAVEYARD = "%s/Display/computer/graveyard"; /** * The Interface COMPUTER_GRAVEYARD. */ - public interface ComputerGraveyard { + public static class ComputerGraveyard { /** The TITLE. */ - String TITLE = "%s/Display/computer/graveyard/title"; + public static final String TITLE = "%s/Display/computer/graveyard/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/computer/graveyard/button"; + public static final String BUTTON = "%s/Display/computer/graveyard/button"; /** The MENU. */ - String MENU = "%s/Display/computer/graveyard/menu"; + public static final String MENU = "%s/Display/computer/graveyard/menu"; } /** The COMPUTE r_ removed. */ - String COMPUTER_REMOVED = "%s/Display/computer/removed"; + public static final String COMPUTER_REMOVED = "%s/Display/computer/removed"; /** * The Interface COMPUTER_REMOVED. */ - public interface ComputerRemoved { + public static class ComputerRemoved { /** The TITLE. */ - String TITLE = "%s/Display/computer/removed/title"; + public static final String TITLE = "%s/Display/computer/removed/title"; /** The BUTTON. */ - String BUTTON = "%s/Display/computer/removed/button"; + public static final String BUTTON = "%s/Display/computer/removed/button"; /** The MENU. */ - String MENU = "%s/Display/computer/removed/menu"; + public static final String MENU = "%s/Display/computer/removed/menu"; } /** The CONCEDE. */ - String CONCEDE = "%s/Display/concede"; + public static final String CONCEDE = "%s/Display/concede"; /** * The Interface CONCEDE. */ - public interface Concede { + public static class Concede { /** The BUTTON. */ - String BUTTON = "%s/Display/concede/button"; + public static final String BUTTON = "%s/Display/concede/button"; /** The MENU. */ - String MENU = "%s/Display/concede/menu"; + public static final String MENU = "%s/Display/concede/menu"; } /** The MANAGEN. */ - String MANAGEN = "%s/Display/managen"; + public static final String MANAGEN = "%s/Display/managen"; /** * The Interface MANAGEN. */ - public interface Managen { + public static class Managen { /** The BUTTON. */ - String BUTTON = "%s/Display/managen/button"; + public static final String BUTTON = "%s/Display/managen/button"; /** The MENU. */ - String MENU = "%s/Display/managen/menu"; + public static final String MENU = "%s/Display/managen/menu"; } /** The SETUPBATTLEFIELD. */ - String SETUPBATTLEFIELD = "%s/Display/setupbattlefield"; + public static final String SETUPBATTLEFIELD = "%s/Display/setupbattlefield"; /** * The Interface SETUPBATTLEFIELD. */ - public interface SetupBattlefield { + public static class SetupBattlefield { /** The BUTTON. */ - String BUTTON = "%s/Display/setupbattlefield/button"; + public static final String BUTTON = "%s/Display/setupbattlefield/button"; /** The MENU. */ - String MENU = "%s/Display/setupbattlefield/menu"; + public static final String MENU = "%s/Display/setupbattlefield/menu"; } /** The TUTOR. */ - String TUTOR = "%s/Display/tutor"; + public static final String TUTOR = "%s/Display/tutor"; /** * The Interface TUTOR. */ - public interface Tutor { + public static class Tutor { /** The BUTTON. */ - String BUTTON = "%s/Display/tutor/button"; + public static final String BUTTON = "%s/Display/tutor/button"; /** The MENU. */ - String MENU = "%s/Display/tutor/menu"; + public static final String MENU = "%s/Display/tutor/menu"; } /** The ADDCOUNTER. */ - String ADDCOUNTER = "%s/Display/addcounter"; + public static final String ADDCOUNTER = "%s/Display/addcounter"; /** * The Interface ADDCOUNTER. */ - public interface AddCounter { + public static class AddCounter { /** The BUTTON. */ - String BUTTON = "%s/Display/addcounter/button"; + public static final String BUTTON = "%s/Display/addcounter/button"; /** The MENU. */ - String MENU = "%s/Display/addcounter/menu"; + public static final String MENU = "%s/Display/addcounter/menu"; } /** The TAPPERM. */ - String TAPPERM = "%s/Display/tapperm"; + public static final String TAPPERM = "%s/Display/tapperm"; /** * The Interface TAPPERM. */ - public interface Tapperm { + public static class Tapperm { /** The BUTTON. */ - String BUTTON = "%s/Display/tapperm/button"; + public static final String BUTTON = "%s/Display/tapperm/button"; /** The MENU. */ - String MENU = "%s/Display/tapperm/menu"; + public static final String MENU = "%s/Display/tapperm/menu"; } /** The UNTAPPERM. */ - String UNTAPPERM = "%s/Display/untapperm"; + public static final String UNTAPPERM = "%s/Display/untapperm"; /** * The Interface UNTAPPERM. */ - public interface Untapperm { + public static class Untapperm { /** The BUTTON. */ - String BUTTON = "%s/Display/untapperm/button"; + public static final String BUTTON = "%s/Display/untapperm/button"; /** The MENU. */ - String MENU = "%s/Display/untapperm/menu"; + public static final String MENU = "%s/Display/untapperm/menu"; } /** The NOLANDLIMIT. */ - String NOLANDLIMIT = "%s/Display/nolandlimit"; + public static final String NOLANDLIMIT = "%s/Display/nolandlimit"; /** * The Interface NOLANDLIMIT. */ - public interface NoLandLimit { + public static class NoLandLimit { /** The BUTTON. */ - String BUTTON = "%s/Display/nolandlimit/button"; + public static final String BUTTON = "%s/Display/nolandlimit/button"; /** The MENU. */ - String MENU = "%s/Display/nolandlimit/menu"; + public static final String MENU = "%s/Display/nolandlimit/menu"; } /** The SETLIFE. */ - String SETLIFE = "%s/Display/setlife"; + public static final String SETLIFE = "%s/Display/setlife"; /** * The Interface SETLIFE. */ - public interface SetLife { + public static class SetLife { /** The BUTTON. */ - String BUTTON = "%s/Display/setlife/button"; + public static final String BUTTON = "%s/Display/setlife/button"; /** The MENU. */ - String MENU = "%s/Display/setlife/menu"; + public static final String MENU = "%s/Display/setlife/menu"; } /** * The Interface TRIGGER. */ - public interface Trigger { + public static class Trigger { /** The ALWAYSACCEPT. */ - String ALWAYSACCEPT = "%s/Display/alwaysaccept"; + public static final String ALWAYSACCEPT = "%s/Display/alwaysaccept"; /** The ALWAYSDECLINE. */ - String ALWAYSDECLINE = "%s/Display/alwaysdecline"; + public static final String ALWAYSDECLINE = "%s/Display/alwaysdecline"; /** The ALWAYSASK. */ - String ALWAYSASK = "%s/Display/alwaysask"; + public static final String ALWAYSASK = "%s/Display/alwaysask"; } } /** * The Interface Gui_DownloadPictures. */ - public interface GuiDownloadPictures { + public static class GuiDownloadPictures { /** The TITLE. */ - String TITLE = "%s/DownloadPictures/title"; + public static final String TITLE = "%s/DownloadPictures/title"; /** The PROX y_ address. */ - String PROXY_ADDRESS = "%s/DownloadPictures/proxy/address"; + public static final String PROXY_ADDRESS = "%s/DownloadPictures/proxy/address"; /** The PROX y_ port. */ - String PROXY_PORT = "%s/DownloadPictures/proxy/port"; + public static final String PROXY_PORT = "%s/DownloadPictures/proxy/port"; /** The N o_ proxy. */ - String NO_PROXY = "%s/DownloadPictures/proxy/type/none"; + public static final String NO_PROXY = "%s/DownloadPictures/proxy/type/none"; /** The HTT p_ proxy. */ - String HTTP_PROXY = "%s/DownloadPictures/proxy/type/http"; + public static final String HTTP_PROXY = "%s/DownloadPictures/proxy/type/http"; /** The SOCK s_ proxy. */ - String SOCKS_PROXY = "%s/DownloadPictures/proxy/type/socks"; + public static final String SOCKS_PROXY = "%s/DownloadPictures/proxy/type/socks"; /** The N o_ more. */ - String NO_MORE = "%s/DownloadPictures/no-more"; + public static final String NO_MORE = "%s/DownloadPictures/no-more"; /** The BA r_ befor e_ start. */ - String BAR_BEFORE_START = "%s/DownloadPictures/bar/before-start"; + public static final String BAR_BEFORE_START = "%s/DownloadPictures/bar/before-start"; /** The BA r_ wait. */ - String BAR_WAIT = "%s/DownloadPictures/bar/wait"; + public static final String BAR_WAIT = "%s/DownloadPictures/bar/wait"; /** The BA r_ close. */ - String BAR_CLOSE = "%s/DownloadPictures/bar/close"; + public static final String BAR_CLOSE = "%s/DownloadPictures/bar/close"; /** * The Interface BUTTONS. */ - public interface Buttons { + public static class Buttons { /** The START. */ - String START = "%s/DownloadPictures/button/start"; + public static final String START = "%s/DownloadPictures/button/start"; /** The CANCEL. */ - String CANCEL = "%s/DownloadPictures/button/cancel"; + public static final String CANCEL = "%s/DownloadPictures/button/cancel"; /** The CLOSE. */ - String CLOSE = "%s/DownloadPictures/button/close"; + public static final String CLOSE = "%s/DownloadPictures/button/close"; } /** * The Interface ERRORS. */ - public interface Errors { + public static class Errors { /** The PROX y_ connect. */ - String PROXY_CONNECT = "%s/DownloadPictures/errors/proxy/connect"; + public static final String PROXY_CONNECT = "%s/DownloadPictures/errors/proxy/connect"; /** The OTHER. */ - String OTHER = "%s/DownloadPictures/errors/other"; + public static final String OTHER = "%s/DownloadPictures/errors/other"; } } /** * The Interface OldGuiNewGame. */ - public interface OldGuiNewGame { + public static class OldGuiNewGame { /** * The Interface NEW_GAME_TEXT. */ - public interface NewGameText { + public static class NewGameText { /** The GAMETYPE. */ - String GAMETYPE = "%s/NewGame/gametype"; + public static final String GAMETYPE = "%s/NewGame/gametype"; /** The LIBRARY. */ - String LIBRARY = "%s/NewGame/library"; + public static final String LIBRARY = "%s/NewGame/library"; /** The SETTINGS. */ - String SETTINGS = "%s/NewGame/settings"; + public static final String SETTINGS = "%s/NewGame/settings"; /** The NE w_ game. */ - String NEW_GAME = "%s/NewGame/new_game"; + public static final String NEW_GAME = "%s/NewGame/new_game"; /** The CONSTRUCTE d_ text. */ - String CONSTRUCTED_TEXT = "%s/NewGame/constructed_text"; + public static final String CONSTRUCTED_TEXT = "%s/NewGame/constructed_text"; /** The SEALE d_ text. */ - String SEALED_TEXT = "%s/NewGame/sealed_text"; + public static final String SEALED_TEXT = "%s/NewGame/sealed_text"; /** The BOOSTE r_ text. */ - String BOOSTER_TEXT = "%s/NewGame/booster_text"; + public static final String BOOSTER_TEXT = "%s/NewGame/booster_text"; /** The YOURDECK. */ - String YOURDECK = "%s/NewGame/yourdeck"; + public static final String YOURDECK = "%s/NewGame/yourdeck"; /** The OPPONENT. */ - String OPPONENT = "%s/NewGame/opponent"; + public static final String OPPONENT = "%s/NewGame/opponent"; /** The DEC k_ editor. */ - String DECK_EDITOR = "%s/NewGame/deckeditor"; + public static final String DECK_EDITOR = "%s/NewGame/deckeditor"; /** The NE w_ gui. */ - String NEW_GUI = "%s/NewGame/newgui"; + public static final String NEW_GUI = "%s/NewGame/newgui"; /** The A i_ land. */ - String AI_LAND = "%s/NewGame/ailand"; + public static final String AI_LAND = "%s/NewGame/ailand"; /** The DE v_ mode. */ - String DEV_MODE = "%s/NewGame/devmode"; + public static final String DEV_MODE = "%s/NewGame/devmode"; /** The QUES t_ mode. */ - String QUEST_MODE = "%s/NewGame/questmode"; + public static final String QUEST_MODE = "%s/NewGame/questmode"; /** The STAR t_ game. */ - String START_GAME = "%s/NewGame/startgame"; + public static final String START_GAME = "%s/NewGame/startgame"; /** The SAV e_ seale d_ msg. */ - String SAVE_SEALED_MSG = "%s/NewGame/savesealed_msg"; + public static final String SAVE_SEALED_MSG = "%s/NewGame/savesealed_msg"; /** The SAV e_ seale d_ ttl. */ - String SAVE_SEALED_TTL = "%s/NewGame/savesealed_ttl"; + public static final String SAVE_SEALED_TTL = "%s/NewGame/savesealed_ttl"; } /** * The Interface MENU_BAR. */ - public interface MenuBar { + public static class MenuBar { /** * The Interface MENU. */ - public interface Menu { + public static class Menu { /** The TITLE. */ - String TITLE = "%s/NewGame/menu/title"; + public static final String TITLE = "%s/NewGame/menu/title"; /** The LF. */ - String LF = "%s/NewGame/menu/lookAndFeel"; + public static final String LF = "%s/NewGame/menu/lookAndFeel"; /** The DOWNLOADPRICE. */ - String DOWNLOADPRICE = "%s/NewGame/menu/downloadPrice"; + public static final String DOWNLOADPRICE = "%s/NewGame/menu/downloadPrice"; /** The DOWNLOAD. */ - String DOWNLOAD = "%s/NewGame/menu/download"; + public static final String DOWNLOAD = "%s/NewGame/menu/download"; /** The DOWNLOADLQ. */ - String DOWNLOADLQ = "%s/NewGame/menu/downloadlq"; + public static final String DOWNLOADLQ = "%s/NewGame/menu/downloadlq"; /** The DOWNLOADSETLQ. */ - String DOWNLOADSETLQ = "%s/NewGame/menu/downloadsetlq"; + public static final String DOWNLOADSETLQ = "%s/NewGame/menu/downloadsetlq"; /** The DOWNLOADQUESTIMG. */ - String DOWNLOADQUESTIMG = "%s/NewGame/menu/downloadquest"; + public static final String DOWNLOADQUESTIMG = "%s/NewGame/menu/downloadquest"; /** The IMPORTPICTURE. */ - String IMPORTPICTURE = "%s/NewGame/menu/importPicture"; + public static final String IMPORTPICTURE = "%s/NewGame/menu/importPicture"; /** The CAR d_ sizes. */ - String CARD_SIZES = "%s/NewGame/menu/cardSizes"; + public static final String CARD_SIZES = "%s/NewGame/menu/cardSizes"; /** The CAR d_ stack. */ - String CARD_STACK = "%s/NewGame/menu/cardStack"; + public static final String CARD_STACK = "%s/NewGame/menu/cardStack"; /** The CAR d_ stac k_ offset. */ - String CARD_STACK_OFFSET = "%s/NewGame/menu/cardStackOffset"; + public static final String CARD_STACK_OFFSET = "%s/NewGame/menu/cardStackOffset"; /** The ABOUT. */ - String ABOUT = "%s/NewGame/menu/about"; + public static final String ABOUT = "%s/NewGame/menu/about"; /** The EXIT. */ - String EXIT = "%s/NewGame/menu/exit"; + public static final String EXIT = "%s/NewGame/menu/exit"; } /** * The Interface OPTIONS. */ - public interface Options { + public static class Options { /** The TITLE. */ - String TITLE = "%s/NewGame/options/title"; + public static final String TITLE = "%s/NewGame/options/title"; /** The FONT. */ - String FONT = "%s/NewGame/options/font"; + public static final String FONT = "%s/NewGame/options/font"; /** The CAR d_ overlay. */ - String CARD_OVERLAY = "%s/NewGame/options/cardOverlay"; + public static final String CARD_OVERLAY = "%s/NewGame/options/cardOverlay"; /** The CAR d_ scale. */ - String CARD_SCALE = "%s/NewGame/options/cardScale"; + public static final String CARD_SCALE = "%s/NewGame/options/cardScale"; /** * The Interface GENERATE. */ - public interface Generate { + public static class Generate { /** The TITLE. */ - String TITLE = "%s/NewGame/options/generate/title"; + public static final String TITLE = "%s/NewGame/options/generate/title"; /** The REMOV e_ small. */ - String REMOVE_SMALL = "%s/NewGame/options/generate/removeSmall"; + public static final String REMOVE_SMALL = "%s/NewGame/options/generate/removeSmall"; /** The REMOV e_ artifacts. */ - String REMOVE_ARTIFACTS = "%s/NewGame/options/generate/removeArtifacts"; + public static final String REMOVE_ARTIFACTS = "%s/NewGame/options/generate/removeArtifacts"; } } /** * The Interface HELP. */ - public interface Help { + public static class Help { /** The TITLE. */ - String TITLE = "%s/NewGame/help/title"; + public static final String TITLE = "%s/NewGame/help/title"; } } @@ -879,40 +879,40 @@ public interface NewConstants { /** * The Interface ERRORS. */ - public interface Errors { + public static class Errors { } } /** * The Interface WinLoseFrame. */ - public interface WinLoseFrame { + public static class WinLoseFrame { /** * The Interface WINLOSETEXT. */ - public interface WinLoseText { + public static class WinLoseText { /** The WON. */ - String WON = "%s/WinLose/won"; + public static final String WON = "%s/WinLose/won"; /** The LOST. */ - String LOST = "%s/WinLose/lost"; + public static final String LOST = "%s/WinLose/lost"; /** The WIN. */ - String WIN = "%s/WinLose/win"; + public static final String WIN = "%s/WinLose/win"; /** The LOSE. */ - String LOSE = "%s/WinLose/lose"; + public static final String LOSE = "%s/WinLose/lose"; /** The CONTINUE. */ - String CONTINUE = "%s/WinLose/continue"; + public static final String CONTINUE = "%s/WinLose/continue"; /** The RESTART. */ - String RESTART = "%s/WinLose/restart"; + public static final String RESTART = "%s/WinLose/restart"; /** The QUIT. */ - String QUIT = "%s/WinLose/quit"; + public static final String QUIT = "%s/WinLose/quit"; } } @@ -922,132 +922,132 @@ public interface NewConstants { /** * The Interface Gui_WinLose. */ - public interface GuiWinLose { + public static class GuiWinLose { /** * The Interface WINLOSE_TEXT. */ - public interface WinLoseText { + public static class WinLoseText { /** The WON. */ - String WON = "%s/WinLose/won"; + public static final String WON = "%s/WinLose/won"; /** The LOST. */ - String LOST = "%s/WinLose/lost"; + public static final String LOST = "%s/WinLose/lost"; /** The WIN. */ - String WIN = "%s/WinLose/win"; + public static final String WIN = "%s/WinLose/win"; /** The LOSE. */ - String LOSE = "%s/WinLose/lose"; + public static final String LOSE = "%s/WinLose/lose"; /** The CONTINUE. */ - String CONTINUE = "%s/WinLose/continue"; + public static final String CONTINUE = "%s/WinLose/continue"; /** The RESTART. */ - String RESTART = "%s/WinLose/restart"; + public static final String RESTART = "%s/WinLose/restart"; /** The QUIT. */ - String QUIT = "%s/WinLose/quit"; + public static final String QUIT = "%s/WinLose/quit"; } } /** * The Interface Gui_DownloadPrices. */ - public interface GuiDownloadPrices { + public static class GuiDownloadPrices { /** * The Interface DOWNLOADPRICES. */ - public interface DownloadPrices { + public static class DownloadPrices { /** The TITLE. */ - String TITLE = "%s/DownloadPrices/title"; + public static final String TITLE = "%s/DownloadPrices/title"; /** The STAR t_ update. */ - String START_UPDATE = "%s/DownloadPrices/startupdate"; + public static final String START_UPDATE = "%s/DownloadPrices/startupdate"; /** The DOWNLOADING. */ - String DOWNLOADING = "%s/DownloadPrices/downloading"; + public static final String DOWNLOADING = "%s/DownloadPrices/downloading"; /** The COMPILING. */ - String COMPILING = "%s/DownloadPrices/compiling"; + public static final String COMPILING = "%s/DownloadPrices/compiling"; } } /** * The Interface GameAction. */ - public interface GameAction { + public static class GameAction { /** * The Interface GAMEACTION_TEXT. */ - public interface GameActionText { + public static class GameActionText { /** The HEADS. */ - String HEADS = "%s/GameAction/heads"; + public static final String HEADS = "%s/GameAction/heads"; /** The TAILS. */ - String TAILS = "%s/GameAction/tails"; + public static final String TAILS = "%s/GameAction/tails"; /** The HEAD s_ o r_ tails. */ - String HEADS_OR_TAILS = "%s/GameAction/heads_or_tails"; + public static final String HEADS_OR_TAILS = "%s/GameAction/heads_or_tails"; /** The COI n_ toss. */ - String COIN_TOSS = "%s/GameAction/coin_toss"; + public static final String COIN_TOSS = "%s/GameAction/coin_toss"; /** The HUMA n_ win. */ - String HUMAN_WIN = "%s/GameAction/human_win"; + public static final String HUMAN_WIN = "%s/GameAction/human_win"; /** The COMPUTE r_ win. */ - String COMPUTER_WIN = "%s/GameAction/computer_win"; + public static final String COMPUTER_WIN = "%s/GameAction/computer_win"; /** The COMPUTE r_ starts. */ - String COMPUTER_STARTS = "%s/GameAction/computer_starts"; + public static final String COMPUTER_STARTS = "%s/GameAction/computer_starts"; /** The HUMA n_ starts. */ - String HUMAN_STARTS = "%s/GameAction/human_starts"; + public static final String HUMAN_STARTS = "%s/GameAction/human_starts"; /** The HUMA n_ man a_ cost. */ - String HUMAN_MANA_COST = "%s/GameAction/human_mana_cost"; + public static final String HUMAN_MANA_COST = "%s/GameAction/human_mana_cost"; /** The COMPUTE r_ man a_ cost. */ - String COMPUTER_MANA_COST = "%s/GameAction/computer_mana_cost"; + public static final String COMPUTER_MANA_COST = "%s/GameAction/computer_mana_cost"; /** The COMPUTE r_ cut. */ - String COMPUTER_CUT = "%s/GameAction/computer_cut"; + public static final String COMPUTER_CUT = "%s/GameAction/computer_cut"; /** The HUMA n_ cut. */ - String HUMAN_CUT = "%s/GameAction/human_cut"; + public static final String HUMAN_CUT = "%s/GameAction/human_cut"; /** The CU t_ number. */ - String CUT_NUMBER = "%s/GameAction/cut_number"; + public static final String CUT_NUMBER = "%s/GameAction/cut_number"; /** The RESOLV e_ starter. */ - String RESOLVE_STARTER = "%s/GameAction/resolve_starter"; + public static final String RESOLVE_STARTER = "%s/GameAction/resolve_starter"; /** The EQUA l_ converte d_ mana. */ - String EQUAL_CONVERTED_MANA = "%s/GameAction/equal_converted_mana"; + public static final String EQUAL_CONVERTED_MANA = "%s/GameAction/equal_converted_mana"; /** The CUTTIN g_ again. */ - String CUTTING_AGAIN = "%s/GameAction/cutting_again"; + public static final String CUTTING_AGAIN = "%s/GameAction/cutting_again"; /** The YES. */ - String YES = "%s/GameAction/yes"; + public static final String YES = "%s/GameAction/yes"; /** The NO. */ - String NO = "%s/GameAction/no"; + public static final String NO = "%s/GameAction/no"; /** The WAN t_ dredge. */ - String WANT_DREDGE = "%s/GameAction/want_dredge"; + public static final String WANT_DREDGE = "%s/GameAction/want_dredge"; /** The SELEC t_ dredge. */ - String SELECT_DREDGE = "%s/GameAction/select_dredge"; + public static final String SELECT_DREDGE = "%s/GameAction/select_dredge"; /** The CHOOS e_2 n d_ land. */ - String CHOOSE_2ND_LAND = "%s/GameAction/choose_2nd_land"; + public static final String CHOOSE_2ND_LAND = "%s/GameAction/choose_2nd_land"; } } diff --git a/src/main/java/forge/quest/data/ReadPriceList.java b/src/main/java/forge/quest/data/ReadPriceList.java index 8a1f73fe761..77f638204f6 100644 --- a/src/main/java/forge/quest/data/ReadPriceList.java +++ b/src/main/java/forge/quest/data/ReadPriceList.java @@ -22,7 +22,7 @@ import forge.properties.NewConstants; * @author Forge * @version $Id$ */ -public class ReadPriceList implements NewConstants { +public class ReadPriceList { /** Constant comment="//". */ private static final String COMMENT = "//"; @@ -44,8 +44,8 @@ public class ReadPriceList implements NewConstants { *

*/ private void setup() { - this.priceMap = this.readFile(ForgeProps.getFile(Quest.PRICE)); - this.priceMap.putAll(this.readFile(ForgeProps.getFile(Quest.BOOSTER_PRICE))); + this.priceMap = this.readFile(ForgeProps.getFile(NewConstants.Quest.PRICE)); + this.priceMap.putAll(this.readFile(ForgeProps.getFile(NewConstants.Quest.BOOSTER_PRICE))); } // setup() diff --git a/src/main/java/forge/quest/gui/bazaar/QuestBazaarStall.java b/src/main/java/forge/quest/gui/bazaar/QuestBazaarStall.java index f0bb9d9a2ef..b3a59d0005c 100644 --- a/src/main/java/forge/quest/gui/bazaar/QuestBazaarStall.java +++ b/src/main/java/forge/quest/gui/bazaar/QuestBazaarStall.java @@ -19,7 +19,6 @@ import javax.swing.border.EmptyBorder; import forge.AllZone; import forge.gui.GuiUtils; -import forge.properties.NewConstants; import forge.quest.data.QuestData; import forge.quest.data.bazaar.QuestStallDefinition; import forge.quest.data.bazaar.QuestStallManager; @@ -33,7 +32,7 @@ import forge.quest.data.bazaar.QuestStallPurchasable; * @author Forge * @version $Id$ */ -public class QuestBazaarStall extends JPanel implements NewConstants { +public class QuestBazaarStall extends JPanel { /** Constant serialVersionUID=-4147745071116906043L. */ private static final long serialVersionUID = -4147745071116906043L; diff --git a/src/main/java/forge/view/swing/OldGuiNewGame.java b/src/main/java/forge/view/swing/OldGuiNewGame.java index 34deab14640..a5de3f0a90f 100644 --- a/src/main/java/forge/view/swing/OldGuiNewGame.java +++ b/src/main/java/forge/view/swing/OldGuiNewGame.java @@ -93,7 +93,7 @@ import forge.quest.gui.QuestOptions; * @author Forge * @version $Id$ */ -public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.Lang.OldGuiNewGame { +public class OldGuiNewGame extends JFrame { /** Constant serialVersionUID=-2437047615019135648L. */ private static final long serialVersionUID = -2437047615019135648L; @@ -141,19 +141,19 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. // use these two variables /** Constant removeSmallCreatures. */ private static JCheckBoxMenuItem removeSmallCreatures = new JCheckBoxMenuItem( - ForgeProps.getLocalized(MenuBar.Options.Generate.REMOVE_SMALL)); + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.Generate.REMOVE_SMALL)); /** Constant removeArtifacts. */ private static JCheckBoxMenuItem removeArtifacts = new JCheckBoxMenuItem( - ForgeProps.getLocalized(MenuBar.Options.Generate.REMOVE_ARTIFACTS)); + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.Generate.REMOVE_ARTIFACTS)); /** Constant useLAFFonts. */ - private static JCheckBoxMenuItem useLAFFonts = new JCheckBoxMenuItem(ForgeProps.getLocalized(MenuBar.Options.FONT)); + private static JCheckBoxMenuItem useLAFFonts = new JCheckBoxMenuItem(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.FONT)); /** Constant cardOverlay. */ private static JCheckBoxMenuItem cardOverlay = new JCheckBoxMenuItem( - ForgeProps.getLocalized(MenuBar.Options.CARD_OVERLAY)); + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.CARD_OVERLAY)); /** Constant cardScale. */ private static JCheckBoxMenuItem cardScale = new JCheckBoxMenuItem( - ForgeProps.getLocalized(MenuBar.Options.CARD_SCALE)); + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.CARD_SCALE)); private final JButton questButton = new JButton(); private final Action lookAndFeelAction = new LookAndFeelAction(this); @@ -220,7 +220,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. this.setSize(550, 565); GuiUtils.centerFrame(this); - this.setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME)); + this.setTitle(ForgeProps.getLocalized(NewConstants.Lang.PROGRAM_NAME)); this.setupMenu(); this.setVisible(true); @@ -258,7 +258,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. // useLAFFonts.setSelected(false); // new stuff - final JMenu generatedDeck = new JMenu(ForgeProps.getLocalized(MenuBar.Options.Generate.TITLE)); + final JMenu generatedDeck = new JMenu(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Options.Generate.TITLE)); generatedDeck.add(OldGuiNewGame.removeSmallCreatures); OldGuiNewGame.removeSmallCreatures.addActionListener(new ActionListener() { @@ -293,7 +293,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. } }); - final JMenu helpMenu = new JMenu(ForgeProps.getLocalized(MenuBar.Help.TITLE)); + final JMenu helpMenu = new JMenu(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Help.TITLE)); final Action[] helpActions = { this.howToPlayAction }; for (final Action a : helpActions) { @@ -402,8 +402,8 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. } final String sDeckName = JOptionPane.showInputDialog(null, - ForgeProps.getLocalized(NewGameText.SAVE_SEALED_MSG), - ForgeProps.getLocalized(NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE); + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SAVE_SEALED_MSG), + ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE); deck.setName(sDeckName); deck.setPlayerType(PlayerType.HUMAN); @@ -472,7 +472,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. */ private void jbInit() throws Exception { - this.titleLabel.setText(ForgeProps.getLocalized(NewGameText.NEW_GAME)); + this.titleLabel.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.NEW_GAME)); this.titleLabel.setFont(new java.awt.Font("Dialog", 0, 26)); /* CHOPPIC */ @@ -488,10 +488,10 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. */ /* jPanel2.setBorder(titledBorder1); */ - this.setCustomBorder(this.jPanel2, ForgeProps.getLocalized(NewGameText.GAMETYPE)); + this.setCustomBorder(this.jPanel2, ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.GAMETYPE)); this.jPanel2.setLayout(new MigLayout("align center")); - this.singleRadioButton.setText(ForgeProps.getLocalized(NewGameText.CONSTRUCTED_TEXT)); + this.singleRadioButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.CONSTRUCTED_TEXT)); this.singleRadioButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -500,7 +500,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. }); // sealedRadioButton.setToolTipText(""); - this.sealedRadioButton.setText(ForgeProps.getLocalized(NewGameText.SEALED_TEXT)); + this.sealedRadioButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SEALED_TEXT)); this.sealedRadioButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -509,7 +509,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. }); // draftRadioButton.setToolTipText(""); - this.draftRadioButton.setText(ForgeProps.getLocalized(NewGameText.BOOSTER_TEXT)); + this.draftRadioButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.BOOSTER_TEXT)); this.draftRadioButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -522,24 +522,24 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. */ /* jPanel1.setBorder(titledBorder2); */ - this.setCustomBorder(this.jPanel1, ForgeProps.getLocalized(NewGameText.LIBRARY)); + this.setCustomBorder(this.jPanel1, ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.LIBRARY)); this.jPanel1.setLayout(new MigLayout("align center")); - this.jLabel2.setText(ForgeProps.getLocalized(NewGameText.YOURDECK)); - this.jLabel3.setText(ForgeProps.getLocalized(NewGameText.OPPONENT)); + this.jLabel2.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.YOURDECK)); + this.jLabel3.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.OPPONENT)); /* * Settings Panel */ /* jPanel3.setBorder(titledBorder3); */ - this.setCustomBorder(this.jPanel3, ForgeProps.getLocalized(NewGameText.SETTINGS)); + this.setCustomBorder(this.jPanel3, ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.SETTINGS)); this.jPanel3.setLayout(new MigLayout("align center")); // newGuiCheckBox.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.NEW_GUI)); - OldGuiNewGame.getSmoothLandCheckBox().setText(ForgeProps.getLocalized(NewGameText.AI_LAND)); + OldGuiNewGame.getSmoothLandCheckBox().setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.AI_LAND)); - OldGuiNewGame.getDevModeCheckBox().setText(ForgeProps.getLocalized(NewGameText.DEV_MODE)); + OldGuiNewGame.getDevModeCheckBox().setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.DEV_MODE)); OldGuiNewGame.getDevModeCheckBox().addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -578,7 +578,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. */ this.deckEditorButton.setFont(new java.awt.Font("Dialog", 0, 15)); - this.deckEditorButton.setText(ForgeProps.getLocalized(NewGameText.DECK_EDITOR)); + this.deckEditorButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.DECK_EDITOR)); this.deckEditorButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -588,7 +588,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. this.startButton.setFont(new java.awt.Font("Dialog", 0, 18)); this.startButton.setHorizontalTextPosition(SwingConstants.LEADING); - this.startButton.setText(ForgeProps.getLocalized(NewGameText.START_GAME)); + this.startButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.START_GAME)); this.startButton.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -597,7 +597,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. }); this.questButton.setFont(new java.awt.Font("Dialog", 0, 18)); - this.questButton.setText(ForgeProps.getLocalized(NewGameText.QUEST_MODE)); + this.questButton.setText(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.NewGameText.QUEST_MODE)); this.getContentPane().add(this.titleLabel, "align center, span 3, grow, wrap"); @@ -1003,7 +1003,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * the component */ public LookAndFeelAction(final Component component) { - super(ForgeProps.getLocalized(MenuBar.Menu.LF)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.LF)); this.c = component; } @@ -1099,7 +1099,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new download price action. */ public DownloadPriceAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADPRICE)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.DOWNLOADPRICE)); } /* @@ -1187,7 +1187,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new download action lq. */ public DownloadActionLQ() { - super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADLQ)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.DOWNLOADLQ)); } /* @@ -1221,7 +1221,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new download action set lq. */ public DownloadActionSetLQ() { - super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADSETLQ)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.DOWNLOADSETLQ)); } /* @@ -1255,7 +1255,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new download action quest. */ public DownloadActionQuest() { - super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADQUESTIMG)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.DOWNLOADQUESTIMG)); } /* @@ -1291,7 +1291,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new import picture action. */ public ImportPictureAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.IMPORTPICTURE)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.IMPORTPICTURE)); } /* @@ -1329,7 +1329,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new card sizes action. */ public CardSizesAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.CARD_SIZES)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.CARD_SIZES)); } /* @@ -1410,7 +1410,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new card stack action. */ public CardStackAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.CARD_STACK)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.CARD_STACK)); } /* @@ -1484,7 +1484,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new card stack offset action. */ public CardStackOffsetAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.CARD_STACK_OFFSET)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.CARD_STACK_OFFSET)); } /* @@ -1562,7 +1562,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new how to play action. */ public HowToPlayAction() { - super(ForgeProps.getLocalized(Lang.HowTo.TITLE)); + super(ForgeProps.getLocalized(NewConstants.Lang.HowTo.TITLE)); } /* @@ -1580,7 +1580,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. */ @Override public final void actionPerformed(final ActionEvent e) { - final String text = ForgeProps.getLocalized(Lang.HowTo.MESSAGE); + final String text = ForgeProps.getLocalized(NewConstants.Lang.HowTo.MESSAGE); final JTextArea area = new JTextArea(text, 25, 40); area.setWrapStyleWord(true); @@ -1588,7 +1588,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. area.setEditable(false); area.setOpaque(false); - JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(Lang.HowTo.TITLE), + JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(NewConstants.Lang.HowTo.TITLE), JOptionPane.INFORMATION_MESSAGE); } } @@ -1606,7 +1606,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new about action. */ public AboutAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.ABOUT)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.ABOUT)); } /* @@ -1659,7 +1659,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants. * Instantiates a new exit action. */ public ExitAction() { - super(ForgeProps.getLocalized(MenuBar.Menu.EXIT)); + super(ForgeProps.getLocalized(NewConstants.Lang.OldGuiNewGame.MenuBar.Menu.EXIT)); } /* diff --git a/src/test/java/forge/BoosterDraftTest.java b/src/test/java/forge/BoosterDraftTest.java index b2243a81699..24adc0ac011 100644 --- a/src/test/java/forge/BoosterDraftTest.java +++ b/src/test/java/forge/BoosterDraftTest.java @@ -1,63 +1,78 @@ package forge; +import org.testng.annotations.Test; + import forge.card.BoosterGenerator; import forge.deck.Deck; - import forge.game.limited.IBoosterDraft; import forge.item.CardPrinted; import forge.item.ItemPool; import forge.item.ItemPoolView; -import org.testng.annotations.Test; - /** - *

BoosterDraftTest class.

- * + *

+ * BoosterDraftTest class. + *

+ * * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class BoosterDraftTest implements IBoosterDraft { + + /** The n. */ int n = 3; /** - *

getDecks.

- * + *

+ * getDecks. + *

+ * * @return an array of {@link forge.deck.Deck} objects. */ + @Override @Test(timeOut = 1000) public Deck[] getDecks() { return null; } /** - *

nextChoice.

- * + *

+ * nextChoice. + *

+ * * @return a {@link forge.CardList} object. */ + @Override public ItemPoolView nextChoice() { - n--; - BoosterGenerator pack = new BoosterGenerator(SetUtils.getSetByCode("M11")); + this.n--; + final BoosterGenerator pack = new BoosterGenerator(SetUtils.getSetByCode("M11")); return ItemPool.createFrom(pack.getBoosterPack(), CardPrinted.class); } /** {@inheritDoc} */ - public void setChoice(CardPrinted c) { + @Override + public void setChoice(final CardPrinted c) { System.out.println(c.getName()); } /** - *

hasNextChoice.

- * + *

+ * hasNextChoice. + *

+ * * @return a boolean. */ + @Override public boolean hasNextChoice() { - return n > 0; + return this.n > 0; } /** - *

getChosenCards.

- * + *

+ * getChosenCards. + *

+ * * @return a {@link forge.CardList} object. */ public CardList getChosenCards() { @@ -65,14 +80,19 @@ public class BoosterDraftTest implements IBoosterDraft { } /** - *

getUnchosenCards.

- * + *

+ * getUnchosenCards. + *

+ * * @return a {@link forge.CardList} object. */ public CardList getUnchosenCards() { return null; } + /* (non-Javadoc) + * @see forge.game.limited.IBoosterDraft#finishedDrafting() + */ @Override public void finishedDrafting() { diff --git a/src/test/java/forge/BoosterDraft_1Test.java b/src/test/java/forge/BoosterDraft_1Test.java index c423d8c9c00..411f658631e 100644 --- a/src/test/java/forge/BoosterDraft_1Test.java +++ b/src/test/java/forge/BoosterDraft_1Test.java @@ -2,27 +2,27 @@ package forge; import org.testng.annotations.Test; - import forge.game.limited.BoosterDraft; import forge.game.limited.CardPoolLimitation; import forge.item.CardPrinted; import forge.item.ItemPoolView; - /** * Unit test for simple App. */ -@Test(groups = {"UnitTest"}, timeOut = 1000) +@Test(groups = { "UnitTest" }, timeOut = 1000) public class BoosterDraft_1Test { /** + * Booster draft_1 test1. * + * @throws Exception the exception */ - @Test(groups = {"UnitTest", "fast"}, timeOut = 1000) + @Test(groups = { "UnitTest", "fast" }, timeOut = 1000) public void BoosterDraft_1Test1() throws Exception { - BoosterDraft draft = new BoosterDraft(CardPoolLimitation.Full); + final BoosterDraft draft = new BoosterDraft(CardPoolLimitation.Full); while (draft.hasNextChoice()) { - ItemPoolView list = draft.nextChoice(); + final ItemPoolView list = draft.nextChoice(); System.out.println(list.countAll()); draft.setChoice(list.toFlatList().get(0)); } diff --git a/src/test/java/forge/CardColorTest.java b/src/test/java/forge/CardColorTest.java index 44a3a0867b4..c1762948099 100644 --- a/src/test/java/forge/CardColorTest.java +++ b/src/test/java/forge/CardColorTest.java @@ -1,22 +1,24 @@ package forge; -import forge.card.mana.ManaCost; -import org.testng.annotations.Test; - import java.util.EnumSet; +import org.testng.annotations.Test; + +import forge.card.mana.ManaCost; + /** - * + * The Class CardColorTest. */ -@Test(groups = {"UnitTest"}, timeOut = 1000) +@Test(groups = { "UnitTest" }, timeOut = 1000) public class CardColorTest { + /** - * + * Card color test1. */ - @Test(groups = {"UnitTest", "fast"}, timeOut = 1000) + @Test(groups = { "UnitTest", "fast" }, timeOut = 1000) public void CardColorTest1() { - ManaCost mc = new ManaCost("R W U"); - EnumSet col = Color.convertManaCostToColor(mc); + final ManaCost mc = new ManaCost("R W U"); + final EnumSet col = Color.convertManaCostToColor(mc); System.out.println(col.toString()); } } diff --git a/src/test/java/forge/CardReaderTest.java b/src/test/java/forge/CardReaderTest.java index dafa87404a1..cf4d78d4e7c 100644 --- a/src/test/java/forge/CardReaderTest.java +++ b/src/test/java/forge/CardReaderTest.java @@ -1,23 +1,24 @@ package forge; -import forge.properties.ForgeProps; -import forge.properties.NewConstants; -import net.slightlymagic.braids.util.ClumsyRunnable; -import org.testng.Assert; -import org.testng.annotations.Test; - import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import static net.slightlymagic.braids.util.testng.BraidsAssertFunctions.assertThrowsException; +import net.slightlymagic.braids.util.ClumsyRunnable; +import net.slightlymagic.braids.util.testng.BraidsAssertFunctions; + +import org.testng.Assert; +import org.testng.annotations.Test; + +import forge.properties.ForgeProps; +import forge.properties.NewConstants; /** * Created by hand to test the CardReader class. */ -@Test(groups = {"UnitTest"}) -public class CardReaderTest implements NewConstants { +@Test(groups = { "UnitTest" }) +public class CardReaderTest { /** The default test-timeout. */ public static final int TEST_TIMEOUT = 1000; @@ -25,64 +26,85 @@ public class CardReaderTest implements NewConstants { /** The estimated number of cards in the cardsfolder. */ public static final int ESTIMATED_CARDS_IN_FOLDER = 9001; - - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_null map. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_nullMap() { final ClumsyRunnable withScissors = new ClumsyRunnable() { + @Override public void run() throws Exception { - new CardReader(ForgeProps.getFile(CARDSFOLDER), null); + new CardReader(ForgeProps.getFile(NewConstants.CARDSFOLDER), null); } }; - assertThrowsException(NullPointerException.class, withScissors); + BraidsAssertFunctions.assertThrowsException(NullPointerException.class, withScissors); } - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_null cards folder. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_nullCardsFolder() { final ClumsyRunnable withScissors = new ClumsyRunnable() { + @Override public void run() throws Exception { - Map map = new HashMap(); + final Map map = new HashMap(); new CardReader(null, map); } }; - assertThrowsException(NullPointerException.class, withScissors); + BraidsAssertFunctions.assertThrowsException(NullPointerException.class, withScissors); } - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_nonexistent cards folder. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_nonexistentCardsFolder() { final ClumsyRunnable withScissors = new ClumsyRunnable() { + @Override public void run() throws Exception { - Map map = new HashMap(); - new CardReader(new File( - "this_does_not_exist_fjksdjfsdjfkdjslkfksdlajfikajfklsdhfksdalfhjklsdahfeakslfdsfdsfdsfdsfdssfc" - ), map); + final Map map = new HashMap(); + new CardReader( + new File( + "this_does_not_exist_fjksdjfsdjfkdjslkfksdlajfikajfklsdhfksdalfhjklsdahfeakslfdsfdsfdsfdsfdssfc"), + map); } }; - assertThrowsException(RuntimeException.class, withScissors); + BraidsAssertFunctions.assertThrowsException(RuntimeException.class, withScissors); } - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_file not folder. + * + * @throws IOException Signals that an I/O exception has occurred. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_fileNotFolder() throws IOException { final File tmpFile = File.createTempFile("just-a-file", ".testng.tmp"); - tmpFile.deleteOnExit(); // request VM to delete later + tmpFile.deleteOnExit(); // request VM to delete later final ClumsyRunnable withScissors = new ClumsyRunnable() { + @Override public void run() throws Exception { - Map map = new HashMap(); + final Map map = new HashMap(); new CardReader(tmpFile, map); } }; - assertThrowsException(RuntimeException.class, withScissors); + BraidsAssertFunctions.assertThrowsException(RuntimeException.class, withScissors); } - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_find card_zip. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_findCard_zip() { final Map map = new HashMap(); - final File cardsfolder = ForgeProps.getFile(CARDSFOLDER); + final File cardsfolder = ForgeProps.getFile(NewConstants.CARDSFOLDER); final CardReader cardReader = new CardReader(cardsfolder, map); final File zipFile = new File(cardsfolder, "cardsfolder.zip"); @@ -95,10 +117,13 @@ public class CardReaderTest implements NewConstants { Assert.assertEquals(elvishWarrior.getName(), "Elvish Warrior", "name is correct"); } - @Test(groups = {"UnitTest", "fast"}, timeOut = TEST_TIMEOUT) + /** + * Test_ read card_find card_nonzip. + */ + @Test(groups = { "UnitTest", "fast" }, timeOut = CardReaderTest.TEST_TIMEOUT) public final void test_ReadCard_findCard_nonzip() { final Map map = new HashMap(); - final File cardsfolder = ForgeProps.getFile(CARDSFOLDER); + final File cardsfolder = ForgeProps.getFile(NewConstants.CARDSFOLDER); final CardReader cardReader = new CardReader(cardsfolder, map, null, false); final Card savannahLions = cardReader.findCard("Savannah Lions"); @@ -107,20 +132,26 @@ public class CardReaderTest implements NewConstants { Assert.assertEquals(savannahLions.getName(), "Savannah Lions", "name is correct"); } - @Test(groups = {"slow"}) + /** + * Test_ read card_run_nonzip. + */ + @Test(groups = { "slow" }) public final void test_ReadCard_run_nonzip() { - final Map map = new HashMap(2 * ESTIMATED_CARDS_IN_FOLDER); - final File cardsfolder = ForgeProps.getFile(CARDSFOLDER); - final CardReader cardReader = new CardReader(cardsfolder, map, null,false); + final Map map = new HashMap(2 * CardReaderTest.ESTIMATED_CARDS_IN_FOLDER); + final File cardsfolder = ForgeProps.getFile(NewConstants.CARDSFOLDER); + final CardReader cardReader = new CardReader(cardsfolder, map, null, false); cardReader.run(); Assert.assertNotNull(map.get("Elvish Warrior"), "Elvish Warrior was loaded"); Assert.assertNotNull(map.get("Savannah Lions"), "Savannah Lions were loaded"); } - @Test(groups = {"slow"}) + /** + * Test_ read card_run_zip. + */ + @Test(groups = { "slow" }) public final void test_ReadCard_run_zip() { - final Map map = new HashMap(2 * ESTIMATED_CARDS_IN_FOLDER); - final File cardsfolder = ForgeProps.getFile(CARDSFOLDER); + final Map map = new HashMap(2 * CardReaderTest.ESTIMATED_CARDS_IN_FOLDER); + final File cardsfolder = ForgeProps.getFile(NewConstants.CARDSFOLDER); final CardReader cardReader = new CardReader(cardsfolder, map); cardReader.run(); Assert.assertNotNull(map.get("Elvish Warrior"), "Elvish Warrior was loaded"); diff --git a/src/test/java/forge/GameActionTest.java b/src/test/java/forge/GameActionTest.java index 88f4cf40c74..138f11859bd 100644 --- a/src/test/java/forge/GameActionTest.java +++ b/src/test/java/forge/GameActionTest.java @@ -1,36 +1,42 @@ package forge; -import forge.deck.generate.GenerateConstructedDeck; import org.testng.annotations.Test; +import forge.deck.generate.GenerateConstructedDeck; + /** - * + * The Class GameActionTest. */ -@Test(groups = {"UnitTest"}, timeOut = 1000) +@Test(groups = { "UnitTest" }, timeOut = 1000) public class GameActionTest { /** - *

main.

+ *

+ * main. + *

+ * + * @throws Exception the exception */ - @Test(groups = {"UnitTest", "fast"}, timeOut = 5000) + @Test(groups = { "UnitTest", "fast" }, timeOut = 5000) public void GameActionTest1() throws Exception { System.out.println("GameActionTest"); - GameAction gameAction = new GameAction(); - GenerateConstructedDeck gen = new GenerateConstructedDeck(); + final GameAction gameAction = new GameAction(); + final GenerateConstructedDeck gen = new GenerateConstructedDeck(); for (int i = 0; i < 2000; i++) { - CardList list = gen.generateDeck(); + final CardList list = gen.generateDeck(); - Card[] card = gameAction.smoothComputerManaCurve(list.toArray()); + final Card[] card = gameAction.smoothComputerManaCurve(list.toArray()); - CardList check = new CardList(); - for (int a = 0; a < 30; a++) + final CardList check = new CardList(); + for (int a = 0; a < 30; a++) { check.add(card[a]); + } if (check.getType("Land").size() != 7) { System.out.println("error - " + check); break; } - }//for + }// for } } diff --git a/src/test/java/forge/GuiBoosterDraftTest.java b/src/test/java/forge/GuiBoosterDraftTest.java index 94fb0566a79..3ce59978451 100644 --- a/src/test/java/forge/GuiBoosterDraftTest.java +++ b/src/test/java/forge/GuiBoosterDraftTest.java @@ -1,31 +1,29 @@ package forge; +import org.testng.Assert; +import org.testng.annotations.Test; + import forge.deck.Deck; import forge.game.GameType; import forge.game.limited.BoosterDraft; import forge.game.limited.CardPoolLimitation; import forge.gui.deckeditor.DeckEditorDraft; -import org.testng.Assert; -import org.testng.annotations.Test; - /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}) +@Test(groups = { "UnitTest" }) public class GuiBoosterDraftTest { /** - * - * + * Gui booster draft test1. */ - @Test(groups = {"UnitTest", "fast"}) - public void GuiBoosterDraftTest1() { + @Test(groups = { "UnitTest", "fast" }) + public void guiBoosterDraftTest1() { Constant.Runtime.setGameType(GameType.Draft); Constant.Runtime.HUMAN_DECK[0] = new Deck(GameType.Sealed); - DeckEditorDraft g = new DeckEditorDraft(); + final DeckEditorDraft g = new DeckEditorDraft(); g.showGui(new BoosterDraft(CardPoolLimitation.Full)); Assert.assertNotNull(g); g.dispose(); diff --git a/src/test/java/forge/GuiDownloadPicturesLQTest.java b/src/test/java/forge/GuiDownloadPicturesLQTest.java index 223aabd0ec1..28580988f28 100644 --- a/src/test/java/forge/GuiDownloadPicturesLQTest.java +++ b/src/test/java/forge/GuiDownloadPicturesLQTest.java @@ -3,18 +3,16 @@ package forge; import org.testng.annotations.Test; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class GuiDownloadPicturesLQTest { - /** - * + * Gui download pictures test1. */ @Test(enabled = false, timeOut = 1000) - public void GuiDownloadPicturesTest1() { + public void GuiDownloadPicturesTest1() { new GuiDownloadPicturesLQ(null); } } diff --git a/src/test/java/forge/GuiDownloadSetPicturesLQTest.java b/src/test/java/forge/GuiDownloadSetPicturesLQTest.java index fa54ac5d87e..693460a006d 100644 --- a/src/test/java/forge/GuiDownloadSetPicturesLQTest.java +++ b/src/test/java/forge/GuiDownloadSetPicturesLQTest.java @@ -3,13 +3,13 @@ package forge; import org.testng.annotations.Test; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class GuiDownloadSetPicturesLQTest { + /** - * + * Gui download set pictures lq test1. */ @Test(enabled = false, timeOut = 1000) public void GuiDownloadSetPicturesLQTest1() { diff --git a/src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java b/src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java index e1ddf418628..5ec7faa23d3 100644 --- a/src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java +++ b/src/test/java/forge/GuiMigrateLocalMWSSetPicturesHQTest.java @@ -3,18 +3,16 @@ package forge; import org.testng.annotations.Test; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class GuiMigrateLocalMWSSetPicturesHQTest { - /** - * + * Gui migrate local mws set pictures h q1. */ @Test(enabled = false, timeOut = 1000) - public void GuiMigrateLocalMWSSetPicturesHQ1() { + public void GuiMigrateLocalMWSSetPicturesHQ1() { GuiMigrateLocalMWSSetPicturesHQ.startDownload(null); } } diff --git a/src/test/java/forge/GuiMultipleBlockers4Test.java b/src/test/java/forge/GuiMultipleBlockers4Test.java index 57078dd5f5c..ea9779418d5 100644 --- a/src/test/java/forge/GuiMultipleBlockers4Test.java +++ b/src/test/java/forge/GuiMultipleBlockers4Test.java @@ -3,19 +3,17 @@ package forge; import org.testng.annotations.Test; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class GuiMultipleBlockers4Test { /** - * - * + * Gui multiple blockers4 test1. */ @Test(timeOut = 1000, enabled = false) public void GuiMultipleBlockers4Test1() { - CardList list = new CardList(); + final CardList list = new CardList(); list.add(AllZone.getCardFactory().getCard("Elvish Piper", null)); list.add(AllZone.getCardFactory().getCard("Lantern Kami", null)); list.add(AllZone.getCardFactory().getCard("Frostling", null)); diff --git a/src/test/java/forge/GuiProgressBarWindowTest.java b/src/test/java/forge/GuiProgressBarWindowTest.java index 4dd28dd9508..757b50cb07c 100644 --- a/src/test/java/forge/GuiProgressBarWindowTest.java +++ b/src/test/java/forge/GuiProgressBarWindowTest.java @@ -1,29 +1,28 @@ package forge; +import javax.swing.WindowConstants; + import org.testng.Assert; import org.testng.annotations.Test; -import javax.swing.*; - /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}) +@Test(groups = { "UnitTest" }) public class GuiProgressBarWindowTest { + /** - * - * + * Gui progress bar window test1. */ - @Test(groups = {"UnitTest", "fast"}) + @Test(groups = { "UnitTest", "fast" }) public void GuiProgressBarWindowTest1() { try { - GuiProgressBarWindow dialog = new GuiProgressBarWindow(); - dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + final GuiProgressBarWindow dialog = new GuiProgressBarWindow(); + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setVisible(true); Assert.assertNotNull(dialog); dialog.dispose(); - } catch (Exception e) { + } catch (final Exception e) { e.printStackTrace(); } } diff --git a/src/test/java/forge/GuiQuestOptionsTest.java b/src/test/java/forge/GuiQuestOptionsTest.java index a02b15d774d..ac579673ea9 100644 --- a/src/test/java/forge/GuiQuestOptionsTest.java +++ b/src/test/java/forge/GuiQuestOptionsTest.java @@ -6,18 +6,17 @@ import org.testng.annotations.Test; import forge.quest.gui.QuestOptions; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}) +@Test(groups = { "UnitTest" }) public class GuiQuestOptionsTest { + /** - * - * + * Gui quest options test1. */ - @Test(groups = {"UnitTest", "fast"}) + @Test(groups = { "UnitTest", "fast" }) public void GuiQuestOptionsTest1() { - QuestOptions dialog = new QuestOptions(); + final QuestOptions dialog = new QuestOptions(); dialog.setVisible(true); Assert.assertNotNull(dialog); dialog.dispose(); diff --git a/src/test/java/forge/PanelTest.java b/src/test/java/forge/PanelTest.java index de282ebdcff..5578716208d 100644 --- a/src/test/java/forge/PanelTest.java +++ b/src/test/java/forge/PanelTest.java @@ -1,63 +1,73 @@ package forge; -import forge.error.ErrorViewer; +import java.awt.Color; +import java.awt.Rectangle; + +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; + import org.testng.annotations.Test; -import javax.swing.*; -import java.awt.Color; -import java.awt.*; - +import forge.error.ErrorViewer; /** - *

PanelTest class.

- * + *

+ * PanelTest class. + *

+ * * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class PanelTest extends JFrame { /** * */ private static final long serialVersionUID = 1L; - private JPanel jPanel1 = new JPanel(); - private JLabel jLabel1 = new JLabel(); + private final JPanel jPanel1 = new JPanel(); + private final JLabel jLabel1 = new JLabel(); /** - * + * Phase test1. */ @Test(timeOut = 1000, enabled = false) public void PhaseTest1() { - PanelTest p = new PanelTest(); + final PanelTest p = new PanelTest(); p.setSize(300, 300); p.setVisible(true); } /** - *

Constructor for PanelTest.

+ *

+ * Constructor for PanelTest. + *

*/ public PanelTest() { try { - jbInit(); - } catch (Exception ex) { + this.jbInit(); + } catch (final Exception ex) { ErrorViewer.showError(ex); ex.printStackTrace(); } } /** - *

jbInit.

- * - * @throws java.lang.Exception if any. + *

+ * jbInit. + *

+ * + * @throws java.lang.Exception + * if any. */ private void jbInit() throws Exception { this.getContentPane().setLayout(null); - jPanel1.setForeground(Color.orange); - jPanel1.setBounds(new Rectangle(15, 36, 252, 156)); - jLabel1.setFont(new java.awt.Font("Dialog", 1, 12)); - jLabel1.setForeground(new Color(70, 90, 163)); - jLabel1.setText("jLabel1"); - this.getContentPane().add(jPanel1, null); - jPanel1.add(jLabel1, null); + this.jPanel1.setForeground(Color.orange); + this.jPanel1.setBounds(new Rectangle(15, 36, 252, 156)); + this.jLabel1.setFont(new java.awt.Font("Dialog", 1, 12)); + this.jLabel1.setForeground(new Color(70, 90, 163)); + this.jLabel1.setText("jLabel1"); + this.getContentPane().add(this.jPanel1, null); + this.jPanel1.add(this.jLabel1, null); } } diff --git a/src/test/java/forge/PhaseTest.java b/src/test/java/forge/PhaseTest.java index 56ed6fbaa62..b7a4ce801b3 100644 --- a/src/test/java/forge/PhaseTest.java +++ b/src/test/java/forge/PhaseTest.java @@ -3,18 +3,17 @@ package forge; import org.testng.annotations.Test; /** - * Created by IntelliJ IDEA. - * User: dhudson + * Created by IntelliJ IDEA. User: dhudson */ -@Test(groups = {"UnitTest"}, timeOut = 5000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 5000, enabled = false) public class PhaseTest { + /** - * - * + * Phase test1. */ - @Test(groups = {"UnitTest", "fast"}, timeOut = 5000, enabled = false) + @Test(groups = { "UnitTest", "fast" }, timeOut = 5000, enabled = false) public void PhaseTest1() { - Phase phase = new Phase(); + final Phase phase = new Phase(); for (int i = 0; i < phase.getPhaseOrder().length; i++) { System.out.println(phase.getPlayerTurn() + " " + phase.getPhase()); phase.nextPhase(); diff --git a/src/test/java/forge/RunTest.java b/src/test/java/forge/RunTest.java index 0ee3dea0bea..05f3496df89 100644 --- a/src/test/java/forge/RunTest.java +++ b/src/test/java/forge/RunTest.java @@ -1,251 +1,263 @@ package forge; -import forge.card.cardfactory.CardFactoryInterface; -import forge.card.mana.ManaCost; -import forge.gui.input.InputPayManaCostUtil; -import org.testng.annotations.Test; - import java.util.ArrayList; import java.util.HashSet; import java.util.Set; +import org.testng.annotations.Test; + +import forge.card.cardfactory.CardFactoryInterface; +import forge.card.mana.ManaCost; +import forge.gui.input.InputPayManaCostUtil; + /** - *

RunTest class.

- * + *

+ * RunTest class. + *

+ * * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) public class RunTest { - //@SuppressWarnings("unchecked") // HashSet needs + // @SuppressWarnings("unchecked") // HashSet needs /** - *

test.

+ *

+ * test. + *

*/ @Test(timeOut = 1000, enabled = false) void test() { { Card c; - CardFactoryInterface cf = AllZone.getCardFactory(); - //********* test Card + final CardFactoryInterface cf = AllZone.getCardFactory(); + // ********* test Card c = cf.getCard("Elvish Warrior", AllZone.getComputerPlayer()); - check("1", c.getOwner().isComputer()); - check("1.1", c.getName().equals("Elvish Warrior")); - check("2", c.getManaCost().equals("G G")); - check("2.1", c.isCreature()); - check("2.2", c.isType("Elf")); - check("2.3", c.isType("Warrior")); - check("3", c.getText().equals("")); - check("4", c.getNetAttack() == 2); - check("5", c.getNetDefense() == 3); - check("6", c.getKeyword().isEmpty()); + this.check("1", c.getOwner().isComputer()); + this.check("1.1", c.getName().equals("Elvish Warrior")); + this.check("2", c.getManaCost().equals("G G")); + this.check("2.1", c.isCreature()); + this.check("2.2", c.isType("Elf")); + this.check("2.3", c.isType("Warrior")); + this.check("3", c.getText().equals("")); + this.check("4", c.getNetAttack() == 2); + this.check("5", c.getNetDefense() == 3); + this.check("6", c.getKeyword().isEmpty()); c = cf.getCard("Shock", null); - check("14", c.isInstant()); - //check("15", c.getText().equals("Shock deals 2 damge to target creature or player.")); + this.check("14", c.isInstant()); + // check("15", + // c.getText().equals("Shock deals 2 damge to target creature or player.")); c = cf.getCard("Bayou", null); - check("17", c.getManaCost().equals("")); - check("18", c.isLand()); - check("19", c.isType("Swamp")); - check("20", c.isType("Forest")); + this.check("17", c.getManaCost().equals("")); + this.check("18", c.isLand()); + this.check("19", c.isType("Swamp")); + this.check("20", c.isType("Forest")); - //********* test ManaCost + // ********* test ManaCost ManaCost manaCost = new ManaCost("G"); - check("21", !manaCost.isPaid()); + this.check("21", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("22", manaCost.isPaid()); + this.check("22", manaCost.isPaid()); manaCost = new ManaCost("7"); - check("23", !manaCost.isPaid()); + this.check("23", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLACK); - check("24", !manaCost.isPaid()); + this.check("24", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("25", !manaCost.isPaid()); + this.check("25", !manaCost.isPaid()); manaCost.payMana(Constant.Color.COLORLESS); - check("26", !manaCost.isPaid()); + this.check("26", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("27", !manaCost.isPaid()); + this.check("27", !manaCost.isPaid()); manaCost.payMana(Constant.Color.RED); - check("28", !manaCost.isPaid()); + this.check("28", !manaCost.isPaid()); manaCost.payMana(Constant.Color.WHITE); - check("29", !manaCost.isPaid()); + this.check("29", !manaCost.isPaid()); manaCost.payMana(Constant.Color.WHITE); - check("30", manaCost.isPaid()); + this.check("30", manaCost.isPaid()); manaCost = new ManaCost("2 W W G G B B U U R R"); - check("31", !manaCost.isPaid()); + this.check("31", !manaCost.isPaid()); manaCost.payMana(Constant.Color.WHITE); - check("32", !manaCost.isPaid()); + this.check("32", !manaCost.isPaid()); manaCost.payMana(Constant.Color.WHITE); - check("32.1", !manaCost.isPaid()); + this.check("32.1", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLACK); - check("33", !manaCost.isPaid()); + this.check("33", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLACK); - check("34", !manaCost.isPaid()); + this.check("34", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("35", !manaCost.isPaid()); + this.check("35", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("36", !manaCost.isPaid()); + this.check("36", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("37", !manaCost.isPaid()); + this.check("37", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("38", !manaCost.isPaid()); + this.check("38", !manaCost.isPaid()); manaCost.payMana(Constant.Color.RED); - check("39", !manaCost.isPaid()); + this.check("39", !manaCost.isPaid()); manaCost.payMana(Constant.Color.RED); - check("40", !manaCost.isPaid()); + this.check("40", !manaCost.isPaid()); manaCost.payMana(Constant.Color.RED); - check("41", !manaCost.isPaid()); + this.check("41", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("42", manaCost.isPaid()); + this.check("42", manaCost.isPaid()); manaCost = new ManaCost("G G"); - check("43", !manaCost.isPaid()); + this.check("43", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("44", !manaCost.isPaid()); + this.check("44", !manaCost.isPaid()); manaCost.payMana(Constant.Color.GREEN); - check("45", manaCost.isPaid()); + this.check("45", manaCost.isPaid()); manaCost = new ManaCost("1 U B"); - check("45", !manaCost.isPaid()); + this.check("45", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLACK); - check("46", !manaCost.isPaid()); + this.check("46", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("47", !manaCost.isPaid()); + this.check("47", !manaCost.isPaid()); manaCost.payMana(Constant.Color.BLUE); - check("48", manaCost.isPaid()); + this.check("48", manaCost.isPaid()); - //********* test CardUtil.getColors() + // ********* test CardUtil.getColors() c = new Card(); c.setManaCost("G"); ArrayList color = CardUtil.getColors(c); - check("49", color.contains(Constant.Color.GREEN)); - check("50", color.size() == 1); + this.check("49", color.contains(Constant.Color.GREEN)); + this.check("50", color.size() == 1); c = new Card(); c.setManaCost("W B G R U"); color = CardUtil.getColors(c); - Set set = new HashSet(color); + final Set set = new HashSet(color); System.out.println("color: " + color); - check("51", set.size() == 5); - check("52", color.contains(Constant.Color.BLACK)); - check("53", color.contains(Constant.Color.BLUE)); - check("54", color.contains(Constant.Color.GREEN)); - check("55", color.contains(Constant.Color.RED)); - check("56", color.contains(Constant.Color.WHITE)); + this.check("51", set.size() == 5); + this.check("52", color.contains(Constant.Color.BLACK)); + this.check("53", color.contains(Constant.Color.BLUE)); + this.check("54", color.contains(Constant.Color.GREEN)); + this.check("55", color.contains(Constant.Color.RED)); + this.check("56", color.contains(Constant.Color.WHITE)); c = new Card(); c.setManaCost("2"); color = CardUtil.getColors(c); - check("57", color.size() == 1); - check("58", color.contains(Constant.Color.COLORLESS)); + this.check("57", color.size() == 1); + this.check("58", color.contains(Constant.Color.COLORLESS)); c = new Card(); color = CardUtil.getColors(c); - check("59", color.size() == 1); - check("60", color.contains(Constant.Color.COLORLESS)); + this.check("59", color.size() == 1); + this.check("60", color.contains(Constant.Color.COLORLESS)); c = new Card(); c.setManaCost(""); color = CardUtil.getColors(c); - check("61", color.size() == 1); - check("62", color.contains(Constant.Color.COLORLESS)); + this.check("61", color.size() == 1); + this.check("62", color.contains(Constant.Color.COLORLESS)); c = cf.getCard("Bayou", null); color = CardUtil.getColors(c); - check("63", color.size() == 1); - check("64", color.contains(Constant.Color.COLORLESS)); + this.check("63", color.size() == 1); + this.check("64", color.contains(Constant.Color.COLORLESS)); c = cf.getCard("Elvish Warrior", null); color = CardUtil.getColors(c); - check("65", color.size() == 1); - check("66", color.contains(Constant.Color.GREEN)); + this.check("65", color.size() == 1); + this.check("66", color.contains(Constant.Color.GREEN)); c = new Card(); c.setManaCost("11 W W B B U U R R G G"); color = CardUtil.getColors(c); - check("67", color.size() == 5); + this.check("67", color.size() == 5); c = new Card(); c = cf.getCard("Elvish Warrior", null); c.setManaCost("11"); color = CardUtil.getColors(c); - check("68", color.size() == 1); - check("69", color.contains(Constant.Color.COLORLESS)); + this.check("68", color.size() == 1); + this.check("69", color.contains(Constant.Color.COLORLESS)); - check("70", c.isCreature()); - check("71", !c.isArtifact()); - check("72", !c.isBasicLand()); - check("73", !c.isEnchantment()); - check("74", !c.isGlobalEnchantment()); - check("75", !c.isInstant()); - check("76", !c.isLand()); - check("77", !c.isAura()); - check("78", c.isPermanent()); - check("79", !c.isSorcery()); - check("80", !c.isTapped()); - check("81", c.isUntapped()); + this.check("70", c.isCreature()); + this.check("71", !c.isArtifact()); + this.check("72", !c.isBasicLand()); + this.check("73", !c.isEnchantment()); + this.check("74", !c.isGlobalEnchantment()); + this.check("75", !c.isInstant()); + this.check("76", !c.isLand()); + this.check("77", !c.isAura()); + this.check("78", c.isPermanent()); + this.check("79", !c.isSorcery()); + this.check("80", !c.isTapped()); + this.check("81", c.isUntapped()); c = cf.getCard("Swamp", null); - check("82", c.isBasicLand()); - check("83", c.isLand()); + this.check("82", c.isBasicLand()); + this.check("83", c.isLand()); c = cf.getCard("Bayou", null); - check("84", !c.isBasicLand()); - check("85", c.isLand()); + this.check("84", !c.isBasicLand()); + this.check("85", c.isLand()); c = cf.getCard("Shock", null); - check("86", !c.isCreature()); - check("87", !c.isArtifact()); - check("88", !c.isBasicLand()); - check("89", !c.isEnchantment()); - check("90", !c.isGlobalEnchantment()); - check("91", c.isInstant()); - check("92", !c.isLand()); - check("93", !c.isAura()); - check("94", !c.isPermanent()); - check("95", !c.isSorcery()); - check("96", !c.isTapped()); - check("97", c.isUntapped()); + this.check("86", !c.isCreature()); + this.check("87", !c.isArtifact()); + this.check("88", !c.isBasicLand()); + this.check("89", !c.isEnchantment()); + this.check("90", !c.isGlobalEnchantment()); + this.check("91", c.isInstant()); + this.check("92", !c.isLand()); + this.check("93", !c.isAura()); + this.check("94", !c.isPermanent()); + this.check("95", !c.isSorcery()); + this.check("96", !c.isTapped()); + this.check("97", c.isUntapped()); - //test Input_PayManaCostUtil - check("98", InputPayManaCostUtil.getLongColorString("G").equals(Constant.Color.GREEN)); - check("99", InputPayManaCostUtil.getLongColorString("1").equals(Constant.Color.COLORLESS)); + // test Input_PayManaCostUtil + this.check("98", InputPayManaCostUtil.getLongColorString("G").equals(Constant.Color.GREEN)); + this.check("99", InputPayManaCostUtil.getLongColorString("1").equals(Constant.Color.COLORLESS)); /* - check("101", Input_PayManaCostUtil.isManaNeeded(Constant.Color.Green, new ManaCost("5")) == true); - check("102", Input_PayManaCostUtil.isManaNeeded(Constant.Color.Blue, new ManaCost("4")) == true); - check("103", Input_PayManaCostUtil.isManaNeeded(Constant.Color.White, new ManaCost("3")) == true); - check("104", Input_PayManaCostUtil.isManaNeeded(Constant.Color.Black, new ManaCost("2")) == true); - check("105", Input_PayManaCostUtil.isManaNeeded(Constant.Color.Red, new ManaCost("1")) == true); - */ + * check("101", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Green, new + * ManaCost("5")) == true); check("102", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Blue, new + * ManaCost("4")) == true); check("103", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.White, new + * ManaCost("3")) == true); check("104", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Black, new + * ManaCost("2")) == true); check("105", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Red, new + * ManaCost("1")) == true); + */ /* - ManaCost cost = new ManaCost("1 B B"); - Input_PayManaCostUtil.isManaNeeded(Constant.Color.Black, cost); - cost.subtractMana(Constant.Color.Black); - cost.subtractMana(Constant.Color.Green); - check("106", Input_PayManaCostUtil.isManaNeeded(Constant.Color.Green, cost) == false); - */ + * ManaCost cost = new ManaCost("1 B B"); + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Black, cost); + * cost.subtractMana(Constant.Color.Black); + * cost.subtractMana(Constant.Color.Green); check("106", + * Input_PayManaCostUtil.isManaNeeded(Constant.Color.Green, cost) == + * false); + */ c = new Card(); Card c2 = new Card(); c.addIntrinsicKeyword("Flying"); c2.addIntrinsicKeyword("Flying"); - //check("107", CombatUtil.canBlock(c, c2)); - //check("108", CombatUtil.canBlock(c2, c)); + // check("107", CombatUtil.canBlock(c, c2)); + // check("108", CombatUtil.canBlock(c2, c)); c = new Card(); c2 = new Card(); c2.addIntrinsicKeyword("Flying"); - check("109", CombatUtil.canBlock(c, c2)); - check("110", !CombatUtil.canBlock(c2, c)); - + this.check("109", CombatUtil.canBlock(c, c2)); + this.check("110", !CombatUtil.canBlock(c2, c)); c = cf.getCard("Fyndhorn Elves", null); c2 = cf.getCard("Talas Warrior", null); - check("110a", !CombatUtil.canBlock(c2, c)); - check("110b", CombatUtil.canBlock(c, c2)); + this.check("110a", !CombatUtil.canBlock(c2, c)); + this.check("110b", CombatUtil.canBlock(c, c2)); c = new Card(); c.setName("1"); @@ -254,79 +266,84 @@ public class RunTest { c2.setName("2"); c2.setUniqueNumber(2); - //test CardList - CardList cardList = new CardList(new Card[] - {c, c2}); - check("111", cardList.contains(c)); - check("112", cardList.contains(c2)); - check("113", cardList.containsName(c)); - check("114", cardList.containsName(c.getName())); - check("115", cardList.containsName(c2)); - check("116", cardList.containsName(c2.getName())); + // test CardList + final CardList cardList = new CardList(new Card[] { c, c2 }); + this.check("111", cardList.contains(c)); + this.check("112", cardList.contains(c2)); + this.check("113", cardList.containsName(c)); + this.check("114", cardList.containsName(c.getName())); + this.check("115", cardList.containsName(c2)); + this.check("116", cardList.containsName(c2.getName())); c = new Card(); - check("117", c.hasSickness() == true); + this.check("117", c.hasSickness() == true); c.addIntrinsicKeyword("Haste"); - check("118", c.hasSickness() == false); - + this.check("118", c.hasSickness() == false); } { - CardFactoryInterface cf = AllZone.getCardFactory(); - CardList c1 = new CardList(); + final CardFactoryInterface cf = AllZone.getCardFactory(); + final CardList c1 = new CardList(); c1.add(cf.getCard("Shock", null)); c1.add(cf.getCard("Royal Assassin", null)); c1.add(cf.getCard("Hymn to Tourach", null)); CardList c2 = c1.filter(new CardListFilter() { - public boolean addCard(Card c) { + @Override + public boolean addCard(final Card c) { return c.isCreature(); } }); - check("119", c2.containsName("Royal Assassin")); - check("119", c2.size() == 1); + this.check("119", c2.containsName("Royal Assassin")); + this.check("119", c2.size() == 1); c2 = c1.filter(new CardListFilter() { - public boolean addCard(Card c) { + @Override + public boolean addCard(final Card c) { return c.isInstant(); } }); - check("120", c2.containsName("Shock")); - check("121", c2.size() == 1); + this.check("120", c2.containsName("Shock")); + this.check("121", c2.size() == 1); c2 = c1.filter(new CardListFilter() { - public boolean addCard(Card c) { + @Override + public boolean addCard(final Card c) { return c.getName().equals("Hymn to Tourach"); } }); - check("120", c2.containsName("Hymn to Tourach")); - check("121", c2.size() == 1); + this.check("120", c2.containsName("Hymn to Tourach")); + this.check("121", c2.size() == 1); - Card card = cf.getCard("Sylvan Basilisk", null); - Card card2 = cf.getCard("Exalted Angel", null); + final Card card = cf.getCard("Sylvan Basilisk", null); + final Card card2 = cf.getCard("Exalted Angel", null); - check("121a", !CombatUtil.canDestroyAttacker(card, card2, null, false)); + this.check("121a", !CombatUtil.canDestroyAttacker(card, card2, null, false)); } { - check("122", CardUtil.getConvertedManaCost("0") == 0); - check("123", CardUtil.getConvertedManaCost("R") == 1); - check("124", CardUtil.getConvertedManaCost("R R") == 2); - check("125", CardUtil.getConvertedManaCost("R R R") == 3); - check("126", CardUtil.getConvertedManaCost("1") == 1); - check("127", CardUtil.getConvertedManaCost("2/R 2/G 2/W 2/B 2/U") == 10); + this.check("122", CardUtil.getConvertedManaCost("0") == 0); + this.check("123", CardUtil.getConvertedManaCost("R") == 1); + this.check("124", CardUtil.getConvertedManaCost("R R") == 2); + this.check("125", CardUtil.getConvertedManaCost("R R R") == 3); + this.check("126", CardUtil.getConvertedManaCost("1") == 1); + this.check("127", CardUtil.getConvertedManaCost("2/R 2/G 2/W 2/B 2/U") == 10); } - }//test() + }// test() /** - *

check.

- * - * @param message a {@link java.lang.String} object. - * @param ok a boolean. + *

+ * check. + *

+ * + * @param message + * a {@link java.lang.String} object. + * @param ok + * a boolean. */ - void check(String message, boolean ok) { + void check(final String message, final boolean ok) { if (!ok) { - //throw new RuntimeException("RunTest test error : " +message); + // throw new RuntimeException("RunTest test error : " +message); System.out.println("RunTest test error : " + message); } diff --git a/src/test/java/forge/TinyTest.java b/src/test/java/forge/TinyTest.java index f128693fe0a..ad282566c97 100644 --- a/src/test/java/forge/TinyTest.java +++ b/src/test/java/forge/TinyTest.java @@ -9,12 +9,12 @@ import org.testng.annotations.Test; * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}) +@Test(groups = { "UnitTest" }) public class TinyTest { /** * Just a quick test to see if TestNG and Assert are working. */ - @Test(groups = {"UnitTest", "fast"}) + @Test(groups = { "UnitTest", "fast" }) public void test_true() { Assert.assertTrue(true); } diff --git a/src/test/java/forge/card/cardFactory/CardFactoryTest.java b/src/test/java/forge/card/cardFactory/CardFactoryTest.java index 11b46e3150c..ffd1188f371 100644 --- a/src/test/java/forge/card/cardFactory/CardFactoryTest.java +++ b/src/test/java/forge/card/cardFactory/CardFactoryTest.java @@ -1,5 +1,15 @@ package forge.card.cardFactory; +import java.util.Set; +import java.util.TreeSet; + +import net.slightlymagic.braids.util.ClumsyRunnable; +import net.slightlymagic.braids.util.testng.BraidsAssertFunctions; + +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + import forge.Card; import forge.CardList; import forge.card.cardfactory.CardFactoryInterface; @@ -8,28 +18,24 @@ import forge.card.cardfactory.PreloadingCardFactory; import forge.properties.ForgeProps; import forge.properties.NewConstants; import forge.view.swing.OldGuiNewGame; -import net.slightlymagic.braids.util.ClumsyRunnable; -import net.slightlymagic.braids.util.testng.BraidsAssertFunctions; -import org.testng.Assert; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import java.util.Set; -import java.util.TreeSet; //import net.slightlymagic.braids.testng.BraidsAssertFunctions; /** - *

Mana_PartTest class.

- * + *

+ * Mana_PartTest class. + *

+ * * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest" }, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS) -public class CardFactoryTest implements NewConstants { +@Test(groups = { "UnitTest" }, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS) +public class CardFactoryTest { /** The default time to allow a test to run before TestNG ignores it. */ - public static final int DEFAULT_TEST_TIMEOUT_MS = 5000; // NOPMD by Braids on 8/18/11 11:43 PM + public static final int DEFAULT_TEST_TIMEOUT_MS = 5000; // NOPMD by Braids + // on 8/18/11 11:43 + // PM private transient CardFactoryInterface factory; @@ -39,16 +45,16 @@ public class CardFactoryTest implements NewConstants { @BeforeMethod public final void setUp() { OldGuiNewGame.loadDynamicGamedata(); - factory = new LazyCardFactory(ForgeProps.getFile(CARDSFOLDER)); + this.factory = new LazyCardFactory(ForgeProps.getFile(NewConstants.CARDSFOLDER)); } /** - * Just a quick test to see if Arc-Slogger is in the database, and if it - * has the correct owner. + * Just a quick test to see if Arc-Slogger is in the database, and if it has + * the correct owner. */ - @Test(enabled = true, timeOut = DEFAULT_TEST_TIMEOUT_MS) + @Test(enabled = true, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS) public final void test_getCard_1() { // NOPMD by Braids on 8/18/11 11:39 PM - final Card card = factory.getCard("Arc-Slogger", null); + final Card card = this.factory.getCard("Arc-Slogger", null); Assert.assertNotNull(card, "card is not null"); Assert.assertNull(card.getOwner(), "card has correct owner"); } @@ -56,38 +62,55 @@ public class CardFactoryTest implements NewConstants { /** * Make sure the method throws an exception when it's supposed to. */ - @Test(enabled = true, timeOut = DEFAULT_TEST_TIMEOUT_MS) - public final void test_getRandomCombinationWithoutRepetition_tooLarge() { // NOPMD by Braids on 8/18/11 11:39 PM - BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class, - new ClumsyRunnable() { - public void run() throws Exception { // NOPMD by Braids on 8/18/11 11:40 PM - factory.getRandomCombinationWithoutRepetition(factory.size()); + @Test(enabled = true, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS) + public final void test_getRandomCombinationWithoutRepetition_tooLarge() { // NOPMD + // by + // Braids + // on + // 8/18/11 + // 11:39 + // PM + BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class, new ClumsyRunnable() { + @Override + public void run() throws Exception { // NOPMD by Braids on 8/18/11 + // 11:40 PM + CardFactoryTest.this.factory.getRandomCombinationWithoutRepetition(CardFactoryTest.this.factory.size()); } }); - BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class, - new ClumsyRunnable() { - public void run() throws Exception { // NOPMD by Braids on 8/18/11 11:40 PM - final int largeDivisorForRandomCombo = 4; // NOPMD by Braids on 8/18/11 11:41 PM - factory.getRandomCombinationWithoutRepetition(factory.size() / largeDivisorForRandomCombo); + BraidsAssertFunctions.assertThrowsException(IllegalArgumentException.class, new ClumsyRunnable() { + @Override + public void run() throws Exception { // NOPMD by Braids on 8/18/11 + // 11:40 PM + final int largeDivisorForRandomCombo = 4; // NOPMD by Braids on + // 8/18/11 11:41 PM + CardFactoryTest.this.factory.getRandomCombinationWithoutRepetition(CardFactoryTest.this.factory.size() + / largeDivisorForRandomCombo); } }); } /** * Make sure the method works. - * - * This doesn't work with LazyCardFactory, so it is too slow to enable by default. + * + * This doesn't work with LazyCardFactory, so it is too slow to enable by + * default. */ - @Test(enabled = false, timeOut = DEFAULT_TEST_TIMEOUT_MS) - public final void test_getRandomCombinationWithoutRepetition_oneTenth() { // NOPMD by Braids on 8/18/11 11:39 PM - factory = new PreloadingCardFactory(ForgeProps.getFile(CARDSFOLDER)); + @Test(enabled = false, timeOut = CardFactoryTest.DEFAULT_TEST_TIMEOUT_MS) + public final void test_getRandomCombinationWithoutRepetition_oneTenth() { // NOPMD + // by + // Braids + // on + // 8/18/11 + // 11:39 + // PM + this.factory = new PreloadingCardFactory(ForgeProps.getFile(NewConstants.CARDSFOLDER)); final int divisor = 10; // NOPMD by Braids on 8/18/11 11:41 PM - final CardList actual = factory.getRandomCombinationWithoutRepetition(factory.size() / divisor); + final CardList actual = this.factory.getRandomCombinationWithoutRepetition(this.factory.size() / divisor); final Set cardNames = new TreeSet(); - for (Card card : actual) { + for (final Card card : actual) { Assert.assertNotNull(card); cardNames.add(card.getName()); } diff --git a/src/test/java/forge/card/cardFactory/CardFactoryUtilTest.java b/src/test/java/forge/card/cardFactory/CardFactoryUtilTest.java index 56c0de94811..03eacf30734 100644 --- a/src/test/java/forge/card/cardFactory/CardFactoryUtilTest.java +++ b/src/test/java/forge/card/cardFactory/CardFactoryUtilTest.java @@ -1,9 +1,5 @@ package forge.card.cardFactory; -import static forge.card.cardfactory.CardFactoryUtil.getMostProminentCreatureType; -import static forge.card.cardfactory.CardFactoryUtil.isNegativeCounter; -import static forge.card.cardfactory.CardFactoryUtil.multiplyManaCost; - import org.testng.annotations.Test; import com.google.code.jyield.Generator; @@ -14,19 +10,21 @@ import forge.Card; import forge.CardFilter; import forge.CardList; import forge.Counters; -import forge.properties.NewConstants; +import forge.card.cardfactory.CardFactoryUtil; /** - *

Mana_PartTest class.

- * + *

+ * Mana_PartTest class. + *

+ * * @author Forge * @version $Id$ */ -@Test(groups = {"UnitTest"}, timeOut = 1000, enabled = false) -public class CardFactoryUtilTest implements NewConstants { +@Test(groups = { "UnitTest" }, timeOut = 1000, enabled = false) +public class CardFactoryUtilTest { /** - * + * Card factory test1. */ @Test(timeOut = 1000, enabled = false) public void CardFactoryTest1() { @@ -34,23 +32,23 @@ public class CardFactoryUtilTest implements NewConstants { Generator in = YieldUtils.toGenerator(AllZone.getCardFactory()); in = CardFilter.getColor(in, "black"); - + CardList list = new CardList(in); list = list.getType("Creature"); - System.out.println("Most prominent creature type: " + getMostProminentCreatureType(list)); + System.out.println("Most prominent creature type: " + CardFactoryUtil.getMostProminentCreatureType(list)); - - String manacost = "3 GW W W R B S"; - String multipliedTwice = multiplyManaCost(manacost, 2); - String multipliedThrice = multiplyManaCost(manacost, 3); + final String manacost = "3 GW W W R B S"; + final String multipliedTwice = CardFactoryUtil.multiplyManaCost(manacost, 2); + final String multipliedThrice = CardFactoryUtil.multiplyManaCost(manacost, 3); System.out.println(manacost + " times 2 = " + multipliedTwice); System.out.println(manacost + " times 3 = " + multipliedThrice); - if (isNegativeCounter(Counters.M1M1)) { + if (CardFactoryUtil.isNegativeCounter(Counters.M1M1)) { System.out.println("M1M1 is a bad counter!"); - } else + } else { System.out.println("M1M1 is a good counter!"); + } } }