Package org.geomajas.sld

Examples of org.geomajas.sld.GraphicInfo$ChoiceInfo


    namedStyleInfo.setLabelStyle(labelStyleInfo);
    return namedStyleInfo;
  }

  private void convertSymbol(FeatureStyleInfo featureStyleInfo, PointSymbolizerInfo pointInfo) {
    GraphicInfo graphic = pointInfo.getGraphic();
    SymbolInfo symbol = new SymbolInfo();

    if (graphic.getChoiceList().size() > 0) {
      ChoiceInfo choice = graphic.getChoiceList().get(0);
      if (choice.ifExternalGraphic()) {
        ExternalGraphicInfo externalGraphic = choice.getExternalGraphic();
        String href = externalGraphic.getOnlineResource().getHref().getHref();
        ImageInfo image = new ImageInfo();
        image.setHref(href);
        // SLD has no selection concept + no default: what to do ?
        image.setSelectionHref(href);
        image.setHeight((int) Float.parseFloat(getParameterValue(graphic.getSize())));
        symbol.setImage(image);
      } else if (choice.ifMark()) {
        MarkInfo mark = choice.getMark();
        String name = mark.getWellKnownName().getWellKnownName();
        if (name.equalsIgnoreCase("square")) {
          RectInfo rect = new RectInfo();
          rect.setH(Float.parseFloat(getParameterValue(graphic.getSize())));
          rect.setW(Float.parseFloat(getParameterValue(graphic.getSize())));
          symbol.setRect(rect);
        } else {
          // should treat everything else as circle ?!
          CircleInfo circle = new CircleInfo();
          circle.setR(0.5F * Float.parseFloat(getParameterValue(graphic.getSize())));
          symbol.setCircle(circle);
        }
        convertFill(featureStyleInfo, mark.getFill());
        convertStroke(featureStyleInfo, mark.getStroke());
      }
View Full Code Here


      }
      if (cssMap.containsKey("fill-opacity")) {
        featureStyleInfo.setFillOpacity(Float.parseFloat(cssMap.get("fill-opacity")));
      }
      if (fill.getGraphicFill() != null) {
        GraphicInfo graphic = fill.getGraphicFill().getGraphic();
        for (GraphicInfo.ChoiceInfo choice : graphic.getChoiceList()) {
          if (choice.ifExternalGraphic()) {
            // can't handle this
          } else if (choice.ifMark()) {
            MarkInfo mark = (MarkInfo) choice.getMark();
            if (mark.getFill() != null) {
View Full Code Here

TOP

Related Classes of org.geomajas.sld.GraphicInfo$ChoiceInfo

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.