Ignore:
Timestamp:
2013-12-27T15:03:59+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9482, see #9423, see #6853 - fix regression from r6542: irregular behaviour drawing ways

File:
1 edited

Legend:

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

    r6535 r6546  
    5151import org.openstreetmap.josm.actions.downloadtasks.DownloadTask;
    5252import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler;
     53import org.openstreetmap.josm.actions.mapmode.DrawAction;
    5354import org.openstreetmap.josm.actions.mapmode.MapMode;
    5455import org.openstreetmap.josm.actions.search.SearchAction;
     
    6061import org.openstreetmap.josm.data.coor.LatLon;
    6162import org.openstreetmap.josm.data.osm.DataSet;
     63import org.openstreetmap.josm.data.osm.OsmPrimitive;
    6264import org.openstreetmap.josm.data.osm.PrimitiveDeepCopy;
    6365import org.openstreetmap.josm.data.projection.Projection;
     
    591593        return getEditLayer().data;
    592594    }
     595   
     596    /**
     597     * Replies the current selected primitives, from a end-user point of view.
     598     * It is not always technically the same collection of primitives than {@link DataSet#getSelected()}.
     599     * Indeed, if the user is currently in drawing mode, only the way currently being drawn is returned,
     600     * see {@link DrawAction#getInProgressSelection()}.
     601     *
     602     * @return The current selected primitives, from a end-user point of view. Can be {@code null}.
     603     * @since 6546
     604     */
     605    public Collection<OsmPrimitive> getInProgressSelection() {
     606        if (map != null && map.mapMode instanceof DrawAction) {
     607            return ((DrawAction) map.mapMode).getInProgressSelection();
     608        } else {
     609            DataSet ds = getCurrentDataSet();
     610            if (ds == null) return null;
     611            return ds.getSelected();
     612        }
     613    }
    593614
    594615    /**
Note: See TracChangeset for help on using the changeset viewer.