Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r8509 r8510 501 501 } 502 502 panel.setVisible(true); 503 redoUndoListener.commandChanged(0, 0);503 redoUndoListener.commandChanged(0, 0); 504 504 505 505 Main.map = map; … … 532 532 533 533 Object updateStatus(String event); 534 534 535 void finish(Object status); 535 536 } … … 768 769 setMapFrame(mapFrame); 769 770 if (firstLayer != null) { 770 mapFrame.selectMapMode((MapMode) mapFrame.getDefaultButtonAction(), firstLayer);771 mapFrame.selectMapMode((MapMode) mapFrame.getDefaultButtonAction(), firstLayer); 771 772 } 772 773 mapFrame.initializeDialogsPane(); … … 904 905 protected static int windowState = JFrame.NORMAL; 905 906 906 private final CommandQueueListener redoUndoListener = new CommandQueueListener() {907 private final CommandQueueListener redoUndoListener = new CommandQueueListener() { 907 908 @Override 908 909 public void commandChanged(final int queueSize, final int redoSize) { … … 998 999 ); 999 1000 } 1000 if (f !=null) {1001 if (f != null) { 1001 1002 fileList.add(f); 1002 1003 } … … 1008 1009 } 1009 1010 } 1010 if (!fileList.isEmpty()) {1011 if (!fileList.isEmpty()) { 1011 1012 OpenFileAction.openFiles(fileList, true); 1012 1013 } … … 1067 1068 continue; 1068 1069 } 1069 AbstractModifiableLayer odl = (AbstractModifiableLayer) l;1070 AbstractModifiableLayer odl = (AbstractModifiableLayer) l; 1070 1071 if ((odl.requiresSaveToFile() || (odl.requiresUploadToServer() && !odl.isUploadDiscouraged())) && odl.isModified()) { 1071 1072 layersWithUnmodifiedChanges.add(odl); … … 1138 1139 */ 1139 1140 private static DownloadParamType paramType(String s) { 1140 if (s.startsWith("http:") || s.startsWith("https:")) return DownloadParamType.httpUrl;1141 if (s.startsWith("file:")) return DownloadParamType.fileUrl;1141 if (s.startsWith("http:") || s.startsWith("https:")) return DownloadParamType.httpUrl; 1142 if (s.startsWith("file:")) return DownloadParamType.fileUrl; 1142 1143 String coorPattern = "\\s*[+-]?[0-9]+(\\.[0-9]+)?\\s*"; 1143 if (s.matches(coorPattern+"(,"+coorPattern+"){3}")) return DownloadParamType.bounds;1144 if (s.matches(coorPattern+"(,"+coorPattern+") {3}")) return DownloadParamType.bounds; 1144 1145 // everything else must be a file name 1145 1146 return DownloadParamType.fileName; … … 1174 1175 if (st.countTokens() == 4) { 1175 1176 Bounds b = new Bounds( 1176 new LatLon(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken())),1177 new LatLon(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()))1177 new LatLon(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken())), 1178 new LatLon(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken())) 1178 1179 ); 1179 1180 downloadFromParamBounds(rawGps, b); … … 1247 1248 Component c = e.getComponent(); 1248 1249 if (c instanceof JFrame && c.isVisible()) { 1249 if (Main.windowState == JFrame.NORMAL) {1250 if (Main.windowState == JFrame.NORMAL) { 1250 1251 Main.geometry = new WindowGeometry((JFrame) c); 1251 1252 } else { … … 1258 1259 protected static void addListener() { 1259 1260 parent.addComponentListener(new WindowPositionSizeListener()); 1260 ((JFrame) parent).addWindowStateListener(new WindowPositionSizeListener());1261 ((JFrame) parent).addWindowStateListener(new WindowPositionSizeListener()); 1261 1262 } 1262 1263 … … 1356 1357 || (newValue != null && oldValue != null && !Objects.equals(newValue.toCode(), oldValue.toCode()))) { 1357 1358 1358 synchronized (Main.class) {1359 synchronized (Main.class) { 1359 1360 Iterator<WeakReference<ProjectionChangeListener>> it = listeners.iterator(); 1360 while (it.hasNext()) {1361 while (it.hasNext()) { 1361 1362 WeakReference<ProjectionChangeListener> wr = it.next(); 1362 1363 ProjectionChangeListener listener = wr.get(); … … 1398 1399 public static void removeProjectionChangeListener(ProjectionChangeListener listener) { 1399 1400 if (listener == null) return; 1400 synchronized (Main.class){1401 synchronized (Main.class) { 1401 1402 Iterator<WeakReference<ProjectionChangeListener>> it = listeners.iterator(); 1402 while (it.hasNext()) {1403 while (it.hasNext()) { 1403 1404 WeakReference<ProjectionChangeListener> wr = it.next(); 1404 1405 // remove the listener - and any other listener which got garbage … … 1462 1463 public static void removeWindowSwitchListener(WindowSwitchListener listener) { 1463 1464 if (listener == null) return; 1464 synchronized (Main.class) {1465 synchronized (Main.class) { 1465 1466 Iterator<WeakReference<WindowSwitchListener>> it = windowSwitchListeners.iterator(); 1466 while (it.hasNext()) {1467 while (it.hasNext()) { 1467 1468 WeakReference<WindowSwitchListener> wr = it.next(); 1468 1469 // remove the listener - and any other listener which got garbage … … 1536 1537 synchronized (Main.class) { 1537 1538 Iterator<WeakReference<WindowSwitchListener>> it = windowSwitchListeners.iterator(); 1538 while (it.hasNext()) {1539 while (it.hasNext()) { 1539 1540 WeakReference<WindowSwitchListener> wr = it.next(); 1540 1541 WindowSwitchListener listener = wr.get(); … … 1565 1566 synchronized (Main.class) { 1566 1567 Iterator<WeakReference<WindowSwitchListener>> it = windowSwitchListeners.iterator(); 1567 while (it.hasNext()) {1568 while (it.hasNext()) { 1568 1569 WeakReference<WindowSwitchListener> wr = it.next(); 1569 1570 WindowSwitchListener listener = wr.get();
Note:
See TracChangeset
for help on using the changeset viewer.