Examples of featureTypeStyles()


Examples of org.geotools.styling.Style.featureTypeStyles()

    featureLayer.getUserData().put(USERDATA_KEY_SHOWING, extraInfo.isShowing());
    List<Rule> rules = new ArrayList<Rule>();
    double scaleDenominator = RendererUtilities.calculateOGCScale(mapContext.getAreaOfInterest(), (int) mapContext
        .getViewport().getScreenArea().getWidth(), null);
    // find the applicable rules
    for (FeatureTypeStyle fts : style.featureTypeStyles()) {
      for (Rule rule : fts.rules()) {
        if (isWithInScale(rule, scaleDenominator)) {
          FeatureIterator<SimpleFeature> it;
          try {
            it = featureLayer.getSimpleFeatureSource().getFeatures().features();
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    }
    layer.getUserData().put(USERDATA_KEY_SHOWING, layerInfo.isShowing());
    layer.setTitle(layerInfo.getLabel());
    List<Rule> rules = new ArrayList<Rule>();
    // all rules are needed for map/legend
    for (FeatureTypeStyle fts : style.featureTypeStyles()) {
      for (Rule rule : fts.rules()) {
        rules.add(rule);
      }
    }
    layer.getUserData().put(USERDATA_KEY_STYLE_RULES, rules);
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

        rules.addAll(createRules(layerType, styleFilter, featureInfo, featureStyle));
      }
      // create the style
      FeatureTypeStyle normalStyle = styleBuilder.createFeatureTypeStyle(typeName,
          rules.toArray(new Rule[rules.size()]));
      style.featureTypeStyles().add(normalStyle);
      // apply the selection style
      rules.clear();
      if (vectorLayerRasterizingInfo.getSelectedFeatureIds() != null) {
        // create the filter
        Filter fidFilter = filterService.createFidFilter(vectorLayerRasterizingInfo.getSelectedFeatureIds());
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

            vectorLayerRasterizingInfo.getSelectionStyle()));
      }
      // create the style
      FeatureTypeStyle selectionStyle = styleBuilder.createFeatureTypeStyle(typeName,
          rules.toArray(new Rule[rules.size()]));
      style.featureTypeStyles().add(selectionStyle);
    }
    // apply the label style
    if (vectorLayerRasterizingInfo.isPaintLabels()) {
      // create the rule
      TextSymbolizer textSymbolizer = createTextSymbolizer(vectorLayerRasterizingInfo.getStyle().getLabelStyle(),
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

      TextSymbolizer textSymbolizer = createTextSymbolizer(vectorLayerRasterizingInfo.getStyle().getLabelStyle(),
          layerType);
      Rule labelRule = styleBuilder.createRule(textSymbolizer);
      // create the style
      FeatureTypeStyle labelStyle = styleBuilder.createFeatureTypeStyle(typeName, labelRule);
      style.featureTypeStyles().add(labelStyle);
    }
    return style;
  }

  public Style createStyle(LayerType type, FeatureStyleInfo featureStyleInfo) throws GeomajasException {
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

  public Style createStyle(LayerType type, FeatureStyleInfo featureStyleInfo) throws GeomajasException {
    Style style = styleBuilder.createStyle();
    Symbolizer symbolizer = createGeometrySymbolizer(type, featureStyleInfo);
    FeatureTypeStyle fts = styleBuilder.createFeatureTypeStyle(symbolizer);
    style.featureTypeStyles().add(fts);
    return style;
  }

  private List<Rule> createRules(LayerType layerType, Filter filter, FeatureInfo featureInfo,
      FeatureStyleInfo featureStyle) {
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    parser.setInput(getClass().getResource("point_pointwithdefaultlabel.sld"));
    Style[] styles = parser.readXML();
    Assert.assertEquals(1, styles.length);
    visitor.visit(styles[0]);
    Style copy = (Style) visitor.getCopy();
    FeatureTypeStyle featureTypeStyle = copy.featureTypeStyles().iterator().next();
    Rule rule = featureTypeStyle.rules().iterator().next();
    Iterator<Symbolizer> it = rule.symbolizers().iterator();
    Assert.assertTrue(it.next() instanceof TextSymbolizer);
    Assert.assertFalse(it.hasNext());
  }
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    parser.setInput(getClass().getResource("point_pointwithdefaultlabel.sld"));
    Style[] styles = parser.readXML();
    Assert.assertEquals(1, styles.length);
    visitor.visit(styles[0]);
    Style copy = (Style) visitor.getCopy();
    FeatureTypeStyle featureTypeStyle = copy.featureTypeStyles().iterator().next();
    Rule rule = featureTypeStyle.rules().iterator().next();
    Iterator<Symbolizer> it = rule.symbolizers().iterator();
    Assert.assertTrue(it.next() instanceof PointSymbolizer);
    Assert.assertFalse(it.hasNext());
  }
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    parser.setInput(getClass().getResource("point_pointwithdefaultlabel.sld"));
    Style[] styles = parser.readXML();
    Assert.assertEquals(1, styles.length);
    visitor.visit(styles[0]);
    Style copy = (Style) visitor.getCopy();
    FeatureTypeStyle featureTypeStyle = copy.featureTypeStyles().iterator().next();
    Rule rule = featureTypeStyle.rules().iterator().next();
    Iterator<Symbolizer> it = rule.symbolizers().iterator();
    Assert.assertTrue(it.next() instanceof PointSymbolizer);
    Assert.assertTrue(it.next() instanceof TextSymbolizer);
    Assert.assertFalse(it.hasNext());
View Full Code Here

Examples of org.geotools.styling.Style.featureTypeStyles()

    public static Style getDefaultStyle( StyledLayerDescriptor sld ) {
        Style[] styles = styles(sld);
        for( int i = 0; i < styles.length; i++ ) {
            Style style = styles[i];
            List<FeatureTypeStyle> ftStyles = style.featureTypeStyles();
            genericizeftStyles(ftStyles);
            if (style.isDefault()) {
                return style;
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.