Examples of GwtCommand


Examples of org.geomajas.gwt.client.command.GwtCommand

  public void clearLocation() {
    geocoderWidget.setValue("");
  }

  public void goToLocation(final String location) {
    GwtCommand command = new GwtCommand(GetLocationForStringRequest.COMMAND);
    GetLocationForStringRequest request = new GetLocationForStringRequest();
    request.setCrs(map.getMapModel().getCrs());
    request.setLocation(location);
    request.setServicePattern(servicePattern);
    if (GWT.isClient()) {
      // causes NPE when run as junit test
      String locale = LocaleInfo.getCurrentLocale().getLocaleName();
      if (!"default".equals(locale)) {
        request.setLocale(locale);
      }
    }
    command.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

      public void execute(CommandResponse commandResponse) {
        goToLocation(commandResponse, location);
      }
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

   * @param callback
   *            When this node's data comes from the server, it will be handled by this callback function.
   */
  public void fetch(final String filter, final TileFunction<VectorTile> callback) {
    final GetVectorTileRequest request = createRequest(filter);
    GwtCommand command = new GwtCommand(GetVectorTileRequest.COMMAND);
    command.setCommandRequest(request);
    final VectorTile self = this;
    deferred = GwtCommandDispatcher.getInstance().execute(command, new CommandCallback<GetVectorTileResponse>() {

      public void execute(GetVectorTileResponse response) {
        if (!(deferred != null && deferred.isCancelled())) {
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

      request.setLayerId(first.getLayer().getServerLayerId());
      request.setMax(0);
      request.setFilter(first.getLayer().getFilter());
      request.setFeatureIncludes(featureIncludes);

      GwtCommand command = new GwtCommand(SearchFeatureRequest.COMMAND);
      command.setCommandRequest(request);
      GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

        public void execute(CommandResponse response) {
          if (response instanceof SearchFeatureResponse) {
            SearchFeatureResponse resp = (SearchFeatureResponse) response;
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

      if (layer.isShowing() && layer instanceof VectorLayer) {
        request.setFilter(layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
      }
    }

    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

    if (serverLayerIds == null) {
      init();
    }

    Polygon polygon = mapModel.getGeometryFactory().createPolygon(currentBounds);
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    request.setLayerIds(serverLayerIds);
    addFilters(request);
    request.setFeatureIncludes(GeomajasConstant.FEATURE_INCLUDE_GEOMETRY);
    request.setLocation(GeometryConverter.toDto(polygon));
    request.setCrs(mapModel.getCrs());
    request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {
      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<org.geomajas.layer.feature.Feature>> featureMap = response.getFeatureMap();
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

    // we can clear here !
    if (!shiftOrCtrl) {
      MapModel mapModel = mapWidget.getMapModel();
      mapModel.clearSelectedFeatures();
    }
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    request.setLayerIds(getSelectionLayerIds());
    for (Layer<?> layer : mapWidget.getMapModel().getLayers()) {
      if (layer.isShowing() && layer instanceof VectorLayer) {
        request.setFilter(layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
      }
    }

    Polygon polygon = mapWidget.getMapModel().getGeometryFactory().createPolygon(selectedArea);
    request.setLocation(GeometryConverter.toDto(polygon));
    request.setCrs(mapWidget.getMapModel().getCrs());
    request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
    request.setRatio(coverageRatio);
    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
    request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback<CommandResponse>() {

      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

    if (clearSelection) {
      mapWidget.getMapModel().clearSelectedFeatures();
    }
    MapModel mapModel = mapWidget.getMapModel();
    Coordinate worldPosition = mapModel.getMapView().getWorldViewTransformer().viewToWorld(coordinate);
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    Layer<?> layer = mapModel.getSelectedLayer();
    if (priorityToSelectedLayer && layer != null && layer instanceof VectorLayer) {
      if (!layer.isShowing()) {
        return;
      }
      request.setLayerIds(new String[] { layer.getServerLayerId() });
      request.setFilter(layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
    } else {
      request.setLayerIds(getVisibleServerLayerIds(mapModel));
    }
    Point point = mapModel.getGeometryFactory().createPoint(worldPosition);
    request.setLocation(GeometryConverter.toDto(point));
    request.setCrs(mapWidget.getMapModel().getCrs());
    request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
    request.setBuffer(calculateBufferFromPixelTolerance());
    request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());
    commandRequest.setCommandRequest(request);
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback<CommandResponse>() {
      public void execute(CommandResponse commandResponse) {
        if (commandResponse instanceof SearchByLocationResponse) {
          SearchByLocationResponse response = (SearchByLocationResponse) commandResponse;
          Map<String, List<Feature>> featureMap = response.getFeatureMap();
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

        + ": <a href='http://www.geomajas.org/'>http://www.geomajas.org/</a></p>");
    layout.addMember(flow);

    final HTMLFlow copyrightWidget = new HTMLFlow("Copyright info");
    layout.addMember(copyrightWidget);
    GwtCommand commandRequest = new GwtCommand(CopyrightRequest.COMMAND);
    commandRequest.setCommandRequest(new EmptyCommandRequest());
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

      public void execute(CommandResponse response) {
        if (response instanceof CopyrightResponse) {
          Collection<CopyrightInfo> copyrights = ((CopyrightResponse) response).getCopyrights();
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

        request.setLayerId(layer.getServerLayerId());
        request.setMax(maximumResultSize);
        request.setFilter(layer.getFilter());
        request.setFeatureIncludes(GwtCommandDispatcher.getInstance().getLazyFeatureIncludesSelect());

        GwtCommand command = new GwtCommand(SearchFeatureRequest.COMMAND);
        command.setCommandRequest(request);
        GwtCommandDispatcher.getInstance().execute(command, new CommandCallback() {

          public void execute(CommandResponse response) {
            if (response instanceof SearchFeatureResponse) {
              SearchFeatureResponse resp = (SearchFeatureResponse) response;
View Full Code Here

Examples of org.geomajas.gwt.client.command.GwtCommand

   *
   * @since 1.6.0
   */
  @Api
  public void init() {
    GwtCommand commandRequest = new GwtCommand(GetMapConfigurationRequest.COMMAND);
    commandRequest.setCommandRequest(new GetMapConfigurationRequest(id, applicationId));
    GwtCommandDispatcher.getInstance().execute(commandRequest, new CommandCallback() {

      public void execute(CommandResponse response) {
        if (response instanceof GetMapConfigurationResponse) {
          GetMapConfigurationResponse r = (GetMapConfigurationResponse) response;
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.