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
ConstructorsModifierConstructorDescriptionprotectedRuleImpl()Creates a new instance of DefaultRuleCopy constructorprotectedRuleImpl(Symbolizer... symbolizers) Creates a new instance of DefaultRuleprotectedRuleImpl(Symbolizer[] symbolizers, Description desc, Graphic legend, String name, Filter filter, boolean isElseFilter, double maxScale, double minScale) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(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.booleanCompares this Rule with another for equality.Description for this rule.This is the filter used to select content for this rule to displaydoubleGetter for property maxScaleDenominator.doubleGetter 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.inthashCode()Generates a hashcode for the Rule.booleanDetermines if a vendor option with the specific key has been set on this Rule.booleanReturns true if thisRuleis to fire only if no other rules in the containing style have fired yet.voidsetDescription(Description description) Description for this rule.voidsetElseFilter(boolean defaultb) voidFilter used to select content for this rule to display.voidsetLegend(GraphicLegend legend) voidsetMaxScaleDenominator(double maxScaleDenominator) Setter for property maxScaleDenominator.voidsetMinScaleDenominator(double minScaleDenominator) Setter for property minScaleDenominator.voidSets the name of the rule.voidsetOnlineResource(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:RuleSymbolizers used, in order, to portray the features selected by this rule.Please note that this list may be modified direct.
- Specified by:
symbolizersin interfaceRule
-
getSymbolizers
Description copied from interface:RuleThe 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:
getSymbolizersin 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:RuleDescription for this rule.- Specified by:
getDescriptionin interfaceRule- Returns:
- Human readable description for use in user interfaces
-
setDescription
Description copied from interface:RuleDescription for this rule.- Specified by:
setDescriptionin interfaceRule- Parameters:
description- Human readable title and abstract.
-
getName
Description copied from interface:RuleReturns 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:RuleSets the name of the rule. -
getFilter
Description copied from interface:RuleThis is the filter used to select content for this rule to display -
setFilter
Description copied from interface:RuleFilter 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:RuleReturns true if thisRuleis 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:
isElseFilterin interfaceRule- Returns:
- true if the filter is an else filter
-
setElseFilter
public void setElseFilter(boolean defaultb) - Specified by:
setElseFilterin interfaceRule- Parameters:
defaultb- if this rule should accept any features not already rendered
-
getMaxScaleDenominator
public double getMaxScaleDenominator()Getter for property maxScaleDenominator.- Specified by:
getMaxScaleDenominatorin interfaceRule- Returns:
- Value of property maxScaleDenominator.
-
setMaxScaleDenominator
public void setMaxScaleDenominator(double maxScaleDenominator) Setter for property maxScaleDenominator.- Specified by:
setMaxScaleDenominatorin interfaceRule- Parameters:
maxScaleDenominator- New value of property maxScaleDenominator.
-
getMinScaleDenominator
public double getMinScaleDenominator()Getter for property minScaleDenominator.- Specified by:
getMinScaleDenominatorin interfaceRule- Returns:
- Value of property minScaleDenominator.
-
setMinScaleDenominator
public void setMinScaleDenominator(double minScaleDenominator) Setter for property minScaleDenominator.- Specified by:
setMinScaleDenominatorin interfaceRule- Parameters:
minScaleDenominator- New value of property minScaleDenominator.
-
accept
Description copied from interface:Rulecalls the visit method of a StyleVisitor -
accept
Description copied from interface:RuleUsed 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:
getOnlineResourcein interfaceRule- Returns:
- Location where this style is defined; file or server; or null if unknown
-
setOnlineResource
- Specified by:
setOnlineResourcein interfaceRule- Parameters:
online- Indicates where this style is defined
-
hasOption
Description copied from interface:RuleDetermines if a vendor option with the specific key has been set on this Rule. -
getOptions
Description copied from interface:RuleMap of vendor options for the Rule.Client code looking for the existence of a single option should use
Rule.hasOption(String)- Specified by:
getOptionsin interfaceRule
-