Package org.geomajas.configuration

Examples of org.geomajas.configuration.FeatureStyleInfo


  }

  public void addVectorLayer(SimpleFeatureType schema, String title, Rule rule, Font font) {
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
    FeatureStyleInfo defaultStyle = new FeatureStyleInfo();
    defaultStyle.applyDefaults();
    int width = 16;
    int height = 16;
    int margin = 5;
    RuleIcon icon = new RuleIcon(schema, rule, width, height);
    icon.setBounds(margin, margin, margin + width, margin + height);
View Full Code Here


    layer.draw(image.createGraphics(), mapContext, mapContext.getViewport());
    new DirectLayerAssert(layer, mapContext).assertEqualImage("polygon.png", writeImages, DELTA);
  }

  private FeatureStyleInfo createPolygonStyle() {
    FeatureStyleInfo style = new FeatureStyleInfo();
    style.setFillColor("#D2691E");
    style.setFillOpacity(0.5f);
    style.setStrokeColor("#D2691E");
    style.setStrokeOpacity(1f);
    style.setStrokeWidth(3);
    return style;
  }
View Full Code Here

    LabelStyleInfo labelStyleInfo = new LabelStyleInfo();
    List<FeatureStyleInfo> featureStyleInfos = new ArrayList<FeatureStyleInfo>();
    for (FeatureTypeStyleInfo featureTypeStyleInfo : userStyle.getFeatureTypeStyleList()) {
      int styleIndex = 0;
      for (RuleInfo ruleInfo : featureTypeStyleInfo.getRuleList()) {
        FeatureStyleInfo featureStyleInfo = new FeatureStyleInfo();
        if (ruleInfo.getChoice() != null) {
          if (ruleInfo.getChoice().ifFilter()) {
            featureStyleInfo.setFormula(convertFormula(ruleInfo.getChoice().getFilter(), featureInfo));
          }
        }
        for (SymbolizerTypeInfo symbolizerTypeInfo : ruleInfo.getSymbolizerList()) {
          if (symbolizerTypeInfo instanceof PointSymbolizerInfo) {
            PointSymbolizerInfo pointInfo = (PointSymbolizerInfo) symbolizerTypeInfo;
            convertSymbol(featureStyleInfo, pointInfo);
          } else if (symbolizerTypeInfo instanceof LineSymbolizerInfo) {
            LineSymbolizerInfo lineInfo = (LineSymbolizerInfo) symbolizerTypeInfo;
            convertStroke(featureStyleInfo, lineInfo.getStroke());
          } else if (symbolizerTypeInfo instanceof PolygonSymbolizerInfo) {
            PolygonSymbolizerInfo polygonInfo = (PolygonSymbolizerInfo) symbolizerTypeInfo;
            convertFill(featureStyleInfo, polygonInfo.getFill());
            convertStroke(featureStyleInfo, polygonInfo.getStroke());
          } else if (symbolizerTypeInfo instanceof TextSymbolizerInfo) {
            TextSymbolizerInfo textInfo = (TextSymbolizerInfo) symbolizerTypeInfo;
            labelStyleInfo.setFontStyle(convertFont(textInfo.getFont()));
            for (ExpressionInfo expr : textInfo.getLabel().getExpressionList()) {
              labelStyleInfo.setLabelAttributeName(expr.getValue());
            }
            convertFontFill(labelStyleInfo.getFontStyle(), textInfo.getFill());
            FeatureStyleInfo background = new FeatureStyleInfo();
            if (textInfo.getHalo() != null) {
              convertFill(background, textInfo.getHalo().getFill());
            }
            labelStyleInfo.setBackgroundStyle(background);
          }
View Full Code Here

  }

  // Private methods:

  private ShapeStyle createStyleForFeature(Feature feature) {
    FeatureStyleInfo styleInfo = null;
    if (feature != null && feature.getStyleId() != null) {
      for (FeatureStyleInfo style : feature.getLayer().getLayerInfo().getNamedStyleInfo().getFeatureStyles()) {
        if (feature.getStyleId().equals(style.getStyleId())) {
          styleInfo = style;
          break;
View Full Code Here

TOP

Related Classes of org.geomajas.configuration.FeatureStyleInfo

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.