Changeset 6546 in josm for trunk/src/org/openstreetmap/josm/Main.java
- Timestamp:
- 2013-12-27T15:03:59+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6535 r6546 51 51 import org.openstreetmap.josm.actions.downloadtasks.DownloadTask; 52 52 import org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler; 53 import org.openstreetmap.josm.actions.mapmode.DrawAction; 53 54 import org.openstreetmap.josm.actions.mapmode.MapMode; 54 55 import org.openstreetmap.josm.actions.search.SearchAction; … … 60 61 import org.openstreetmap.josm.data.coor.LatLon; 61 62 import org.openstreetmap.josm.data.osm.DataSet; 63 import org.openstreetmap.josm.data.osm.OsmPrimitive; 62 64 import org.openstreetmap.josm.data.osm.PrimitiveDeepCopy; 63 65 import org.openstreetmap.josm.data.projection.Projection; … … 591 593 return getEditLayer().data; 592 594 } 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 } 593 614 594 615 /**
Note:
See TracChangeset
for help on using the changeset viewer.