Examples of VectorLayerComponentInfo


Examples of org.geomajas.plugin.printing.component.dto.VectorLayerComponentInfo

    map.setApplicationId(applicationId);
    map.setRasterResolution(rasterDpi);
    List<PrintComponentInfo> layerChildren = new ArrayList<PrintComponentInfo>();
    for (Layer layer : mapModel.getLayers()) {
      if (layer instanceof VectorLayer && layer.isShowing()) {
        VectorLayerComponentInfo info = new VectorLayerComponentInfo();
        VectorLayer vectorLayer = (VectorLayer) layer;
        info.setLayerId(vectorLayer.getServerLayerId());
        ClientVectorLayerInfo layerInfo = vectorLayer.getLayerInfo();
        info.setStyleInfo(layerInfo.getNamedStyleInfo());
        info.setFilter(vectorLayer.getFilter());
        info.setLabelsVisible(vectorLayer.isLabeled());
        info.setSelected(vectorLayer.isSelected());
        Set<String> features = vectorLayer.getSelectedFeatures();
        info.setSelectedFeatureIds(features.toArray(new String[features.size()]));
        layerChildren.add(info);
      } else if (layer instanceof RasterLayer && layer.isShowing()) {
        RasterLayerComponentInfo info = new RasterLayerComponentInfo();
        RasterLayer rasterLayer = (RasterLayer) layer;
        info.setLayerId(rasterLayer.getServerLayerId());
        info.setStyle(rasterLayer.getLayerInfo().getStyle());
        layerChildren.add(info);
      }
    }
    map.getChildren().addAll(0, layerChildren);
    return map;
View Full Code Here

Examples of org.geomajas.plugin.printing.component.dto.VectorLayerComponentInfo

    mapComponent.clearLayers();
    ClientMapInfo map = configurationService.getMapInfo(mapComponent.getMapId(), mapComponent.getApplicationId());
    List<BaseLayerComponent> layers = new ArrayList<BaseLayerComponent>();
    for (ClientLayerInfo info : map.getLayers()) {
      if (info instanceof ClientVectorLayerInfo) {
        VectorLayerComponentInfo vectorInfo = new VectorLayerComponentInfo();
        vectorInfo.setLabelsVisible(false);
        vectorInfo.setLayerId(info.getServerLayerId());
        vectorInfo.setStyleInfo(((ClientVectorLayerInfo) info).getNamedStyleInfo());
        vectorInfo.setVisible(true);
        try {
          VectorLayerComponentImpl comp = (VectorLayerComponentImpl) printDtoConverterService
              .toInternal(vectorInfo);
          layers.add(comp);
        } catch (PrintingException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.