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

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


  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


  public void onMouseMove(MouseMoveEvent event) {
    if (getFeatureTransaction() != 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

          for (String serverLayerId : featureMap.keySet()) {
            VectorLayer vl = findLayer(serverLayerId);
            List<Feature> features = new ArrayList<Feature>();
            featureCache.put(vl, features);
            for (org.geomajas.layer.feature.Feature dtoFeat : featureMap.get(serverLayerId)) {
              features.add(new Feature(dtoFeat, vl));
            }
          }
        }
      }
    });
View Full Code Here

    List<VectorLayer> layers = mapWidget.getMapModel().getVectorLayersByServerId(serverLayerId);
    Layer<?> selectedLayer = mapWidget.getMapModel().getSelectedLayer();
    for (VectorLayer vectorLayer : layers) {
      if (isSelectionTargetLayer(vectorLayer, selectedLayer)) {
        for (org.geomajas.layer.feature.Feature orgFeature : orgFeatures) {
          Feature feature = new Feature(orgFeature, vectorLayer);
          vectorLayer.getFeatureStore().addFeature(feature);
          vectorLayer.selectFeature(feature);
        }
      }
    }
View Full Code Here

  // -------------------------------------------------------------------------
  // Private methods:
  // -------------------------------------------------------------------------

  private FeaturePainter getFeaturePainter() {
    List<Painter> painters = painterVisitor.getPaintersForObject(new Feature());
    for (Painter painter : painters) {
      if (painter instanceof FeaturePainter) {
        return (FeaturePainter) painter;
      }
    }
View Full Code Here

    List<Feature> features = new ArrayList<Feature>();
    features.add(feature);
    LazyLoader.lazyLoad(features, GeomajasConstant.FEATURE_INCLUDE_ATTRIBUTES, new LazyLoadCallback() {

      public void execute(List<Feature> response) {
        Feature feature = response.get(0);
        if (attributeTable == null) {
          buildWidget(feature.getLayer());
        }
        if (feature != null) {
          setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(feature.getLabel()));
        } else {
          setTitle(I18nProvider.getAttribute().getAttributeWindowTitle(""));
        }
        attributeTable.setFeature(feature);
      }
View Full Code Here

   * @return true when the feature was deselected
   */
  public boolean selectFeature(Feature feature) {
    if (!selectedFeatures.containsKey(feature.getId())) {
      // make sure we get the layer's instance (if we can find it) !
      Feature layerFeature = getFeatureStore().getPartialFeature(feature.getId());
      if (null != layerFeature) {
        selectedFeatures.put(layerFeature.getId(), layerFeature);
        handlerManager.fireEvent(new FeatureSelectedEvent(layerFeature));
      } else {
        selectedFeatures.put(feature.getId(), feature);
        handlerManager.fireEvent(new FeatureSelectedEvent(feature));
      }
View Full Code Here

   *            The feature that is to be selected.
   * @return true when the feature was selected
   */
  public boolean deselectFeature(Feature feature) {
    if (selectedFeatures.containsKey(feature.getId())) {
      Feature org = selectedFeatures.remove(feature.getId());
      handlerManager.fireEvent(new FeatureDeselectedEvent(org));
      return true;
    } else {
      return false;
    }
View Full Code Here

          public void execute(CommandResponse response) {
            if (response instanceof SearchFeatureResponse) {
              SearchFeatureResponse resp = (SearchFeatureResponse) response;
              List<Feature> features = new ArrayList<Feature>();
              for (org.geomajas.layer.feature.Feature dtoFeature : resp.getFeatures()) {
                Feature feature = new Feature(dtoFeature, layer);
                layer.getFeatureStore().addFeature(feature);
                features.add(feature);
              }
              SearchEvent event = new SearchEvent(layer, features);
              FeatureSearch.this.fireEvent(event);
View Full Code Here

  }

  public void getFeature(String id, int featureIncludes, LazyLoadCallback callback) {
    List<Feature> list = new ArrayList<Feature>();
    if (!contains(id)) {
      Feature feature = new Feature(id, getLayer());
      features.put(id, feature);
    }
    list.add(features.get(id));
    LazyLoader.lazyLoad(list, featureIncludes, callback);
  }
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.