Changeset 4762 in josm


Ignore:
Timestamp:
2012-01-04T08:43:23+01:00 (8 years ago)
Author:
jttt
Message:

Add method getWindowParent to ProgressMonitor (see #7208)

Location:
trunk/src/org/openstreetmap/josm/gui/progress
Files:
5 edited

Legend:

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

    r4718 r4762  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.progress;
     3
     4import java.awt.Component;
    35
    46public class ChildProgress extends AbstractProgressMonitor {
     
    6567        return parent.getProgressTaskId();
    6668    }
     69
     70    @Override
     71    public Component getWindowParent() {
     72        return parent.getWindowParent();
     73    }
    6774}
  • trunk/src/org/openstreetmap/josm/gui/progress/NullProgressMonitor.java

    r4718 r4762  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.progress;
     3
     4import java.awt.Component;
     5
     6import org.openstreetmap.josm.Main;
    37
    48public class NullProgressMonitor implements ProgressMonitor {
     
    8993        return null;
    9094    }
     95
     96    @Override
     97    public Component getWindowParent() {
     98        return Main.parent;
     99    }
    91100}
  • trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java

    r4761 r4762  
    322322    }
    323323
     324
     325    @Override
     326    public Component getWindowParent() {
     327        Component parent = dialog;
     328        if (isInBackground || parent == null)
     329            return Main.parent;
     330        else
     331            return parent;
     332    }
    324333}
  • trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java

    r4718 r4762  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.progress;
     3
     4import java.awt.Component;
    35
    46/**
     
    140142     */
    141143    ProgressTaskId getProgressTaskId();
     144
     145    /**
     146     *
     147     * @return component suitable as parent for dialogs that wants to be shown in front of progress dialog
     148     */
     149    Component getWindowParent();
    142150}
  • trunk/src/org/openstreetmap/josm/gui/progress/SwingRenderingProgressMonitor.java

    r4758 r4762  
    22package org.openstreetmap.josm.gui.progress;
    33
     4import java.awt.Component;
     5
    46import javax.swing.SwingUtilities;
    57
     8import org.openstreetmap.josm.Main;
    69import org.openstreetmap.josm.tools.CheckParameterUtil;
    710
     
    102105        return null;
    103106    }
     107
     108    @Override
     109    public Component getWindowParent() {
     110        return Main.parent;
     111    }
    104112}
Note: See TracChangeset for help on using the changeset viewer.