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

View File

@@ -102,8 +102,8 @@ import forge.properties.NewConstants;
* @author Forge
* @version $Id$
*/
public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewConstants, NewConstants.GUI.GuiDisplay,
NewConstants.LANG.GuiDisplay {
public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewConstants, NewConstants.Gui.GuiDisplay,
NewConstants.Lang.GuiDisplay {
/** Constant <code>serialVersionUID=4519302185194841060L</code>. */
private static final long serialVersionUID = 4519302185194841060L;
@@ -216,7 +216,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
computerGraveyardAction, computerRemovedAction, new JSeparator(), playsoundCheckboxForMenu,
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) {
if (o instanceof ForgeAction) {
gameMenu.add(((ForgeAction) o).setupButton(new JMenuItem()));
@@ -230,7 +230,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
}
// 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 humanLabel = new JMenuItem("Human");
@@ -244,18 +244,18 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
}
// 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]);
if (Constant.Runtime.DEV_MODE[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),
COMPUTER_LIBRARY.BASE);
ComputerLibrary.BASE);
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) {
private static final long serialVersionUID = 7171104690016706405L;
@@ -860,7 +860,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
*/
private void initComponents() {
// Preparing the Frame
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME));
setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME));
if (!Singletons.getModel().getPreferences().lafFonts) {
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.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) {
oppHandLabel.setFont(statFont);
}
@@ -1279,12 +1279,12 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
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) {
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) {
playerHandLabel.setFont(statFont);
}
@@ -1565,7 +1565,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
private JLabel playerLifeLabel = new JLabel();
private JLabel oppPCLabel = 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);
private JLabel oppHandValue = new JLabel();
private JLabel oppLibraryValue = new JLabel();
@@ -1723,7 +1723,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
public TriggerReactionMenu() {
super();
ForgeAction actAccept = new ForgeAction(LANG.GuiDisplay.TRIGGER.ALWAYSACCEPT) {
ForgeAction actAccept = new ForgeAction(Lang.GuiDisplay.Trigger.ALWAYSACCEPT) {
private static final long serialVersionUID = -3734674058185367612L;
@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;
@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;
@Override

View File

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

View File

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

View File

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

View File

@@ -37,7 +37,7 @@ import com.esotericsoftware.minlog.Log;
import forge.error.ErrorViewer;
import forge.properties.ForgeProps;
import forge.properties.NewConstants;
import forge.properties.NewConstants.LANG.Gui_DownloadPictures;
import forge.properties.NewConstants.Lang.GuiDownloadPictures;
//import java.io.BufferedReader;
//import java.io.FileReader;
@@ -53,7 +53,7 @@ import forge.properties.NewConstants.LANG.Gui_DownloadPictures;
* @version $Id$
*/
public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRangeModel implements Runnable,
NewConstants, NewConstants.LANG.Gui_DownloadPictures {
NewConstants, NewConstants.Lang.GuiDownloadPictures {
/** Constant <code>serialVersionUID=-7890794857949935256L</code>. */
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) {
this.cards = c;
this.addr = new JTextField(ForgeProps.getLocalized(Gui_DownloadPictures.PROXY_ADDRESS));
this.port = new JTextField(ForgeProps.getLocalized(Gui_DownloadPictures.PROXY_PORT));
this.addr = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_ADDRESS));
this.port = new JTextField(ForgeProps.getLocalized(GuiDownloadPictures.PROXY_PORT));
this.bar = new JProgressBar(this);
final JPanel p0 = new JPanel();
@@ -130,9 +130,9 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
// Proxy Choice
final ButtonGroup bg = new ButtonGroup();
final String[] labels = { ForgeProps.getLocalized(Gui_DownloadPictures.NO_PROXY),
ForgeProps.getLocalized(Gui_DownloadPictures.HTTP_PROXY),
ForgeProps.getLocalized(Gui_DownloadPictures.SOCKS_PROXY) };
final String[] labels = { ForgeProps.getLocalized(GuiDownloadPictures.NO_PROXY),
ForgeProps.getLocalized(GuiDownloadPictures.HTTP_PROXY),
ForgeProps.getLocalized(GuiDownloadPictures.SOCKS_PROXY) };
for (int i = 0; i < Gui_MigrateLocalMWSSetPictures_HQ.TYPES.length; i++) {
final JRadioButton rb = new JRadioButton(labels[i]);
rb.addChangeListener(new ProxyHandler(i));
@@ -181,7 +181,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
this.bar.setPreferredSize(d);
// JOptionPane
this.close = new JButton(ForgeProps.getLocalized(BUTTONS.CANCEL));
this.close = new JButton(ForgeProps.getLocalized(Buttons.CANCEL));
final Object[] options = { b, this.close };
this.dlg = new JOptionPane(p0, JOptionPane.DEFAULT_OPTION,
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));
}
} 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));
}
@@ -298,7 +298,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
* @return a {@link javax.swing.JDialog} object.
*/
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() {
@Override
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(
this.addr.getText(), Integer.parseInt(this.port.getText())));
} catch (final Exception ex) {
ErrorViewer.showError(ex, ForgeProps.getLocalized(ERRORS.PROXY_CONNECT), this.addr.getText(),
ErrorViewer.showError(ex, ForgeProps.getLocalized(Errors.PROXY_CONNECT), this.addr.getText(),
this.port.getText());
// throw new
// RuntimeException("Gui_DownloadPictures : error 1 - " +ex);
@@ -427,7 +427,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
}
} // for
}
this.close.setText(ForgeProps.getLocalized(BUTTONS.CLOSE));
this.close.setText(ForgeProps.getLocalized(Buttons.CLOSE));
} // run
/**
@@ -442,7 +442,7 @@ public final class Gui_MigrateLocalMWSSetPictures_HQ extends DefaultBoundedRange
final MCard[] card = Gui_MigrateLocalMWSSetPictures_HQ.getNeededCards();
if (card.length == 0) {
JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(Gui_DownloadPictures.NO_MORE));
JOptionPane.showMessageDialog(frame, ForgeProps.getLocalized(GuiDownloadPictures.NO_MORE));
return;
}

View File

@@ -19,7 +19,7 @@ import forge.properties.NewConstants;
* @author Forge
* @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>. */
private static final long serialVersionUID = 5552000208438248428L;

View File

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

View File

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

View File

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

View File

@@ -57,7 +57,7 @@ public class BuildInfo {
* where to find the mock Forge jar
*/
public BuildInfo(final String pathToMockJarFile) {
pathToForgeJar = pathToMockJarFile;
this.pathToForgeJar = pathToMockJarFile;
}
/**
@@ -71,7 +71,7 @@ public class BuildInfo {
String[] manifestResultArray;
String result = "0000";
String version = getVersion();
final String version = this.getVersion();
manifestResultArray = version.split("r");
manifestResult = manifestResultArray[manifestResultArray.length - 1];
@@ -119,14 +119,14 @@ public class BuildInfo {
InputStream manifestStream = null;
try {
if (pathToForgeJar == null) {
if (this.pathToForgeJar == null) {
// We're definitely not unit testing. Try to load from the
// currently running jar.
manifestStream = ClassLoader.getSystemResourceAsStream("META-INF/MANIFEST.MF");
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")); } } } }
*/
if (result == null && pathToForgeJar == null) {
if ((result == null) && (this.pathToForgeJar == null)) {
throw new FileNotFoundException(
"There is nothing matching forge-*-with-dependencies.jar in the class path.");
}
if (result == null) {
jar = new JarFile(pathToForgeJar);
jar = new JarFile(this.pathToForgeJar);
final Manifest manifest = jar.getManifest();
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 {
try {
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
}
try {
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
}
}
@@ -203,7 +205,7 @@ public class BuildInfo {
* @return a user-friendly string describing the version and build ID
*/
public final String toPrettyString() {
final String rawVersion = getVersion();
final String rawVersion = this.getVersion();
// final String rawBuildID = getBuildID();
String version;

View File

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

View File

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

View File

@@ -10,11 +10,11 @@ public class MultipleForgeJarsFoundError extends RuntimeException {
/** Automatically generated. */
private static final long serialVersionUID = 8899307272033517172L;
/**
* 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) {
super(message);

View File

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

View File

@@ -6,8 +6,6 @@ package forge.properties;
* Created on 30.08.2009
*/
import static java.lang.String.format;
import java.io.File;
import java.io.IOException;
import java.util.Locale;
@@ -24,18 +22,18 @@ import forge.error.ErrorViewer;
*/
public class ForgeProps {
/** Constant <code>properties</code>. */
private static final TreeProperties properties;
private static final TreeProperties PROPERTIES;
static {
TreeProperties p;
try {
p = new TreeProperties("forge.properties");
p.rethrow();
} catch (IOException ex) {
} catch (final IOException ex) {
ErrorViewer.showError(ex);
p = null;
}
properties = p;
PROPERTIES = p;
}
/**
@@ -44,34 +42,37 @@ public class ForgeProps {
* @return a {@link tree.properties.TreeProperties} object.
*/
public static TreeProperties getProperties() {
return properties;
return ForgeProps.PROPERTIES;
}
/**
* 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.
*/
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.
*
* @param key a {@link java.lang.String} object.
* @param def a {@link java.lang.String} object.
* @param key
* a {@link java.lang.String} object.
* @param def
* a {@link java.lang.String} object.
* @return a {@link java.lang.String} object.
*/
public static String getProperty(final String key, final String def) {
String result;
try {
result = getProperties().getProperty(key);
result = ForgeProps.getProperties().getProperty(key);
if (result == null) {
result = def;
}
} catch (Exception ex) {
} catch (final Exception ex) {
result = def;
}
return result;
@@ -80,28 +81,31 @@ public class ForgeProps {
/**
* 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.
*/
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.
*
* @param key a {@link java.lang.String} object.
* @param def a {@link java.io.File} object.
* @param key
* a {@link java.lang.String} object.
* @param def
* a {@link java.io.File} object.
* @return a {@link java.io.File} object.
*/
public static File getFile(final String key, final File def) {
File result;
try {
result = getProperties().getFile(key);
result = ForgeProps.getProperties().getFile(key);
if (result == null) {
result = def;
}
} catch (Exception ex) {
} catch (final Exception ex) {
result = def;
}
return result;
@@ -119,7 +123,7 @@ public class ForgeProps {
* @return a {@link java.lang.String} object.
*/
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 first is the configured language
// 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 {
for (String lang : languages) {
for (final String lang : languages) {
// could be if a property does not exist
// just skip it, and try the next
if (lang == null) {
continue;
}
String result = getProperty(format(key, lang));
final String result = ForgeProps.getProperty(String.format(key, lang));
if (result != null) {
return result;
}
@@ -156,7 +161,7 @@ public class ForgeProps {
// exceptions are skipped here; also the error viewer uses this, and
// reporting exceptions may result
// 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
// value

View File

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

View File

@@ -18,7 +18,7 @@ import java.util.Vector;
public class Preferences {
/** The props. */
protected Properties props;
private Properties props;
/**
* <p>
@@ -26,7 +26,7 @@ public class Preferences {
* </p>
*/
public Preferences() {
props = new Properties();
this.props = new Properties();
}
/**
@@ -38,7 +38,7 @@ public class Preferences {
* a {@link forge.properties.Preferences} object.
*/
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() {
@SuppressWarnings({ "unchecked", "rawtypes" })
Set<String> keysEnum = (Set) props.keySet();
Vector<String> keyList = new Vector<String>();
final Set<String> keysEnum = (Set) this.props.keySet();
final Vector<String> keyList = new Vector<String>();
keyList.addAll(keysEnum);
Collections.sort(keyList);
return keyList.elements();
@@ -69,13 +69,13 @@ public class Preferences {
* @return a int.
*/
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) {
return defaultValue;
}
try {
return Integer.parseInt(value);
} catch (NumberFormatException ex) {
} catch (final NumberFormatException ex) {
return defaultValue;
}
}
@@ -92,7 +92,7 @@ public class Preferences {
* @return a boolean.
*/
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) {
return defaultValue;
}
@@ -111,7 +111,7 @@ public class Preferences {
* @return a long.
*/
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) {
return defaultValue;
}
@@ -129,7 +129,7 @@ public class Preferences {
* a {@link java.lang.Object} object.
*/
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) {
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.
*/
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.
*/
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. */
package forge.properties;

View File

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

View File

@@ -68,7 +68,7 @@ public class QuestDataIO {
// read file "questData"
QuestData data = null;
File xmlSaveFile = ForgeProps.getFile(NewConstants.QUEST.XMLDATA);
File xmlSaveFile = ForgeProps.getFile(NewConstants.Quest.XMLDATA);
GZIPInputStream zin = new GZIPInputStream(new FileInputStream(xmlSaveFile));
@@ -172,7 +172,7 @@ public class QuestDataIO {
xStream.registerConverter(new CardPoolToXml());
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));
GZIPOutputStream zout = new GZIPOutputStream(bout);
xStream.toXML(qd, zout);

View File

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

View File

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

View File

@@ -57,11 +57,11 @@ public class QuestEventManager {
List<String> contents;
QuestEvent tempEvent;
File file = ForgeProps.getFile(NewConstants.QUEST.DECKS);
File file = ForgeProps.getFile(NewConstants.Quest.DECKS);
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) {
contents = FileUtil.readFile(f);

View File

@@ -71,8 +71,8 @@ import forge.item.ItemPool;
import forge.properties.ForgePreferences.CardSizeType;
import forge.properties.ForgePreferences.StackOffsetType;
import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG;
import forge.properties.NewConstants.LANG.OldGuiNewGame.NEW_GAME_TEXT;
import forge.properties.NewConstants.Lang;
import forge.properties.NewConstants.Lang.OldGuiNewGame.NewGameText;
import forge.quest.gui.QuestOptions;
/**
@@ -743,7 +743,7 @@ public class Gui_HomeScreen {
cmdHowToPlay.setBackground(clrScrollBackground);
cmdHowToPlay.addActionListener(new ActionListener() {
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);
area.setWrapStyleWord(true);
@@ -752,7 +752,7 @@ public class Gui_HomeScreen {
area.setOpaque(false);
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);
@@ -940,8 +940,8 @@ public class Gui_HomeScreen {
}
String sDeckName = JOptionPane.showInputDialog(null,
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
ForgeProps.getLocalized(NewGameText.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
deck.setName(sDeckName);
deck.setPlayerType(PlayerType.HUMAN);

View File

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

View File

@@ -80,8 +80,8 @@ import forge.properties.ForgePreferences.CardSizeType;
import forge.properties.ForgePreferences.StackOffsetType;
import forge.properties.ForgeProps;
import forge.properties.NewConstants;
import forge.properties.NewConstants.LANG.OldGuiNewGame.MENU_BAR.MENU;
import forge.properties.NewConstants.LANG.OldGuiNewGame.MENU_BAR.OPTIONS;
import forge.properties.NewConstants.Lang.OldGuiNewGame.MenuBar.Menu;
import forge.properties.NewConstants.Lang.OldGuiNewGame.MenuBar.Options;
import forge.quest.gui.QuestOptions;
/*CHOPPIC*/
@@ -94,7 +94,7 @@ import forge.quest.gui.QuestOptions;
* @author Forge
* @version $Id$
*/
public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.LANG.OldGuiNewGame {
public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.Lang.OldGuiNewGame {
/** Constant <code>serialVersionUID=-2437047615019135648L</code>. */
private static final long serialVersionUID = -2437047615019135648L;
@@ -142,19 +142,19 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
// use these two variables
/** Constant <code>removeSmallCreatures</code>. */
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>. */
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>. */
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>. */
public static JCheckBoxMenuItem cardOverlay = new JCheckBoxMenuItem(
ForgeProps.getLocalized(MENU_BAR.OPTIONS.CARD_OVERLAY));
ForgeProps.getLocalized(MenuBar.Options.CARD_OVERLAY));
/** Constant <code>cardScale</code>. */
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 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);
GuiUtils.centerFrame(this);
setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME));
setTitle(ForgeProps.getLocalized(Lang.PROGRAM_NAME));
setupMenu();
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,
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 };
JMenu menu = new JMenu(ForgeProps.getLocalized(MENU.TITLE));
JMenu menu = new JMenu(ForgeProps.getLocalized(Menu.TITLE));
for (Action a : actions) {
menu.add(a);
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);
// 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);
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(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};
for (Action a : helpActions) {
@@ -396,8 +396,8 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
}
String sDeckName = JOptionPane.showInputDialog(null,
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NEW_GAME_TEXT.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
ForgeProps.getLocalized(NewGameText.SAVE_SEALED_MSG),
ForgeProps.getLocalized(NewGameText.SAVE_SEALED_TTL), JOptionPane.QUESTION_MESSAGE);
deck.setName(sDeckName);
deck.setPlayerType(PlayerType.HUMAN);
@@ -466,7 +466,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/
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));
/* CHOPPIC */
@@ -482,10 +482,10 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/
/* jPanel2.setBorder(titledBorder1); */
setCustomBorder(jPanel2, ForgeProps.getLocalized(NEW_GAME_TEXT.GAMETYPE));
setCustomBorder(jPanel2, ForgeProps.getLocalized(NewGameText.GAMETYPE));
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() {
public void actionPerformed(final ActionEvent e) {
singleRadioButtonActionPerformed(e);
@@ -493,7 +493,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
});
// 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() {
public void actionPerformed(final ActionEvent e) {
sealedRadioButtonActionPerformed(e);
@@ -501,7 +501,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
});
// 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() {
public void actionPerformed(final ActionEvent e) {
draftRadioButtonActionPerformed(e);
@@ -513,24 +513,24 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
*/
/* jPanel1.setBorder(titledBorder2); */
setCustomBorder(jPanel1, ForgeProps.getLocalized(NEW_GAME_TEXT.LIBRARY));
setCustomBorder(jPanel1, ForgeProps.getLocalized(NewGameText.LIBRARY));
jPanel1.setLayout(new MigLayout("align center"));
jLabel2.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.YOURDECK));
jLabel3.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.OPPONENT));
jLabel2.setText(ForgeProps.getLocalized(NewGameText.YOURDECK));
jLabel3.setText(ForgeProps.getLocalized(NewGameText.OPPONENT));
/*
* Settings Panel
*/
/* jPanel3.setBorder(titledBorder3); */
setCustomBorder(jPanel3, ForgeProps.getLocalized(NEW_GAME_TEXT.SETTINGS));
setCustomBorder(jPanel3, ForgeProps.getLocalized(NewGameText.SETTINGS));
jPanel3.setLayout(new MigLayout("align center"));
// 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() {
public void actionPerformed(final ActionEvent e) {
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.setText(ForgeProps.getLocalized(NEW_GAME_TEXT.DECK_EDITOR));
deckEditorButton.setText(ForgeProps.getLocalized(NewGameText.DECK_EDITOR));
deckEditorButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(final ActionEvent e) {
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.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() {
public void actionPerformed(final ActionEvent 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.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");
@@ -986,7 +986,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* the component
*/
public LookAndFeelAction(final Component component) {
super(ForgeProps.getLocalized(MENU_BAR.MENU.LF));
super(ForgeProps.getLocalized(MenuBar.Menu.LF));
this.c = component;
}
@@ -1081,7 +1081,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new download price action.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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.
*/
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
*/
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);
area.setWrapStyleWord(true);
@@ -1526,7 +1526,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
area.setEditable(false);
area.setOpaque(false);
JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(LANG.HowTo.TITLE),
JOptionPane.showMessageDialog(null, new JScrollPane(area), ForgeProps.getLocalized(Lang.HowTo.TITLE),
JOptionPane.INFORMATION_MESSAGE);
}
}
@@ -1544,7 +1544,7 @@ public class OldGuiNewGame extends JFrame implements NewConstants, NewConstants.
* Instantiates a new about action.
*/
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.
*/
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.FPanel;
import forge.properties.ForgeProps;
import forge.properties.NewConstants.LANG.WinLoseFrame.WINLOSETEXT;
import forge.properties.NewConstants.Lang.WinLoseFrame.WinLoseText;
import forge.quest.data.QuestMatchState;
/**
@@ -171,14 +171,14 @@ public class WinLoseFrame extends JFrame {
int humanWins = matchState.countGamesWonBy(human.getName());
int humanLosses = matchState.getGamesPlayedCount() - humanWins;
lblStats.setText(ForgeProps.getLocalized(WINLOSETEXT.WON) + humanWins
+ ForgeProps.getLocalized(WINLOSETEXT.LOST) + humanLosses);
lblStats.setText(ForgeProps.getLocalized(WinLoseText.WON) + humanWins
+ ForgeProps.getLocalized(WinLoseText.LOST) + humanLosses);
// Show "You Won" or "You Lost"
if (matchState.hasWonLastGame(human.getName())) {
lblTitle.setText(ForgeProps.getLocalized(WINLOSETEXT.WIN));
lblTitle.setText(ForgeProps.getLocalized(WinLoseText.WIN));
} else {
lblTitle.setText(ForgeProps.getLocalized(WINLOSETEXT.LOSE));
lblTitle.setText(ForgeProps.getLocalized(WinLoseText.LOSE));
}
// Populate custom panel, if necessary.