Changeset 13955 in josm for trunk


Ignore:
Timestamp:
2018-06-18T20:14:01+02:00 (16 months ago)
Author:
Don-vip
Message:

use IPrimitive in AutoScaleAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r13926 r13955  
    3030import org.openstreetmap.josm.data.osm.OsmPrimitive;
    3131import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    32 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor;
    3332import org.openstreetmap.josm.data.validation.TestError;
    3433import org.openstreetmap.josm.gui.MainApplication;
     
    287286
    288287    private BoundingXYVisitor modeSelectionOrConflict(BoundingXYVisitor v) {
    289         Collection<OsmPrimitive> sel = new HashSet<>();
     288        Collection<IPrimitive> sel = new HashSet<>();
    290289        if ("selection".equals(mode)) {
    291             DataSet dataSet = getLayerManager().getActiveDataSet();
     290            OsmData<?, ?, ?, ?> dataSet = getLayerManager().getActiveData();
    292291            if (dataSet != null) {
    293                 sel = dataSet.getSelected();
     292                sel.addAll(dataSet.getSelected());
    294293            }
    295294        } else {
    296295            ConflictDialog conflictDialog = MainApplication.getMap().conflictDialog;
    297             Conflict<? extends OsmPrimitive> c = conflictDialog.getSelectedConflict();
     296            Conflict<? extends IPrimitive> c = conflictDialog.getSelectedConflict();
    298297            if (c != null) {
    299298                sel.add(c.getMy());
    300299            } else if (conflictDialog.getConflicts() != null) {
    301                 sel = conflictDialog.getConflicts().getMyConflictParties();
     300                sel.addAll(conflictDialog.getConflicts().getMyConflictParties());
    302301            }
    303302        }
     
    310309            return null;
    311310        }
    312         for (OsmPrimitive osm : sel) {
    313             osm.accept((PrimitiveVisitor) v);
     311        for (IPrimitive osm : sel) {
     312            osm.accept(v);
    314313        }
    315314
Note: See TracChangeset for help on using the changeset viewer.