checkstyle and refactor

This commit is contained in:
jendave
2011-11-01 16:14:27 +00:00
parent 311af14ac9
commit 8d8dd1361e
29 changed files with 392 additions and 384 deletions

View File

@@ -17,7 +17,7 @@ import java.util.List;
import forge.error.ErrorViewer; import forge.error.ErrorViewer;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG.Gui_DownloadPictures.ERRORS; import forge.properties.NewConstants.Lang.GuiDownloadPictures.Errors;
/** /**
* <p> * <p>
@@ -166,7 +166,7 @@ public final class FileUtil {
out.flush(); out.flush();
out.close(); out.close();
} catch (IOException ioex) { } catch (IOException ioex) {
ErrorViewer.showError(ioex, ForgeProps.getLocalized(ERRORS.OTHER), "deck_temp.html", url); ErrorViewer.showError(ioex, ForgeProps.getLocalized(Errors.OTHER), "deck_temp.html", url);
} }
} }

View File

@@ -38,7 +38,7 @@ import forge.gui.input.Input_PayManaCost;
import forge.gui.input.Input_PayManaCost_Ability; import forge.gui.input.Input_PayManaCost_Ability;
import forge.item.CardPrinted; import forge.item.CardPrinted;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG.GameAction.GAMEACTION_TEXT; import forge.properties.NewConstants.Lang.GameAction.GameActionText;
import forge.quest.gui.QuestWinLoseHandler; import forge.quest.gui.QuestWinLoseHandler;
import forge.quest.gui.main.QuestEvent; import forge.quest.gui.main.QuestEvent;
import forge.view.swing.WinLoseFrame; import forge.view.swing.WinLoseFrame;
@@ -1593,10 +1593,10 @@ public class GameAction {
* </p> * </p>
*/ */
public final void seeWhoPlaysFirst_CoinToss() { public final void seeWhoPlaysFirst_CoinToss() {
Object[] possibleValues = { ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS), Object[] possibleValues = { ForgeProps.getLocalized(GameActionText.HEADS),
ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS) }; ForgeProps.getLocalized(GameActionText.TAILS) };
Object q = JOptionPane.showOptionDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS_OR_TAILS), Object q = JOptionPane.showOptionDialog(null, ForgeProps.getLocalized(GameActionText.HEADS_OR_TAILS),
ForgeProps.getLocalized(GAMEACTION_TEXT.COIN_TOSS), JOptionPane.DEFAULT_OPTION, ForgeProps.getLocalized(GameActionText.COIN_TOSS), JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]); JOptionPane.INFORMATION_MESSAGE, null, possibleValues, possibleValues[0]);
int Flip = MyRandom.getRandom().nextInt(2); int Flip = MyRandom.getRandom().nextInt(2);
@@ -1605,21 +1605,21 @@ public class GameAction {
// JOptionPane.showMessageDialog(null, q, "", // JOptionPane.showMessageDialog(null, q, "",
// JOptionPane.INFORMATION_MESSAGE); // JOptionPane.INFORMATION_MESSAGE);
if (q.equals(0)) { if (q.equals(0)) {
Human_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS); Human_Flip = ForgeProps.getLocalized(GameActionText.HEADS);
Computer_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS); Computer_Flip = ForgeProps.getLocalized(GameActionText.TAILS);
} else { } else {
Human_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.TAILS); Human_Flip = ForgeProps.getLocalized(GameActionText.TAILS);
Computer_Flip = ForgeProps.getLocalized(GAMEACTION_TEXT.HEADS); Computer_Flip = ForgeProps.getLocalized(GameActionText.HEADS);
} }
if ((Flip == 0 && q.equals(0)) || (Flip == 1 && q.equals(1))) { if ((Flip == 0 && q.equals(0)) || (Flip == 1 && q.equals(1))) {
JOptionPane.showMessageDialog(null, JOptionPane.showMessageDialog(null,
Human_Flip + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_WIN), "", Human_Flip + "\r\n" + ForgeProps.getLocalized(GameActionText.HUMAN_WIN), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} else { } else {
computerStartsGame(); computerStartsGame();
JOptionPane.showMessageDialog(null, JOptionPane.showMessageDialog(null,
Computer_Flip + "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_WIN), "", Computer_Flip + "\r\n" + ForgeProps.getLocalized(GameActionText.COMPUTER_WIN), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
} // seeWhoPlaysFirst_CoinToss() } // seeWhoPlaysFirst_CoinToss()
@@ -1652,8 +1652,8 @@ public class GameAction {
} else { } else {
computerStartsGame(); computerStartsGame();
JOptionPane JOptionPane
.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_MANA_COST) + "\r\n" .showMessageDialog(null, ForgeProps.getLocalized(GameActionText.HUMAN_MANA_COST) + "\r\n"
+ ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", + ForgeProps.getLocalized(GameActionText.COMPUTER_STARTS), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
@@ -1661,8 +1661,8 @@ public class GameAction {
if (CLibrary.size() > 0) { if (CLibrary.size() > 0) {
setComputerCut(CLibrary.get(MyRandom.getRandom().nextInt(CLibrary.size()))); setComputerCut(CLibrary.get(MyRandom.getRandom().nextInt(CLibrary.size())));
} else { } else {
JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_MANA_COST) JOptionPane.showMessageDialog(null, ForgeProps.getLocalized(GameActionText.COMPUTER_MANA_COST)
+ "\r\n" + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", + "\r\n" + ForgeProps.getLocalized(GameActionText.HUMAN_STARTS), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
@@ -1674,37 +1674,37 @@ public class GameAction {
AllZone.getGameAction().getComputerCut()); AllZone.getGameAction().getComputerCut());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_CUT) + getHumanCut().getName() + " (" sb.append(ForgeProps.getLocalized(GameActionText.HUMAN_CUT) + getHumanCut().getName() + " ("
+ getHumanCut().getManaCost() + ")" + "\r\n"); + getHumanCut().getManaCost() + ")" + "\r\n");
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_CUT) + getComputerCut().getName() + " (" sb.append(ForgeProps.getLocalized(GameActionText.COMPUTER_CUT) + getComputerCut().getName() + " ("
+ getComputerCut().getManaCost() + ")" + "\r\n"); + getComputerCut().getManaCost() + ")" + "\r\n");
sb.append("\r\n" + "Number of times the deck has been cut: " + Cut_Count + "\r\n"); sb.append("\r\n" + "Number of times the deck has been cut: " + Cut_Count + "\r\n");
if (CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) > CardUtil if (CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) > CardUtil
.getConvertedManaCost(getHumanCut().getManaCost())) { .getConvertedManaCost(getHumanCut().getManaCost())) {
computerStartsGame(); computerStartsGame();
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_STARTS), "", JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GameActionText.COMPUTER_STARTS), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
return; return;
} else if (CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) < CardUtil } else if (CardUtil.getConvertedManaCost(getComputerCut().getManaCost()) < CardUtil
.getConvertedManaCost(getHumanCut().getManaCost())) { .getConvertedManaCost(getHumanCut().getManaCost())) {
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_STARTS), "", JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GameActionText.HUMAN_STARTS), "",
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
return; return;
} else { } else {
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.EQUAL_CONVERTED_MANA) + "\r\n"); sb.append(ForgeProps.getLocalized(GameActionText.EQUAL_CONVERTED_MANA) + "\r\n");
if (i == Cut_CountMax - 1) { if (i == Cut_CountMax - 1) {
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.RESOLVE_STARTER)); sb.append(ForgeProps.getLocalized(GameActionText.RESOLVE_STARTER));
if (MyRandom.getRandom().nextInt(2) == 1) { if (MyRandom.getRandom().nextInt(2) == 1) {
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.HUMAN_WIN), JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GameActionText.HUMAN_WIN),
"", JOptionPane.INFORMATION_MESSAGE); "", JOptionPane.INFORMATION_MESSAGE);
} else { } else {
computerStartsGame(); computerStartsGame();
JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GAMEACTION_TEXT.COMPUTER_WIN), JOptionPane.showMessageDialog(null, sb + ForgeProps.getLocalized(GameActionText.COMPUTER_WIN),
"", JOptionPane.INFORMATION_MESSAGE); "", JOptionPane.INFORMATION_MESSAGE);
} }
return; return;
} else { } else {
sb.append(ForgeProps.getLocalized(GAMEACTION_TEXT.CUTTING_AGAIN)); sb.append(ForgeProps.getLocalized(GameActionText.CUTTING_AGAIN));
} }
JOptionPane.showMessageDialog(null, sb, "", JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, sb, "", JOptionPane.INFORMATION_MESSAGE);
} }

View File

@@ -102,8 +102,8 @@ import forge.properties.NewConstants;
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewConstants, NewConstants.GUI.GuiDisplay, public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewConstants, NewConstants.Gui.GuiDisplay,
NewConstants.LANG.GuiDisplay { NewConstants.Lang.GuiDisplay {
/** Constant <code>serialVersionUID=4519302185194841060L</code>. */ /** Constant <code>serialVersionUID=4519302185194841060L</code>. */
private static final long serialVersionUID = 4519302185194841060L; private static final long serialVersionUID = 4519302185194841060L;
@@ -216,7 +216,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
computerGraveyardAction, computerRemovedAction, new JSeparator(), playsoundCheckboxForMenu, computerGraveyardAction, computerRemovedAction, new JSeparator(), playsoundCheckboxForMenu,
new JSeparator(), ErrorViewer.ALL_THREADS_ACTION, concedeAction }; new JSeparator(), ErrorViewer.ALL_THREADS_ACTION, concedeAction };
JMenu gameMenu = new JMenu(ForgeProps.getLocalized(MENU_BAR.MENU.TITLE)); JMenu gameMenu = new JMenu(ForgeProps.getLocalized(MenuBar.Menu.TITLE));
for (Object o : obj) { for (Object o : obj) {
if (o instanceof ForgeAction) { if (o instanceof ForgeAction) {
gameMenu.add(((ForgeAction) o).setupButton(new JMenuItem())); gameMenu.add(((ForgeAction) o).setupButton(new JMenuItem()));
@@ -230,7 +230,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
} }
// Phase Menu Creation // Phase Menu Creation
JMenu gamePhases = new JMenu(ForgeProps.getLocalized(MENU_BAR.PHASE.TITLE)); JMenu gamePhases = new JMenu(ForgeProps.getLocalized(MenuBar.PHASE.TITLE));
JMenuItem aiLabel = new JMenuItem("Computer"); JMenuItem aiLabel = new JMenuItem("Computer");
JMenuItem humanLabel = new JMenuItem("Human"); JMenuItem humanLabel = new JMenuItem("Human");
@@ -244,18 +244,18 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
} }
// Dev Mode Creation // Dev Mode Creation
JMenu devMenu = new JMenu(ForgeProps.getLocalized(MENU_BAR.DEV.TITLE)); JMenu devMenu = new JMenu(ForgeProps.getLocalized(MenuBar.DEV.TITLE));
devMenu.setEnabled(Constant.Runtime.DEV_MODE[0]); devMenu.setEnabled(Constant.Runtime.DEV_MODE[0]);
if (Constant.Runtime.DEV_MODE[0]) { if (Constant.Runtime.DEV_MODE[0]) {
canLoseByDecking.setSelected(Constant.Runtime.MILL[0]); canLoseByDecking.setSelected(Constant.Runtime.MILL[0]);
Action viewAIHand = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Hand), COMPUTER_HAND.BASE); Action viewAIHand = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Hand), ComputerHand.BASE);
Action viewAILibrary = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Library), Action viewAILibrary = new ZoneAction(AllZone.getComputerPlayer().getZone(Zone.Library),
COMPUTER_LIBRARY.BASE); ComputerLibrary.BASE);
Action viewHumanLibrary Action viewHumanLibrary
= new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Library), HUMAN_LIBRARY.BASE); = new ZoneAction(AllZone.getHumanPlayer().getZone(Zone.Library), HumanLibrary.BASE);
ForgeAction generateMana = new ForgeAction(MANAGEN) { ForgeAction generateMana = new ForgeAction(MANAGEN) {
private static final long serialVersionUID = 7171104690016706405L; private static final long serialVersionUID = 7171104690016706405L;
@@ -860,7 +860,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
*/ */
private void initComponents() { private void initComponents() {
// Preparing the Frame // Preparing the Frame
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME)); setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME));
if (!Singletons.getModel().getPreferences().lafFonts) { if (!Singletons.getModel().getPreferences().lafFonts) {
setFont(new Font("Times New Roman", 0, 16)); setFont(new Font("Times New Roman", 0, 16));
} }
@@ -1185,7 +1185,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
// oppPCLabel.setHorizontalAlignment(SwingConstants.TOP); // oppPCLabel.setHorizontalAlignment(SwingConstants.TOP);
oppPCLabel.setForeground(greenColor); oppPCLabel.setForeground(greenColor);
JLabel oppHandLabel = new JLabel(ForgeProps.getLocalized(COMPUTER_HAND.BUTTON), SwingConstants.TRAILING); JLabel oppHandLabel = new JLabel(ForgeProps.getLocalized(ComputerHand.BUTTON), SwingConstants.TRAILING);
if (!Singletons.getModel().getPreferences().lafFonts) { if (!Singletons.getModel().getPreferences().lafFonts) {
oppHandLabel.setFont(statFont); oppHandLabel.setFont(statFont);
} }
@@ -1279,12 +1279,12 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
playerPCLabel.setForeground(greenColor); playerPCLabel.setForeground(greenColor);
JLabel playerLibraryLabel = new JLabel(ForgeProps.getLocalized(HUMAN_LIBRARY.BUTTON), SwingConstants.TRAILING); JLabel playerLibraryLabel = new JLabel(ForgeProps.getLocalized(HumanLibrary.BUTTON), SwingConstants.TRAILING);
if (!Singletons.getModel().getPreferences().lafFonts) { if (!Singletons.getModel().getPreferences().lafFonts) {
playerLibraryLabel.setFont(statFont); playerLibraryLabel.setFont(statFont);
} }
JLabel playerHandLabel = new JLabel(ForgeProps.getLocalized(HUMAN_HAND.TITLE), SwingConstants.TRAILING); JLabel playerHandLabel = new JLabel(ForgeProps.getLocalized(HumanHand.TITLE), SwingConstants.TRAILING);
if (!Singletons.getModel().getPreferences().lafFonts) { if (!Singletons.getModel().getPreferences().lafFonts) {
playerHandLabel.setFont(statFont); playerHandLabel.setFont(statFont);
} }
@@ -1565,7 +1565,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
private JLabel playerLifeLabel = new JLabel(); private JLabel playerLifeLabel = new JLabel();
private JLabel oppPCLabel = new JLabel(); private JLabel oppPCLabel = new JLabel();
private JLabel playerPCLabel = new JLabel(); private JLabel playerPCLabel = new JLabel();
private JLabel oppLibraryLabel = new JLabel(ForgeProps.getLocalized(COMPUTER_LIBRARY.BUTTON), private JLabel oppLibraryLabel = new JLabel(ForgeProps.getLocalized(ComputerLibrary.BUTTON),
SwingConstants.TRAILING); SwingConstants.TRAILING);
private JLabel oppHandValue = new JLabel(); private JLabel oppHandValue = new JLabel();
private JLabel oppLibraryValue = new JLabel(); private JLabel oppLibraryValue = new JLabel();
@@ -1723,7 +1723,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
public TriggerReactionMenu() { public TriggerReactionMenu() {
super(); super();
ForgeAction actAccept = new ForgeAction(LANG.GuiDisplay.TRIGGER.ALWAYSACCEPT) { ForgeAction actAccept = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSACCEPT) {
private static final long serialVersionUID = -3734674058185367612L; private static final long serialVersionUID = -3734674058185367612L;
@Override @Override
@@ -1732,7 +1732,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
} }
}; };
ForgeAction actDecline = new ForgeAction(LANG.GuiDisplay.TRIGGER.ALWAYSDECLINE) { ForgeAction actDecline = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSDECLINE) {
private static final long serialVersionUID = -1983295769159971502L; private static final long serialVersionUID = -1983295769159971502L;
@Override @Override
@@ -1741,7 +1741,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
} }
}; };
ForgeAction actAsk = new ForgeAction(LANG.GuiDisplay.TRIGGER.ALWAYSASK) { ForgeAction actAsk = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSASK) {
private static final long serialVersionUID = 5045255351332940821L; private static final long serialVersionUID = 5045255351332940821L;
@Override @Override

View File

@@ -40,14 +40,14 @@ public class GuiDownloadQuestImages extends GuiDownloader {
*/ */
protected final DownloadObject[] getNeededImages() { protected final DownloadObject[] getNeededImages() {
// read all card names and urls // read all card names and urls
DownloadObject[] questOpponents = readFile(QUEST.OPPONENT_ICONS, ForgeProps.getFile(QUEST.OPPONENT_DIR)); DownloadObject[] questOpponents = readFile(Quest.OPPONENT_ICONS, ForgeProps.getFile(Quest.OPPONENT_DIR));
DownloadObject[] boosterImages = readFile(PICS_BOOSTER_IMAGES, ForgeProps.getFile(PICS_BOOSTER)); DownloadObject[] boosterImages = readFile(PICS_BOOSTER_IMAGES, ForgeProps.getFile(PICS_BOOSTER));
DownloadObject[] petIcons = readFileWithNames(QUEST.PET_SHOP_ICONS, ForgeProps.getFile(IMAGE_ICON)); DownloadObject[] petIcons = readFileWithNames(Quest.PET_SHOP_ICONS, ForgeProps.getFile(IMAGE_ICON));
DownloadObject[] questPets = readFileWithNames(QUEST.PET_TOKEN_IMAGES, ForgeProps.getFile(IMAGE_TOKEN)); DownloadObject[] questPets = readFileWithNames(Quest.PET_TOKEN_IMAGES, ForgeProps.getFile(IMAGE_TOKEN));
ArrayList<DownloadObject> urls = new ArrayList<DownloadObject>(); ArrayList<DownloadObject> urls = new ArrayList<DownloadObject>();
File file; File file;
File dir = ForgeProps.getFile(QUEST.OPPONENT_DIR); File dir = ForgeProps.getFile(Quest.OPPONENT_DIR);
for (int i = 0; i < questOpponents.length; i++) { for (int i = 0; i < questOpponents.length; i++) {
file = new File(dir, questOpponents[i].getName().replace("%20", " ")); file = new File(dir, questOpponents[i].getName().replace("%20", " "));
if (!file.exists()) { if (!file.exists()) {

View File

@@ -54,7 +54,7 @@ import forge.properties.NewConstants;
* @author Forge * @author Forge
*/ */
public abstract class GuiDownloader extends DefaultBoundedRangeModel implements Runnable, NewConstants, public abstract class GuiDownloader extends DefaultBoundedRangeModel implements Runnable, NewConstants,
NewConstants.LANG.Gui_DownloadPictures { NewConstants.Lang.GuiDownloadPictures {
private static final long serialVersionUID = -8596808503046590349L; private static final long serialVersionUID = -8596808503046590349L;
@@ -171,7 +171,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements
p0.add(port); p0.add(port);
// Start // Start
final JButton b = new JButton(ForgeProps.getLocalized(BUTTONS.START)); final JButton b = new JButton(ForgeProps.getLocalized(Buttons.START));
b.addActionListener(new ActionListener() { b.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
@@ -194,7 +194,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements
bar.setPreferredSize(d); bar.setPreferredSize(d);
// JOptionPane // JOptionPane
close = new JButton(ForgeProps.getLocalized(BUTTONS.CANCEL)); close = new JButton(ForgeProps.getLocalized(Buttons.CANCEL));
Object[] options = { b, close }; Object[] options = { b, close };
dlg = new JOptionPane(p0, DEFAULT_OPTION, PLAIN_MESSAGE, null, options, options[1]); dlg = new JOptionPane(p0, DEFAULT_OPTION, PLAIN_MESSAGE, null, options, options[1]);
@@ -348,7 +348,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements
p = new Proxy(TYPES[type], new InetSocketAddress(addr.getText(), parseInt(port.getText()))); p = new Proxy(TYPES[type], new InetSocketAddress(addr.getText(), parseInt(port.getText())));
} catch (Exception ex) { } catch (Exception ex) {
ErrorViewer ErrorViewer
.showError(ex, ForgeProps.getLocalized(ERRORS.PROXY_CONNECT), addr.getText(), port.getText()); .showError(ex, ForgeProps.getLocalized(Errors.PROXY_CONNECT), addr.getText(), port.getText());
return; return;
} }
} }
@@ -417,7 +417,7 @@ public abstract class GuiDownloader extends DefaultBoundedRangeModel implements
} }
} // for } // for
} }
close.setText(ForgeProps.getLocalized(BUTTONS.CLOSE)); close.setText(ForgeProps.getLocalized(Buttons.CLOSE));
} // run } // run
/** /**

View File

@@ -21,8 +21,8 @@ import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG.Gui_DownloadPrices.DOWNLOADPRICES; import forge.properties.NewConstants.Lang.GuiDownloadPrices.DownloadPrices;
import forge.properties.NewConstants.QUEST; import forge.properties.NewConstants.Quest;
/** /**
* <p> * <p>
@@ -53,7 +53,7 @@ public class Gui_DownloadPrices extends JFrame {
private void initialize() { private void initialize() {
this.setSize(386, 200); this.setSize(386, 200);
setContentPane(getJContentPane()); setContentPane(getJContentPane());
setTitle(ForgeProps.getLocalized(DOWNLOADPRICES.TITLE)); setTitle(ForgeProps.getLocalized(DownloadPrices.TITLE));
} }
/** /**
@@ -78,7 +78,7 @@ public class Gui_DownloadPrices extends JFrame {
private JButton getJButton() { private JButton getJButton() {
if (jButton == null) { if (jButton == null) {
jButton = new JButton(); jButton = new JButton();
jButton.setText(ForgeProps.getLocalized(DOWNLOADPRICES.START_UPDATE)); jButton.setText(ForgeProps.getLocalized(DownloadPrices.START_UPDATE));
jButton.setLocation(new Point(120, 46)); jButton.setLocation(new Point(120, 46));
jButton.setSize(158, 89); jButton.setSize(158, 89);
@@ -102,7 +102,7 @@ public class Gui_DownloadPrices extends JFrame {
in = new BufferedInputStream(new URL(url).openConnection(p).getInputStream()); in = new BufferedInputStream(new URL(url).openConnection(p).getInputStream());
out = new BufferedOutputStream(new FileOutputStream(f)); out = new BufferedOutputStream(new FileOutputStream(f));
jButton.setText(ForgeProps.getLocalized(DOWNLOADPRICES.DOWNLOADING)); jButton.setText(ForgeProps.getLocalized(DownloadPrices.DOWNLOADING));
jContentPane.paintImmediately(jButton.getBounds()); jContentPane.paintImmediately(jButton.getBounds());
int len = 0; int len = 0;
@@ -151,7 +151,7 @@ public class Gui_DownloadPrices extends JFrame {
line = inBR.readLine(); line = inBR.readLine();
line = inBR.readLine(); line = inBR.readLine();
jButton.setText(ForgeProps.getLocalized(DOWNLOADPRICES.COMPILING)); jButton.setText(ForgeProps.getLocalized(DownloadPrices.COMPILING));
jContentPane.paintImmediately(jButton.getBounds()); jContentPane.paintImmediately(jButton.getBounds());
x = 0; x = 0;
@@ -211,12 +211,12 @@ public class Gui_DownloadPrices extends JFrame {
} }
} }
String pfn = ForgeProps.getFile(QUEST.PRICE).getAbsolutePath(); String pfn = ForgeProps.getFile(Quest.PRICE).getAbsolutePath();
String pfnb = pfn.replace(".txt", ".bak"); String pfnb = pfn.replace(".txt", ".bak");
File ff = new File(pfn); File ff = new File(pfn);
ff.renameTo(new File(pfnb)); ff.renameTo(new File(pfnb));
fw = new FileWriter(ForgeProps.getFile(QUEST.PRICE)); fw = new FileWriter(ForgeProps.getFile(Quest.PRICE));
BufferedWriter outBW = new BufferedWriter(fw); BufferedWriter outBW = new BufferedWriter(fw);
// Collection<String> keys = prices.keySet(); // Collection<String> keys = prices.keySet();

View File

@@ -37,7 +37,7 @@ import com.esotericsoftware.minlog.Log;
import forge.error.ErrorViewer; import forge.error.ErrorViewer;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants; import forge.properties.NewConstants;
import forge.properties.NewConstants.LANG.Gui_DownloadPictures; import forge.properties.NewConstants.Lang.GuiDownloadPictures;
//import java.io.BufferedReader; //import java.io.BufferedReader;
//import java.io.FileReader; //import java.io.FileReader;
@@ -53,7 +53,7 @@ import forge.properties.NewConstants.LANG.Gui_DownloadPictures;
* @version $Id$ * @version $Id$
*/ */
public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRangeModel implements Runnable, public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRangeModel implements Runnable,
NewConstants, NewConstants.LANG.Gui_DownloadPictures { NewConstants, NewConstants.Lang.GuiDownloadPictures {
/** Constant <code>serialVersionUID=-7890794857949935256L</code>. */ /** Constant <code>serialVersionUID=-7890794857949935256L</code>. */
private static final long serialVersionUID = -7890794857949935256L; private static final long serialVersionUID = -7890794857949935256L;
@@ -121,8 +121,8 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
*/ */
private Gui_MigrateLocalMWSSetPictures_HQ(final MCard[] c) { private Gui_MigrateLocalMWSSetPictures_HQ(final MCard[] c) {
this.cards = c; this.cards = c;
this.addr = new JTextField(ForgeProps.getLocalized(Gui_DownloadPictures.PROXY_ADDRESS)); this.addr = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_ADDRESS));
this.port = new JTextField(ForgeProps.getLocalized(Gui_DownloadPictures.PROXY_PORT)); this.port = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_PORT));
this.bar = new JProgressBar(this); this.bar = new JProgressBar(this);
final JPanel p0 = new JPanel(); final JPanel p0 = new JPanel();
@@ -130,9 +130,9 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
// Proxy Choice // Proxy Choice
final ButtonGroup bg = new ButtonGroup(); final ButtonGroup bg = new ButtonGroup();
final String[] labels = { ForgeProps.getLocalized(Gui_DownloadPictures.NO_PROXY), final String[] labels = { ForgeProps.getLocalized(GuiDownloadPictures.NO_PROXY),
ForgeProps.getLocalized(Gui_DownloadPictures.HTTP_PROXY), ForgeProps.getLocalized(GuiDownloadPictures.HTTP_PROXY),
ForgeProps.getLocalized(Gui_DownloadPictures.SOCKS_PROXY) }; ForgeProps.getLocalized(GuiDownloadPictures.SOCKS_PROXY) };
for (int i = 0; i < Gui_MigrateLocalMWSSetPictures_HQ.TYPES.length; i++) { for (int i = 0; i < Gui_MigrateLocalMWSSetPictures_HQ.TYPES.length; i++) {
final JRadioButton rb = new JRadioButton(labels[i]); final JRadioButton rb = new JRadioButton(labels[i]);
rb.addChangeListener(new ProxyHandler(i)); rb.addChangeListener(new ProxyHandler(i));
@@ -181,7 +181,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
this.bar.setPreferredSize(d); this.bar.setPreferredSize(d);
// JOptionPane // JOptionPane
this.close = new JButton(ForgeProps.getLocalized(BUTTONS.CANCEL)); this.close = new JButton(ForgeProps.getLocalized(Buttons.CANCEL));
final Object[] options = { b, this.close }; final Object[] options = { b, this.close };
this.dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION, this.dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION,
JOptionPane.PLAIN_MESSAGE, null, options, options[1]); JOptionPane.PLAIN_MESSAGE, null, options, options[1]);
@@ -274,7 +274,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
sb.append(String.format("0:%02d remaining.", t2Go / 1000)); sb.append(String.format("0:%02d remaining.", t2Go / 1000));
} }
} else { } else {
sb.append(String.format(ForgeProps.getLocalized(Gui_DownloadPictures.BAR_CLOSE), this.card, sb.append(String.format(ForgeProps.getLocalized(GuiDownloadPictures.BAR_CLOSE), this.card,
Gui_MigrateLocalMWSSetPictures_HQ.this.cards.length)); Gui_MigrateLocalMWSSetPictures_HQ.this.cards.length));
} }
@@ -298,7 +298,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
* @return a {@link javax.swing.JDialog} object. * @return a {@link javax.swing.JDialog} object.
*/ */
public JDialog getDlg(final JFrame frame) { public JDialog getDlg(final JFrame frame) {
final JDialog dlg = this.dlg.createDialog(frame, ForgeProps.getLocalized(Gui_DownloadPictures.TITLE)); final JDialog dlg = this.dlg.createDialog(frame, ForgeProps.getLocalized(GuiDownloadPictures.TITLE));
this.close.addActionListener(new ActionListener() { this.close.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
@@ -342,7 +342,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
p = new Proxy(Gui_MigrateLocalMWSSetPictures_HQ.TYPES[this.type], new InetSocketAddress( p = new Proxy(Gui_MigrateLocalMWSSetPictures_HQ.TYPES[this.type], new InetSocketAddress(
this.addr.getText(), Integer.parseInt(this.port.getText()))); this.addr.getText(), Integer.parseInt(this.port.getText())));
} catch (final Exception ex) { } catch (final Exception ex) {
ErrorViewer.showError(ex, ForgeProps.getLocalized(ERRORS.PROXY_CONNECT), this.addr.getText(), ErrorViewer.showError(ex, ForgeProps.getLocalized(Errors.PROXY_CONNECT), this.addr.getText(),
this.port.getText()); this.port.getText());
// throw new // throw new
// RuntimeException("Gui_DownloadPictures : error 1 - " +ex); // RuntimeException("Gui_DownloadPictures : error 1 - " +ex);
@@ -427,7 +427,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
} }
} // for } // for
} }
this.close.setText(ForgeProps.getLocalized(BUTTONS.CLOSE)); this.close.setText(ForgeProps.getLocalized(Buttons.CLOSE));
} // run } // run
/** /**
@@ -442,7 +442,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
final MCard[] card = Gui_MigrateLocalMWSSetPictures_HQ.getNeededCards(); final MCard[] card = Gui_MigrateLocalMWSSetPictures_HQ.getNeededCards();
if (card.length == 0) { if (card.length == 0) {
JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(Gui_DownloadPictures.NO_MORE)); JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(GuiDownloadPictures.NO_MORE));
return; return;
} }

View File

@@ -19,7 +19,7 @@ import forge.properties.NewConstants;
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class MenuItem_HowToPlay extends JMenuItem implements NewConstants.LANG.HowTo { public class MenuItem_HowToPlay extends JMenuItem implements NewConstants.Lang.HowTo {
/** Constant <code>serialVersionUID=5552000208438248428L</code>. */ /** Constant <code>serialVersionUID=5552000208438248428L</code>. */
private static final long serialVersionUID = 5552000208438248428L; private static final long serialVersionUID = 5552000208438248428L;

View File

@@ -169,9 +169,9 @@ public class BugzReporter extends JDialog {
this.txtUserName.setColumns(4); this.txtUserName.setColumns(4);
try { try {
this.prefs = new ForgePreferences("forge.preferences"); this.prefs = new ForgePreferences("forge.preferences");
if (!this.prefs.BugzName.equals("")) { if (!this.prefs.bugzName.equals("")) {
this.txtUserName.setText(this.prefs.BugzName); this.txtUserName.setText(this.prefs.bugzName);
this.txtPassword.setText(this.prefs.BugzPwd); this.txtPassword.setText(this.prefs.bugzPwd);
this.chkReportAnonymously.setSelected(false); this.chkReportAnonymously.setSelected(false);
} else { } else {
this.chkReportAnonymously.setSelected(true); this.chkReportAnonymously.setSelected(true);
@@ -189,9 +189,9 @@ public class BugzReporter extends JDialog {
BugzReporter.this.txtUserName.setText("ForgeGUI"); BugzReporter.this.txtUserName.setText("ForgeGUI");
BugzReporter.this.txtPassword.setText("vi2ccTbfBUu^"); BugzReporter.this.txtPassword.setText("vi2ccTbfBUu^");
} else { } else {
if (!BugzReporter.this.prefs.BugzName.equals("")) { if (!BugzReporter.this.prefs.bugzName.equals("")) {
BugzReporter.this.txtUserName.setText(BugzReporter.this.prefs.BugzName); BugzReporter.this.txtUserName.setText(BugzReporter.this.prefs.bugzName);
BugzReporter.this.txtPassword.setText(BugzReporter.this.prefs.BugzPwd); BugzReporter.this.txtPassword.setText(BugzReporter.this.prefs.bugzPwd);
} }
} }
} }
@@ -440,8 +440,8 @@ public class BugzReporter extends JDialog {
break Report; break Report;
} }
this.prefs.BugzName = this.txtUserName.getText(); this.prefs.bugzName = this.txtUserName.getText();
this.prefs.BugzPwd = String.valueOf(this.txtPassword.getPassword()); this.prefs.bugzPwd = String.valueOf(this.txtPassword.getPassword());
try { try {
this.prefs.save(); this.prefs.save();
} catch (final Exception e) { } catch (final Exception e) {

View File

@@ -34,7 +34,7 @@ import forge.properties.NewConstants;
* @author Clemens Koza * @author Clemens Koza
* @version V1.0 02.08.2009 * @version V1.0 02.08.2009
*/ */
public class ErrorViewer implements NewConstants, NewConstants.LANG.ErrorViewer { public class ErrorViewer implements NewConstants, NewConstants.Lang.ErrorViewer {
/** Constant <code>NAME_OS="os.name"</code>. */ /** Constant <code>NAME_OS="os.name"</code>. */
private static final String NAME_OS = "os.name"; private static final String NAME_OS = "os.name";
/** Constant <code>VERSION_OS="os.version"</code>. */ /** Constant <code>VERSION_OS="os.version"</code>. */

View File

@@ -35,7 +35,7 @@ import forge.item.ItemPool;
import forge.item.ItemPoolView; import forge.item.ItemPoolView;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants; import forge.properties.NewConstants;
import forge.properties.NewConstants.LANG.Gui_BoosterDraft; import forge.properties.NewConstants.Lang.GuiBoosterDraft;
import forge.view.swing.Gui_HomeScreen; import forge.view.swing.Gui_HomeScreen;
import forge.view.swing.OldGuiNewGame; import forge.view.swing.OldGuiNewGame;
@@ -47,7 +47,7 @@ import forge.view.swing.OldGuiNewGame;
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class DeckEditorDraft extends DeckEditorBase implements NewConstants, NewConstants.LANG.Gui_BoosterDraft { public class DeckEditorDraft extends DeckEditorBase implements NewConstants, NewConstants.Lang.GuiBoosterDraft {
/** /**
* Constant <code>serialVersionUID=-6055633915602448260L</code>. * Constant <code>serialVersionUID=-6055633915602448260L</code>.
*/ */
@@ -116,7 +116,7 @@ public class DeckEditorDraft extends DeckEditorBase implements NewConstants, New
@Override @Override
public void windowClosing(final WindowEvent ev) { public void windowClosing(final WindowEvent ev) {
final int n = JOptionPane.showConfirmDialog(null, final int n = JOptionPane.showConfirmDialog(null,
ForgeProps.getLocalized(Gui_BoosterDraft.CLOSE_MESSAGE), "", JOptionPane.YES_NO_OPTION); ForgeProps.getLocalized(GuiBoosterDraft.CLOSE_MESSAGE), "", JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) { if (n == JOptionPane.YES_OPTION) {
DeckEditorDraft.this.dispose(); DeckEditorDraft.this.dispose();
@@ -317,8 +317,8 @@ public class DeckEditorDraft extends DeckEditorBase implements NewConstants, New
private void saveDraft() { private void saveDraft() {
String s = ""; String s = "";
while ((s == null) || (s.length() == 0)) { while ((s == null) || (s.length() == 0)) {
s = JOptionPane.showInputDialog(null, ForgeProps.getLocalized(Gui_BoosterDraft.SAVE_DRAFT_MESSAGE), s = JOptionPane.showInputDialog(null, ForgeProps.getLocalized(GuiBoosterDraft.SAVE_DRAFT_MESSAGE),
ForgeProps.getLocalized(Gui_BoosterDraft.SAVE_DRAFT_TITLE), JOptionPane.QUESTION_MESSAGE); ForgeProps.getLocalized(GuiBoosterDraft.SAVE_DRAFT_TITLE), JOptionPane.QUESTION_MESSAGE);
} }
// TODO: check if overwriting the same name, and let the user delete old // TODO: check if overwriting the same name, and let the user delete old
// drafts // drafts

View File

@@ -57,7 +57,7 @@ public class BuildInfo {
* where to find the mock Forge jar * where to find the mock Forge jar
*/ */
public BuildInfo(final String pathToMockJarFile) { public BuildInfo(final String pathToMockJarFile) {
pathToForgeJar = pathToMockJarFile; this.pathToForgeJar = pathToMockJarFile;
} }
/** /**
@@ -71,7 +71,7 @@ public class BuildInfo {
String[] manifestResultArray; String[] manifestResultArray;
String result = "0000"; String result = "0000";
String version = getVersion(); final String version = this.getVersion();
manifestResultArray = version.split("r"); manifestResultArray = version.split("r");
manifestResult = manifestResultArray[manifestResultArray.length - 1]; manifestResult = manifestResultArray[manifestResultArray.length - 1];
@@ -119,14 +119,14 @@ public class BuildInfo {
InputStream manifestStream = null; InputStream manifestStream = null;
try { try {
if (pathToForgeJar == null) { if (this.pathToForgeJar == null) {
// We're definitely not unit testing. Try to load from the // We're definitely not unit testing. Try to load from the
// currently running jar. // currently running jar.
manifestStream = ClassLoader.getSystemResourceAsStream("META-INF/MANIFEST.MF"); manifestStream = ClassLoader.getSystemResourceAsStream("META-INF/MANIFEST.MF");
final Manifest manifest = new Manifest(manifestStream); final Manifest manifest = new Manifest(manifestStream);
result = getMainManifestAttribute(manifest, manifestAttrName); result = this.getMainManifestAttribute(manifest, manifestAttrName);
} }
/* /*
@@ -148,31 +148,33 @@ public class BuildInfo {
* System.getProperty("java.class.path")); } } } } * System.getProperty("java.class.path")); } } } }
*/ */
if (result == null && pathToForgeJar == null) { if ((result == null) && (this.pathToForgeJar == null)) {
throw new FileNotFoundException( throw new FileNotFoundException(
"There is nothing matching forge-*-with-dependencies.jar in the class path."); "There is nothing matching forge-*-with-dependencies.jar in the class path.");
} }
if (result == null) { if (result == null) {
jar = new JarFile(pathToForgeJar); jar = new JarFile(this.pathToForgeJar);
final Manifest manifest = jar.getManifest(); final Manifest manifest = jar.getManifest();
if (manifest == null) { if (manifest == null) {
throw new IOException("Forge jar at <<" + pathToForgeJar + ">> has no manifest."); throw new IOException("Forge jar at <<" + this.pathToForgeJar + ">> has no manifest.");
} }
result = getMainManifestAttribute(manifest, manifestAttrName); result = this.getMainManifestAttribute(manifest, manifestAttrName);
} }
} finally { } finally {
try { try {
manifestStream.close(); manifestStream.close();
} catch (Throwable ignored) { // NOPMD by Braids on 8/12/11 10:21 AM } catch (final Throwable ignored) { // NOPMD by Braids on 8/12/11
// 10:21 AM
// ignored // ignored
} }
try { try {
jar.close(); jar.close();
} catch (Throwable ignored) { // NOPMD by Braids on 8/12/11 10:21 AM } catch (final Throwable ignored) { // NOPMD by Braids on 8/12/11
// 10:21 AM
// ignored // ignored
} }
} }
@@ -203,7 +205,7 @@ public class BuildInfo {
* @return a user-friendly string describing the version and build ID * @return a user-friendly string describing the version and build ID
*/ */
public final String toPrettyString() { public final String toPrettyString() {
final String rawVersion = getVersion(); final String rawVersion = this.getVersion();
// final String rawBuildID = getBuildID(); // final String rawBuildID = getBuildID();
String version; String version;

View File

@@ -29,8 +29,8 @@ public class FGameState {
/** The Constant AI_PLAYER_NAME. */ /** The Constant AI_PLAYER_NAME. */
public static final String AI_PLAYER_NAME = "Computer"; public static final String AI_PLAYER_NAME = "Computer";
private Player humanPlayer = new HumanPlayer(HUMAN_PLAYER_NAME); private Player humanPlayer = new HumanPlayer(FGameState.HUMAN_PLAYER_NAME);
private Player computerPlayer = new AIPlayer(AI_PLAYER_NAME); private Player computerPlayer = new AIPlayer(FGameState.AI_PLAYER_NAME);
private EndOfTurn endOfTurn = new EndOfTurn(); private EndOfTurn endOfTurn = new EndOfTurn();
private EndOfCombat endOfCombat = new EndOfCombat(); private EndOfCombat endOfCombat = new EndOfCombat();
private Upkeep upkeep = new Upkeep(); private Upkeep upkeep = new Upkeep();
@@ -58,7 +58,7 @@ public class FGameState {
* @return the humanPlayer * @return the humanPlayer
*/ */
public final Player getHumanPlayer() { public final Player getHumanPlayer() {
return humanPlayer; return this.humanPlayer;
} }
/** /**
@@ -77,7 +77,7 @@ public class FGameState {
* @return the computerPlayer * @return the computerPlayer
*/ */
public final Player getComputerPlayer() { public final Player getComputerPlayer() {
return computerPlayer; return this.computerPlayer;
} }
/** /**
@@ -96,7 +96,7 @@ public class FGameState {
* @return the players * @return the players
*/ */
public final Player[] getPlayers() { public final Player[] getPlayers() {
return new Player[] {humanPlayer, computerPlayer}; return new Player[] { this.humanPlayer, this.computerPlayer };
} }
/** /**
@@ -105,7 +105,7 @@ public class FGameState {
* @return the endOfTurn * @return the endOfTurn
*/ */
public final EndOfTurn getEndOfTurn() { public final EndOfTurn getEndOfTurn() {
return endOfTurn; return this.endOfTurn;
} }
/** /**
@@ -124,7 +124,7 @@ public class FGameState {
* @return the endOfCombat * @return the endOfCombat
*/ */
public final EndOfCombat getEndOfCombat() { public final EndOfCombat getEndOfCombat() {
return endOfCombat; return this.endOfCombat;
} }
/** /**
@@ -143,7 +143,7 @@ public class FGameState {
* @return the upkeep * @return the upkeep
*/ */
public final Upkeep getUpkeep() { public final Upkeep getUpkeep() {
return upkeep; return this.upkeep;
} }
/** /**
@@ -162,7 +162,7 @@ public class FGameState {
* @return the phase * @return the phase
*/ */
public final Phase getPhase() { public final Phase getPhase() {
return phase; return this.phase;
} }
/** /**
@@ -181,7 +181,7 @@ public class FGameState {
* @return the stack * @return the stack
*/ */
public final MagicStack getStack() { public final MagicStack getStack() {
return stack; return this.stack;
} }
/** /**
@@ -200,7 +200,7 @@ public class FGameState {
* @return the gameAction * @return the gameAction
*/ */
public final GameAction getGameAction() { public final GameAction getGameAction() {
return gameAction; return this.gameAction;
} }
/** /**
@@ -219,7 +219,7 @@ public class FGameState {
* @return the staticEffects * @return the staticEffects
*/ */
public final StaticEffects getStaticEffects() { public final StaticEffects getStaticEffects() {
return staticEffects; return this.staticEffects;
} }
/** /**
@@ -238,7 +238,7 @@ public class FGameState {
* @return the triggerHandler * @return the triggerHandler
*/ */
public final TriggerHandler getTriggerHandler() { public final TriggerHandler getTriggerHandler() {
return triggerHandler; return this.triggerHandler;
} }
/** /**
@@ -257,7 +257,7 @@ public class FGameState {
* @return the combat * @return the combat
*/ */
public final Combat getCombat() { public final Combat getCombat() {
return combat; return this.combat;
} }
/** /**
@@ -276,7 +276,7 @@ public class FGameState {
* @return the stackZone * @return the stackZone
*/ */
public final PlayerZone getStackZone() { public final PlayerZone getStackZone() {
return stackZone; return this.stackZone;
} }
/** /**
@@ -295,8 +295,8 @@ public class FGameState {
* @return the next timestamp * @return the next timestamp
*/ */
public final long getNextTimestamp() { public final long getNextTimestamp() {
setTimestamp(getTimestamp() + 1); this.setTimestamp(this.getTimestamp() + 1);
return getTimestamp(); return this.getTimestamp();
} }
/** /**
@@ -305,7 +305,7 @@ public class FGameState {
* @return the timestamp * @return the timestamp
*/ */
public final long getTimestamp() { public final long getTimestamp() {
return timestamp; return this.timestamp;
} }
/** /**
@@ -324,29 +324,29 @@ public class FGameState {
* @return the game info * @return the game info
*/ */
public final GameSummary getGameInfo() { public final GameSummary getGameInfo() {
return gameInfo; return this.gameInfo;
} }
/** /**
* Call this each time you start a new game, ok?. * Call this each time you start a new game, ok?.
*/ */
public final void newGameCleanup() { public final void newGameCleanup() {
gameInfo = new GameSummary(humanPlayer.getName(), computerPlayer.getName()); this.gameInfo = new GameSummary(this.humanPlayer.getName(), this.computerPlayer.getName());
getHumanPlayer().reset(); this.getHumanPlayer().reset();
getComputerPlayer().reset(); this.getComputerPlayer().reset();
getPhase().reset(); this.getPhase().reset();
getStack().reset(); this.getStack().reset();
getCombat().reset(); this.getCombat().reset();
for (Player p : getPlayers()) { for (final Player p : this.getPlayers()) {
for (Zone z : Player.ALL_ZONES) { for (final Zone z : Player.ALL_ZONES) {
p.getZone(z).reset(); p.getZone(z).reset();
} }
} }
getStaticEffects().reset(); this.getStaticEffects().reset();
} }
} }

View File

@@ -31,7 +31,7 @@ public class FModel {
private BuildInfo buildInfo; private BuildInfo buildInfo;
/** The preferences. */ /** The preferences. */
public ForgePreferences preferences; private ForgePreferences preferences;
private FGameState gameState; private FGameState gameState;
/** /**
@@ -55,28 +55,28 @@ public class FModel {
final File logFile = new File("forge.log"); final File logFile = new File("forge.log");
final boolean deleteSucceeded = logFile.delete(); final boolean deleteSucceeded = logFile.delete();
if (logFile.exists() && !deleteSucceeded && logFile.length() != 0) { if (logFile.exists() && !deleteSucceeded && (logFile.length() != 0)) {
throw new IllegalStateException("Could not delete existing logFile:" + logFile.getAbsolutePath()); throw new IllegalStateException("Could not delete existing logFile:" + logFile.getAbsolutePath());
} }
logFileStream = new FileOutputStream(logFile); this.logFileStream = new FileOutputStream(logFile);
oldSystemOut = System.out; this.oldSystemOut = System.out;
System.setOut(new PrintStream(new MultiplexOutputStream(System.out, logFileStream), true)); System.setOut(new PrintStream(new MultiplexOutputStream(System.out, this.logFileStream), true));
oldSystemErr = System.err; this.oldSystemErr = System.err;
System.setErr(new PrintStream(new MultiplexOutputStream(System.err, logFileStream), true)); System.setErr(new PrintStream(new MultiplexOutputStream(System.err, this.logFileStream), true));
try { try {
setPreferences(new ForgePreferences("forge.preferences")); this.setPreferences(new ForgePreferences("forge.preferences"));
} catch (Exception exn) { } catch (final Exception exn) {
throw new RuntimeException(exn); // NOPMD by Braids on 8/13/11 8:21 throw new RuntimeException(exn); // NOPMD by Braids on 8/13/11 8:21
// PM // PM
} }
Constant.Runtime.MILL[0] = preferences.millingLossCondition; Constant.Runtime.MILL[0] = this.preferences.millingLossCondition;
Constant.Runtime.DEV_MODE[0] = preferences.developerMode; Constant.Runtime.DEV_MODE[0] = this.preferences.developerMode;
Constant.Runtime.UPLOAD_DRAFT[0] = preferences.uploadDraftAI; Constant.Runtime.UPLOAD_DRAFT[0] = this.preferences.uploadDraftAI;
Constant.Runtime.RANDOM_FOIL[0] = preferences.randCFoil; Constant.Runtime.RANDOM_FOIL[0] = this.preferences.randCFoil;
final HttpUtil pinger = new HttpUtil(); final HttpUtil pinger = new HttpUtil();
if (pinger.getURL("http://cardforge.org/draftAI/ping.php").equals("pong")) { if (pinger.getURL("http://cardforge.org/draftAI/ping.php").equals("pong")) {
@@ -85,7 +85,7 @@ public class FModel {
Constant.Runtime.UPLOAD_DRAFT[0] = false; Constant.Runtime.UPLOAD_DRAFT[0] = false;
} }
setBuildInfo(new BuildInfo()); this.setBuildInfo(new BuildInfo());
} }
/** /**
@@ -96,7 +96,7 @@ public class FModel {
*/ */
@Override @Override
protected final void finalize() throws Throwable { protected final void finalize() throws Throwable {
close(); this.close();
super.finalize(); super.finalize();
} }
@@ -105,11 +105,11 @@ public class FModel {
* file. * file.
*/ */
public final void close() { public final void close() {
System.setOut(oldSystemOut); System.setOut(this.oldSystemOut);
System.setErr(oldSystemErr); System.setErr(this.oldSystemErr);
try { try {
logFileStream.close(); this.logFileStream.close();
} catch (IOException e) { // NOPMD by Braids on 8/12/11 10:25 AM } catch (final IOException e) { // NOPMD by Braids on 8/12/11 10:25 AM
// ignored // ignored
} }
} }
@@ -120,7 +120,7 @@ public class FModel {
* @return the buildInfo * @return the buildInfo
*/ */
public final BuildInfo getBuildInfo() { public final BuildInfo getBuildInfo() {
return buildInfo; return this.buildInfo;
} }
/** /**
@@ -139,7 +139,7 @@ public class FModel {
* @return the preferences * @return the preferences
*/ */
public final ForgePreferences getPreferences() { public final ForgePreferences getPreferences() {
return preferences; return this.preferences;
} }
/** /**
@@ -158,7 +158,7 @@ public class FModel {
* @return the game state * @return the game state
*/ */
public final FGameState getGameState() { public final FGameState getGameState() {
return gameState; return this.gameState;
} }
/** /**
@@ -167,8 +167,8 @@ public class FModel {
* @return a fresh game state * @return a fresh game state
*/ */
public final FGameState resetGameState() { public final FGameState resetGameState() {
gameState = new FGameState(); this.gameState = new FGameState();
return gameState; return this.gameState;
} }
} }

View File

@@ -10,11 +10,11 @@ public class MultipleForgeJarsFoundError extends RuntimeException {
/** Automatically generated. */ /** Automatically generated. */
private static final long serialVersionUID = 8899307272033517172L; private static final long serialVersionUID = 8899307272033517172L;
/** /**
* Create an exception with a message. * Create an exception with a message.
* *
* @param message the message, which could be the System's class path. * @param message
* the message, which could be the System's class path.
*/ */
public MultipleForgeJarsFoundError(final String message) { public MultipleForgeJarsFoundError(final String message) {
super(message); super(message);

View File

@@ -67,10 +67,10 @@ public class ForgePreferences extends Preferences {
public boolean deckGenRmvSmall; public boolean deckGenRmvSmall;
/** The Bugz name. */ /** The Bugz name. */
public String BugzName; public String bugzName;
/** The Bugz pwd. */ /** The Bugz pwd. */
public String BugzPwd; public String bugzPwd;
// Phases // Phases
/** The b ai upkeep. */ /** The b ai upkeep. */
@@ -103,7 +103,7 @@ public class ForgePreferences extends Preferences {
/** The b human end combat. */ /** The b human end combat. */
public boolean bHumanEndCombat; public boolean bHumanEndCombat;
private List<SavePreferencesListener> saveListeners = new ArrayList<SavePreferencesListener>(); private final List<SavePreferencesListener> saveListeners = new ArrayList<SavePreferencesListener>();
private final String fileName; private final String fileName;
/** /**
@@ -118,56 +118,56 @@ public class ForgePreferences extends Preferences {
*/ */
public ForgePreferences(final String fileName) throws Exception { public ForgePreferences(final String fileName) throws Exception {
this.fileName = fileName; this.fileName = fileName;
File f = new File(fileName); final File f = new File(fileName);
if (!f.exists()) { if (!f.exists()) {
f.createNewFile(); f.createNewFile();
} }
try { try {
FileInputStream stream = new FileInputStream(fileName); final FileInputStream stream = new FileInputStream(fileName);
load(stream); this.load(stream);
stream.close(); stream.close();
} catch (FileNotFoundException ex) { } catch (final FileNotFoundException ex) {
throw new Exception("File not found: \"" + fileName + "\".", ex); throw new Exception("File not found: \"" + fileName + "\".", ex);
} catch (IOException ex) { } catch (final IOException ex) {
throw new Exception("Error reading \"" + fileName + "\".", ex); throw new Exception("Error reading \"" + fileName + "\".", ex);
} }
newGui = getBoolean("gui.new", true); this.newGui = this.getBoolean("gui.new", true);
stackAiLand = getBoolean("AI.stack.land", false); this.stackAiLand = this.getBoolean("AI.stack.land", false);
millingLossCondition = getBoolean("loss.condition.milling", true); this.millingLossCondition = this.getBoolean("loss.condition.milling", true);
developerMode = getBoolean("developer.mode", false); this.developerMode = this.getBoolean("developer.mode", false);
uploadDraftAI = getBoolean("upload.Draft.AI", true); this.uploadDraftAI = this.getBoolean("upload.Draft.AI", true);
randCFoil = getBoolean("rand.C.Foil", true); this.randCFoil = this.getBoolean("rand.C.Foil", true);
laf = get("gui.laf", ""); this.laf = this.get("gui.laf", "");
lafFonts = getBoolean("gui.laf.fonts", false); this.lafFonts = this.getBoolean("gui.laf.fonts", false);
skin = get("gui.skin", "default"); this.skin = this.get("gui.skin", "default");
cardOverlay = getBoolean("card.overlay", true); this.cardOverlay = this.getBoolean("card.overlay", true);
cardSize = CardSizeType.valueOf(get("card.images.size", "medium")); this.cardSize = CardSizeType.valueOf(this.get("card.images.size", "medium"));
stackOffset = StackOffsetType.valueOf(get("stack.offset", "tiny")); this.stackOffset = StackOffsetType.valueOf(this.get("stack.offset", "tiny"));
maxStackSize = getInt("stack.max.size", 3); this.maxStackSize = this.getInt("stack.max.size", 3);
scaleLargerThanOriginal = getBoolean("card.scale.larger.than.original", true); this.scaleLargerThanOriginal = this.getBoolean("card.scale.larger.than.original", true);
deckGenRmvArtifacts = getBoolean("deck.gen.rmv.artifacts", false); this.deckGenRmvArtifacts = this.getBoolean("deck.gen.rmv.artifacts", false);
deckGenRmvSmall = getBoolean("deck.gen.rmv.small", false); this.deckGenRmvSmall = this.getBoolean("deck.gen.rmv.small", false);
BugzName = get("bugz.user.name", ""); this.bugzName = this.get("bugz.user.name", "");
BugzPwd = get("bugz.user.pwd", ""); this.bugzPwd = this.get("bugz.user.pwd", "");
// Stop at Phases // Stop at Phases
bAIUpkeep = getBoolean("phase.ai.upkeep", true); this.bAIUpkeep = this.getBoolean("phase.ai.upkeep", true);
bAIDraw = getBoolean("phase.ai.draw", true); this.bAIDraw = this.getBoolean("phase.ai.draw", true);
bAIEOT = getBoolean("phase.ai.eot", true); this.bAIEOT = this.getBoolean("phase.ai.eot", true);
bAIBeginCombat = getBoolean("phase.ai.beginCombat", true); this.bAIBeginCombat = this.getBoolean("phase.ai.beginCombat", true);
bAIEndCombat = getBoolean("phase.ai.endCombat", true); this.bAIEndCombat = this.getBoolean("phase.ai.endCombat", true);
bHumanUpkeep = getBoolean("phase.human.upkeep", true); this.bHumanUpkeep = this.getBoolean("phase.human.upkeep", true);
bHumanDraw = getBoolean("phase.human.draw", true); this.bHumanDraw = this.getBoolean("phase.human.draw", true);
bHumanEOT = getBoolean("phase.human.eot", true); this.bHumanEOT = this.getBoolean("phase.human.eot", true);
bHumanBeginCombat = getBoolean("phase.human.beginCombat", true); this.bHumanBeginCombat = this.getBoolean("phase.human.beginCombat", true);
bHumanEndCombat = getBoolean("phase.human.endCombat", true); this.bHumanEndCombat = this.getBoolean("phase.human.endCombat", true);
} }
/** /**
@@ -180,51 +180,51 @@ public class ForgePreferences extends Preferences {
*/ */
public final void save() throws Exception { public final void save() throws Exception {
set("gui.new", newGui); this.set("gui.new", this.newGui);
set("AI.stack.land", stackAiLand); this.set("AI.stack.land", this.stackAiLand);
set("loss.condition.milling", millingLossCondition); this.set("loss.condition.milling", this.millingLossCondition);
set("developer.mode", developerMode); this.set("developer.mode", this.developerMode);
set("upload.Draft.AI", uploadDraftAI); this.set("upload.Draft.AI", this.uploadDraftAI);
set("rand.C.Foil", randCFoil); this.set("rand.C.Foil", this.randCFoil);
set("gui.skin", skin); this.set("gui.skin", this.skin);
set("gui.laf", laf); this.set("gui.laf", this.laf);
set("gui.laf.fonts", lafFonts); this.set("gui.laf.fonts", this.lafFonts);
set("card.overlay", cardOverlay); this.set("card.overlay", this.cardOverlay);
set("card.images.size", cardSize); this.set("card.images.size", this.cardSize);
set("stack.offset", stackOffset); this.set("stack.offset", this.stackOffset);
set("stack.max.size", maxStackSize); this.set("stack.max.size", this.maxStackSize);
set("card.scale.larger.than.original", scaleLargerThanOriginal); this.set("card.scale.larger.than.original", this.scaleLargerThanOriginal);
for (SavePreferencesListener listeners : saveListeners) { for (final SavePreferencesListener listeners : this.saveListeners) {
listeners.savePreferences(); listeners.savePreferences();
} }
set("deck.gen.rmv.artifacts", deckGenRmvArtifacts); this.set("deck.gen.rmv.artifacts", this.deckGenRmvArtifacts);
set("deck.gen.rmv.small", deckGenRmvSmall); this.set("deck.gen.rmv.small", this.deckGenRmvSmall);
set("bugz.user.name", BugzName); this.set("bugz.user.name", this.bugzName);
set("bugz.user.pwd", BugzPwd); this.set("bugz.user.pwd", this.bugzPwd);
set("phase.ai.upkeep", bAIUpkeep); this.set("phase.ai.upkeep", this.bAIUpkeep);
set("phase.ai.draw", bAIDraw); this.set("phase.ai.draw", this.bAIDraw);
set("phase.ai.eot", bAIEOT); this.set("phase.ai.eot", this.bAIEOT);
set("phase.ai.beginCombat", bAIBeginCombat); this.set("phase.ai.beginCombat", this.bAIBeginCombat);
set("phase.ai.endCombat", bAIEndCombat); this.set("phase.ai.endCombat", this.bAIEndCombat);
set("phase.human.upkeep", bHumanUpkeep); this.set("phase.human.upkeep", this.bHumanUpkeep);
set("phase.human.draw", bHumanDraw); this.set("phase.human.draw", this.bHumanDraw);
set("phase.human.eot", bHumanEOT); this.set("phase.human.eot", this.bHumanEOT);
set("phase.human.beginCombat", bHumanBeginCombat); this.set("phase.human.beginCombat", this.bHumanBeginCombat);
set("phase.human.endCombat", bHumanEndCombat); this.set("phase.human.endCombat", this.bHumanEndCombat);
try { try {
FileOutputStream stream = new FileOutputStream(fileName); final FileOutputStream stream = new FileOutputStream(this.fileName);
store(stream, "Forge"); this.store(stream, "Forge");
stream.close(); stream.close();
} catch (IOException ex) { } catch (final IOException ex) {
throw new Exception("Error saving \"" + fileName + "\".", ex); throw new Exception("Error saving \"" + this.fileName + "\".", ex);
} }
} }
@@ -237,7 +237,7 @@ public class ForgePreferences extends Preferences {
* a {@link forge.properties.SavePreferencesListener} object. * a {@link forge.properties.SavePreferencesListener} object.
*/ */
public final void addSaveListener(final SavePreferencesListener listener) { public final void addSaveListener(final SavePreferencesListener listener) {
saveListeners.add(listener); this.saveListeners.add(listener);
} }
/** /**
@@ -262,7 +262,7 @@ public class ForgePreferences extends Preferences {
/** /**
* The Enum StackOffsetType. * The Enum StackOffsetType.
*/ */
static public enum StackOffsetType { public static enum StackOffsetType {
/** The tiny. */ /** The tiny. */
tiny, tiny,

View File

@@ -6,8 +6,6 @@ package forge.properties;
* Created on 30.08.2009 * Created on 30.08.2009
*/ */
import static java.lang.String.format;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Locale; import java.util.Locale;
@@ -24,54 +22,57 @@ import forge.error.ErrorViewer;
*/ */
public class ForgeProps { public class ForgeProps {
/** Constant <code>properties</code>. */ /** Constant <code>properties</code>. */
private static final TreeProperties properties; private static final TreeProperties PROPERTIES;
static { static {
TreeProperties p; TreeProperties p;
try { try {
p = new TreeProperties("forge.properties"); p = new TreeProperties("forge.properties");
p.rethrow(); p.rethrow();
} catch (IOException ex) { } catch (final IOException ex) {
ErrorViewer.showError(ex); ErrorViewer.showError(ex);
p = null; p = null;
} }
properties = p; PROPERTIES = p;
} }
/** /**
* Returns the tree properties of forge. * Returns the tree properties of forge.
* *
* @return a {@link tree.properties.TreeProperties} object. * @return a {@link tree.properties.TreeProperties} object.
*/ */
public static TreeProperties getProperties() { public static TreeProperties getProperties() {
return properties; return ForgeProps.PROPERTIES;
} }
/** /**
* Returns the string property value, or null if there's no such property. * Returns the string property value, or null if there's no such property.
* *
* @param key a {@link java.lang.String} object. * @param key
* a {@link java.lang.String} object.
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public static String getProperty(final String key) { public static String getProperty(final String key) {
return getProperty(key, null); return ForgeProps.getProperty(key, null);
} }
/** /**
* Returns the string property value, or def if there's no such property. * Returns the string property value, or def if there's no such property.
* *
* @param key a {@link java.lang.String} object. * @param key
* @param def a {@link java.lang.String} object. * a {@link java.lang.String} object.
* @param def
* a {@link java.lang.String} object.
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public static String getProperty(final String key, final String def) { public static String getProperty(final String key, final String def) {
String result; String result;
try { try {
result = getProperties().getProperty(key); result = ForgeProps.getProperties().getProperty(key);
if (result == null) { if (result == null) {
result = def; result = def;
} }
} catch (Exception ex) { } catch (final Exception ex) {
result = def; result = def;
} }
return result; return result;
@@ -79,29 +80,32 @@ public class ForgeProps {
/** /**
* Returns the File property value, or null if there's no such property. * Returns the File property value, or null if there's no such property.
* *
* @param key a {@link java.lang.String} object. * @param key
* a {@link java.lang.String} object.
* @return a {@link java.io.File} object. * @return a {@link java.io.File} object.
*/ */
public static File getFile(final String key) { public static File getFile(final String key) {
return getFile(key, null); return ForgeProps.getFile(key, null);
} }
/** /**
* Returns the File property value, or def if there's no such property. * Returns the File property value, or def if there's no such property.
* *
* @param key a {@link java.lang.String} object. * @param key
* @param def a {@link java.io.File} object. * a {@link java.lang.String} object.
* @param def
* a {@link java.io.File} object.
* @return a {@link java.io.File} object. * @return a {@link java.io.File} object.
*/ */
public static File getFile(final String key, final File def) { public static File getFile(final String key, final File def) {
File result; File result;
try { try {
result = getProperties().getFile(key); result = ForgeProps.getProperties().getFile(key);
if (result == null) { if (result == null) {
result = def; result = def;
} }
} catch (Exception ex) { } catch (final Exception ex) {
result = def; result = def;
} }
return result; return result;
@@ -119,7 +123,7 @@ public class ForgeProps {
* @return a {@link java.lang.String} object. * @return a {@link java.lang.String} object.
*/ */
public static String getLocalized(final String key) { public static String getLocalized(final String key) {
return getLocalized(key, null); return ForgeProps.getLocalized(key, null);
} }
/** /**
@@ -140,15 +144,16 @@ public class ForgeProps {
// the list of languages to look for, in the order to be used // the list of languages to look for, in the order to be used
// the first is the configured language // the first is the configured language
// the second is the default locale's language code // the second is the default locale's language code
String[] languages = {getProperty(NewConstants.LANG.LANGUAGE), Locale.getDefault().getLanguage(), "en"}; final String[] languages = { ForgeProps.getProperty(NewConstants.Lang.LANGUAGE),
Locale.getDefault().getLanguage(), "en" };
try { try {
for (String lang : languages) { for (final String lang : languages) {
// could be if a property does not exist // could be if a property does not exist
// just skip it, and try the next // just skip it, and try the next
if (lang == null) { if (lang == null) {
continue; continue;
} }
String result = getProperty(format(key, lang)); final String result = ForgeProps.getProperty(String.format(key, lang));
if (result != null) { if (result != null) {
return result; return result;
} }
@@ -156,7 +161,7 @@ public class ForgeProps {
// exceptions are skipped here; also the error viewer uses this, and // exceptions are skipped here; also the error viewer uses this, and
// reporting exceptions may result // reporting exceptions may result
// in a more fatal error (stack overflow) // in a more fatal error (stack overflow)
} catch (Exception ex) { } catch (final Exception ex) {
} }
// if no property was found, or an error occurred, return the default // if no property was found, or an error occurred, return the default
// value // value

View File

@@ -125,7 +125,7 @@ public interface NewConstants {
/** /**
* These properties are for a regular game. * These properties are for a regular game.
*/ */
public static interface REGULAR { public interface Regular {
/** Property path for a common card. */ /** Property path for a common card. */
String COMMON = "regular/common"; String COMMON = "regular/common";
/** Property path for an uncommon card. */ /** Property path for an uncommon card. */
@@ -137,7 +137,7 @@ public interface NewConstants {
/** /**
* These properties are for a booster draft. * These properties are for a booster draft.
*/ */
public static interface DRAFT { public interface Draft {
/** Property path for a common card. */ /** Property path for a common card. */
String COMMON = "draft/common"; String COMMON = "draft/common";
/** Property path for an uncommon card. */ /** Property path for an uncommon card. */
@@ -149,7 +149,7 @@ public interface NewConstants {
/** /**
* These properties are for a quest game. * These properties are for a quest game.
*/ */
public static interface QUEST { public interface Quest {
/** Property path for a common card. */ /** Property path for a common card. */
String COMMON = "quest/common"; String COMMON = "quest/common";
/** Property path for an uncommon card. */ /** Property path for an uncommon card. */
@@ -191,12 +191,12 @@ public interface NewConstants {
/** /**
* These are GUI-related properties. * These are GUI-related properties.
*/ */
public static interface GUI { public interface Gui {
/** /**
* The Interface GuiDisplay. * The Interface GuiDisplay.
*/ */
public static interface GuiDisplay { public interface GuiDisplay {
/** The LAYOUT. */ /** The LAYOUT. */
String LAYOUT = "gui/Display"; String LAYOUT = "gui/Display";
@@ -208,7 +208,7 @@ public interface NewConstants {
/** /**
* The Interface GuiDeckEditor. * The Interface GuiDeckEditor.
*/ */
public static interface GuiDeckEditor { public interface GuiDeckEditor {
/** The LAYOUT. */ /** The LAYOUT. */
String LAYOUT = "gui/DeckEditor"; String LAYOUT = "gui/DeckEditor";
@@ -219,7 +219,7 @@ public interface NewConstants {
/** /**
* These are localization properties. * These are localization properties.
*/ */
public static interface LANG { public interface Lang {
/** The PROGRA m_ name. */ /** The PROGRA m_ name. */
String PROGRAM_NAME = "%s/program/name"; String PROGRAM_NAME = "%s/program/name";
@@ -230,7 +230,7 @@ public interface NewConstants {
/** /**
* The Interface HowTo. * The Interface HowTo.
*/ */
public static interface HowTo { public interface HowTo {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/HowTo/title"; String TITLE = "%s/HowTo/title";
@@ -242,7 +242,7 @@ public interface NewConstants {
/** /**
* The Interface ErrorViewer. * The Interface ErrorViewer.
*/ */
public static interface ErrorViewer { public interface ErrorViewer {
/** The SHO w_ error. */ /** The SHO w_ error. */
String SHOW_ERROR = "%s/ErrorViewer/show"; String SHOW_ERROR = "%s/ErrorViewer/show";
@@ -265,7 +265,7 @@ public interface NewConstants {
/** /**
* The Interface ERRORS. * The Interface ERRORS.
*/ */
public static interface ERRORS { public interface ERRORS {
/** The SAV e_ message. */ /** The SAV e_ message. */
String SAVE_MESSAGE = "%s/ErrorViewer/errors/save/message"; String SAVE_MESSAGE = "%s/ErrorViewer/errors/save/message";
@@ -278,7 +278,7 @@ public interface NewConstants {
/** /**
* The Interface Gui_BoosterDraft. * The Interface Gui_BoosterDraft.
*/ */
public static interface Gui_BoosterDraft { public interface GuiBoosterDraft {
/** The CLOS e_ message. */ /** The CLOS e_ message. */
String CLOSE_MESSAGE = "%s/BoosterDraft/close/message"; String CLOSE_MESSAGE = "%s/BoosterDraft/close/message";
@@ -305,17 +305,17 @@ public interface NewConstants {
/** /**
* The Interface GuiDisplay. * The Interface GuiDisplay.
*/ */
public static interface GuiDisplay { public interface GuiDisplay {
/** /**
* The Interface MENU_BAR. * The Interface MENU_BAR.
*/ */
public static interface MENU_BAR { public interface MenuBar {
/** /**
* The Interface MENU. * The Interface MENU.
*/ */
public static interface MENU { public interface Menu {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/menu/title"; String TITLE = "%s/Display/menu/title";
@@ -324,7 +324,7 @@ public interface NewConstants {
/** /**
* The Interface PHASE. * The Interface PHASE.
*/ */
public static interface PHASE { public interface PHASE {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/phase/title"; String TITLE = "%s/Display/phase/title";
@@ -333,7 +333,7 @@ public interface NewConstants {
/** /**
* The Interface DEV. * The Interface DEV.
*/ */
public static interface DEV { public interface DEV {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/dev/title"; String TITLE = "%s/Display/dev/title";
@@ -349,7 +349,7 @@ public interface NewConstants {
/** /**
* The Interface HUMAN_HAND. * The Interface HUMAN_HAND.
*/ */
public static interface HUMAN_HAND { public interface HumanHand {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/human/hand/title"; String TITLE = "%s/Display/human/hand/title";
@@ -358,7 +358,7 @@ public interface NewConstants {
/** /**
* The Interface HUMAN_LIBRARY. * The Interface HUMAN_LIBRARY.
*/ */
public static interface HUMAN_LIBRARY { public interface HumanLibrary {
/** The BASE. */ /** The BASE. */
String BASE = "%s/Display/human/library"; String BASE = "%s/Display/human/library";
@@ -379,7 +379,7 @@ public interface NewConstants {
/** /**
* The Interface HUMAN_GRAVEYARD. * The Interface HUMAN_GRAVEYARD.
*/ */
public static interface HUMAN_GRAVEYARD { public interface HumanGraveyard {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/human/graveyard/title"; String TITLE = "%s/Display/human/graveyard/title";
@@ -397,7 +397,7 @@ public interface NewConstants {
/** /**
* The Interface HUMAN_REMOVED. * The Interface HUMAN_REMOVED.
*/ */
public static interface HUMAN_REMOVED { public interface HumanRemoved {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/human/removed/title"; String TITLE = "%s/Display/human/removed/title";
@@ -418,7 +418,7 @@ public interface NewConstants {
/** /**
* The Interface HUMAN_FLASHBACK. * The Interface HUMAN_FLASHBACK.
*/ */
public static interface HUMAN_FLASHBACK { public interface HumanFlashback {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/human/flashback/title"; String TITLE = "%s/Display/human/flashback/title";
@@ -436,7 +436,7 @@ public interface NewConstants {
/** /**
* The Interface COMPUTER_HAND. * The Interface COMPUTER_HAND.
*/ */
public static interface COMPUTER_HAND { public interface ComputerHand {
/** The BASE. */ /** The BASE. */
String BASE = "%s/Display/computer/hand"; String BASE = "%s/Display/computer/hand";
@@ -454,7 +454,7 @@ public interface NewConstants {
/** /**
* The Interface COMPUTER_LIBRARY. * The Interface COMPUTER_LIBRARY.
*/ */
public static interface COMPUTER_LIBRARY { public interface ComputerLibrary {
/** The BASE. */ /** The BASE. */
String BASE = "%s/Display/computer/library"; String BASE = "%s/Display/computer/library";
@@ -475,7 +475,7 @@ public interface NewConstants {
/** /**
* The Interface COMPUTER_GRAVEYARD. * The Interface COMPUTER_GRAVEYARD.
*/ */
public static interface COMPUTER_GRAVEYARD { public interface ComputerGraveyard {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/computer/graveyard/title"; String TITLE = "%s/Display/computer/graveyard/title";
@@ -493,7 +493,7 @@ public interface NewConstants {
/** /**
* The Interface COMPUTER_REMOVED. * The Interface COMPUTER_REMOVED.
*/ */
public static interface COMPUTER_REMOVED { public interface ComputerRemoved {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/Display/computer/removed/title"; String TITLE = "%s/Display/computer/removed/title";
@@ -511,7 +511,7 @@ public interface NewConstants {
/** /**
* The Interface CONCEDE. * The Interface CONCEDE.
*/ */
public static interface CONCEDE { public interface Concede {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/concede/button"; String BUTTON = "%s/Display/concede/button";
@@ -526,7 +526,7 @@ public interface NewConstants {
/** /**
* The Interface MANAGEN. * The Interface MANAGEN.
*/ */
public static interface MANAGEN { public interface Managen {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/managen/button"; String BUTTON = "%s/Display/managen/button";
@@ -541,7 +541,7 @@ public interface NewConstants {
/** /**
* The Interface SETUPBATTLEFIELD. * The Interface SETUPBATTLEFIELD.
*/ */
public static interface SETUPBATTLEFIELD { public interface SetupBattlefield {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/setupbattlefield/button"; String BUTTON = "%s/Display/setupbattlefield/button";
@@ -556,7 +556,7 @@ public interface NewConstants {
/** /**
* The Interface TUTOR. * The Interface TUTOR.
*/ */
public static interface TUTOR { public interface Tutor {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/tutor/button"; String BUTTON = "%s/Display/tutor/button";
@@ -571,7 +571,7 @@ public interface NewConstants {
/** /**
* The Interface ADDCOUNTER. * The Interface ADDCOUNTER.
*/ */
public static interface ADDCOUNTER { public interface AddCounter {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/addcounter/button"; String BUTTON = "%s/Display/addcounter/button";
@@ -586,7 +586,7 @@ public interface NewConstants {
/** /**
* The Interface TAPPERM. * The Interface TAPPERM.
*/ */
public static interface TAPPERM { public interface Tapperm {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/tapperm/button"; String BUTTON = "%s/Display/tapperm/button";
@@ -601,7 +601,7 @@ public interface NewConstants {
/** /**
* The Interface UNTAPPERM. * The Interface UNTAPPERM.
*/ */
public static interface UNTAPPERM { public interface Untapperm {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/untapperm/button"; String BUTTON = "%s/Display/untapperm/button";
@@ -616,7 +616,7 @@ public interface NewConstants {
/** /**
* The Interface NOLANDLIMIT. * The Interface NOLANDLIMIT.
*/ */
public static interface NOLANDLIMIT { public interface NoLandLimit {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/nolandlimit/button"; String BUTTON = "%s/Display/nolandlimit/button";
@@ -631,7 +631,7 @@ public interface NewConstants {
/** /**
* The Interface SETLIFE. * The Interface SETLIFE.
*/ */
public static interface SETLIFE { public interface SetLife {
/** The BUTTON. */ /** The BUTTON. */
String BUTTON = "%s/Display/setlife/button"; String BUTTON = "%s/Display/setlife/button";
@@ -643,7 +643,7 @@ public interface NewConstants {
/** /**
* The Interface TRIGGER. * The Interface TRIGGER.
*/ */
public static interface TRIGGER { public interface Trigger {
/** The ALWAYSACCEPT. */ /** The ALWAYSACCEPT. */
String ALWAYSACCEPT = "%s/Display/alwaysaccept"; String ALWAYSACCEPT = "%s/Display/alwaysaccept";
@@ -659,7 +659,7 @@ public interface NewConstants {
/** /**
* The Interface Gui_DownloadPictures. * The Interface Gui_DownloadPictures.
*/ */
public static interface Gui_DownloadPictures { public interface GuiDownloadPictures {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/DownloadPictures/title"; String TITLE = "%s/DownloadPictures/title";
@@ -694,7 +694,7 @@ public interface NewConstants {
/** /**
* The Interface BUTTONS. * The Interface BUTTONS.
*/ */
public static interface BUTTONS { public interface Buttons {
/** The START. */ /** The START. */
String START = "%s/DownloadPictures/button/start"; String START = "%s/DownloadPictures/button/start";
@@ -709,7 +709,7 @@ public interface NewConstants {
/** /**
* The Interface ERRORS. * The Interface ERRORS.
*/ */
public static interface ERRORS { public interface Errors {
/** The PROX y_ connect. */ /** The PROX y_ connect. */
String PROXY_CONNECT = "%s/DownloadPictures/errors/proxy/connect"; String PROXY_CONNECT = "%s/DownloadPictures/errors/proxy/connect";
@@ -722,12 +722,12 @@ public interface NewConstants {
/** /**
* The Interface OldGuiNewGame. * The Interface OldGuiNewGame.
*/ */
public static interface OldGuiNewGame { public interface OldGuiNewGame {
/** /**
* The Interface NEW_GAME_TEXT. * The Interface NEW_GAME_TEXT.
*/ */
public static interface NEW_GAME_TEXT { public interface NewGameText {
/** The GAMETYPE. */ /** The GAMETYPE. */
String GAMETYPE = "%s/NewGame/gametype"; String GAMETYPE = "%s/NewGame/gametype";
@@ -785,12 +785,12 @@ public interface NewConstants {
/** /**
* The Interface MENU_BAR. * The Interface MENU_BAR.
*/ */
public static interface MENU_BAR { public interface MenuBar {
/** /**
* The Interface MENU. * The Interface MENU.
*/ */
public static interface MENU { public interface Menu {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/NewGame/menu/title"; String TITLE = "%s/NewGame/menu/title";
@@ -835,7 +835,7 @@ public interface NewConstants {
/** /**
* The Interface OPTIONS. * The Interface OPTIONS.
*/ */
public static interface OPTIONS { public interface Options {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/NewGame/options/title"; String TITLE = "%s/NewGame/options/title";
@@ -852,7 +852,7 @@ public interface NewConstants {
/** /**
* The Interface GENERATE. * The Interface GENERATE.
*/ */
public static interface GENERATE { public interface Generate {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/NewGame/options/generate/title"; String TITLE = "%s/NewGame/options/generate/title";
@@ -868,7 +868,7 @@ public interface NewConstants {
/** /**
* The Interface HELP. * The Interface HELP.
*/ */
public static interface HELP { public interface Help {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/NewGame/help/title"; String TITLE = "%s/NewGame/help/title";
@@ -879,19 +879,19 @@ public interface NewConstants {
/** /**
* The Interface ERRORS. * The Interface ERRORS.
*/ */
public static interface ERRORS { public interface Errors {
} }
} }
/** /**
* The Interface WinLoseFrame. * The Interface WinLoseFrame.
*/ */
public static interface WinLoseFrame { public interface WinLoseFrame {
/** /**
* The Interface WINLOSETEXT. * The Interface WINLOSETEXT.
*/ */
public static interface WINLOSETEXT { public interface WinLoseText {
/** The WON. */ /** The WON. */
String WON = "%s/WinLose/won"; String WON = "%s/WinLose/won";
@@ -922,12 +922,12 @@ public interface NewConstants {
/** /**
* The Interface Gui_WinLose. * The Interface Gui_WinLose.
*/ */
public static interface Gui_WinLose { public interface GuiWinLose {
/** /**
* The Interface WINLOSE_TEXT. * The Interface WINLOSE_TEXT.
*/ */
public static interface WINLOSE_TEXT { public interface WinLoseText {
/** The WON. */ /** The WON. */
String WON = "%s/WinLose/won"; String WON = "%s/WinLose/won";
@@ -955,12 +955,12 @@ public interface NewConstants {
/** /**
* The Interface Gui_DownloadPrices. * The Interface Gui_DownloadPrices.
*/ */
public static interface Gui_DownloadPrices { public interface GuiDownloadPrices {
/** /**
* The Interface DOWNLOADPRICES. * The Interface DOWNLOADPRICES.
*/ */
public static interface DOWNLOADPRICES { public interface DownloadPrices {
/** The TITLE. */ /** The TITLE. */
String TITLE = "%s/DownloadPrices/title"; String TITLE = "%s/DownloadPrices/title";
@@ -979,12 +979,12 @@ public interface NewConstants {
/** /**
* The Interface GameAction. * The Interface GameAction.
*/ */
public static interface GameAction { public interface GameAction {
/** /**
* The Interface GAMEACTION_TEXT. * The Interface GAMEACTION_TEXT.
*/ */
public static interface GAMEACTION_TEXT { public interface GameActionText {
/** The HEADS. */ /** The HEADS. */
String HEADS = "%s/GameAction/heads"; String HEADS = "%s/GameAction/heads";

View File

@@ -18,7 +18,7 @@ import java.util.Vector;
public class Preferences { public class Preferences {
/** The props. */ /** The props. */
protected Properties props; private Properties props;
/** /**
* <p> * <p>
@@ -26,7 +26,7 @@ public class Preferences {
* </p> * </p>
*/ */
public Preferences() { public Preferences() {
props = new Properties(); this.props = new Properties();
} }
/** /**
@@ -38,7 +38,7 @@ public class Preferences {
* a {@link forge.properties.Preferences} object. * a {@link forge.properties.Preferences} object.
*/ */
public Preferences(final Preferences prefs) { public Preferences(final Preferences prefs) {
props = prefs.props; this.props = prefs.props;
} }
/** /**
@@ -50,8 +50,8 @@ public class Preferences {
*/ */
public final synchronized Enumeration<String> keys() { public final synchronized Enumeration<String> keys() {
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings({ "unchecked", "rawtypes" })
Set<String> keysEnum = (Set) props.keySet(); final Set<String> keysEnum = (Set) this.props.keySet();
Vector<String> keyList = new Vector<String>(); final Vector<String> keyList = new Vector<String>();
keyList.addAll(keysEnum); keyList.addAll(keysEnum);
Collections.sort(keyList); Collections.sort(keyList);
return keyList.elements(); return keyList.elements();
@@ -69,13 +69,13 @@ public class Preferences {
* @return a int. * @return a int.
*/ */
public final int getInt(final String name, final int defaultValue) { public final int getInt(final String name, final int defaultValue) {
String value = props.getProperty(name); final String value = this.props.getProperty(name);
if (value == null) { if (value == null) {
return defaultValue; return defaultValue;
} }
try { try {
return Integer.parseInt(value); return Integer.parseInt(value);
} catch (NumberFormatException ex) { } catch (final NumberFormatException ex) {
return defaultValue; return defaultValue;
} }
} }
@@ -92,7 +92,7 @@ public class Preferences {
* @return a boolean. * @return a boolean.
*/ */
public final boolean getBoolean(final String name, final boolean defaultValue) { public final boolean getBoolean(final String name, final boolean defaultValue) {
String value = props.getProperty(name); final String value = this.props.getProperty(name);
if (value == null) { if (value == null) {
return defaultValue; return defaultValue;
} }
@@ -111,7 +111,7 @@ public class Preferences {
* @return a long. * @return a long.
*/ */
public final long getLong(final String name, final long defaultValue) { public final long getLong(final String name, final long defaultValue) {
String value = props.getProperty(name); final String value = this.props.getProperty(name);
if (value == null) { if (value == null) {
return defaultValue; return defaultValue;
} }
@@ -129,7 +129,7 @@ public class Preferences {
* a {@link java.lang.Object} object. * a {@link java.lang.Object} object.
*/ */
public final void set(final String key, final Object value) { public final void set(final String key, final Object value) {
props.setProperty(key, String.valueOf(value)); this.props.setProperty(key, String.valueOf(value));
} }
/** /**
@@ -148,7 +148,7 @@ public class Preferences {
if (value != null) { if (value != null) {
string = String.valueOf(value); string = String.valueOf(value);
} }
return props.getProperty(key, string); return this.props.getProperty(key, string);
} }
/** /**
@@ -162,7 +162,7 @@ public class Preferences {
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public final void load(final FileInputStream stream) throws IOException { public final void load(final FileInputStream stream) throws IOException {
props.load(stream); this.props.load(stream);
} }
/** /**
@@ -178,6 +178,6 @@ public class Preferences {
* Signals that an I/O exception has occurred. * Signals that an I/O exception has occurred.
*/ */
public final void store(final FileOutputStream stream, final String comments) throws IOException { public final void store(final FileOutputStream stream, final String comments) throws IOException {
props.store(stream, comments); this.props.store(stream, comments);
} }
} }

View File

@@ -1,2 +1,3 @@
/** Forge Card Game. */ /** Forge Card Game. */
package forge.properties; package forge.properties;

View File

@@ -571,8 +571,8 @@ public final class QuestData {
* @return true, if successful * @return true, if successful
*/ */
public boolean hasSaveFile() { public boolean hasSaveFile() {
return ForgeProps.getFile(NewConstants.QUEST.DATA).exists() return ForgeProps.getFile(NewConstants.Quest.DATA).exists()
|| ForgeProps.getFile(NewConstants.QUEST.XMLDATA).exists(); || ForgeProps.getFile(NewConstants.Quest.XMLDATA).exists();
} }
/** /**

View File

@@ -68,7 +68,7 @@ public class QuestDataIO {
// read file "questData" // read file "questData"
QuestData data = null; QuestData data = null;
File xmlSaveFile = ForgeProps.getFile(NewConstants.QUEST.XMLDATA); File xmlSaveFile = ForgeProps.getFile(NewConstants.Quest.XMLDATA);
GZIPInputStream zin = new GZIPInputStream(new FileInputStream(xmlSaveFile)); GZIPInputStream zin = new GZIPInputStream(new FileInputStream(xmlSaveFile));
@@ -172,7 +172,7 @@ public class QuestDataIO {
xStream.registerConverter(new CardPoolToXml()); xStream.registerConverter(new CardPoolToXml());
xStream.alias("CardPool", ItemPool.class); xStream.alias("CardPool", ItemPool.class);
File f = ForgeProps.getFile(NewConstants.QUEST.XMLDATA); File f = ForgeProps.getFile(NewConstants.Quest.XMLDATA);
BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(f)); BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(f));
GZIPOutputStream zout = new GZIPOutputStream(bout); GZIPOutputStream zout = new GZIPOutputStream(bout);
xStream.toXML(qd, zout); xStream.toXML(qd, zout);

View File

@@ -5,7 +5,7 @@ import java.io.FileReader;
import java.io.Serializable; import java.io.Serializable;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.QUEST; import forge.properties.NewConstants.Quest;
/** /**
* <p> * <p>
@@ -99,7 +99,7 @@ public class QuestPreferences implements Serializable {
*/ */
public static void grabPrefsFromFile() { public static void grabPrefsFromFile() {
try { try {
BufferedReader input = new BufferedReader(new FileReader(ForgeProps.getFile(QUEST.PREFS))); BufferedReader input = new BufferedReader(new FileReader(ForgeProps.getFile(Quest.PREFS)));
String line = null; String line = null;
while ((line = input.readLine()) != null) { while ((line = input.readLine()) != null) {
if (line.startsWith("#") || line.length() == 0) { if (line.startsWith("#") || line.length() == 0) {

View File

@@ -44,8 +44,8 @@ public class ReadPriceList implements NewConstants {
* </p> * </p>
*/ */
private void setup() { private void setup() {
priceMap = readFile(ForgeProps.getFile(QUEST.PRICE)); priceMap = readFile(ForgeProps.getFile(Quest.PRICE));
priceMap.putAll(readFile(ForgeProps.getFile(QUEST.BOOSTER_PRICE))); priceMap.putAll(readFile(ForgeProps.getFile(Quest.BOOSTER_PRICE)));
} // setup() } // setup()

View File

@@ -57,11 +57,11 @@ public class QuestEventManager {
List<String> contents; List<String> contents;
QuestEvent tempEvent; QuestEvent tempEvent;
File file = ForgeProps.getFile(NewConstants.QUEST.DECKS); File file = ForgeProps.getFile(NewConstants.Quest.DECKS);
DeckManager manager = new DeckManager(file); DeckManager manager = new DeckManager(file);
File[] allFiles = ForgeProps.getFile(NewConstants.QUEST.DECKS).listFiles(DeckManager.DCK_FILE_FILTER); File[] allFiles = ForgeProps.getFile(NewConstants.Quest.DECKS).listFiles(DeckManager.DCK_FILE_FILTER);
for (File f : allFiles) { for (File f : allFiles) {
contents = FileUtil.readFile(f); contents = FileUtil.readFile(f);

View File

@@ -71,8 +71,8 @@ import forge.item.ItemPool;
import forge.properties.ForgePreferences.CardSizeType; import forge.properties.ForgePreferences.CardSizeType;
import forge.properties.ForgePreferences.StackOffsetType; import forge.properties.ForgePreferences.StackOffsetType;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG; import forge.properties.NewConstants.Lang;
import forge.properties.NewConstants.LANG.OldGuiNewGame.NEW_GAME_TEXT; import forge.properties.NewConstants.Lang.OldGuiNewGame.NewGameText;
import forge.quest.gui.QuestOptions; import forge.quest.gui.QuestOptions;
/** /**
@@ -743,7 +743,7 @@ public class Gui_HomeScreen {
cmdHowToPlay.setBackground(clrScrollBackground); cmdHowToPlay.setBackground(clrScrollBackground);
cmdHowToPlay.addActionListener(new ActionListener() { cmdHowToPlay.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg0) { public void actionPerformed(final ActionEvent arg0) {
String text = ForgeProps.getLocalized(LANG.HowTo.MESSAGE); String text = ForgeProps.getLocalized(Lang.HowTo.MESSAGE);
JTextArea area = new JTextArea(text, 25, 40); JTextArea area = new JTextArea(text, 25, 40);
area.setWrapStyleWord(true); area.setWrapStyleWord(true);
@@ -752,7 +752,7 @@ public class Gui_HomeScreen {
area.setOpaque(false); area.setOpaque(false);
JOptionPane.showMessageDialog(null, new JScrollPane(area), JOptionPane.showMessageDialog(null, new JScrollPane(area),
ForgeProps.getLocalized(LANG.HowTo.TITLE), JOptionPane.INFORMATION_MESSAGE); ForgeProps.getLocalized(Lang.HowTo.TITLE), JOptionPane.INFORMATION_MESSAGE);
} }
}); });
pnlUtilities.add(cmdHowToPlay); pnlUtilities.add(cmdHowToPlay);
@@ -940,8 +940,8 @@ public class Gui_HomeScreen {
} }
String sDeckName = JOptionPane.showInputDialog(null, String sDeckName = JOptionPane.showInputDialog(null,
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_MSG), ForgeProps.getLocalized(NewGameText.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE); ForgeProps.getLocalized(NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
deck.setName(sDeckName); deck.setName(sDeckName);
deck.setPlayerType(PlayerType.HUMAN); deck.setPlayerType(PlayerType.HUMAN);

View File

@@ -31,7 +31,7 @@ public final class Main {
final FModel model = new FModel(null); final FModel model = new FModel(null);
Singletons.setModel(model); Singletons.setModel(model);
FSkin skin = new FSkin(model.preferences.skin); FSkin skin = new FSkin(model.getPreferences().skin);
final FView view = new ApplicationView(skin); final FView view = new ApplicationView(skin);
Singletons.setView(view); Singletons.setView(view);

View File

@@ -80,8 +80,8 @@ import forge.properties.ForgePreferences.CardSizeType;
import forge.properties.ForgePreferences.StackOffsetType; import forge.properties.ForgePreferences.StackOffsetType;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants; import forge.properties.NewConstants;
import forge.properties.NewConstants.LANG.OldGuiNewGame.MENU_BAR.MENU; import forge.properties.NewConstants.Lang.OldGuiNewGame.MenuBar.Menu;
import forge.properties.NewConstants.LANG.OldGuiNewGame.MENU_BAR.OPTIONS; import forge.properties.NewConstants.Lang.OldGuiNewGame.MenuBar.Options;
import forge.quest.gui.QuestOptions; import forge.quest.gui.QuestOptions;
/*CHOPPIC*/ /*CHOPPIC*/
@@ -94,7 +94,7 @@ import forge.quest.gui.QuestOptions;
* @author Forge * @author Forge
* @version $Id$ * @version $Id$
*/ */
public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.LANG.OldGuiNewGame { public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.Lang.OldGuiNewGame {
/** Constant <code>serialVersionUID=-2437047615019135648L</code>. */ /** Constant <code>serialVersionUID=-2437047615019135648L</code>. */
private static final long serialVersionUID = -2437047615019135648L; private static final long serialVersionUID = -2437047615019135648L;
@@ -142,19 +142,19 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
// use these two variables // use these two variables
/** Constant <code>removeSmallCreatures</code>. */ /** Constant <code>removeSmallCreatures</code>. */
public static JCheckBoxMenuItem removeSmallCreatures = new JCheckBoxMenuItem( public static JCheckBoxMenuItem removeSmallCreatures = new JCheckBoxMenuItem(
ForgeProps.getLocalized(MENU_BAR.OPTIONS.GENERATE.REMOVE_SMALL)); ForgeProps.getLocalized(MenuBar.Options.Generate.REMOVE_SMALL));
/** Constant <code>removeArtifacts</code>. */ /** Constant <code>removeArtifacts</code>. */
public static JCheckBoxMenuItem removeArtifacts = new JCheckBoxMenuItem( public static JCheckBoxMenuItem removeArtifacts = new JCheckBoxMenuItem(
ForgeProps.getLocalized(MENU_BAR.OPTIONS.GENERATE.REMOVE_ARTIFACTS)); ForgeProps.getLocalized(MenuBar.Options.Generate.REMOVE_ARTIFACTS));
/** Constant <code>useLAFFonts</code>. */ /** Constant <code>useLAFFonts</code>. */
public static JCheckBoxMenuItem useLAFFonts = new JCheckBoxMenuItem(ForgeProps.getLocalized(MENU_BAR.OPTIONS.FONT)); public static JCheckBoxMenuItem useLAFFonts = new JCheckBoxMenuItem(ForgeProps.getLocalized(MenuBar.Options.FONT));
/** Constant <code>cardOverlay</code>. */ /** Constant <code>cardOverlay</code>. */
public static JCheckBoxMenuItem cardOverlay = new JCheckBoxMenuItem( public static JCheckBoxMenuItem cardOverlay = new JCheckBoxMenuItem(
ForgeProps.getLocalized(MENU_BAR.OPTIONS.CARD_OVERLAY)); ForgeProps.getLocalized(MenuBar.Options.CARD_OVERLAY));
/** Constant <code>cardScale</code>. */ /** Constant <code>cardScale</code>. */
public static JCheckBoxMenuItem cardScale = new JCheckBoxMenuItem( public static JCheckBoxMenuItem cardScale = new JCheckBoxMenuItem(
ForgeProps.getLocalized(MENU_BAR.OPTIONS.CARD_SCALE)); ForgeProps.getLocalized(MenuBar.Options.CARD_SCALE));
private JButton questButton = new JButton(); private JButton questButton = new JButton();
private final Action LOOK_AND_FEEL_ACTION = new LookAndFeelAction(this); private final Action LOOK_AND_FEEL_ACTION = new LookAndFeelAction(this);
@@ -221,7 +221,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
this.setSize(550, 565); this.setSize(550, 565);
GuiUtils.centerFrame(this); GuiUtils.centerFrame(this);
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME)); setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME));
setupMenu(); setupMenu();
setVisible(true); setVisible(true);
@@ -246,7 +246,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
LOOK_AND_FEEL_ACTION, DNLD_PRICES_ACTION, DOWNLOAD_ACTION_LQ, DOWNLOAD_ACTION_SETLQ, LOOK_AND_FEEL_ACTION, DNLD_PRICES_ACTION, DOWNLOAD_ACTION_LQ, DOWNLOAD_ACTION_SETLQ,
DOWNLOAD_ACTION_QUEST, IMPORT_PICTURE, CARD_SIZES_ACTION, CARD_STACK_ACTION, CARD_STACK_OFFSET_ACTION, DOWNLOAD_ACTION_QUEST, IMPORT_PICTURE, CARD_SIZES_ACTION, CARD_STACK_ACTION, CARD_STACK_OFFSET_ACTION,
BUGZ_REPORTER_ACTION, ErrorViewer.ALL_THREADS_ACTION, ABOUT_ACTION, EXIT_ACTION }; BUGZ_REPORTER_ACTION, ErrorViewer.ALL_THREADS_ACTION, ABOUT_ACTION, EXIT_ACTION };
JMenu menu = new JMenu(ForgeProps.getLocalized(MENU.TITLE)); JMenu menu = new JMenu(ForgeProps.getLocalized(Menu.TITLE));
for (Action a : actions) { for (Action a : actions) {
menu.add(a); menu.add(a);
if (a.equals(LOOK_AND_FEEL_ACTION) || a.equals(IMPORT_PICTURE) || a.equals(CARD_STACK_OFFSET_ACTION) if (a.equals(LOOK_AND_FEEL_ACTION) || a.equals(IMPORT_PICTURE) || a.equals(CARD_STACK_OFFSET_ACTION)
@@ -258,7 +258,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
// useLAFFonts.setSelected(false); // useLAFFonts.setSelected(false);
// new stuff // new stuff
JMenu generatedDeck = new JMenu(ForgeProps.getLocalized(MENU_BAR.OPTIONS.GENERATE.TITLE)); JMenu generatedDeck = new JMenu(ForgeProps.getLocalized(MenuBar.Options.Generate.TITLE));
generatedDeck.add(removeSmallCreatures); generatedDeck.add(removeSmallCreatures);
removeSmallCreatures.addActionListener(new ActionListener() { removeSmallCreatures.addActionListener(new ActionListener() {
@@ -274,7 +274,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
} }
}); });
JMenu optionsMenu = new JMenu(ForgeProps.getLocalized(OPTIONS.TITLE)); JMenu optionsMenu = new JMenu(ForgeProps.getLocalized(Options.TITLE));
optionsMenu.add(generatedDeck); optionsMenu.add(generatedDeck);
optionsMenu.add(useLAFFonts); optionsMenu.add(useLAFFonts);
@@ -288,7 +288,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
} }
}); });
JMenu helpMenu = new JMenu(ForgeProps.getLocalized(MENU_BAR.HELP.TITLE)); JMenu helpMenu = new JMenu(ForgeProps.getLocalized(MenuBar.Help.TITLE));
Action[] helpActions = {HOW_TO_PLAY_ACTION}; Action[] helpActions = {HOW_TO_PLAY_ACTION};
for (Action a : helpActions) { for (Action a : helpActions) {
@@ -396,8 +396,8 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
} }
String sDeckName = JOptionPane.showInputDialog(null, String sDeckName = JOptionPane.showInputDialog(null,
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_MSG), ForgeProps.getLocalized(NewGameText.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE); ForgeProps.getLocalized(NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
deck.setName(sDeckName); deck.setName(sDeckName);
deck.setPlayerType(PlayerType.HUMAN); deck.setPlayerType(PlayerType.HUMAN);
@@ -466,7 +466,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/ */
private void jbInit() throws Exception { private void jbInit() throws Exception {
titleLabel.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.NEW_GAME)); titleLabel.setText(ForgeProps.getLocalized(NewGameText.NEW_GAME));
titleLabel.setFont(new java.awt.Font("Dialog", 0, 26)); titleLabel.setFont(new java.awt.Font("Dialog", 0, 26));
/* CHOPPIC */ /* CHOPPIC */
@@ -482,10 +482,10 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/ */
/* jPanel2.setBorder(titledBorder1); */ /* jPanel2.setBorder(titledBorder1); */
setCustomBorder(jPanel2, ForgeProps.getLocalized(NEW_GAME_TEXT.GAMETYPE)); setCustomBorder(jPanel2, ForgeProps.getLocalized(NewGameText.GAMETYPE));
jPanel2.setLayout(new MigLayout("align center")); jPanel2.setLayout(new MigLayout("align center"));
singleRadioButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.CONSTRUCTED_TEXT)); singleRadioButton.setText(ForgeProps.getLocalized(NewGameText.CONSTRUCTED_TEXT));
singleRadioButton.addActionListener(new java.awt.event.ActionListener() { singleRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
singleRadioButtonActionPerformed(e); singleRadioButtonActionPerformed(e);
@@ -493,7 +493,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
}); });
// sealedRadioButton.setToolTipText(""); // sealedRadioButton.setToolTipText("");
sealedRadioButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.SEALED_TEXT)); sealedRadioButton.setText(ForgeProps.getLocalized(NewGameText.SEALED_TEXT));
sealedRadioButton.addActionListener(new java.awt.event.ActionListener() { sealedRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
sealedRadioButtonActionPerformed(e); sealedRadioButtonActionPerformed(e);
@@ -501,7 +501,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
}); });
// draftRadioButton.setToolTipText(""); // draftRadioButton.setToolTipText("");
draftRadioButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.BOOSTER_TEXT)); draftRadioButton.setText(ForgeProps.getLocalized(NewGameText.BOOSTER_TEXT));
draftRadioButton.addActionListener(new java.awt.event.ActionListener() { draftRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
draftRadioButtonActionPerformed(e); draftRadioButtonActionPerformed(e);
@@ -513,24 +513,24 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/ */
/* jPanel1.setBorder(titledBorder2); */ /* jPanel1.setBorder(titledBorder2); */
setCustomBorder(jPanel1, ForgeProps.getLocalized(NEW_GAME_TEXT.LIBRARY)); setCustomBorder(jPanel1, ForgeProps.getLocalized(NewGameText.LIBRARY));
jPanel1.setLayout(new MigLayout("align center")); jPanel1.setLayout(new MigLayout("align center"));
jLabel2.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.YOURDECK)); jLabel2.setText(ForgeProps.getLocalized(NewGameText.YOURDECK));
jLabel3.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.OPPONENT)); jLabel3.setText(ForgeProps.getLocalized(NewGameText.OPPONENT));
/* /*
* Settings Panel * Settings Panel
*/ */
/* jPanel3.setBorder(titledBorder3); */ /* jPanel3.setBorder(titledBorder3); */
setCustomBorder(jPanel3, ForgeProps.getLocalized(NEW_GAME_TEXT.SETTINGS)); setCustomBorder(jPanel3, ForgeProps.getLocalized(NewGameText.SETTINGS));
jPanel3.setLayout(new MigLayout("align center")); jPanel3.setLayout(new MigLayout("align center"));
// newGuiCheckBox.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.NEW_GUI)); // newGuiCheckBox.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.NEW_GUI));
smoothLandCheckBox.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.AI_LAND)); smoothLandCheckBox.setText(ForgeProps.getLocalized(NewGameText.AI_LAND));
devModeCheckBox.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.DEV_MODE)); devModeCheckBox.setText(ForgeProps.getLocalized(NewGameText.DEV_MODE));
devModeCheckBox.addActionListener(new java.awt.event.ActionListener() { devModeCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
Constant.Runtime.DEV_MODE[0] = devModeCheckBox.isSelected(); Constant.Runtime.DEV_MODE[0] = devModeCheckBox.isSelected();
@@ -564,7 +564,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/ */
deckEditorButton.setFont(new java.awt.Font("Dialog", 0, 15)); deckEditorButton.setFont(new java.awt.Font("Dialog", 0, 15));
deckEditorButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.DECK_EDITOR)); deckEditorButton.setText(ForgeProps.getLocalized(NewGameText.DECK_EDITOR));
deckEditorButton.addActionListener(new java.awt.event.ActionListener() { deckEditorButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
deckEditorButtonActionPerformed(GameType.Constructed, null); deckEditorButtonActionPerformed(GameType.Constructed, null);
@@ -573,7 +573,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
startButton.setFont(new java.awt.Font("Dialog", 0, 18)); startButton.setFont(new java.awt.Font("Dialog", 0, 18));
startButton.setHorizontalTextPosition(SwingConstants.LEADING); startButton.setHorizontalTextPosition(SwingConstants.LEADING);
startButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.START_GAME)); startButton.setText(ForgeProps.getLocalized(NewGameText.START_GAME));
startButton.addActionListener(new java.awt.event.ActionListener() { startButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) { public void actionPerformed(final ActionEvent e) {
startButtonActionPerformed(e); startButtonActionPerformed(e);
@@ -581,7 +581,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
}); });
questButton.setFont(new java.awt.Font("Dialog", 0, 18)); questButton.setFont(new java.awt.Font("Dialog", 0, 18));
questButton.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.QUEST_MODE)); questButton.setText(ForgeProps.getLocalized(NewGameText.QUEST_MODE));
this.getContentPane().add(titleLabel, "align center, span 3, grow, wrap"); this.getContentPane().add(titleLabel, "align center, span 3, grow, wrap");
@@ -986,7 +986,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* the component * the component
*/ */
public LookAndFeelAction(final Component component) { public LookAndFeelAction(final Component component) {
super(ForgeProps.getLocalized(MENU_BAR.MENU.LF)); super(ForgeProps.getLocalized(MenuBar.Menu.LF));
this.c = component; this.c = component;
} }
@@ -1081,7 +1081,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new download price action. * Instantiates a new download price action.
*/ */
public DownloadPriceAction() { public DownloadPriceAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.DOWNLOADPRICE)); super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADPRICE));
} }
/* /*
@@ -1161,7 +1161,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new download action lq. * Instantiates a new download action lq.
*/ */
public DownloadActionLQ() { public DownloadActionLQ() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.DOWNLOADLQ)); super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADLQ));
} }
/* /*
@@ -1191,7 +1191,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new download action set lq. * Instantiates a new download action set lq.
*/ */
public DownloadActionSetLQ() { public DownloadActionSetLQ() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.DOWNLOADSETLQ)); super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADSETLQ));
} }
/* /*
@@ -1221,7 +1221,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new download action quest. * Instantiates a new download action quest.
*/ */
public DownloadActionQuest() { public DownloadActionQuest() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.DOWNLOADQUESTIMG)); super(ForgeProps.getLocalized(MenuBar.Menu.DOWNLOADQUESTIMG));
} }
/* /*
@@ -1253,7 +1253,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new import picture action. * Instantiates a new import picture action.
*/ */
public ImportPictureAction() { public ImportPictureAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.IMPORTPICTURE)); super(ForgeProps.getLocalized(MenuBar.Menu.IMPORTPICTURE));
} }
/* /*
@@ -1287,7 +1287,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new card sizes action. * Instantiates a new card sizes action.
*/ */
public CardSizesAction() { public CardSizesAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.CARD_SIZES)); super(ForgeProps.getLocalized(MenuBar.Menu.CARD_SIZES));
} }
/* /*
@@ -1362,7 +1362,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new card stack action. * Instantiates a new card stack action.
*/ */
public CardStackAction() { public CardStackAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.CARD_STACK)); super(ForgeProps.getLocalized(MenuBar.Menu.CARD_STACK));
} }
/* /*
@@ -1432,7 +1432,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new card stack offset action. * Instantiates a new card stack offset action.
*/ */
public CardStackOffsetAction() { public CardStackOffsetAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.CARD_STACK_OFFSET)); super(ForgeProps.getLocalized(MenuBar.Menu.CARD_STACK_OFFSET));
} }
/* /*
@@ -1504,7 +1504,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new how to play action. * Instantiates a new how to play action.
*/ */
public HowToPlayAction() { public HowToPlayAction() {
super(ForgeProps.getLocalized(LANG.HowTo.TITLE)); super(ForgeProps.getLocalized(Lang.HowTo.TITLE));
} }
/* /*
@@ -1518,7 +1518,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* @param e ActionEvent * @param e ActionEvent
*/ */
public final void actionPerformed(final ActionEvent e) { public final void actionPerformed(final ActionEvent e) {
String text = ForgeProps.getLocalized(LANG.HowTo.MESSAGE); String text = ForgeProps.getLocalized(Lang.HowTo.MESSAGE);
JTextArea area = new JTextArea(text, 25, 40); JTextArea area = new JTextArea(text, 25, 40);
area.setWrapStyleWord(true); area.setWrapStyleWord(true);
@@ -1526,7 +1526,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
area.setEditable(false); area.setEditable(false);
area.setOpaque(false); area.setOpaque(false);
JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(LANG.HowTo.TITLE), JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(Lang.HowTo.TITLE),
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
} }
@@ -1544,7 +1544,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new about action. * Instantiates a new about action.
*/ */
public AboutAction() { public AboutAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.ABOUT)); super(ForgeProps.getLocalized(MenuBar.Menu.ABOUT));
} }
/* /*
@@ -1593,7 +1593,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new exit action. * Instantiates a new exit action.
*/ */
public ExitAction() { public ExitAction() {
super(ForgeProps.getLocalized(MENU_BAR.MENU.EXIT)); super(ForgeProps.getLocalized(MenuBar.Menu.EXIT));
} }
/* /*

View File

@@ -22,7 +22,7 @@ import forge.Player;
import forge.gui.skin.FButton; import forge.gui.skin.FButton;
import forge.gui.skin.FPanel; import forge.gui.skin.FPanel;
import forge.properties.ForgeProps; import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG.WinLoseFrame.WINLOSETEXT; import forge.properties.NewConstants.Lang.WinLoseFrame.WinLoseText;
import forge.quest.data.QuestMatchState; import forge.quest.data.QuestMatchState;
/** /**
@@ -171,14 +171,14 @@ public class WinLoseFrame extends JFrame {
int humanWins = matchState.countGamesWonBy(human.getName()); int humanWins = matchState.countGamesWonBy(human.getName());
int humanLosses = matchState.getGamesPlayedCount() - humanWins; int humanLosses = matchState.getGamesPlayedCount() - humanWins;
lblStats.setText(ForgeProps.getLocalized(WINLOSETEXT.WON) + humanWins lblStats.setText(ForgeProps.getLocalized(WinLoseText.WON) + humanWins
+ ForgeProps.getLocalized(WINLOSETEXT.LOST) + humanLosses); + ForgeProps.getLocalized(WinLoseText.LOST) + humanLosses);
// Show "You Won" or "You Lost" // Show "You Won" or "You Lost"
if (matchState.hasWonLastGame(human.getName())) { if (matchState.hasWonLastGame(human.getName())) {
lblTitle.setText(ForgeProps.getLocalized(WINLOSETEXT.WIN)); lblTitle.setText(ForgeProps.getLocalized(WinLoseText.WIN));
} else { } else {
lblTitle.setText(ForgeProps.getLocalized(WINLOSETEXT.LOSE)); lblTitle.setText(ForgeProps.getLocalized(WinLoseText.LOSE));
} }
// Populate custom panel, if necessary. // Populate custom panel, if necessary.