Package org.geomajas.gwt.client.gfx.style

Examples of org.geomajas.gwt.client.gfx.style.ShapeStyle


          styleInfo = style;
          break;
        }
      }
    }
    ShapeStyle style = new ShapeStyle(styleInfo);

    if (feature.getGeometry() instanceof LineString || feature.getGeometry() instanceof MultiLineString) {
      style.merge(lineSelectStyle);
    } else if (feature.getGeometry() instanceof Polygon || feature.getGeometry() instanceof MultiPolygon) {
      style.merge(polygonSelectStyle);
    } else if (feature.getGeometry() instanceof Point || feature.getGeometry() instanceof MultiPoint) {
      style.merge(pointSelectStyle);
    }
    return style;
  }
View Full Code Here


        if (layer instanceof VectorLayer) {
          VectorLayer vLayer = (VectorLayer) layer;

          // For vector layer; loop over the style definitions:
          for (FeatureStyleInfo styleInfo : vLayer.getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
            ShapeStyle style = new ShapeStyle(styleInfo);
            graphics.drawSymbolDefinition(null, styleInfo.getStyleId(), styleInfo.getSymbol(),
                new ShapeStyle(styleInfo), null);
            lineCount++;

            if (vLayer.getLayerInfo().getLayerType() == LayerType.LINESTRING
                || vLayer.getLayerInfo().getLayerType() == LayerType.MULTILINESTRING) {
              // Lines, draw a LineString;
View Full Code Here

  private ShapeStyle polygonStyle;

  public FeatureTransactionPainter(MapWidget mapWidget) {
    this.mapWidget = mapWidget;
    pointStyle = new ShapeStyle("#FF6600", 1, "#FFFFFF", 0, 1);
    edgeStyle = new ShapeStyle("#FFFFFF", 0, "#FFAA00", 1, 3);
    lineStringStyle = new ShapeStyle("#FFFFFF", 0, "#FFFFFF", 0, 0);
    linearRingStyle = new ShapeStyle("#FFEE00", 0, "#FFAA00", 1, 3);
    polygonStyle = new ShapeStyle("#FFCC00", 0.5f, "#FFAA00", 0, 0);
  }
View Full Code Here

    // Draw symbol types, as these can change any time:
    if (layer.getLayerInfo().getLayerType().equals(LayerType.POINT)
        || layer.getLayerInfo().getLayerType().equals(LayerType.MULTIPOINT)) {
      for (FeatureStyleInfo style : layer.getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
        context.getVectorContext().drawSymbolDefinition(null, style.getStyleId(), style.getSymbol(),
            new ShapeStyle(style), null);
      }
    }

    // Check layer visibility:
    if (layer.isShowing()) {
View Full Code Here

   */
  public void paint(Paintable paintable, Object group, MapContext context) {
    if (paintable != null) {
      GfxGeometry gfxGeometry = (GfxGeometry) paintable;
      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();
View Full Code Here

      Coordinate position = getPanPosition(event);
      LineString lineString = getGeometryIndex().getGeometry(featureTransaction).getGeometryFactory()
          .createLineString(new Coordinate[] { position, position });
      tempLine = new GfxGeometry("LineStringEditController.updateLine");
      tempLine.setGeometry(lineString);
      tempLine.setStyle(new ShapeStyle("#FFFFFF", 0, "#FF3322", 1, 1));
      mapWidget.render(tempLine, RenderGroup.VECTOR, RenderStatus.ALL);
    }
  }
View Full Code Here

      Coordinate position = getPanPosition(event);
      Geometry geom = getGeometryIndex().getGeometry(featureTransaction);
      LineString lineString = geom.getGeometryFactory().createLineString(new Coordinate[] { position, position });
      tempLine1 = new GfxGeometry("LineStringEditController.updateLine1");
      tempLine1.setGeometry(lineString);
      tempLine1.setStyle(new ShapeStyle("#FFFFFF", 0, "#FF3322", 1, 1));
      mapWidget.render(tempLine1, RenderGroup.VECTOR, RenderStatus.ALL);
      tempLine2 = new GfxGeometry("LineStringEditController.updateLine2");
      tempLine2.setGeometry(lineString);
      tempLine2.setStyle(new ShapeStyle("#FFFFFF", 0, "#FF3322", 1, 1));
      mapWidget.render(tempLine2, RenderGroup.VECTOR, RenderStatus.ALL);
    }
  }
View Full Code Here

      pixelLength = info.getPixelLength();
      graphics.setBackgroundColor(info.getBackgroundColor());
      mapModel.initialize(info);
      setNavigationAddonEnabled(info.isPanButtonsEnabled());
      setScalebarEnabled(info.isScaleBarEnabled());
      painterVisitor.registerPainter(new FeaturePainter(new ShapeStyle(info.getPointSelectStyle()),
          new ShapeStyle(info.getLineSelectStyle()), new ShapeStyle(info.getPolygonSelectStyle())));

      for (final Layer<?> layer : mapModel.getLayers()) {
        layer.addLayerChangedHandler(new LayerChangedHandler() {

          public void onLabelChange(LayerLabeledEvent event) {
View Full Code Here

      LinearRing shell = factory.createLinearRing(mapWidget.getMapModel().getMapView().getMaxBounds());
      Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });

      maxExtent = new GfxGeometry("maxExtent");
      maxExtent.setGeometry(polygon);
      maxExtent.setStyle(new ShapeStyle("#000000", .6f, "#990000", 1, 2));
      mapWidget.registerWorldPaintable(maxExtent);
    }
  }
View Full Code Here

    this.useTargetMaxExtent = useTargetMaxExtent;
    this.drawTargetMaxExtent = drawTargetMaxExtent;
    targetMap.getMapModel().getMapView().addMapViewChangedHandler(new UpdatePointOfViewHandler());
    scaleBarEnabled = false;
    navigationAddonEnabled = false;
    rectangleStyle = new ShapeStyle("#FF9900", 0.2f, "#FF9900", 1f, 2);
    targetMaxExtentRectangleStyle = new ShapeStyle("#555555", 0.4f, "#555555", 1f, 1);
    setZoomOnScrollEnabled(false);
    // handle max extent when both maps are loaded
    MaxExtentHandler meh = new MaxExtentHandler();
    getMapModel().addMapModelHandler(meh);
    targetMap.getMapModel().addMapModelHandler(meh);
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.gfx.style.ShapeStyle

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.