Changeset 10474 in josm
- Timestamp:
- 2016-06-24T07:59:21+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10458 r10474 319 319 320 320 /** 321 * A layer painter that issues a warning when being called. 322 * @author Michael Zangl 323 * @since 10474 324 */ 325 private static class WarningLayerPainter implements LayerPainter { 326 boolean warningPrinted = false; 327 private Layer layer; 328 329 public WarningLayerPainter(Layer layer) { 330 this.layer = layer; 331 } 332 333 @Override 334 public void paint(MapViewGraphics graphics) { 335 if (!warningPrinted) { 336 Main.debug("A layer triggered a repaint while being added: " + layer); 337 warningPrinted = true; 338 } 339 } 340 341 @Override 342 public void detachFromMapView(MapViewEvent event) { 343 // ignored 344 } 345 } 346 347 /** 321 348 * Removes a layer change listener 322 349 * <p> … … 603 630 try { 604 631 Layer layer = e.getAddedLayer(); 632 registeredLayers.put(layer, new WarningLayerPainter(layer)); 633 // Layers may trigger a redraw during this call if they open dialogs. 605 634 registeredLayers.put(layer, layer.attachToMapView(new MapViewEvent(this, false))); 606 635
Note:
See TracChangeset
for help on using the changeset viewer.