Changeset 89 in josm
- Timestamp:
- 2006-04-21T15:25:32+02:00 (19 years ago)
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r86 r89 16 16 import java.util.concurrent.Executor; 17 17 import java.util.concurrent.Executors; 18 import java.util.regex.Matcher; 19 import java.util.regex.Pattern; 18 20 19 21 import javax.swing.Action; … … 220 222 System.out.println("options:"); 221 223 System.out.println("\t--help Show this help"); 224 System.out.println("\t--geometry=widthxheight(+|-)x(+|-)y Standard unix geometry argument"); 222 225 System.out.println("\t--download=minlat,minlon,maxlat,maxlon Download the bounding box"); 223 226 System.out.println("\t--no-fullscreen Don't launch in fullscreen mode"); … … 292 295 downloadFromParamString(true, s.substring(14)); 293 296 it.remove(); 297 } else if (s.startsWith("--geometry=")) { 298 Matcher m = Pattern.compile("(\\d+)x(\\d+)(([+-])(\\d+)([+-])(\\d+))?").matcher(s.substring(11)); 299 if (m.matches()) { 300 main.setExtendedState(NORMAL); 301 Integer w = Integer.valueOf(m.group(1)); 302 Integer h = Integer.valueOf(m.group(2)); 303 main.setSize(w, h); 304 if (m.group(3) != null) { 305 int x = Integer.valueOf(m.group(5)); 306 int y = Integer.valueOf(m.group(7)); 307 if (m.group(4).equals("-")) 308 x = Toolkit.getDefaultToolkit().getScreenSize().width - x - w; 309 if (m.group(6).equals("-")) 310 y = Toolkit.getDefaultToolkit().getScreenSize().height - y - h; 311 main.setLocation(x,y); 312 } 313 } else 314 System.out.println("Ignoring malformed geometry: "+s.substring(11)); 315 it.remove(); 294 316 } 295 317 }
Note:
See TracChangeset
for help on using the changeset viewer.