Class RuleCreator


  • public class RuleCreator
    extends Object
    Utility class for creating Styles from rules and rule editing.
    Author:
    Nick Collier, Eric Tatara
    • Constructor Detail

      • RuleCreator

        public RuleCreator()
    • Method Detail

      • createStyle

        public org.geotools.styling.Style createStyle​(String attributeName,
                                                      List<org.geotools.styling.Rule> rules)
        Creates a Style from the specified list of Rules.
        Parameters:
        rules - the rules to create the style from
        Returns:
        the created style
      • createValueRule

        public org.geotools.styling.Rule createValueRule​(org.opengis.feature.simple.SimpleFeature feature,
                                                         String attributeName,
                                                         SymbolizerFactory factory)
        Creates a rule that matches on the specified attribute and and the specified features attribute value. The Symoblizer will use a clone of the specified mark and the specified color.
        Parameters:
        feature - the feature whose attribute value will be used in the rule.
        attributeName - the name of the attribute
        factory - the factory to create the symbolizer with
        Returns:
        the created rule.
      • getColor

        public static Color getColor​(org.geotools.styling.Rule rule)
        Gets the color of the symbolizer in the specified rule.
        Parameters:
        rule - the rule whose color we want to get
        Returns:
        the color of the symbolizer in the specified rule.
      • setColor

        public static void setColor​(org.geotools.styling.Rule rule,
                                    Color color)
        Sets the color of the symbolizer in the specified rule.
        Parameters:
        rule - the rule whose color we want to set