Package org.geomajas.gwt.client.gfx.paintable

Examples of org.geomajas.gwt.client.gfx.paintable.Image


    buttonLayout.setHeight(25);
    buttonLayout.setMembersMargin(10);
    IButton button1 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNScreen());
    button1.setWidth("50%");

    final Image screenImage = new Image("imageInScreenSpace");
    screenImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
    screenImage.setBounds(new Bbox(60, 60, 48, 48)); // Pixel coordinates
    screenImage.setStyle(new PictureStyle(0.6));

    button1.addClickHandler(new ClickHandler() {

      // Draw an image in screen space:
      public void onClick(ClickEvent event) {
        map.render(screenImage, RenderGroup.SCREEN, RenderStatus.ALL);
      }
    });
    buttonLayout.addMember(button1);

    IButton button2 = new IButton(I18nProvider.getSampleMessages().screenWorldBTNWorld());
    button2.setWidth("50%");

    // An image
    final Image worldImage = new Image("imageInWorldSpace");
    worldImage.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
    worldImage.setBounds(new Bbox(-2000000, -2000000, 4000000, 4000000)); // Mercator coordinates
    worldImage.setStyle(new PictureStyle(0.8));

    // And some geometries
    final GfxGeometry worldGeometry = new GfxGeometry("MultiPolygonInWorldSpace");
    final GeometryFactory gf = new GeometryFactory(map.getMapModel().getSrid(), map.getMapModel().getPrecision());
    Polygon p1 = gf.createPolygon(gf.createLinearRing(new Bbox(10000000d, 1000d, 1000000d, 1000000d)), null);
View Full Code Here


    IButton button6 = new IButton(I18nProvider.getSampleMessages().renderingDrawImage());
    button6.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        Image image = new Image("image");
        image.setHref(Geomajas.getIsomorphicDir() + "geomajas/example/images/smile.png");
        image.setBounds(new Bbox(250, 70, 48, 48));
        image.setStyle(new PictureStyle(0.5));
        // map.render(image, "all");
        map.getVectorContext().drawImage(group1, image.getId(), image.getHref(), image.getBounds(),
            (PictureStyle) image.getStyle());
      }
    });
    button6.setWidth100();
    column2.addMember(button6);
View Full Code Here

   *            The group where the object resides in (optional).
   * @param context
   *            A MapContext object, responsible for actual drawing.
   */
  public void paint(Paintable paintable, Object group, MapContext context) {
    Image image = (Image) paintable;
    context.getVectorContext().drawImage(group, image.getId(), image.getHref(), image.getBounds(),
        (PictureStyle) image.getStyle());
  }
View Full Code Here

   *            The group where the object resides in (optional).
   * @param graphics
   *            The context to paint on.
   */
  public void deleteShape(Paintable paintable, Object group, MapContext context) {
    Image image = (Image) paintable;
    context.getVectorContext().deleteElement(group, image.getId());
  }
View Full Code Here

      if (null != targetRectangle) {
        render(targetRectangle, RenderGroup.SCREEN, RenderStatus.DELETE);
        targetRectangle = null;
      }
      if (null == targetReticle) {
        targetReticle = new Image("targetReticle");
        targetReticle.setHref(Geomajas.getIsomorphicDir() + TARGET_RETICLE_IMAGE);
        targetReticle.setBounds(new Bbox(0, 0, 21, 21));
      }
      double x = viewBegin.getX() + (width / 2) - 10;
      double y = viewBegin.getY() + (width / 2) - 10;
View Full Code Here

    south = new PanButton(getId() + "_panSouth", map, PanButtonDirection.SOUTH);
    south.setParent(this);
    west = new PanButton(getId() + "_panWest", map, PanButtonDirection.WEST);
    west.setParent(this);

    background = new Image(getId() + "_panImageBG");
    background.setHref(Geomajas.getIsomorphicDir() + "geomajas/mapaddon/panbg.png");
    background.setStyle(new PictureStyle(1));

    applyPosition();
  }
View Full Code Here

  // Constructor:

  public Watermark(String id, MapWidget map) {
    super(id, 125, 12);
    this.map = map;
    image = new Image(id + "-img");
    image.setBounds(new Bbox(0, 0, 125, 12));
    image.setHref(Geomajas.getIsomorphicDir() + "geomajas/mapaddon/powered_by_geomajas.gif");
    image.setStyle(new PictureStyle(1));

    dummy = new Rectangle(getId() + "-dummy");
View Full Code Here

        panVector = new Coordinate(-1, 0);
        imgUrl = westImage;
        break;
    }
    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

TOP

Related Classes of org.geomajas.gwt.client.gfx.paintable.Image

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.