private void setRootLayer(ILayer newRoot) { if (layerModel != null) { layerModel.removeLayerListenerRecursively(openerListener); } super.setLayerModel(newRoot); layerModel.addLayerListenerRecursively(openerListener); }
@Override public void setSelectedStyles(Style[] selectedStyles) { checkIsOpen(); super.setSelectedStyles(selectedStyles); // DEPRECATED LISTENERS for (MapContextListener listener : listeners) { listener.layerSelectionChanged(this); } }
@Override public void setSelectedLayers(ILayer[] selectedLayers) { checkIsOpen(); ArrayList<ILayer> filtered = new ArrayList<ILayer>(); for (ILayer layer : selectedLayers) { if (layerModel.getLayerByName(layer.getName()) != null) { filtered.add(layer); } } super.setSelectedLayers(filtered.toArray(new ILayer[filtered.size()])); // DEPRECATED LISTENERS for (MapContextListener listener : listeners) { listener.layerSelectionChanged(this); } }