Package org.geotools.styling

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


                 * At present this dialog just examines the very first rule and symbolizer
                 */
                if (featureTypeStyle.rules() == null || featureTypeStyle.rules().isEmpty()) {
                    return;
                }
                rule = featureTypeStyle.rules().get(0);

                if (rule.symbolizers() == null) {
                    return;
                }
                for (Symbolizer sym : rule.symbolizers()) {
View Full Code Here


                 * Just grap the first feature type style that contains the
                 * right sort of symbolizer
                 */
                for (int ifts = 0; featureTypeStyle == null && ifts < style.featureTypeStyles().size(); ifts++) {
                    FeatureTypeStyle fts = style.featureTypeStyles().get(ifts);
                    for (int irule = 0; featureTypeStyle == null && irule < fts.rules().size(); irule++) {
                        Rule r = fts.rules().get(irule);
                        for (Symbolizer sym : r.symbolizers()) {
                            if (isValidSymbolizer(sym, geomType)) {
                                featureTypeStyle = fts;
                                rule = r;
View Full Code Here

                 * right sort of symbolizer
                 */
                for (int ifts = 0; featureTypeStyle == null && ifts < style.featureTypeStyles().size(); ifts++) {
                    FeatureTypeStyle fts = style.featureTypeStyles().get(ifts);
                    for (int irule = 0; featureTypeStyle == null && irule < fts.rules().size(); irule++) {
                        Rule r = fts.rules().get(irule);
                        for (Symbolizer sym : r.symbolizers()) {
                            if (isValidSymbolizer(sym, geomType)) {
                                featureTypeStyle = fts;
                                rule = r;
                                symbolizer = sym;
View Full Code Here

     */
    public static Rule getRasterSymbolizerRule( Style s ) {
        List<FeatureTypeStyle> fts = s.featureTypeStyles();
        for( int i = 0; i < fts.size(); i++ ) {
            FeatureTypeStyle featureTypeStyle = fts.get(i);
            List<Rule> rules = featureTypeStyle.rules();
            for( int j = 0; j < rules.size(); j++ ) {
                Rule rule = rules.get(j);
                Symbolizer[] symbolizers = rule.getSymbolizers();
                for( int k = 0; k < symbolizers.length; k++ ) {
                    Symbolizer symbolizer = symbolizers[k];
View Full Code Here

    @Override
    public void visit(FeatureTypeStyle fts) {
        super.visit(fts);
        FeatureTypeStyle copy = (FeatureTypeStyle) pages.peek();
        List<Rule> nonNullCopies = new ArrayList<Rule>();
        for (Rule r : copy.rules()) {
            if (r != null) {
                nonNullCopies.add(r);
            }
        }
View Full Code Here

        if (nonNullCopies.size() == 0) {
            pages.pop();
            pages.push(null);
        } else {
            copy.rules().clear();
            copy.rules().addAll(nonNullCopies);
        }
    }

    @Override
View Full Code Here

        if (nonNullCopies.size() == 0) {
            pages.pop();
            pages.push(null);
        } else {
            copy.rules().clear();
            copy.rules().addAll(nonNullCopies);
        }
    }

    @Override
    public void visit(Style style) {
View Full Code Here

                if(!miniRule.symbolizers.isEmpty()){
                    Rule realRule = factory.createRule();
                    for (Symbolizer sym : miniRule.symbolizers) {
                        realRule.symbolizers().add(sym);
                    }
                    ftStyle.rules().add(realRule);
                }
            }
            style.featureTypeStyles().add(ftStyle);
        }
        return style;
View Full Code Here

       for (int i = 0; i < 21; i++) {
           Filter f = ff.equals(ff.literal(1), ff.literal(1));
           Rule r = sf.createRule();
           r.setFilter(f);
           r.symbolizers().add(sf.createPolygonSymbolizer());
           fts.rules().add(r);
       }

       cat.getResourcePool().writeStyle(style, s);
       cat.save(style);
View Full Code Here

   
    @Test
    public void testOneFtsFullyStatic() {
        Style style = sb.createStyle();
        FeatureTypeStyle fts = sb.createFeatureTypeStyle("Feature", staticPolygonRule);
        fts.rules().add(staticLineRule);
        style.featureTypeStyles().add(fts);
       
        style.accept(visitor);
        Style copy = (Style) visitor.getCopy();
        assertNull(copy);
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.