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.
|
String |
getAbstract()
Deprecated.
use getDescription().getAbstract().getString()
|
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.
|
Graphic[] |
getLegendGraphic()
Deprecated.
Please use getLegend
|
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.
|
Symbolizer[] |
getSymbolizers()
The symbolizers contain the actual styling information for different geometry types.
|
String |
getTitle()
Deprecated.
use getDescription().getTitle().getString()
|
boolean |
hasElseFilter()
Deprecated.
Please use isElseFilter
|
void |
setAbstract(String abstractStr)
Deprecated.
use getDescription().setAbstract()
|
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 |
setIsElseFilter(boolean isElse) |
void |
setLegend(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(String name)
Sets the name of the rule.
|
void |
setOnlineResource(OnLineResource online) |
void |
setSymbolizers(Symbolizer[] symbolizers)
Deprecated.
please use symbolizers().addAll()
|
void |
setTitle(String title)
Sets the title.
|
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.String getTitle()
void setTitle(String title)
title
- The title of the rule. This is a brief, human readable, description of the rule.String getAbstract()
void setAbstract(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.Filter getFilter()
void setFilter(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
- GraphicLegend 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
- 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] )List<Symbolizer> symbolizers()
Please note that this list may be modified direct.
symbolizers
in interface 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.OnLineResource getOnlineResource()
Rule
getOnlineResource
in interface Rule
void setOnlineResource(OnLineResource online)
resource
- Indicates where this style is definedvoid accept(StyleVisitor visitor)
visitor
- Copyright © 1996–2019 Geotools. All rights reserved.