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

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


    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((Polygon) polygon.clone());
    op.execute(feature);
    Polygon p = (Polygon) feature.getGeometry();
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(20.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here


    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((MultiPolygon) multiPolygon.clone());
    op.execute(feature);
    MultiPolygon m = (MultiPolygon) feature.getGeometry();
    Polygon p = (Polygon) m.getGeometryN(index.getGeometryIndex());
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(20.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiPolygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    op = new AddCoordinateOp(index, new Coordinate(50, 50));
  }

  @Test
  public void testLineString() {
    Feature feature = new Feature();
    feature.setGeometry((LineString) lineString.clone());
    op.execute(feature);
    Geometry g = feature.getGeometry();
    Assert.assertEquals(50.0, g.getCoordinates()[g.getNumPoints() - 1].getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiLineString() {
    Feature feature = new Feature();
    feature.setGeometry((MultiLineString) multiLineString.clone());
    op.execute(feature);
    Geometry g = feature.getGeometry();
    Assert.assertEquals(50.0, g.getCoordinates()[g.getNumPoints() - 1].getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((Polygon) polygon.clone());
    op.execute(feature);
    Polygon p = (Polygon) feature.getGeometry();
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(r.getNumPoints() - 2).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((MultiPolygon) multiPolygon.clone());
    op.execute(feature);
    MultiPolygon m = (MultiPolygon) feature.getGeometry();
    Polygon p = (Polygon) m.getGeometryN(index.getGeometryIndex());
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(r.getNumPoints() - 2).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiPolygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    op = new SetCoordinateOp(index, new Coordinate(50, 50));
  }

  @Test
  public void testLineString() {
    Feature feature = new Feature();
    feature.setGeometry((LineString) lineString.clone());
    op.execute(feature);
    LineString l = (LineString) feature.getGeometry();
    Assert.assertEquals(50.0, l.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiLineString() {
    Feature feature = new Feature();
    feature.setGeometry((MultiLineString) multiLineString.clone());
    op.execute(feature);
    MultiLineString m = (MultiLineString) feature.getGeometry();
    LineString l = (LineString) m.getGeometryN(index.getGeometryIndex());
    Assert.assertEquals(50.0, l.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((Polygon) polygon.clone());
    op.execute(feature);
    Polygon p = (Polygon) feature.getGeometry();
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((MultiPolygon) multiPolygon.clone());
    op.execute(feature);
    MultiPolygon m = (MultiPolygon) feature.getGeometry();
    Polygon p = (Polygon) m.getGeometryN(index.getGeometryIndex());
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiPolygon.toWkt(), feature.getGeometry().toWkt());
  }
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.