Package org.geomajas.gwt.client.spatial.geometry

Examples of org.geomajas.gwt.client.spatial.geometry.MultiLineString


      String name = feature.getLayer().getId() + "-" + feature.getId();

      if (geometry instanceof LineString) {
        context.getVectorContext().drawLine(feature, name, (LineString) geometry, style);
      } else if (geometry instanceof MultiLineString) {
        MultiLineString m = (MultiLineString) geometry;
        for (int i = 0; i < m.getNumGeometries(); i++) {
          context.getVectorContext().drawLine(feature, name + "." + i, (LineString) m.getGeometryN(i), style);
        }
      } else if (geometry instanceof Polygon) {
        context.getVectorContext().drawPolygon(feature, name, (Polygon) geometry, style);
      } else if (geometry instanceof MultiPolygon) {
        MultiPolygon m = (MultiPolygon) geometry;
        for (int i = 0; i < m.getNumGeometries(); i++) {
          context.getVectorContext().drawPolygon(feature, name + "." + i, (Polygon) m.getGeometryN(i), style);
        }
      } else if (geometry instanceof Point) {
        if (hasImageSymbol(feature)) {
          context.getVectorContext().drawSymbol(feature, name, geometry.getCoordinate(), null,
              feature.getStyleId() + "-selection");
View Full Code Here


      Geometry geometry = gfxGeometry.getGeometry();
      ShapeStyle shapeStyle = gfxGeometry.getStyle();
      if (geometry instanceof LineString) {
        context.getVectorContext().drawLine(group, gfxGeometry.getId(), (LineString) geometry, shapeStyle);
      } else if (geometry instanceof MultiLineString) {
        MultiLineString m = (MultiLineString) geometry;
        String gfxId = gfxGeometry.getId();
        GraphicsContext gc = context.getVectorContext();
        for (int i = 0; i < m.getNumGeometries(); i++) {
          gc.drawLine(group, gfxId + "." + i, (LineString) m.getGeometryN(i), shapeStyle);
        }
      } else if (geometry instanceof Polygon) {
        context.getVectorContext().drawPolygon(group, gfxGeometry.getId(), (Polygon) geometry, shapeStyle);
      } else if (geometry instanceof MultiPolygon) {
        MultiPolygon m = (MultiPolygon) geometry;
        String gfxId = gfxGeometry.getId();
        GraphicsContext gc = context.getVectorContext();
        for (int i = 0; i < m.getNumGeometries(); i++) {
          gc.drawPolygon(group, gfxId + "." + i, (Polygon) m.getGeometryN(i), shapeStyle);
        }
      } else if (geometry instanceof Point) {
        context.getVectorContext().drawSymbolDefinition(group, gfxGeometry.getId() + ".def",
            gfxGeometry.getSymbolInfo(), shapeStyle, null);
        context.getVectorContext().drawSymbol(group, gfxGeometry.getId(), geometry.getCoordinate(), shapeStyle,
View Full Code Here

  @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(30.0, l.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

  @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

  @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

TOP

Related Classes of org.geomajas.gwt.client.spatial.geometry.MultiLineString

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.