Changeset 1286 in josm for trunk/src/org
- Timestamp:
- 2009-01-17T22:41:20+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r1266 r1286 420 420 421 421 Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); 422 String geometry = Main.pref.get("gui.geometry"); 422 423 if (args.containsKey("geometry")) { 423 String geometry = args.get("geometry").iterator().next(); 424 geometry = args.get("geometry").iterator().next(); 425 } 426 if (geometry.length() != 0) { 424 427 final Matcher m = Pattern.compile("(\\d+)x(\\d+)(([+-])(\\d+)([+-])(\\d+))?").matcher(geometry); 425 428 if (m.matches()) { … … 436 439 } 437 440 bounds = new Rectangle(x,y,w,h); 441 if(!Main.pref.get("gui.geometry").equals(geometry)) { 442 // remember this geometry 443 Main.pref.put("gui.geometry", geometry); 444 } 438 445 } else 439 446 System.out.println("Ignoring malformed geometry: "+geometry); … … 548 555 return Locale.getDefault().getLanguage() + ":"; 549 556 } 557 558 static public void saveGuiGeometry() { 559 // if the gui.geometry preference is already set, 560 // save the current window geometry 561 String curGeometryPref = pref.get("gui.geometry"); 562 if(curGeometryPref.length() != 0) { 563 Rectangle bounds = parent.getBounds(); 564 pref.put("gui.geometry", 565 (int)bounds.getWidth() + 566 "x" + (int)bounds.getHeight() + 567 "+" + (int)bounds.getX() + 568 "+" + (int)bounds.getY()); 569 } 570 } 550 571 } -
trunk/src/org/openstreetmap/josm/actions/ExitAction.java
r1169 r1286 25 25 26 26 public void actionPerformed(ActionEvent e) { 27 if (!Main.breakBecauseUnsavedChanges()) 27 if (!Main.breakBecauseUnsavedChanges()) { 28 Main.saveGuiGeometry(); 28 29 System.exit(0); 30 } 29 31 } 30 32 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r1260 r1286 56 56 if (Main.breakBecauseUnsavedChanges()) 57 57 return; 58 Main.saveGuiGeometry(); 58 59 System.exit(0); 59 60 } … … 215 216 splash.closeSplash(); 216 217 217 if (!args.containsKey("no-fullscreen") && !args.containsKey("geometry") && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH))218 if (!args.containsKey("no-fullscreen") && !args.containsKey("geometry") && Main.pref.get("gui.geometry") == null && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH)) 218 219 mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); 219 220
Note:
See TracChangeset
for help on using the changeset viewer.