Changeset 4758 in josm
- Timestamp:
- 2012-01-01T18:27:06+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/progress
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/progress/AbstractProgressMonitor.java
r4718 r4758 6 6 import java.util.LinkedList; 7 7 import java.util.Queue; 8 9 import javax.swing.SwingUtilities;10 8 11 9 public abstract class AbstractProgressMonitor implements ProgressMonitor { … … 61 59 } 62 60 throw new ProgressException("Expected states are %s but current state is %s", Arrays.asList(expectedStates).toString(), state); 63 }64 65 protected void doInEDT(Runnable runnable) {66 if (SwingUtilities.isEventDispatchThread()) {67 runnable.run();68 } else {69 SwingUtilities.invokeLater(runnable);70 }71 61 } 72 62 -
trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
r4756 r4758 13 13 14 14 import javax.swing.JOptionPane; 15 import javax.swing.SwingUtilities; 15 16 16 17 import org.openstreetmap.josm.Main; … … 48 49 private boolean cancelable; 49 50 51 private void doInEDT(Runnable runnable) { 52 // This must be invoke later even if current thread is EDT because inside there is dialog.setVisible which freeze current code flow until modal dialog is closed 53 SwingUtilities.invokeLater(runnable); 54 } 55 56 50 57 private void setDialogVisible(boolean visible) { 51 58 if (dialog.isVisible() != visible) { -
trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java
r4718 r4758 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.progress; 3 4 import javax.swing.SwingUtilities; 3 5 4 6 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 25 27 CheckParameterUtil.ensureParameterNotNull(delegate, "delegate"); 26 28 this.delegate = delegate; 29 } 30 31 private void doInEDT(Runnable runnable) { 32 if (SwingUtilities.isEventDispatchThread()) { 33 runnable.run(); 34 } else { 35 SwingUtilities.invokeLater(runnable); 36 } 27 37 } 28 38
Note:
See TracChangeset
for help on using the changeset viewer.