Changeset 7575 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2014-09-21T23:00:38+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r7501 r7575 24 24 import org.openstreetmap.josm.Main; 25 25 import org.openstreetmap.josm.data.Bounds; 26 import org.openstreetmap.josm.data.Data; 27 import org.openstreetmap.josm.data.DataSource; 26 28 import org.openstreetmap.josm.data.SelectionChangedListener; 27 29 import org.openstreetmap.josm.data.coor.EastNorth; … … 90 92 * @author imi 91 93 */ 92 public final class DataSet implements Cloneable, ProjectionChangeListener {94 public final class DataSet implements Data, Cloneable, ProjectionChangeListener { 93 95 94 96 /** … … 916 918 } 917 919 918 /** 919 * Returns the total area of downloaded data (the "yellow rectangles"). 920 * @return Area object encompassing downloaded data. 921 */ 920 @Override 921 public Collection<DataSource> getDataSources() { 922 return dataSources; 923 } 924 925 @Override 922 926 public Area getDataSourceArea() { 923 if (dataSources.isEmpty()) return null; 924 Area a = new Area(); 925 for (DataSource source : dataSources) { 926 // create area from data bounds 927 a.add(new Area(source.bounds.asRect())); 928 } 929 return a; 927 return DataSource.getDataSourceArea(dataSources); 930 928 } 931 929 … … 1317 1315 } 1318 1316 1319 /** 1320 * <p>Replies the list of data source bounds.</p> 1321 * 1322 * <p>Dataset maintains a list of data sources which have been merged into the 1323 * data set. Each of these sources can optionally declare a bounding box of the 1324 * data it supplied to the dataset.</p> 1325 * 1326 * <p>This method replies the list of defined (non {@code null}) bounding boxes.</p> 1327 * 1328 * @return the list of data source bounds. An empty list, if no non-null data source 1329 * bounds are defined. 1330 */ 1317 @Override 1331 1318 public List<Bounds> getDataSourceBounds() { 1332 List<Bounds> ret = new ArrayList<>(dataSources.size()); 1333 for (DataSource ds : dataSources) { 1334 if (ds.bounds != null) { 1335 ret.add(ds.bounds); 1336 } 1337 } 1338 return ret; 1319 return DataSource.getDataSourceBounds(dataSources); 1339 1320 } 1340 1321
Note:
See TracChangeset
for help on using the changeset viewer.