Changeset 4718 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2011-12-27T12:56:27+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r4681 r4718 22 22 import java.util.Collection; 23 23 import java.util.Iterator; 24 import java.util.LinkedList;25 24 import java.util.List; 26 25 import java.util.Map; 27 26 import java.util.StringTokenizer; 28 27 import java.util.concurrent.ExecutorService; 29 import java.util.concurrent.Executors;30 28 import java.util.concurrent.Future; 31 29 import java.util.regex.Matcher; … … 41 39 import javax.swing.JTextArea; 42 40 import javax.swing.KeyStroke; 41 import javax.swing.RepaintManager; 43 42 import javax.swing.UIManager; 44 43 44 import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager; 45 45 import org.openstreetmap.gui.jmapviewer.FeatureAdapter; 46 46 import org.openstreetmap.josm.actions.JosmAction; … … 76 76 import org.openstreetmap.josm.gui.preferences.TaggingPresetPreference; 77 77 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; 78 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 79 import org.openstreetmap.josm.gui.progress.ProgressMonitorExecutor; 78 80 import org.openstreetmap.josm.io.OsmApi; 79 81 import org.openstreetmap.josm.plugins.PluginHandler; … … 116 118 * and sequential. 117 119 */ 118 public final static ExecutorService worker = Executors.newSingleThreadExecutor();120 public final static ExecutorService worker = new ProgressMonitorExecutor(); 119 121 /** 120 122 * Global application preferences … … 143 145 144 146 public UndoRedoHandler undoRedo = new UndoRedoHandler(); 147 148 public static PleaseWaitProgressMonitor currentProgressMonitor; 145 149 146 150 /** … … 208 212 209 213 PluginHandler.notifyMapFrameChanged(old, map); 214 if (map == null && currentProgressMonitor != null) { 215 currentProgressMonitor.showForegroundDialog(); 216 } 210 217 } 211 218 … … 238 245 isOpenjdk = System.getProperty("java.vm.name").toUpperCase().indexOf("OPENJDK") != -1; 239 246 240 if (initListener != null) 247 if (initListener != null) { 241 248 initListener.updateStatus(tr("Executing platform startup hook")); 249 } 242 250 platform.startupHook(); 243 251 … … 245 253 // capabilities are already known to the editor instance. However 246 254 // if it goes wrong that's not critical at this stage. 247 if (initListener != null) 255 if (initListener != null) { 248 256 initListener.updateStatus(tr("Initializing OSM API")); 257 } 249 258 try { 250 259 OsmApi.getOsmApi().initialize(null, true); … … 253 262 } 254 263 255 if (initListener != null) 264 if (initListener != null) { 256 265 initListener.updateStatus(tr("Building main menu")); 266 } 257 267 contentPanePrivate.add(panel, BorderLayout.CENTER); 258 268 panel.add(gettingStarted, BorderLayout.CENTER); … … 267 277 KeyEvent.VK_F1, Shortcut.GROUP_DIRECT)); 268 278 269 if (initListener != null) 279 if (initListener != null) { 270 280 initListener.updateStatus(tr("Initializing presets")); 281 } 271 282 TaggingPresetPreference.initialize(); 272 283 273 if (initListener != null) 284 if (initListener != null) { 274 285 initListener.updateStatus(tr("Initializing map styles")); 286 } 275 287 MapPaintPreference.initialize(); 276 288 277 if (initListener != null) 289 if (initListener != null) { 278 290 initListener.updateStatus(tr("Loading imagery preferences")); 291 } 279 292 ImageryPreference.initialize(); 280 293 281 if (initListener != null) 294 if (initListener != null) { 282 295 initListener.updateStatus(tr("Initializing validator")); 296 } 283 297 validator = new OsmValidator(); 284 298 MapView.addLayerChangeListener(validator); … … 293 307 FeatureAdapter.registerTranslationAdapter(I18n.getTranslationAdapter()); 294 308 295 if (initListener != null) 309 if (initListener != null) { 296 310 initListener.updateStatus(tr("Updating user interface")); 311 } 297 312 298 313 toolbar.refreshToolbarControl(); … … 527 542 tr("Warning"), 528 543 JOptionPane.WARNING_MESSAGE 529 );544 ); 530 545 } 531 546 if (f!=null) { … … 560 575 tr("Warning"), 561 576 JOptionPane.WARNING_MESSAGE 562 );577 ); 563 578 } 564 579 } … … 647 662 tr("Warning"), 648 663 JOptionPane.WARNING_MESSAGE 649 );664 ); 650 665 } else { 651 666 downloadFromParamBounds(rawGps, b); … … 664 679 new LatLon(Double.parseDouble(st.nextToken()),Double.parseDouble(st.nextToken())), 665 680 new LatLon(Double.parseDouble(st.nextToken()),Double.parseDouble(st.nextToken())) 666 );681 ); 667 682 downloadFromParamBounds(rawGps, b); 668 683 }
Note:
See TracChangeset
for help on using the changeset viewer.