use of org.activityinfo.shared.report.model.layers.MapLayer in project activityinfo by bedatadriven.
the class LayersWidget method updateStore.
private void updateStore() {
// Save the selecteditem, because removing all items from the store
// triggers
// a selecteditem change
int selectedItemIndex = store.indexOf(view.getSelectionModel().getSelectedItem());
store.removeAll();
if (mapElement != null) {
for (MapLayer layer : mapElement.getLayers()) {
LayerModel model = new LayerModel();
model.setName(layer.getName());
model.setVisible(layer.isVisible());
model.setMapLayer(layer);
model.setLayerType(layer.getTypeName());
store.add(model);
}
}
// Place selection back at original selection
if ((selectedItemIndex != -1) && (selectedItemIndex < store.getCount())) {
List<LayerModel> selectedItem = new ArrayList<LayerModel>();
selectedItem.add(store.getAt(selectedItemIndex));
view.getSelectionModel().setSelection(selectedItem);
}
}
use of org.activityinfo.shared.report.model.layers.MapLayer in project activityinfo by bedatadriven.
the class NewLayerWizard method createLayer.
public MapLayer createLayer() {
MapLayer layer = layerTypePage.newLayer();
layer.setName(composeName());
for (Integer indicatorId : indicatorPage.getSelectedIds()) {
layer.addIndicatorId(indicatorId);
}
if (layer instanceof PolygonMapLayer) {
((PolygonMapLayer) layer).setAdminLevelId(adminLevelPage.getSelectedLevelId());
}
return layer;
}
Aggregations