private void setCurrentFeature(final Feature feature) {
   this.feature = feature;
   if (feature != null) {
     final Geometry geom = (Geometry) FeatureExt.getDefaultGeometryAttributeValue(feature);
     decoration.setGeometries(Collections.singleton(helper.toObjectiveCRS(geom)));
     dialogDecoration.clipboardPanel.setGeometry(geom);
     dialogDecoration.clipboardPanel.setCrs(FeatureExt.getCRS(feature.getType()));
   } else {
     dialogDecoration.clipboardPanel.setGeometry(null);
   }
 }
Ejemplo n.º 2
0
 @Override
 public WebMapTileClient create(Map<String, ? extends Serializable> params)
     throws DataStoreException {
   try {
     return create(FeatureExt.toParameter(params, getParametersDescriptor()));
   } catch (InvalidParameterValueException ex) {
     throw new DataStoreException(ex);
   }
 }
  @Override
  public void mouseClicked(final MouseEvent e) {

    final int button = e.getButton();

    if (button == MouseEvent.BUTTON1) {
      if (feature == null) {
        setCurrentFeature(helper.grabFeature(e.getX(), e.getY(), false));
      }
    } else if (button == MouseEvent.BUTTON3 && feature != null) {
      final Geometry oldgeom = (Geometry) FeatureExt.getDefaultGeometryAttributeValue(feature);
      final Geometry newGeom = dialogDecoration.clipboardPanel.getGeometry();
      if (!oldgeom.equals(newGeom)) {
        helper.sourceModifyFeature(feature, newGeom, false);
      }
      reset();
    }
  }