Changeset 31459 in osm for applications/editors/josm/plugins/mapillary/src/org
- Timestamp:
- 2015-08-06T16:55:05+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31457 r31459 2 2 3 3 import org.openstreetmap.josm.Main; 4 import org.openstreetmap.josm.data.Bounds; 4 5 import org.openstreetmap.josm.plugins.mapillary.cache.CacheUtils; 5 6 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog; … … 26 27 27 28 private CopyOnWriteArrayList<MapillaryDataListener> listeners = new CopyOnWriteArrayList<>(); 29 30 /** The bounds of the areas for which the pictures have been downloaded. */ 31 public CopyOnWriteArrayList<Bounds> bounds; 28 32 29 33 /** -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31457 r31459 74 74 public boolean TEMP_SEMIAUTOMATIC = false; 75 75 76 /** Unique instance of the class */ 76 /** Unique instance of the class. */ 77 77 public static MapillaryLayer INSTANCE; 78 /** The image pointed by the blue line */ 78 /** The image pointed by the blue line. */ 79 79 public static MapillaryImage BLUE; 80 /** The image pointed by the red line */ 80 /** The image pointed by the red line. */ 81 81 public static MapillaryImage RED; 82 82 83 /** {@link MapillaryData} object that stores the database */ 83 /** {@link MapillaryData} object that stores the database. */ 84 84 private final MapillaryData data; 85 85 86 /** The bounds of the areas for which the pictures have been downloaded */ 87 public CopyOnWriteArrayList<Bounds> bounds; 88 89 /** Mode of the layer */ 86 /** Mode of the layer. */ 90 87 public AbstractMode mode; 91 88 … … 100 97 super(tr("Mapillary Images")); 101 98 this.data = new MapillaryData(); 102 this.bounds = new CopyOnWriteArrayList<>(); 99 this.data.bounds = new CopyOnWriteArrayList<>(); 103 100 init(); 104 101 } … … 243 240 * Replies background color for downloaded areas. 244 241 * 245 * @return background color for downloaded areas. Black by default 242 * @return background color for downloaded areas. Black by default. 246 243 */ 247 244 private static Color getBackgroundColor() { … … 252 249 * Replies background color for non-downloaded areas. 253 250 * 254 * @return background color for non-downloaded areas. Yellow by default 251 * @return background color for non-downloaded areas. Yellow by default. 255 252 */ 256 253 private static Color getOutsideColor() { … … 259 256 260 257 /** 261 * Initialize the hatch pattern used to paint the non-downloaded area 258 * Initialize the hatch pattern used to paint the non-downloaded area. 262 259 */ 263 260 private void createHatchTexture() { … … 283 280 Area a = new Area(b); 284 281 // now successively subtract downloaded areas 285 for (Bounds bounds : this.bounds) { 282 for (Bounds bounds : this.data.bounds) { 286 283 Point p1 = mv.getPoint(bounds.getMin()); 287 284 Point p2 = mv.getPoint(bounds.getMax()); … … 508 505 } 509 506 510 // EditDataLayerChanged511 507 @Override 512 508 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
r31455 r31459 82 82 if (isViewDownloaded(view)) 83 83 return; 84 MapillaryLayer.getInstance().bounds.add(view); 84 MapillaryLayer.getInstance().getData().bounds.add(view); 85 85 getImages(view); 86 86 } … … 108 108 } 109 109 110 /** 111 * Checks if the given {@LatLon} object lies inside the bounds of the 112 * image. 113 * 114 * @param latlon 115 * @return true if it lies inside the bounds; false otherwise; 116 */ 110 117 private static boolean isInBounds(LatLon latlon) { 111 for (Bounds bounds : MapillaryLayer.getInstance().bounds) { 118 for (Bounds bounds : MapillaryLayer.getInstance().getData().bounds) { 112 119 if (bounds.contains(latlon)) 113 120 return true; … … 141 148 for (Bounds bounds : Main.map.mapView.getEditLayer().data 142 149 .getDataSourceBounds()) { 143 if (!layer.bounds.contains(bounds)) { 144 layer.bounds.add(bounds); 150 if (!layer.getData().bounds.contains(bounds)) { 151 layer.getData().bounds.add(bounds); 145 152 MapillaryDownloader.getImages(bounds.getMin(), bounds.getMax()); 146 153 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java
r31451 r31459 132 132 133 133 private boolean isInside(MapillaryAbstractImage image) { 134 for (int i = 0; i < this.layer.bounds.size(); i++) 135 if (this.layer.bounds.get(i).contains(image.getLatLon())) 134 for (int i = 0; i < this.layer.getData().bounds.size(); i++) 135 if (this.layer.getData().bounds.get(i).contains(image.getLatLon())) 136 136 return true; 137 137 return false;
Note:
See TracChangeset
for help on using the changeset viewer.