Changeset 12638 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-08-25T00:57:47+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r12637 r12638 48 48 import org.openstreetmap.josm.gui.MapFrameListener; 49 49 import org.openstreetmap.josm.gui.layer.MainLayerManager; 50 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener;51 50 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; 52 51 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 53 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;54 52 import org.openstreetmap.josm.io.FileWatcher; 55 53 import org.openstreetmap.josm.io.OnlineResource; … … 147 145 148 146 /** 149 * The progress monitor being currently displayed.150 */151 public static PleaseWaitProgressMonitor currentProgressMonitor;152 153 /**154 147 * The main menu bar at top of screen. 155 148 */ … … 726 719 // Implementation part 727 720 /////////////////////////////////////////////////////////////////////////// 728 729 /**730 * Listener that sets the enabled state of undo/redo menu entries.731 */732 protected final CommandQueueListener redoUndoListener = (queueSize, redoSize) -> {733 menu.undo.setEnabled(queueSize > 0);734 menu.redo.setEnabled(redoSize > 0);735 };736 721 737 722 /** -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12637 r12638 76 76 import org.openstreetmap.josm.gui.layer.AutosaveTask; 77 77 import org.openstreetmap.josm.gui.layer.MainLayerManager; 78 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 78 79 import org.openstreetmap.josm.gui.layer.TMSLayer; 79 80 import org.openstreetmap.josm.gui.preferences.ToolbarPreferences; … … 152 153 */ 153 154 private static final MainLayerManager layerManager = new MainLayerManager(); 155 156 /** 157 * Listener that sets the enabled state of undo/redo menu entries. 158 */ 159 private final CommandQueueListener redoUndoListener = (queueSize, redoSize) -> { 160 menu.undo.setEnabled(queueSize > 0); 161 menu.redo.setEnabled(redoSize > 0); 162 }; 154 163 155 164 /** -
trunk/src/org/openstreetmap/josm/gui/MainPanel.java
r12636 r12638 14 14 import org.openstreetmap.josm.gui.layer.MainLayerManager.LayerAvailabilityEvent; 15 15 import org.openstreetmap.josm.gui.layer.MainLayerManager.LayerAvailabilityListener; 16 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor; 16 17 import org.openstreetmap.josm.gui.util.GuiHelper; 17 18 … … 80 81 listener.mapFrameInitialized(old, map); 81 82 } 82 if (map == null && Main.currentProgressMonitor!= null) {83 Main.currentProgressMonitor.showForegroundDialog();83 if (map == null && PleaseWaitProgressMonitor.getCurrent() != null) { 84 PleaseWaitProgressMonitor.getCurrent().showForegroundDialog(); 84 85 } 85 86 } -
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r12636 r12638 139 139 @Override 140 140 public void mouseClicked(MouseEvent e) { 141 PleaseWaitProgressMonitor monitor = Main.currentProgressMonitor;141 PleaseWaitProgressMonitor monitor = PleaseWaitProgressMonitor.getCurrent(); 142 142 if (monitor != null) { 143 143 monitor.showForegroundDialog(); -
trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
r12630 r12638 73 73 */ 74 74 public static final int PROGRESS_BAR_MAX = 10_000; 75 76 /** 77 * The progress monitor being currently displayed. 78 */ 79 static PleaseWaitProgressMonitor currentProgressMonitor; 80 75 81 private final Component dialogParent; 76 82 … … 86 92 87 93 private boolean cancelable; 94 95 /** 96 * Returns the progress monitor being currently displayed. 97 * @return the progress monitor being currently displayed 98 * @since 12638 99 */ 100 public static PleaseWaitProgressMonitor getCurrent() { 101 return currentProgressMonitor; 102 } 88 103 89 104 private void doInEDT(Runnable runnable) { … … 215 230 public void doBeginTask() { 216 231 doInEDT(() -> { 217 Main.currentProgressMonitor = this;232 currentProgressMonitor = this; 218 233 if (GraphicsEnvironment.isHeadless()) { 219 234 return; … … 339 354 dialog.dispose(); 340 355 dialog = null; 341 Main.currentProgressMonitor = null;356 currentProgressMonitor = null; 342 357 MapFrame map = MainApplication.getMap(); 343 358 if (map != null) { -
trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitorExecutor.java
r9665 r12638 6 6 import java.util.concurrent.TimeUnit; 7 7 8 import org.openstreetmap.josm.Main;9 8 import org.openstreetmap.josm.tools.Utils; 10 9 … … 30 29 @Override 31 30 public void execute(Runnable command) { 32 if ( Main.currentProgressMonitor != null) {31 if (PleaseWaitProgressMonitor.currentProgressMonitor != null) { 33 32 //TODO show only if this can't be in background or better if always in background is not checked 34 Main.currentProgressMonitor.showForegroundDialog();33 PleaseWaitProgressMonitor.currentProgressMonitor.showForegroundDialog(); 35 34 } 36 35 super.execute(command);
Note:
See TracChangeset
for help on using the changeset viewer.