|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Rule
A rule is used to attach a condition to, and group, the individual symbolizers used for rendering. The Title and Abstract describe the rule and may be used to generate a legend, as may the LegendGraphic. The Filter, ElseFilter, MinScale and MaxScale elements allow the selection of features and rendering scales for a rule. The scale selection works as follows. When a map is to be rendered, the scale denominator is computed and all rules in all UserStyles that have a scale outside of the request range are dropped. (This also includes Rules that have an ElseFilter.) An ElseFilter is simply an ELSE condition to the conditions (Filters) of all other rules in the same UserStyle. The exact meaning of the ElseFilter is determined after Rules have been eliminated for not fitting the rendering scale. This definition of the behaviour of ElseFilters may seem a little strange, but it allows for scale-dependent and scale-independent ELSE conditions. For the Filter, only SqlExpression is available for specification, but this is a hack and should be replaced with Filter as defined in WFS. A missing Filter element means "always true". If a set of Rules has no ElseFilters, then some features may not be rendered (which is presumably the desired behavior). The Scales are actually scale denominators (as double floats), so "10e6" would be interpreted as 1:10M. A missing MinScale means there is no lower bound to the scale-denominator range (lim[x->0+](x)), and a missing MaxScale means there is no upper bound (infinity). 0.28mm
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>
Method Summary | |
---|---|
void |
accept(StyleVisitor visitor)
Used to traverse the style data structure. |
java.lang.String |
getAbstract()
Deprecated. use getDescription().getAbstract().getString() |
Description |
getDescription()
Description for this rule. |
org.opengis.filter.Filter |
getFilter()
This is the filter used to select content for this rule to display |
org.opengis.style.GraphicLegend |
getLegend()
|
Graphic[] |
getLegendGraphic()
Deprecated. Please use getLegend |
org.opengis.metadata.citation.OnLineResource |
getOnlineResource()
|
Symbolizer[] |
getSymbolizers()
The symbolizers contain the actual styling information for different geometry types. |
java.lang.String |
getTitle()
Deprecated. use getDescription().getTitle().getString() |
boolean |
hasElseFilter()
Deprecated. Please use isElseFilter |
void |
setAbstract(java.lang.String abstractStr)
Deprecated. use getDescription().setAbstract() |
void |
setDescription(org.opengis.style.Description description)
Description for this rule. |
void |
setElseFilter(boolean isElse)
|
void |
setFilter(org.opengis.filter.Filter filter)
Filter used to select content for this rule to display. |
void |
setIsElseFilter(boolean isElse)
|
void |
setLegend(org.opengis.style.GraphicLegend legend)
|
void |
setLegendGraphic(Graphic[] graphics)
Deprecated. Please use setLegend |
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(java.lang.String name)
Sets the name of the rule. |
void |
setOnlineResource(org.opengis.metadata.citation.OnLineResource online)
|
void |
setSymbolizers(Symbolizer[] symbolizers)
Deprecated. please use symbolizers().addAll() |
void |
setTitle(java.lang.String title)
Sets the title. |
java.util.List<Symbolizer> |
symbolizers()
Symbolizers used, in order, to portray the features selected by this rule. |
Methods inherited from interface org.opengis.style.Rule |
---|
accept, getMaxScaleDenominator, getMinScaleDenominator, getName, isElseFilter |
Method Detail |
---|
void setName(java.lang.String name)
name
- The name of the rule. This provides a way to identify a
rule.Description getDescription()
getDescription
in interface org.opengis.style.Rule
void setDescription(org.opengis.style.Description description)
description
- Human readable title and abstract.java.lang.String getTitle()
void setTitle(java.lang.String title)
title
- The title of the rule. This is a brief, human readable,
description of the rule.java.lang.String getAbstract()
void setAbstract(java.lang.String abstractStr)
abstractStr
- The abstract text, a more detailed description of the
rule.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.org.opengis.filter.Filter getFilter()
getFilter
in interface org.opengis.style.Rule
void setFilter(org.opengis.filter.Filter filter)
This filter is only consulted if isElseFilter is false.
filter
- boolean hasElseFilter()
void setElseFilter(boolean isElse)
isElse
- if this rule should accept any features not already renderedvoid setIsElseFilter(boolean isElse)
isElse
- org.opengis.style.GraphicLegend getLegend()
getLegend
in interface org.opengis.style.Rule
void setLegend(org.opengis.style.GraphicLegend legend)
legend
- Graphic[] getLegendGraphic()
void setLegendGraphic(Graphic[] graphics)
graphics
- Graphic objects; the first one will be used to configure getGraphicLengedSymbolizer[] getSymbolizers()
Please
- use symbolizers().toArray( new Symbolizer[0] )
java.util.List<Symbolizer> symbolizers()
Please note that this list may be modified direct.
symbolizers
in interface org.opengis.style.Rule
void setSymbolizers(Symbolizer[] symbolizers)
symbolizers
- An array of symbolizers to be applied, in sequence,
to all of the features addressed by the FeatureTypeStyler which
contains this rule.org.opengis.metadata.citation.OnLineResource getOnlineResource()
getOnlineResource
in interface org.opengis.style.Rule
void setOnlineResource(org.opengis.metadata.citation.OnLineResource online)
resource
- Indicates where this style is definedvoid accept(StyleVisitor visitor)
visitor
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |