Package org.geomajas.puregwt.client.spatial

Examples of org.geomajas.puregwt.client.spatial.Point


    }
  }

  public Path toPath(Geometry geometry) {
    if (geometry instanceof Point) {
      Point point = (Point) geometry;
      return new Path((int) point.getX(), (int) point.getY());
    } else if (geometry instanceof LineString) {
      return toPath((LineString) geometry);
    } else if (geometry instanceof LinearRing) {
      return toPath((LinearRing) geometry);
    } else if (geometry instanceof Polygon) {
View Full Code Here


  }

  private Path toPath(MultiPoint multiPoint) {
    Path path = new Path((int) multiPoint.getCoordinate().getX(), (int) multiPoint.getCoordinate().getY());
    for (int i = 1; i < multiPoint.getNumGeometries(); i++) {
      Point point = (Point) multiPoint.getGeometryN(i);
      path.moveTo((int) point.getX(), (int) point.getY());
    }
    return path;
  }
View Full Code Here

    Assert.assertEquals(10.0, transformed.getMaxY(), DELTA);
  }

  @Test
  public void testTransformPoint() {
    Point point = factory.createPoint(new Coordinate(0, 0));
    Geometry result = viewPort.transform(point, RenderSpace.WORLD, RenderSpace.SCREEN);
    Assert.assertEquals(MAP_WIDTH / 2, ((Point) result).getX(), DELTA);
    Assert.assertEquals(MAP_HEIGHT / 2, ((Point) result).getY(), DELTA);

    result = viewPort.transform(result, RenderSpace.SCREEN, RenderSpace.WORLD);
View Full Code Here

    Assert.assertEquals(5.0, c.getY(), DELTA);
  }

  @Test
  public void testTransformMultiPoint() {
    Point point1 = factory.createPoint(new Coordinate(0, 0));
    Point point2 = factory.createPoint(new Coordinate(5, 10));
    MultiPoint multiPoint = factory.createMultiPoint(new Point[] { point1, point2 });

    Geometry result = viewPort.transform(multiPoint, RenderSpace.WORLD, RenderSpace.SCREEN);
    Coordinate coordinate = result.getGeometryN(0).getCoordinate();
    Assert.assertEquals(MAP_WIDTH / 2, coordinate.getX(), DELTA);
View Full Code Here

TOP

Related Classes of org.geomajas.puregwt.client.spatial.Point

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.