Package org.geotools.styling

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


     *
     * @return the default style.
     */
    public static Style createDefaultPolygonStyle() {
        FeatureTypeStyle featureTypeStyle = sf.createFeatureTypeStyle();
        featureTypeStyle.rules().add(createDefaultPolygonRule());

        Style style = sf.createStyle();
        style.featureTypeStyles().add(featureTypeStyle);

        return style;
View Full Code Here


     *
     * @return the default style.
     */
    public static Style createDefaultLineStyle() {
        FeatureTypeStyle featureTypeStyle = sf.createFeatureTypeStyle();
        featureTypeStyle.rules().add(createDefaultLineRule());

        Style style = sf.createStyle();
        style.featureTypeStyles().add(featureTypeStyle);

        return style;
View Full Code Here

     */
    public static Style rulesToStyle( List<Rule> rules, String name, boolean oneFeaturetypestylePerRule ) {
        Style namedStyle = Utilities.sf.createStyle();
        if (!oneFeaturetypestylePerRule) {
            FeatureTypeStyle featureTypeStyle = Utilities.sf.createFeatureTypeStyle();
            List<Rule> currentRules = featureTypeStyle.rules();
            for( int i = 0; i < rules.size(); i++ ) {
                Rule rule = rules.get(i);
                currentRules.add(rule);
            }
            namedStyle.featureTypeStyles().add(featureTypeStyle);
View Full Code Here

            namedStyle.featureTypeStyles().add(featureTypeStyle);
        } else {
            for( int i = 0; i < rules.size(); i++ ) {
                FeatureTypeStyle featureTypeStyle = Utilities.sf.createFeatureTypeStyle();
                Rule rule = rules.get(i);
                featureTypeStyle.rules().add(rule);
                namedStyle.featureTypeStyles().add(featureTypeStyle);
            }
        }
        namedStyle.setName(name);
        return namedStyle;
View Full Code Here

        Rule rule = sf.createRule();
        PointSymbolizer pointSymbolizer = sf.createPointSymbolizer(gr, null);
        rule.symbolizers().add(pointSymbolizer);

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

        Style namedStyle = sf.createStyle();
        namedStyle.featureTypeStyles().add(featureTypeStyle);
        namedStyle.setName(FilenameUtils.removeExtension(name));
View Full Code Here

        saveButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                RuleWrapper selectedRule = getSelectedRule();

                FeatureTypeStyle featureTypeStyle = Utilities.sf.createFeatureTypeStyle();
                featureTypeStyle.rules().add(selectedRule.getRule());
                Style namedStyle = Utilities.sf.createStyle();
                namedStyle.featureTypeStyles().add(featureTypeStyle);
                namedStyle.setName(selectedRule.getName());

                try {
View Full Code Here

    if (style == null){
      return null;
    }
    for (int i = 0; i < style.length; i ++){
      FeatureTypeStyle fstyle = style[i]
      List<Rule> rules = fstyle.rules();
      if (rules == null){
        continue;
      }
     
      for (Rule rule : rules){
View Full Code Here

            Style style = (Style) parentElement;
            Rule[] rule = SLDs.rules(style);
            return rule; // return rules
        } else if (parentElement instanceof FeatureTypeStyle) {
            FeatureTypeStyle fts = (FeatureTypeStyle) parentElement;
            List<Rule> rules = fts.rules();
            Rule[] rulesArray = (Rule[]) rules.toArray(new Rule[rules.size()]);
            return rulesArray;
        }
        return EMPTY_ARRAY;
    }
View Full Code Here

            }
        }
        if(defaultStyle == null)
            return;
       
        Rule rule = defaultStyle.rules().get(0);
        // Find the first PointSymbolizer in the rule
        PointSymbolizer sym = null;
        for(Symbolizer symbolizer : rule.symbolizers()) {
            if(symbolizer instanceof PointSymbolizer) {
                sym = (PointSymbolizer)symbolizer;
View Full Code Here

        reverseButton.addSelectionListener(new SelectionListener() {

            public void widgetSelected( SelectionEvent e ) {
                reverseColours = !reverseColours; //used by generateTheme to get things half right
                FeatureTypeStyle fts = getFTS();
                List<Rule> ruleList = fts.rules();
                for (int i = 0; i < (ruleList.size() / 2); i++) {
                    swapColours(ruleList.get(i), ruleList.get(ruleList.size()-i-1));
                }
                treeViewer.refresh();
            }
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.