Package org.geomajas.gwt.client.map.feature

Examples of org.geomajas.gwt.client.map.feature.Feature


        GwtCommandDispatcher.getInstance().execute(searchCommand,
            new AbstractCommandCallback<SearchFeatureResponse>() {

              public void execute(SearchFeatureResponse response) {
                for (org.geomajas.layer.feature.Feature feature : response.getFeatures()) {
                  Feature f = new Feature(feature, layer);
                  grid.addFeature(f);
                  layer.getFeatureStore().addFeature(f);
                }
              }
            });
View Full Code Here


        GwtCommandDispatcher.getInstance().execute(searchCommand,
            new AbstractCommandCallback<SearchFeatureResponse>() {

              public void execute(SearchFeatureResponse response) {
                for (org.geomajas.layer.feature.Feature feature : response.getFeatures()) {
                  grid.addFeature(new Feature(feature, layer));
                }
              }
            });
      }
    });
View Full Code Here

          public void execute(CommandResponse response) {
            if (response instanceof SearchFeatureResponse) {
              SearchFeatureResponse resp = (SearchFeatureResponse) response;
              for (org.geomajas.layer.feature.Feature dtoFeature : resp.getFeatures()) {
                Feature feature = new Feature(dtoFeature, layer);
                if (null != featureAttributeWindow) {
                  featureAttributeWindow.destroy();
                  featureAttributeWindow = null;
                }
                featureAttributeWindow = new FeatureAttributeWindow(feature, true);
View Full Code Here

    List<Geometry> geoms = new ArrayList<Geometry>();
    for (VectorLayer layer : mapWidget.getMapModel().getVectorLayers()) {
      if (layer.isShowing()) {
        VectorLayerStore store = layer.getFeatureStore();
        for (String featureId : layer.getSelectedFeatures()) {
          Feature f = store.getPartialFeature(featureId);
          if (f.isSelected()) {
            geoms.add(f.getGeometry());
          }
        }
      }
    }
    if (geoms.size() == 0) {
View Full Code Here

    Bbox bounds = null;
    for (VectorLayer layer : mapWidget.getMapModel().getVectorLayers()) {
      if (layer.isShowing()) {
        VectorLayerStore store = layer.getFeatureStore();
        for (String featureId : layer.getSelectedFeatures()) {
          Feature f = store.getPartialFeature(featureId);
          if (bounds == null) {
            bounds = f.getGeometry().getBounds();
          } else {
            bounds = bounds.union(f.getGeometry().getBounds());
          }
        }
      }
    }
    if (bounds == null) {
View Full Code Here

    public void onTransactionSuccess(FeatureTransactionEvent event) {
      List<ListGridRecord> updates = new ArrayList<ListGridRecord>();
      for (ListGridRecord record : getRecords()) {
        String featureId = record.getAttribute(FEATURE_ID_FIELD_NAME);
        Feature feature = layer.getFeatureStore().getPartialFeature(featureId);
        if (feature != null && feature.isAttributesLoaded()) {
          copyToRecord(feature, record);
          updates.add(record);
        }
      }
      setData(updates.toArray(new Record[0]));
View Full Code Here

   * @param context
   *            A MapContext object, responsible for actual drawing.
   */
  public void paint(Paintable paintable, Object group, MapContext context) {
    if (paintable != null) {
      Feature feature = (Feature) paintable;
      WorldViewTransformer worldViewTransformer = feature.getLayer().getMapModel().getMapView()
          .getWorldViewTransformer();
      Geometry geometry = worldViewTransformer.worldToPan(feature.getGeometry());
      ShapeStyle style = createStyleForFeature(feature);
      PaintableGroup selectionGroup = feature.getLayer().getSelectionGroup();
      context.getVectorContext().drawGroup(selectionGroup, feature);
      String name = feature.getLayer().getId() + "-" + feature.getId();

      if (geometry instanceof LineString) {
        context.getVectorContext().drawLine(feature, name, (LineString) geometry, style);
      } else if (geometry instanceof MultiLineString) {
        MultiLineString m = (MultiLineString) geometry;
        for (int i = 0; i < m.getNumGeometries(); i++) {
          context.getVectorContext().drawLine(feature, name + "." + i, (LineString) m.getGeometryN(i), style);
        }
      } else if (geometry instanceof Polygon) {
        context.getVectorContext().drawPolygon(feature, name, (Polygon) geometry, style);
      } else if (geometry instanceof MultiPolygon) {
        MultiPolygon m = (MultiPolygon) geometry;
        for (int i = 0; i < m.getNumGeometries(); i++) {
          context.getVectorContext().drawPolygon(feature, name + "." + i, (Polygon) m.getGeometryN(i), style);
        }
      } else if (geometry instanceof Point) {
        if (hasImageSymbol(feature)) {
          context.getVectorContext().drawSymbol(feature, name, geometry.getCoordinate(), null,
              feature.getStyleId() + "-selection");
        } else {
          context.getVectorContext().drawSymbol(feature, name, geometry.getCoordinate(), style,
              feature.getStyleId());
        }
      } else if (geometry instanceof MultiPoint) {
        Coordinate[] coordinates = geometry.getCoordinates();
        if (hasImageSymbol(feature)) {
          for (int i = 0; i < coordinates.length; i++) {
            context.getVectorContext().drawSymbol(feature, name + "." + i, coordinates[i], null,
                feature.getStyleId() + "-selection");
          }
        } else {
          for (int i = 0; i < coordinates.length; i++) {
            context.getVectorContext().drawSymbol(feature, name + "." + i, coordinates[i], style,
                feature.getStyleId());
          }
        }
      }
    }
  }
View Full Code Here

  public void onMouseMove(MouseMoveEvent event) {
    FeatureTransaction featureTransaction = getFeatureTransaction();
    if (featureTransaction != null && parent.getEditMode() == EditMode.DRAG_MODE && dragTargetId != null) {
      TransactionGeomIndex index = TransactionGeomIndexUtil.getIndex(dragTargetId);

      Feature feature = dragTransaction.getNewFeatures()[index.getFeatureIndex()];
      FeatureOperation op = new SetCoordinateOp(index, getWorldPosition(event));
      op.execute(feature);

      mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.DELETE);
      mapWidget.render(dragTransaction, RenderGroup.VECTOR, RenderStatus.ALL);
View Full Code Here

   *
   */
  private class ApplyFeatureTransactionToWindow implements FeatureTransactionHandler {

    public void onTransactionSuccess(FeatureTransactionEvent event) {
      Feature feature = attributeTable.getFeature();
      if (feature != null) {
        setFeature(feature);
      } else {
        setFeature(null);
      }
View Full Code Here

          for (String serverLayerId : featureMap.keySet()) {
            List<VectorLayer> layers = mapWidget.getMapModel().getVectorLayersByServerId(serverLayerId);
            for (VectorLayer vectorLayer : layers) {
              List<org.geomajas.layer.feature.Feature> orgFeatures = featureMap.get(serverLayerId);
              if (orgFeatures.size() > 0) {
                Feature feature = new Feature(orgFeatures.get(0), vectorLayer);
                vectorLayer.getFeatureStore().addFeature(feature);
                FeatureAttributeWindow window = new FeatureAttributeWindow(feature, false);
                window.setPageTop(mapWidget.getAbsoluteTop() + 10);
                window.setPageLeft(mapWidget.getAbsoluteLeft() + 10);
                window.draw();
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.map.feature.Feature

Copyright © 2018 www.massapicom. 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.