Package org.geotools.styling

Examples of org.geotools.styling.FeatureTypeStyleImpl


    }

    public void visit(FeatureTypeStyle fts) {
       
       
        FeatureTypeStyle copy = new FeatureTypeStyleImpl( (FeatureTypeStyleImpl)fts);

//        copy = new StyleFactoryImpl().createFeatureTypeStyle(
//                fts.getRules(),
//                fts.getSemanticTypeIdentifiers(),
//                fts.featureInstanceIDs(),
//                fts.getFeatureTypeName(),
//                fts.getDescription(),
//                fts.getName());
       
       
        Rule[] rules = fts.getRules();
        int length=rules.length;
        Rule[] rulesCopy = new Rule[length];
        for (int i = 0; i < length; i++) {
            if (rules[i] != null) {
                rules[i].accept(this);
                rulesCopy[i] = (Rule) pages.pop();
            }
        }
//
//        copy = sf.createFeatureTypeStyle();
//        copy.setName(fts.getName());
//        copy.setTitle(fts.getTitle());
//        copy.setAbstract(fts.getAbstract());
//        copy.setFeatureTypeName(fts.getFeatureTypeName());
        copy.setRules(rulesCopy);
//        copy.setSemanticTypeIdentifiers((String[]) fts.getSemanticTypeIdentifiers().clone());
       
        if( STRICT && !copy.equals( fts )){
            throw new IllegalStateException("Was unable to duplicate provided FeatureTypeStyle:"+fts );
        }
        pages.push(copy);
    }
View Full Code Here


        copy.featureTypeStyles().addAll(filtered);
    }

    @Override
    public void visit(FeatureTypeStyle fts) {
        FeatureTypeStyle copy = new FeatureTypeStyleImpl((FeatureTypeStyleImpl) fts);

        // preserve only the rules active at this scale range
        List<Rule> rulesCopy = new ArrayList<Rule>();
        for (Rule r : fts.rules()) {
            if (((r.getMinScaleDenominator() - TOLERANCE) <= scaleDenominator)
                    && ((r.getMaxScaleDenominator() + TOLERANCE) > scaleDenominator)) {
                rulesCopy.add(r);
            }

        }
        copy.rules().clear();
        copy.rules().addAll(rulesCopy);
        pages.push(copy);
    }
View Full Code Here

TOP

Related Classes of org.geotools.styling.FeatureTypeStyleImpl

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.