Ignore:
Timestamp:
2020-03-06T23:54:39+01:00 (5 years ago)
Author:
Don-vip
Message:

see #18845 - see #16860 - directory cleanup

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r15469 r16050  
    6363import javax.swing.UnsupportedLookAndFeelException;
    6464
    65 import org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager;
    6665import org.openstreetmap.josm.actions.DeleteAction;
    6766import org.openstreetmap.josm.actions.JosmAction;
     
    121120import org.openstreetmap.josm.gui.preferences.server.ProxyPreference;
    122121import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor;
     122import org.openstreetmap.josm.gui.util.CheckThreadViolationRepaintManager;
    123123import org.openstreetmap.josm.gui.util.GuiHelper;
    124124import org.openstreetmap.josm.gui.util.RedirectInputMap;
  • trunk/src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java

    r16049 r16050  
    1515 */
    1616
    17 package org.jdesktop.swinghelper.debug;
     17package org.openstreetmap.josm.gui.util;
    1818
    1919import java.lang.ref.WeakReference;
     
    2222import javax.swing.RepaintManager;
    2323import javax.swing.SwingUtilities;
     24
     25import org.openstreetmap.josm.tools.Logging;
    2426
    2527/**
     
    3941 */
    4042public class CheckThreadViolationRepaintManager extends RepaintManager {
    41     // it is recommended to pass the complete check
    42     private boolean completeCheck = true;
    4343    private WeakReference<JComponent> lastComponent;
    44 
    45     public CheckThreadViolationRepaintManager(boolean completeCheck) {
    46         this.completeCheck = completeCheck;
    47     }
    48 
    49     public CheckThreadViolationRepaintManager() {
    50         this(true);
    51     }
    5244
    5345    @Override
     
    6456
    6557    private void checkThreadViolations(JComponent c) {
    66         if (!SwingUtilities.isEventDispatchThread() && (completeCheck || c.isShowing())) {
     58        if (!SwingUtilities.isEventDispatchThread()) {
    6759            boolean repaint = false;
    6860            boolean fromSwing = false;
     
    7163            for (StackTraceElement st : stackTrace) {
    7264                if (repaint && st.getClassName().startsWith("javax.swing.") &&
    73                         // for details see
    74                         // https://swinghelper.dev.java.net/issues/show_bug.cgi?id=1
    75                          !st.getClassName().startsWith("javax.swing.SwingWorker")) {
     65                    // for details see https://swinghelper.dev.java.net/issues/show_bug.cgi?id=1
     66                    !st.getClassName().startsWith("javax.swing.SwingWorker")) {
    7667                    fromSwing = true;
    7768                }
     
    10697    }
    10798
    108     protected void violationFound(JComponent c, StackTraceElement[] stackTrace) {
    109         System.out.println();
    110         System.out.println("EDT violation detected");
    111         System.out.println(c);
     99    protected static void violationFound(JComponent c, StackTraceElement[] stackTrace) {
     100        Logging.error("");
     101        Logging.error("EDT violation detected");
     102        Logging.error(c.toString());
    112103        for (StackTraceElement st : stackTrace) {
    113             System.out.println("\tat " + st);
     104            Logging.error("\tat " + st);
    114105        }
    115106    }
Note: See TracChangeset for help on using the changeset viewer.