Changeset 1914 in josm for trunk/src/org
- Timestamp:
- 2009-08-05T11:40:38+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r1895 r1914 305 305 tempG.fillRect(0, 0, getWidth(), getHeight()); 306 306 307 Layer activeLayer = getActiveLayer(); 307 308 for (int i = layers.size()-1; i >= 0; --i) { 308 309 Layer l = layers.get(i); 309 if (l.isVisible() /* && l != getActiveLayer()*/) {310 if (l.isVisible() && l != getActiveLayer()) { 310 311 l.paint(tempG, this); 311 312 } 312 313 } 313 314 /*if (getActiveLayer() != null && getActiveLayer().visible)315 getActiveLayer().paint(tempG, this);*/314 if (activeLayer != null) { 315 activeLayer.paint(tempG, this); 316 } 316 317 317 318 for (MapViewPaintable mvp : temporaryLayers) { … … 392 393 public List<Layer> getAllLayersAsList() { 393 394 return Collections.unmodifiableList(layers); 395 } 396 397 /** 398 * Replies an unmodifiable list of layers of a certain type. 399 * 400 * Example: 401 * <pre> 402 * List<WMSLayer> wmsLayers = getLayersOfType(WMSLayer.class); 403 * </pre> 404 * 405 * @return an unmodifiable list of layers of a certain type. 406 */ 407 public <T> List<T> getLayersOfType(Class<T> ofType) { 408 ArrayList<T> ret = new ArrayList<T>(); 409 for (Layer layer : getAllLayersAsList()) { 410 if (ofType.isInstance(layer)) { 411 ret.add(ofType.cast(layer)); 412 } 413 } 414 return ret; 394 415 } 395 416
Note:
See TracChangeset
for help on using the changeset viewer.