Ignore:
Timestamp:
2017-08-28T19:26:47+02:00 (2 years ago)
Author:
Don-vip
Message:

see #15182 - introduce Main.getEditDataSet to avoid unneeded GUI dependence in validator tests and tagging presets

Location:
trunk/src/org/openstreetmap/josm/data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r12636 r12691  
    8686     */
    8787    public synchronized void add(final Command c) {
    88         DataSet ds = Optional.ofNullable(c.getAffectedDataSet()).orElseGet(() -> MainApplication.getLayerManager().getEditDataSet());
     88        DataSet ds = Optional.ofNullable(c.getAffectedDataSet()).orElseGet(() -> Main.main.getEditDataSet());
    8989        Collection<? extends OsmPrimitive> oldSelection = null;
    9090        if (ds != null) {
     
    115115        if (commands.isEmpty())
    116116            return;
    117         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     117        DataSet ds = Main.main.getEditDataSet();
    118118        Collection<? extends OsmPrimitive> oldSelection = null;
    119119        if (ds != null) {
     
    156156        if (redoCommands.isEmpty())
    157157            return;
    158         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     158        DataSet ds = Main.main.getEditDataSet();
    159159        Collection<? extends OsmPrimitive> oldSelection = ds.getSelected();
    160160        for (int i = 0; i < num; ++i) {
  • trunk/src/org/openstreetmap/josm/data/osm/FilterModel.java

    r12656 r12691  
    9696     */
    9797    public void executeFilters() {
    98         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     98        DataSet ds = Main.main.getEditDataSet();
    9999        changed = false;
    100100        if (ds == null) {
     
    145145     */
    146146    public void executeFilters(Collection<? extends OsmPrimitive> primitives) {
    147         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     147        DataSet ds = Main.main.getEditDataSet();
    148148        if (ds == null)
    149149            return;
     
    207207     */
    208208    public void clearFilterFlags() {
    209         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     209        DataSet ds = Main.main.getEditDataSet();
    210210        if (ds != null) {
    211211            FilterWorker.clearFilterFlags(ds.allPrimitives());
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java

    r12649 r12691  
    3232import org.openstreetmap.josm.data.validation.Test;
    3333import org.openstreetmap.josm.data.validation.TestError;
    34 import org.openstreetmap.josm.gui.MainApplication;
    3534import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    3635import org.openstreetmap.josm.tools.Logging;
     
    169168        mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0);
    170169        minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0);
    171         DataSet dataSet = MainApplication.getLayerManager().getEditDataSet();
     170        DataSet dataSet = Main.main.getEditDataSet();
    172171        dsArea = dataSet == null ? null : dataSet.getDataSourceArea();
    173172    }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java

    r12636 r12691  
    99import java.util.Set;
    1010
     11import org.openstreetmap.josm.Main;
    1112import org.openstreetmap.josm.command.Command;
    1213import org.openstreetmap.josm.data.osm.DataSet;
     
    1819import org.openstreetmap.josm.data.validation.Test;
    1920import org.openstreetmap.josm.data.validation.TestError;
    20 import org.openstreetmap.josm.gui.MainApplication;
    2121import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2222
     
    142142    public void startTest(ProgressMonitor monitor) {
    143143        super.startTest(monitor);
    144         DataSet ds = MainApplication.getLayerManager().getEditDataSet();
     144        DataSet ds = Main.main.getEditDataSet();
    145145        if (ds == null)
    146146            return;
Note: See TracChangeset for help on using the changeset viewer.