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

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


    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
View Full Code Here


    // Overview map layout:
    SectionStackSection section1 = new SectionStackSection("Overview map");
    section1.setExpanded(true);
    overviewMap = new OverviewMap("mapOverview", "app", map, false, true);
    overviewMap.setTargetMaxExtentRectangleStyle(new ShapeStyle("#888888", 0.3f, "#666666", 0.75f, 2));
    overviewMap.setRectangleStyle(new ShapeStyle("#6699FF", 0.3f, "#6699CC", 1f, 2));
    section1.addItem(overviewMap);
    sectionStack.addSection(section1);

    // LayerTree layout:
    SectionStackSection section2 = new SectionStackSection("Layer tree");
View Full Code Here

  public PointDrawController(MapWidget mapWidget, AbstractFreeDrawingController parent) {
    super(mapWidget, parent);
    factory = new GeometryFactory(mapWidget.getMapModel().getSrid(), mapWidget.getMapModel().getPrecision());
    geometry = factory.createPoint(new Coordinate());
    drawStyle = new ShapeStyle("#FF7F00", 0.3f, "#FF7F00", 1, 2);
    symbolStyle = new SymbolInfo();
    CircleInfo c = new CircleInfo();
    symbolStyle.setCircle(c);
    c.setR(8);
  }
View Full Code Here

      for (int i = 0; i < srCoords.length; i++) {
        srCoords[i] = getTransformer().worldToPan(worldCoords[i]);
      }

      tempLineEnd = new GfxGeometry("LineStringEditController.updateLineEnd");
      tempLineEnd.setStyle(new ShapeStyle("#FF3322", 0.5f, "#FF3322", 1, 1));

      linearRing = geometry.getGeometryFactory().createLinearRing(srCoords);
      Polygon polygon = geometry.getGeometryFactory().createPolygon(linearRing, null);

      if (geometry.isValid()) {
View Full Code Here

    IButton button1 = new IButton(I18nProvider.getSampleMessages().renderingDrawCircle());
    button1.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        ShapeStyle style = new ShapeStyle("#66CC22", 0.5f, "#66AA22", 1, 2);
        map.getVectorContext().drawCircle(group1, "circle", new Coordinate(200, 100), 30, style);
      }
    });
    button1.setWidth100();
    column1.addMember(button1);

    // Button2: Draw LineString
    IButton button2 = new IButton(I18nProvider.getSampleMessages().renderingDrawLineString());
    button2.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        LineString geometry = map.getMapModel().getGeometryFactory().createLineString(
            new Coordinate[] { new Coordinate(60, 20), new Coordinate(120, 80), new Coordinate(80, 100) });
        ShapeStyle style = new ShapeStyle("#994488", 0.0f, "#993388", 1, 2);
        map.getVectorContext().drawLine(group2, "LineString", geometry, style);
      }
    });
    button2.setWidth100();
    column1.addMember(button2);

    // Button3: Draw Polygon
    IButton button3 = new IButton(I18nProvider.getSampleMessages().renderingDrawPolygon());
    button3.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        GeometryFactory factory = map.getMapModel().getGeometryFactory();
        LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(110, 10),
            new Coordinate(210, 10), new Coordinate(210, 110), new Coordinate(110, 110),
            new Coordinate(110, 10) });
        LinearRing hole = factory.createLinearRing(new Coordinate[] { new Coordinate(140, 40),
            new Coordinate(170, 40), new Coordinate(170, 70), new Coordinate(140, 70),
            new Coordinate(140, 40) });
        Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });
        ShapeStyle style = new ShapeStyle("#9933EE", 0.5f, "#9900FF", 1, 2);
        map.getVectorContext().drawPolygon(group2, "Polygon", polygon, style);
      }
    });
    button3.setWidth100();
    column1.addMember(button3);

    // Button4: Draw Text
    IButton button4 = new IButton(I18nProvider.getSampleMessages().renderingDrawText());
    button4.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group1);
        FontStyle style = new FontStyle("#FF0000", 12, "Verdana", "normal", "normal");
        map.getVectorContext()
            .drawText(group1, "text", "This is some text...", new Coordinate(100, 120), style);
      }
    });
    button4.setWidth100();
    column2.addMember(button4);

    // Button5: Draw Rectangle
    IButton button5 = new IButton(I18nProvider.getSampleMessages().renderingDrawRectangle());
    button5.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        ShapeStyle style = new ShapeStyle("#337788", 0.5f, "#337766", 1, 2);
        map.getVectorContext().drawRectangle(group2, "rectangle", new Bbox(50, 200, 200, 50), style);
      }
    });
    button5.setWidth100();
    column2.addMember(button5);
View Full Code Here

    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);
    Polygon p2 = gf.createPolygon(gf.createLinearRing(new Bbox(12000000d, 1000d, 500000d, 500000d)), null);
    MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
    worldGeometry.setStyle(new ShapeStyle("#FF0000", 0.5f, "#FF0000", 1.0f, 2));
    worldGeometry.setGeometry(mp);

    final GfxGeometry worldGeometry2 = new GfxGeometry("MultiPointInWorldSpace");
    SymbolInfo si = new SymbolInfo();
    CircleInfo ci = new CircleInfo();
    ci.setR(8.0f);
    si.setCircle(ci);
    Point pt1 = gf.createPoint(new Coordinate(6000000, -5000000));
    Point pt2 = gf.createPoint(new Coordinate(8000000, -5000000));
    Point pt3 = gf.createPoint(new Coordinate(7000000, -7000000));
    worldGeometry2.setStyle(new ShapeStyle("#0000FF", 0.3f, "#0000FF", 1.0f, 2));
    worldGeometry2.setGeometry(gf.createMultiPoint(new Point[] {pt1, pt2, pt3}));
    worldGeometry2.setSymbolInfo(si);

    button2.addClickHandler(new ClickHandler() {
View Full Code Here

  public Canvas getViewPanel() {

    // Drawing information:
    final Bbox rectangle = new Bbox(100, 100, 300, 100);
    final ShapeStyle style = new ShapeStyle("#66AA00", 0.7f, "#667700", 0.8f, 3);
    final ShapeStyle hoverStyle = new ShapeStyle("#66AA00", 0.5f, "#667700", 0.7f, 3);

    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID wmsMap is defined in the XML configuration. (mapWms.xml)
    final MapWidget map = new MapWidget("mapOsm", "gwt-samples");

    // Create the custom controller:
    final GraphicsController customController = new AbstractGraphicsController(map) {

      public void onMouseOver(MouseOverEvent event) {
        // When the mouse hovers over the image, make it transparent:
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            hoverStyle);
      }

      public void onMouseOut(MouseOutEvent event) {
        // When the mouse moves away from the image, make it visible again:
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle, style);
      }

      public void onMouseDown(MouseDownEvent event) {
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            new ShapeStyle("#AA0000", 0.8f, "#990000", 1.0f, 3));
      }

      public void onMouseUp(MouseUpEvent event) {
        map.getVectorContext().drawRectangle(map.getGroup(RenderGroup.SCREEN), "rectangle", rectangle,
            hoverStyle);
View Full Code Here

    // Button1: Toggle the rectangle style:
    IButton button1 = new IButton(I18nProvider.getSampleMessages().overviewMapToggleRectStyle());
    button1.addClickHandler(new ClickHandler() {

      private ShapeStyle nextStyle = new ShapeStyle("#000000", 0.6f, "#000000", 1, 1);

      public void onClick(ClickEvent event) {
        ShapeStyle temp = nextStyle;
        nextStyle = overviewMap.getRectangleStyle();
        overviewMap.setRectangleStyle(temp);
      }
    });
    button1.setWidth100();
    buttonLayout.addMember(button1);

    // Button2: Toggle the maximum extent style:
    IButton button2 = new IButton(I18nProvider.getSampleMessages().overviewMapToggleExtentStyle());
    button2.addClickHandler(new ClickHandler() {

      private ShapeStyle nextStyle = new ShapeStyle("#FF0000", 0.6f, "#FF0000", 1, 3);

      public void onClick(ClickEvent event) {
        ShapeStyle temp = nextStyle;
        nextStyle = overviewMap.getTargetMaxExtentRectangleStyle();
        overviewMap.setTargetMaxExtentRectangleStyle(temp);
      }
    });
    button2.setWidth100();
View Full Code Here

  /**
   * @param mapWidget
   */
  public GeometricSearchPanel(final MapWidget mapWidget) {
    super(mapWidget);
    selectionStyle = new ShapeStyle();
    selectionStyle.setFillColor("#FFFF00");
    selectionStyle.setFillOpacity(0.3f);
    selectionStyle.setStrokeColor("#B45F04");
    selectionStyle.setStrokeOpacity(0.9f);
    selectionStyle.setStrokeWidth(2f);
View Full Code Here

    if (paintable != null) {
      Feature feature = (Feature) paintable;
      WorldViewTransformer worldViewTransformer = feature.getLayer().getMapModel().getMapView()
          .getWorldViewTransformer();
      Geometry geometry = worldViewTransformer.worldToPan(feature.getGeometry());
      ShapeStyle style = createStyleForFeature(feature);
      PaintableGroup selectionGroup = feature.getLayer().getSelectionGroup();
      context.getVectorContext().drawGroup(selectionGroup, feature);
      String name = feature.getLayer().getId() + "-" + feature.getId();

      if (geometry instanceof LineString) {
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.