Changeset 17741 in josm
- Timestamp:
- 2021-04-11T11:29:12+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityAction.java
r17740 r17741 610 610 panels.put(color, colorPanel); 611 611 612 List<Color> colors = layerSupplier.get().stream().map(l -> l.getColor()).distinct().collect(Collectors.toList());612 List<Color> colors = getColors(); 613 613 if (colors.size() == 1) { 614 614 highlightColor(colors.get(0)); … … 616 616 } 617 617 618 @Override 619 public void updateLayers() { 620 Collection<Layer> layers = layerSupplier.get(); 621 List<Color> colors = layers.stream().filter(l -> l instanceof GpxLayer) 622 .map(l -> ((GpxLayer) l).getColor()) 618 private List<Color> getColors() { 619 return layerSupplier.get().stream() 620 .filter(layer -> layer instanceof GpxLayer) 621 .map(Layer::getColor) 623 622 .distinct() 624 623 .collect(Collectors.toList()); 624 } 625 626 @Override 627 public void updateLayers() { 628 List<Color> colors = getColors(); 625 629 if (colors.size() == 1) { 626 630 setVisible(true);
Note:
See TracChangeset
for help on using the changeset viewer.