Package org.geotools.styling

Examples of org.geotools.styling.FeatureTypeStyle.rules()


        String xml = "<Style>" + "<LineStyle/>" + "<PolyStyle/>" + "<LabelStyle/>" + "</Style>";

        buildDocument(xml);

        FeatureTypeStyle style = (FeatureTypeStyle) parse();
        Symbolizer[] syms = style.rules().get(0).getSymbolizers();

        assertEquals(3, syms.length);
        assertTrue(syms[0] instanceof LineSymbolizer);
        assertTrue(syms[1] instanceof PolygonSymbolizer);
        assertTrue(syms[2] instanceof TextSymbolizer);
View Full Code Here


                 StyleGenerator.ELSEMODE_IGNORE, 0.5, null);
         assertNotNull(fts);

         // test each filter
         //we would expect two rules here - one for each of the two bins created
         List<Rule> rules = fts.rules();
         assertEquals(1, rules.size());
        
         //do a preliminary test to make sure each rule's filter returns some results    
         assertNotNull(StyleGenerator.toStyleExpression(rules.get(0).getFilter()));
         final Filter filter = rules.get(0).getFilter();
View Full Code Here

     */
    private Style createDefaultStyle() {
        Rule rule = createRule(LINE_COLOUR, FILL_COLOUR);

        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
        fts.rules().add(rule);

        Style style = sf.createStyle();
        style.featureTypeStyles().add(fts);
        return style;
    }
View Full Code Here

        Rule otherRule = createRule(LINE_COLOUR, FILL_COLOUR);
        otherRule.setElseFilter(true);

        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
        fts.rules().add(selectedRule);
        fts.rules().add(otherRule);

        Style style = sf.createStyle();
        style.featureTypeStyles().add(fts);
        return style;
View Full Code Here

        Rule otherRule = createRule(LINE_COLOUR, FILL_COLOUR);
        otherRule.setElseFilter(true);

        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
        fts.rules().add(selectedRule);
        fts.rules().add(otherRule);

        Style style = sf.createStyle();
        style.featureTypeStyles().add(fts);
        return style;
    }
View Full Code Here

    PointSymbolizer pointSymbolizer = sf.pointSymbolizer("point", ff.property("the_geom"), null,
            null, city);
   
    rule1.symbolizers().add(pointSymbolizer);
   
    featureTypeStyle.rules().add(rule1);
   
    //
    // RULE 2 Default
   
    List<GraphicalSymbol> dotSymbols = new ArrayList<GraphicalSymbol>();
View Full Code Here

    List<org.opengis.style.Symbolizer> symbolizers = new ArrayList<org.opengis.style.Symbolizer>();
    symbolizers.add(dotSymbolizer);
    Filter other = null; // null will mark this rule as "other" accepting all remaining features
    Rule rule2 = sf.rule("default", null, null, Double.MIN_VALUE, Double.MAX_VALUE, symbolizers,
            other);
    featureTypeStyle.rules().add(rule2);
   
    style.featureTypeStyles().add(featureTypeStyle);
   
    layer.userStyles().add(style);
   
View Full Code Here

    // creating the rule 1
    Rule rule1 = styleFactory.createRule();
    rule1.setName("rule1");
    Filter aFilter = filterFactory.id(Collections.singleton(filterFactory.featureId("FID")));
    rule1.setFilter(aFilter);
    fts2.rules().add(rule1);
   
    // creating the rule 2
    Rule rule2 = styleFactory.createRule();
    rule2.setIsElseFilter(true);
    rule2.setName("rule2");
View Full Code Here

   
    // creating the rule 2
    Rule rule2 = styleFactory.createRule();
    rule2.setIsElseFilter(true);
    rule2.setName("rule2");
    fts2.rules().add(rule2);
   
    style.featureTypeStyles().add(fts2);
    // twoFeatureTypeStyles end
}
View Full Code Here

        TextSymbolizer text = null;
        LabelPlacement placement = null;

        List<Rule> rules = Collections.emptyList();
        if (fts != null)
            rules = fts.rules();
        if (rules.size() > 1) {
            // simple mode trimms away all but the first rule
            Rule keepRule = rules.get(0);
            rules.clear();
            rules.add(keepRule);
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.