public interface Rule extends Rule
The details of this object are taken from the OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.:
<xsd:element name="Rule">
<xsd:annotation>
<xsd:documentation>
A Rule is used to attach property/scale conditions to and group
the individual symbolizers used for rendering.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="sld:Name" minOccurs="0"/>
<xsd:element ref="sld:Title" minOccurs="0"/>
<xsd:element ref="sld:Abstract" minOccurs="0"/>
<xsd:element ref="sld:LegendGraphic" minOccurs="0"/>
<xsd:choice minOccurs="0">
<xsd:element ref="ogc:Filter"/>
<xsd:element ref="sld:ElseFilter"/>
</xsd:choice>
<xsd:element ref="sld:MinScaleDenominator" minOccurs="0"/>
<xsd:element ref="sld:MaxScaleDenominator" minOccurs="0"/>
<xsd:element ref="sld:Symbolizer" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Modifier and Type | Method and Description |
---|---|
void |
accept(StyleVisitor visitor)
Used to traverse the style data structure.
|
Description |
getDescription()
Description for this rule.
|
Filter |
getFilter()
This is the filter used to select content for this rule to display
|
GraphicLegend |
getLegend()
Returns a small Graphic that could be used by the rendering engine to draw a legend window.
|
OnLineResource |
getOnlineResource()
It is common to have a style coming from a external xml file, this method provide a way to
get the original source if there is one.
|
default Map<String,String> |
getOptions()
Map of vendor options for the Rule.
|
Symbolizer[] |
getSymbolizers()
The symbolizers contain the actual styling information for different geometry types.
|
default boolean |
hasOption(String key)
Determines if a vendor option with the specific key has been set on this Rule.
|
void |
setDescription(Description description)
Description for this rule.
|
void |
setElseFilter(boolean isElse) |
void |
setFilter(Filter filter)
Filter used to select content for this rule to display.
|
void |
setLegend(GraphicLegend legend) |
void |
setMaxScaleDenominator(double scale)
The largest value for scale denominator at which symbolizers contained by this rule should be
applied.
|
void |
setMinScaleDenominator(double scale)
The smallest value for scale denominator at which symbolizers contained by this rule should
be applied.
|
void |
setName(String name)
Sets the name of the rule.
|
void |
setOnlineResource(OnLineResource resource) |
List<Symbolizer> |
symbolizers()
Symbolizers used, in order, to portray the features selected by this rule.
|
accept, getMaxScaleDenominator, getMinScaleDenominator, getName, isElseFilter
void setName(String name)
name
- The name of the rule. This provides a way to identify a rule.Description getDescription()
getDescription
in interface Rule
void setDescription(Description description)
description
- Human readable title and abstract.void setMinScaleDenominator(double scale)
scale
- The smallest (inclusive) denominator value that this rule will be active for.void setMaxScaleDenominator(double scale)
scale
- The largest (exclusive) denominator value that this rule will be active for.Filter getFilter()
void setFilter(Filter filter)
This filter is only consulted if isElseFilter is false.
void setElseFilter(boolean isElse)
isElse
- if this rule should accept any features not already renderedGraphicLegend getLegend()
Rule
A nice user interface may want to present the user with a legend that indicates how
features of a given type are being portrayed. Through its LegendGraphic
property, a
Rule
may provide a custom picture to be used in such a legend window.
void setLegend(GraphicLegend legend)
legend
- Symbolizer[] getSymbolizers()
List<Symbolizer> symbolizers()
Please note that this list may be modified direct.
symbolizers
in interface Rule
OnLineResource getOnlineResource()
Rule
getOnlineResource
in interface Rule
void setOnlineResource(OnLineResource resource)
resource
- Indicates where this style is defineddefault boolean hasOption(String key)
default Map<String,String> getOptions()
Client code looking for the existence of a single option should use hasOption(String)
void accept(StyleVisitor visitor)
Copyright © 1996–2022 Geotools. All rights reserved.