Package org.geotools.styling
Class RuleImpl
- Object
-
- RuleImpl
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RuleImpl()
Creates a new instance of DefaultRuleRuleImpl(Rule rule)
Copy 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StyleVisitor visitor)
Used to traverse the style data structure.Object
accept(TraversingStyleVisitor visitor, Object data)
calls the visit method of a StyleVisitorObject
clone()
Creates a deep copy clone of the rule.boolean
equals(Object oth)
Compares this Rule with another for equality.DescriptionImpl
getDescription()
Description for this rule.Filter
getFilter()
This is the filter used to select content for this rule to displayGraphicLegend
getLegend()
double
getMaxScaleDenominator()
Getter for property maxScaleDenominator.double
getMinScaleDenominator()
Getter for property minScaleDenominator.String
getName()
Returns a name for this rule.OnLineResource
getOnlineResource()
Map<String,String>
getOptions()
Map of vendor options for the Rule.Symbolizer[]
getSymbolizers()
The symbolizers contain the actual styling information for different geometry types.int
hashCode()
Generates a hashcode for the Rule.boolean
hasOption(String key)
Determines if a vendor option with the specific key has been set on this Rule.boolean
isElseFilter()
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
setFilter(Filter filter)
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
setName(String name)
Sets the name of the rule.void
setOnlineResource(OnLineResource online)
List<Symbolizer>
symbolizers()
Symbolizers used, in order, to portray the features selected by this rule.String
toString()
-
-
-
Constructor Detail
-
RuleImpl
protected RuleImpl()
Creates a new instance of DefaultRule
-
RuleImpl
protected RuleImpl(Symbolizer... symbolizers)
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
public RuleImpl(Rule rule)
Copy constructor
-
-
Method Detail
-
getLegend
public GraphicLegend getLegend()
-
setLegend
public void setLegend(GraphicLegend legend)
-
symbolizers
public List<Symbolizer> 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
public Symbolizer[] 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
public DescriptionImpl 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
public void setDescription(Description description)
Description copied from interface:Rule
Description for this rule.- Specified by:
setDescription
in interfaceRule
- Parameters:
description
- Human readable title and abstract.
-
getName
public String 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
public void setName(String name)
Description copied from interface:Rule
Sets the name of the rule.
-
getFilter
public Filter getFilter()
Description copied from interface:Rule
This is the filter used to select content for this rule to display
-
setFilter
public void setFilter(Filter filter)
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
public Object accept(TraversingStyleVisitor visitor, Object data)
Description copied from interface:Rule
calls the visit method of a StyleVisitor
-
accept
public void accept(StyleVisitor visitor)
Description copied from interface:Rule
Used to traverse the style data structure.
-
clone
public Object clone()
Creates a deep copy clone of the rule.- Specified by:
clone
in interfaceCloneable
- Overrides:
clone
in classObject
- Returns:
- A copy of this object.
- See Also:
Object.clone()
-
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
public boolean equals(Object oth)
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.
-
getOnlineResource
public OnLineResource getOnlineResource()
- Specified by:
getOnlineResource
in interfaceRule
- Returns:
- Location where this style is defined; file or server; or null if unknown
-
setOnlineResource
public void setOnlineResource(OnLineResource online)
- Specified by:
setOnlineResource
in interfaceRule
- Parameters:
online
- Indicates where this style is defined
-
hasOption
public boolean hasOption(String key)
Description copied from interface:Rule
Determines if a vendor option with the specific key has been set on this Rule.
-
getOptions
public Map<String,String> 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
-
-