Package org.geomajas.gwt.client.spatial

Examples of org.geomajas.gwt.client.spatial.Bbox


    RasterCallBack callBack = new RasterCallBack(worldToPan(bounds), onUpdate);
    deferred = GwtCommandDispatcher.getInstance().execute(command, callBack);
  }

  private void updateTiles(Bbox bounds, final TileFunction<RasterTile> onUpdate) {
    Bbox panBounds = worldToPan(bounds);
    for (RasterTile tile : tiles.values()) {
      if (panBounds.intersects(tile.getBounds())) {
        onUpdate.execute(tile);
      }
    }
  }
View Full Code Here


    return bounds.transform(t);
  }

  private void addTiles(List<org.geomajas.layer.tile.RasterTile> images) {
    Matrix t = rasterLayer.getMapModel().getMapView().getWorldToPanTranslation();
    Bbox cacheBounds = null;
    for (org.geomajas.layer.tile.RasterTile image : images) {
      TileCode code = image.getCode().clone();
      if (!tiles.containsKey(code)) {
        Bbox panBounds = new Bbox(image.getBounds());
        panBounds.translate(Math.round(t.getDx()), Math.round(t.getDy()));
        if (cacheBounds == null) {
          cacheBounds = panBounds;
        } else {
          cacheBounds = cacheBounds.union(panBounds);
        }
View Full Code Here

  public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) {
    map.getVectorContext().drawGroup(group, this);

    Coordinate c = getUpperLeftCorner();
    map.getVectorContext().drawImage(this, "bg", Geomajas.getIsomorphicDir() + "geomajas/mapaddon/zoombg.png",
        new Bbox(c.getX(), c.getY(), 20, 60), new PictureStyle(1));

    map.getVectorContext().drawImage(this, "plus", Geomajas.getIsomorphicDir() + "geomajas/mapaddon/zoomPlus.png",
        new Bbox(c.getX(), c.getY(), 20, 20), new PictureStyle(1));

    map.getVectorContext().drawImage(this, "minus",
        Geomajas.getIsomorphicDir() + "geomajas/mapaddon/zoomMinus.png",
        new Bbox(c.getX(), c.getY() + 40, 20, 20), new PictureStyle(1));

    map.getVectorContext().drawImage(this, "max", Geomajas.getIsomorphicDir() + "geomajas/mapaddon/maxextent.png",
        new Bbox(c.getX(), c.getY() + 20, 20, 20), new PictureStyle(1));

    if (firstTime) {
      map.getVectorContext().setController(this, "plus", new ZoomController(map, 2), Event.MOUSEEVENTS);
      map.getVectorContext().setCursor(this, "plus", Cursor.POINTER.getValue());
View Full Code Here

    protected MaxExtentController(MapWidget mapWidget) {
      super(mapWidget);
    }

    public void onMouseUp(MouseUpEvent event) {
      Bbox max = mapWidget.getMapModel().getMapView().getMaxBounds();
      mapWidget.getMapModel().getMapView().applyBounds(max, ZoomOption.LEVEL_FIT);
      event.stopPropagation();
    }
View Full Code Here

    this.unitType = unitType;
    this.unitLength = unitLength;

    backGround = new Rectangle((null == getId() ? "" : getId() + "-bg"));
    backGround.setBounds(new Bbox(0, 0, 5, MARKERHEIGHT + 2 * VERTICALPADDING));
    backGround.setStyle(STYLE_BACKGROUND);
    leftMarker = new Rectangle((null == getId() ? "" : getId() + "-lm"));
    leftMarker.setStyle(STYLE_MARKER);
    leftMarker.setBounds(new Bbox(0, 0, 1, MARKERHEIGHT));

    rightMarker = new Rectangle((null == getId() ? "" : getId() + "-rm"));
    rightMarker.setStyle(STYLE_MARKER);
    rightMarker.setBounds(new Bbox(0, 0, 1, MARKERHEIGHT));
    bottomLine = new Rectangle((null == getId() ? "" : getId() + "-bm"));
    bottomLine.setStyle(STYLE_MARKER);
    bottomLine.setBounds(new Bbox(0, 0, 0, 1));
    distance = new Text((null == getId() ? "" : getId() + "-text"));
    distance.setStyle(STYLE_FONT);

    dummy = new Rectangle(getId() + "-dummy");
    dummy.setStyle(new ShapeStyle("#FFFFFF", 0, "#FFFFFF", 0, 0));
    dummy.setBounds(new Bbox(0, 0, 1, 1));
  }
View Full Code Here

    map.getVectorContext().drawGroup(group, this);

    Coordinate c = getUpperLeftCorner();
    map.getVectorContext().drawImage(this, "zoom-rect-img",
        Geomajas.getIsomorphicDir() + "geomajas/mapaddon/zoom_rectangle.png",
        new Bbox(c.getX(), c.getY(), 20, 20), new PictureStyle(1));

    if (firstTime) {
      map.getVectorContext().setController(this, "zoom-rect-img", new ActivateRectangleController(map),
          Event.MOUSEEVENTS);
      map.getVectorContext().setCursor(this, "zoom-rect-img", Cursor.POINTER.getValue());
View Full Code Here

  /**
   * Paint this pan button!
   */
  public void accept(PainterVisitor visitor, Object group, Bbox bounds, boolean recursive) {
    // First place the image at the correct location:
    image.setBounds(new Bbox(getUpperLeftCorner().getX(), getUpperLeftCorner().getY(), getWidth(), getHeight()));

    // Then draw:
    if (parent != null) {
      map.getVectorContext().drawImage(parent, getId(), image.getHref(), image.getBounds(),
          (PictureStyle) image.getStyle());
View Full Code Here

    }
    controller = new PanArrowController(map, panVector);
    image = new Image(getId());
    image.setHref(imgUrl);
    image.setStyle(style);
    image.setBounds(new Bbox(0, 0, getWidth(), getHeight()));
  }
View Full Code Here

      if (coordinate.getY() > maxY) {
        maxY = coordinate.getY();
      }
    }

    return new Bbox(minX, minY, maxX - minX, maxY - minY);
  }
View Full Code Here

  /**
   * Return the closest bounding box around the geometry.
   */
  public Bbox getBounds() {
    Bbox bounds = null;
    if (!isEmpty()) {
      for (LineString lineString : lineStrings) {
        if (bounds == null) {
          bounds = lineString.getBounds();
        } else {
          bounds = bounds.union(lineString.getBounds());
        }
      }
    }
    return bounds;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.spatial.Bbox

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.