diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index 26093eb2cad..59e6441de07 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -1,12 +1,12 @@ - + 0 0 - 1440 - 827 + 1018 + 693 @@ -17,7 +17,7 @@ 0 0 242 - 827 + 693 @@ -28,7 +28,7 @@ 0 0 242 - 145 + 118 @@ -47,7 +47,7 @@ 0 - 145 + 118 242 10 @@ -62,9 +62,9 @@ 0 - 155 + 128 242 - 171 + 144 @@ -83,7 +83,7 @@ 0 - 326 + 272 242 10 @@ -98,9 +98,9 @@ 0 - 336 + 282 242 - 115 + 88 @@ -119,7 +119,7 @@ 0 - 451 + 370 242 10 @@ -134,9 +134,9 @@ 0 - 461 + 380 242 - 107 + 80 @@ -155,7 +155,7 @@ 0 - 568 + 460 242 10 @@ -170,9 +170,9 @@ 0 - 578 + 470 242 - 249 + 223 @@ -205,7 +205,7 @@ 242 0 10 - 827 + 693 @@ -219,8 +219,8 @@ 252 0 - 906 - 827 + 484 + 693 @@ -230,8 +230,8 @@ 252 0 - 906 - 163 + 484 + 136 @@ -250,8 +250,8 @@ 252 - 163 - 906 + 136 + 484 10 @@ -265,9 +265,9 @@ 252 - 173 - 906 - 166 + 146 + 484 + 139 @@ -286,8 +286,8 @@ 252 - 339 - 906 + 285 + 484 10 @@ -301,9 +301,9 @@ 252 - 349 - 906 - 140 + 295 + 484 + 113 @@ -322,8 +322,8 @@ 252 - 489 - 906 + 408 + 484 10 @@ -337,9 +337,9 @@ 252 - 499 - 906 - 145 + 418 + 484 + 118 @@ -358,8 +358,8 @@ 252 - 644 - 906 + 536 + 484 10 @@ -373,9 +373,9 @@ 252 - 654 - 906 - 173 + 546 + 484 + 147 @@ -408,10 +408,10 @@ - 1158 + 736 0 10 - 827 + 693 @@ -423,10 +423,10 @@ - 1168 + 746 0 272 - 827 + 693 @@ -434,10 +434,10 @@ - 1168 + 746 0 272 - 424 + 357 @@ -455,8 +455,8 @@ - 1168 - 424 + 746 + 357 272 10 @@ -470,10 +470,10 @@ - 1168 - 434 + 746 + 367 272 - 393 + 326 diff --git a/res/lang/de.properties b/res/lang/de.properties index fb241fef371..d5ac1a764fd 100644 --- a/res/lang/de.properties +++ b/res/lang/de.properties @@ -77,10 +77,10 @@ ErrorViewer/message=Ein Fehler ist aufgetreten. Du kannst diese Nachricht kopier Bitte melde diese Nachricht, und wie er aufgetreten ist, hier:\n\ \t%s\n\ Falls du keine Konto anlegen willst, schreibe eine Mail an\n\ - \t%s\n\n\ - %s\n\n\ + \t%s\n\n\n\ + %s\n\n\n\ Version:\n\ - %s\n\ + %s\n\n\ Detaillierter Stapelverlauf:\n ErrorViewer/button/save=Speichern... ErrorViewer/button/close=Schließen diff --git a/res/lang/en.properties b/res/lang/en.properties index f03b423abc3..fefc3ac9784 100644 --- a/res/lang/en.properties +++ b/res/lang/en.properties @@ -77,10 +77,10 @@ ErrorViewer/message=An error has occured. You can copy/paste this message or sav Please report this, plus what you tried to do, to:\n\ \t%s\n\ If you don't want to register an account, you can mail it directly to\n\ - \t%s\n\n\ - %s\n\n\ + \t%s\n\n\n\ + %s\n\n\n\ Version:\n\ - %s\n\ + %s\n\n\ Detailed error trace:\n ErrorViewer/button/save=Save... ErrorViewer/button/close=Close diff --git a/src/forge/GuiDisplay3.java b/src/forge/GuiDisplay3.java index dcf0a710c68..9a9c1bd0837 100644 --- a/src/forge/GuiDisplay3.java +++ b/src/forge/GuiDisplay3.java @@ -1,5 +1,7 @@ + package forge; + import static org.jdesktop.swingx.MultiSplitLayout.*; import java.awt.BorderLayout; @@ -123,10 +125,10 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon HUMAN_GRAVEYARD_ACTION = new ZoneAction(AllZone.Human_Graveyard, HUMAN_GRAVEYARD); HUMAN_REMOVED_ACTION = new ZoneAction(AllZone.Human_Removed, HUMAN_REMOVED); HUMAN_FLASHBACK_ACTION = new ZoneAction(AllZone.Human_Removed, HUMAN_FLASHBACK) { - - private static final long serialVersionUID = 8120331222693706164L; - - @Override + + private static final long serialVersionUID = 8120331222693706164L; + + @Override protected Card[] getCards() { return CardFactoryUtil.getFlashbackCards(Constant.Player.Human).toArray(); } @@ -143,10 +145,10 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon } private void addMenu() { - Object[] obj = { - HUMAN_GRAVEYARD_ACTION, HUMAN_REMOVED_ACTION, HUMAN_FLASHBACK_ACTION, COMPUTER_GRAVEYARD_ACTION, - COMPUTER_REMOVED_ACTION, GuiDisplay3.eotCheckboxForMenu, new JSeparator(), - ErrorViewer.ALL_THREADS_ACTION, new JSeparator(), CONCEDE_ACTION}; + Object[] obj = { + HUMAN_GRAVEYARD_ACTION, HUMAN_REMOVED_ACTION, HUMAN_FLASHBACK_ACTION, COMPUTER_GRAVEYARD_ACTION, + COMPUTER_REMOVED_ACTION, GuiDisplay3.eotCheckboxForMenu, new JSeparator(), + ErrorViewer.ALL_THREADS_ACTION, new JSeparator(), CONCEDE_ACTION}; JMenu gameMenu = new JMenu(ForgeProps.getLocalized(MENU_BAR.MENU.TITLE)); for(Object o:obj) { @@ -429,7 +431,7 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon if(c.getCounters(Counters.AGE) != 0) counterText = counterText + "Age counters: " + c.getCounters(Counters.AGE) + "\r\n"; if(c.getCounters(Counters.BLAZE) != 0) counterText = counterText + "Blaze counters: " - + c.getCounters(Counters.BLAZE) + "\r\n"; + + c.getCounters(Counters.BLAZE) + "\r\n"; if(c.getCounters(Counters.CHARGE) != 0) counterText = counterText + "Charge counters: " + c.getCounters(Counters.CHARGE) + "\r\n"; if(c.getCounters(Counters.DIVINITY) != 0) counterText = counterText + "Divinity counters: " @@ -459,8 +461,8 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon if (c.getCounters(Counters.M1M1) != 0) counterText = counterText + "-1/-1 counters: " + c.getCounters(Counters.M1M1) + "\r\n"; */ - if(c.getCounters(Counters.QUEST) != 0) - counterText = counterText + "Quest counters: " + c.getCounters(Counters.QUEST) + "\r\n"; + if(c.getCounters(Counters.QUEST) != 0) counterText = counterText + "Quest counters: " + + c.getCounters(Counters.QUEST) + "\r\n"; if(c.getCounters(Counters.SPORE) != 0) counterText = counterText + "Spore counters: " + c.getCounters(Counters.SPORE) + "\r\n"; @@ -693,7 +695,7 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon private void initComponents() { //Preparing the Frame - setTitle(ForgeProps.getProperty(LANG.PROGRAM_NAME)); + setTitle(ForgeProps.getLocalized(LANG.PROGRAM_NAME)); setFont(new Font("Times New Roman", 0, 16)); getContentPane().setLayout(new BorderLayout()); addWindowListener(new WindowAdapter() { @@ -1102,9 +1104,9 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon JLabel playerRemovedValue = new JLabel(); private class ZoneAction extends ForgeAction { - private static final long serialVersionUID = -5822976087772388839L; - private PlayerZone zone; - private String title; + private static final long serialVersionUID = -5822976087772388839L; + private PlayerZone zone; + private String title; public ZoneAction(PlayerZone zone, String property) { super(property); @@ -1123,6 +1125,7 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon if(choice != null) doAction(choice); } } + /* protected PlayerZone getZone() { return zone; @@ -1136,10 +1139,10 @@ public class GuiDisplay3 extends JFrame implements Display, NewConstants, NewCon } private class ConcedeAction extends ForgeAction { - - private static final long serialVersionUID = -6976695235601916762L; - - public ConcedeAction() { + + private static final long serialVersionUID = -6976695235601916762L; + + public ConcedeAction() { super(CONCEDE); } diff --git a/src/forge/Gui_NewGame.java b/src/forge/Gui_NewGame.java index dc6765dbe90..b902ac99389 100644 --- a/src/forge/Gui_NewGame.java +++ b/src/forge/Gui_NewGame.java @@ -106,7 +106,6 @@ public class Gui_NewGame extends JFrame implements NewConstants, NewConstants.LA "ComboBox.background", "MenuItem.background", "JCheckBoxMenuItem.background", "Dialog.background", "OptionPane.background", "ScrollBar.background"}; for(int i = 0; i < properties.length; i++) { - //UIManager.put(properties, background); UIManager.put(properties[i], background); } } diff --git a/src/forge/NewDeckIO.java b/src/forge/NewDeckIO.java index 89879716bdf..125d9457bf4 100755 --- a/src/forge/NewDeckIO.java +++ b/src/forge/NewDeckIO.java @@ -47,6 +47,7 @@ public class NewDeckIO implements DeckIO { } public NewDeckIO(File dir) { + if(dir == null) throw new IllegalArgumentException("No deck directory specified"); try { this.dir = dir; diff --git a/src/forge/error/ErrorViewer.java b/src/forge/error/ErrorViewer.java index 12b68812e82..5d78219118f 100644 --- a/src/forge/error/ErrorViewer.java +++ b/src/forge/error/ErrorViewer.java @@ -125,8 +125,8 @@ public class ErrorViewer implements NewConstants, NewConstants.LANG.ErrorViewer if(message != null) System.err.println(message); ex.printStackTrace(); - pw.printf(getLocalized(MESSAGE), getProperty(FORUM), getProperty(MAIL), getProperty(VERSION), - message != null? message:ex.getMessage()); + pw.printf(getLocalized(MESSAGE), getProperty(FORUM), getProperty(MAIL), + message != null? message:ex.getMessage(), getProperty(VERSION)); ex.printStackTrace(pw); } @@ -136,7 +136,7 @@ public class ErrorViewer implements NewConstants, NewConstants.LANG.ErrorViewer private static void printError(PrintWriter pw, String message) { System.err.println(message); - pw.printf(getLocalized(MESSAGE), getProperty(FORUM), getProperty(MAIL), getProperty(VERSION), message); + pw.printf(getLocalized(MESSAGE), getProperty(FORUM), getProperty(MAIL), message, getProperty(VERSION)); Map traces = Thread.getAllStackTraces(); for(Entry e:traces.entrySet()) { pw.println(); diff --git a/src/treeProperties/TreeProperties.java b/src/treeProperties/TreeProperties.java index ff6efd4ccfe..e2973160b84 100644 --- a/src/treeProperties/TreeProperties.java +++ b/src/treeProperties/TreeProperties.java @@ -260,7 +260,7 @@ public class TreeProperties implements Iterable { * Returns a property of the given type. This does not work to retrieve tree properties. */ @SuppressWarnings("unchecked") - public T getProperty(String key, Class cls) { + public T getProperty(String key, Class cls) { String suffix; if(cls == String.class) suffix = ""; else { @@ -303,6 +303,10 @@ public class TreeProperties implements Iterable { return result; } } + Exception ex= + new Exception("TreeProperties returns null for " + key + suffix); +// ex.printStackTrace(); + System.err.println(ex); return null; } @@ -330,7 +334,7 @@ public class TreeProperties implements Iterable { } //After this call, the next element is determined, or the child iterator has next - + public boolean hasNext() { if(next != null) return true; else if(child != null && child.hasNext()) return true; @@ -356,29 +360,29 @@ public class TreeProperties implements Iterable { cls = t.getType(); } next = new PropertyElement() { - + public String getKey() { return prefix + parts[0]; } - + public Class getType() { return cls; } - + public Object getValue() { return value; } - + public void setValue(String value) {} }; return true; } else return false; } - + public PropertyElement next() { if(!hasNext()) throw new NoSuchElementException(); else if(next != null) { @@ -388,7 +392,7 @@ public class TreeProperties implements Iterable { } else return child.next(); } - + public void remove() { throw new UnsupportedOperationException(); }