Package org.geotools.styling
Class RuleImpl
Object
RuleImpl
Provides the default implementation of Rule.
- Author:
- James Macgill, Johann Sorel (Geomatys)
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
RuleImpl()
Creates a new instance of DefaultRuleCopy constructorprotected
RuleImpl
(Symbolizer... symbolizers) Creates a new instance of DefaultRuleprotected
RuleImpl
(Symbolizer[] symbolizers, Description desc, Graphic legend, String name, Filter filter, boolean isElseFilter, double maxScale, double minScale) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StyleVisitor visitor) Used to traverse the style data structure.accept
(TraversingStyleVisitor visitor, Object data) calls the visit method of a StyleVisitorclone()
Creates a deep copy clone of the rule.boolean
Compares this Rule with another for equality.Description for this rule.This is the filter used to select content for this rule to displaydouble
Getter for property maxScaleDenominator.double
Getter for property minScaleDenominator.getName()
Returns a name for this rule.Map of vendor options for the Rule.The symbolizers contain the actual styling information for different geometry types.int
hashCode()
Generates a hashcode for the Rule.boolean
Determines if a vendor option with the specific key has been set on this Rule.boolean
Returns true if thisRule
is to fire only if no other rules in the containing style have fired yet.void
setDescription
(Description description) Description for this rule.void
setElseFilter
(boolean defaultb) void
Filter used to select content for this rule to display.void
setLegend
(GraphicLegend legend) void
setMaxScaleDenominator
(double maxScaleDenominator) Setter for property maxScaleDenominator.void
setMinScaleDenominator
(double minScaleDenominator) Setter for property minScaleDenominator.void
Sets the name of the rule.void
setOnlineResource
(OnLineResource online) Symbolizers used, in order, to portray the features selected by this rule.toString()
-
Field Details
-
options
-
-
Constructor Details
-
RuleImpl
protected RuleImpl()Creates a new instance of DefaultRule -
RuleImpl
Creates a new instance of DefaultRule -
RuleImpl
protected RuleImpl(Symbolizer[] symbolizers, Description desc, Graphic legend, String name, Filter filter, boolean isElseFilter, double maxScale, double minScale) -
RuleImpl
Copy constructor
-
-
Method Details
-
getLegend
-
setLegend
-
symbolizers
Description copied from interface:Rule
Symbolizers used, in order, to portray the features selected by this rule.Please note that this list may be modified direct.
- Specified by:
symbolizers
in interfaceRule
-
getSymbolizers
Description copied from interface:Rule
The symbolizers contain the actual styling information for different geometry types. A single feature may be rendered by more than one of the symbolizers returned by this method. It is important that the symbolizers be applied in the order in which they are returned if the end result is to be as intended. All symbolizers should be applied to all features which make it through the filters in this rule regardless of the features' geometry. For example, a polygon symbolizer should be applied to line geometries and even points. If this is not the desired beaviour, ensure that either the filters block inappropriate features or that the FeatureTypeStyler which contains this rule has its FeatureTypeName or SemanticTypeIdentifier set appropriately.- Specified by:
getSymbolizers
in interfaceRule
- Returns:
- An array of symbolizers to be applied, in sequence, to all of the features addressed by the FeatureTypeStyler which contains this rule.
-
getDescription
Description copied from interface:Rule
Description for this rule.- Specified by:
getDescription
in interfaceRule
- Returns:
- Human readable description for use in user interfaces
-
setDescription
Description copied from interface:Rule
Description for this rule.- Specified by:
setDescription
in interfaceRule
- Parameters:
description
- Human readable title and abstract.
-
getName
Description copied from interface:Rule
Returns a name for this rule. This can be any string that uniquely identifies this rule within a given canvas. It is not meant to be human-friendly. (The "title" property is meant to be human friendly.) -
setName
Description copied from interface:Rule
Sets the name of the rule. -
getFilter
Description copied from interface:Rule
This is the filter used to select content for this rule to display -
setFilter
Description copied from interface:Rule
Filter used to select content for this rule to display.This filter is only consulted if isElseFilter is false.
-
isElseFilter
public boolean isElseFilter()Description copied from interface:Rule
Returns true if thisRule
is to fire only if no other rules in the containing style have fired yet. If this is true, then the filter must be Filter.EXCLUDES.- Specified by:
isElseFilter
in interfaceRule
- Returns:
- true if the filter is an else filter
-
setElseFilter
public void setElseFilter(boolean defaultb) - Specified by:
setElseFilter
in interfaceRule
- Parameters:
defaultb
- if this rule should accept any features not already rendered
-
getMaxScaleDenominator
public double getMaxScaleDenominator()Getter for property maxScaleDenominator.- Specified by:
getMaxScaleDenominator
in interfaceRule
- Returns:
- Value of property maxScaleDenominator.
-
setMaxScaleDenominator
public void setMaxScaleDenominator(double maxScaleDenominator) Setter for property maxScaleDenominator.- Specified by:
setMaxScaleDenominator
in interfaceRule
- Parameters:
maxScaleDenominator
- New value of property maxScaleDenominator.
-
getMinScaleDenominator
public double getMinScaleDenominator()Getter for property minScaleDenominator.- Specified by:
getMinScaleDenominator
in interfaceRule
- Returns:
- Value of property minScaleDenominator.
-
setMinScaleDenominator
public void setMinScaleDenominator(double minScaleDenominator) Setter for property minScaleDenominator.- Specified by:
setMinScaleDenominator
in interfaceRule
- Parameters:
minScaleDenominator
- New value of property minScaleDenominator.
-
accept
Description copied from interface:Rule
calls the visit method of a StyleVisitor -
accept
Description copied from interface:Rule
Used to traverse the style data structure. -
clone
Creates a deep copy clone of the rule. -
hashCode
public int hashCode()Generates a hashcode for the Rule.For complex styles this can be an expensive operation since the hash code is computed using all the hashcodes of the object within the style.
-
equals
Compares this Rule with another for equality.Two RuleImpls are equal if all their properties are equal.
For complex styles this can be an expensive operation since it checks all objects for equality.
-
toString
-
getOnlineResource
- Specified by:
getOnlineResource
in interfaceRule
- Returns:
- Location where this style is defined; file or server; or null if unknown
-
setOnlineResource
- Specified by:
setOnlineResource
in interfaceRule
- Parameters:
online
- Indicates where this style is defined
-
hasOption
Description copied from interface:Rule
Determines if a vendor option with the specific key has been set on this Rule. -
getOptions
Description copied from interface:Rule
Map of vendor options for the Rule.Client code looking for the existence of a single option should use
Rule.hasOption(String)
- Specified by:
getOptions
in interfaceRule
-