Package org.geotools.styling

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


        FeatureTypeStyle fts = sldContentManager.getDefaultFeatureTypeStyle();
        fts.setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        fts.setName("simple"); //$NON-NLS-1$
        fts.setSemanticTypeIdentifiers(new String[] {"generic:geometry", "simple"}); //$NON-NLS-1$ //$NON-NLS-2$
       
        fts.addRule(rule);
        style.addFeatureTypeStyle(fts);
        style.setName("simpleStyle");       
       
        return style;
    }
View Full Code Here


        FeatureTypeStyle fts = sldContentManager.getDefaultFeatureTypeStyle();
        fts.setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        fts.setName("simple"); //$NON-NLS-1$
        fts.setSemanticTypeIdentifiers(new String[]{"generic:geometry", "simple"}); //$NON-NLS-1$ //$NON-NLS-2$

        fts.addRule(rule);
        style.addFeatureTypeStyle(fts);
        style.setName("simpleStyle"); //$NON-NLS-1$

        return style;
    }
View Full Code Here

    public Rule getDefaultRule( Style style ) {
        FeatureTypeStyle ftStyle = getDefaultFeatureTypeStyle(style);
        if (ftStyle.getRules() == null || ftStyle.getRules().length == 0) {
            // create an empty rule
            Rule rule = styleBuilder.createRule(new Symbolizer[]{});
            ftStyle.addRule(rule);
            return rule;
        }

        return ftStyle.getRules()[0];
    }
View Full Code Here

                localMin = ranged.getMin(i);
                localMax = ranged.getMax(i);

                Rule rule = createRuleRanged(ranged, expression, localMin, localMax,
                        geometryAttrType, i, elseMode, colors, opacity, defaultStroke);
                fts.addRule(rule);
            }
        } else if (classifier instanceof ExplicitClassifier) {
            ExplicitClassifier explicit = (ExplicitClassifier) classifier;

            // for each class
View Full Code Here

            // for each class
            for (int i = 0; i < explicit.getSize(); i++) {
                Set value = (Set) explicit.getValues(i);
                Rule rule = createRuleExplicit(explicit, expression, value, geometryAttrType, i,
                        elseMode, colors, opacity, defaultStroke);
                fts.addRule(rule);
            }
        } else {
            LOGGER.log(Level.SEVERE, "Error: no handler for this Classifier type");
        }
View Full Code Here

                    opacity, defaultStroke);
            Rule elseRule = sb.createRule(symb);
            elseRule.setIsElseFilter(true);
            elseRule.setTitle("Else");
            elseRule.setName("else");
            fts.addRule(elseRule);
        }

        // sort the FeatureTypeStyle rules
        Rule[] rule = fts.getRules();
View Full Code Here

    }

    private FeatureTypeStyle fts2() {
        FeatureTypeStyle fts2 = sf.createFeatureTypeStyle();
        Rule rule = sf.createRule();
        fts2.addRule(rule);
        fts2.setFeatureTypeName("feature-type-2");

        return fts2;
    }
View Full Code Here

        rule1.setFilter(ff.id(Collections.singleton(ff.featureId("FID"))));

        Rule rule2 = sf.createRule();
        rule2.setIsElseFilter(true);
        rule2.setName("rule2");
        fts.addRule(rule1);
        fts.addRule(rule2);

        fts.accept( visitor );
        FeatureTypeStyle clone = (FeatureTypeStyle) visitor.getCopy();
        //assertClone(fts, clone);
View Full Code Here

        Rule rule2 = sf.createRule();
        rule2.setIsElseFilter(true);
        rule2.setName("rule2");
        fts.addRule(rule1);
        fts.addRule(rule2);

        fts.accept( visitor );
        FeatureTypeStyle clone = (FeatureTypeStyle) visitor.getCopy();
        //assertClone(fts, clone);
        assertEqualsContract( fts, clone );
View Full Code Here

        rule1.setName("rule1");
        rule1.setFilter(ff.id(Collections.singleton(ff.featureId("FID"))));

        FeatureTypeStyle notEq = sf.createFeatureTypeStyle();
        notEq.setName("fts-not-equal");
        notEq.addRule(rule1);
        assertEqualsContract(clone, notEq, fts);
    }

    public void testRule() throws Exception {
        Symbolizer symb1 = sf.createLineSymbolizer(sf
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.