deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.graphics.sld
Class Rule

java.lang.Object
  extended by org.deegree.graphics.sld.Rule
All Implemented Interfaces:
Marshallable

public class Rule
extends Object
implements Marshallable

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

Version:
$Revision: 18195 $ $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Katharina Lupp , last edited by: $Author: mschneider $

Constructor Summary
Rule()
          default constructor
Rule(Symbolizer[] symbolizers, String name, String title, String abstract_, LegendGraphic legendGraphic, Filter filter, boolean elseFilter, double minScaleDenominator, double maxScaleDenominator)
          constructor initializing the class with the Rule
 
Method Summary
 void addSymbolizer(Symbolizer symbolizer)
          adds a
 String exportAsXML()
          exports the content of the Rule as XML formated String
 String getAbstract()
          returns the human readable abstract of the rule
 Filter getFilter()
          The Filter element has a relatively straightforward meaning.
 LegendGraphic getLegendGraphic()
          The LegendGraphic element gives an optional explicit Graphic symbol to be displayed in a legend for this rule.
 double getMaxScaleDenominator()
          The MinScaleDenominator and MaxScaleDenominator elements of a Rule define the range of map-rendering scales for which the rule should be applied.
 double getMinScaleDenominator()
          The MinScaleDenominator and MaxScaleDenominator elements of a Rule define the range of map-rendering scales for which the rule should be applied.
 String getName()
          returns the name of the rule. this for machine interpreting.
 Symbolizer[] getSymbolizers()
          Embedded inside of Rules, which group conditions for styling features, are Symbolizers.
 String getTitle()
          returns the human readable title of the rule
 boolean hasElseFilter()
          The ElseFilter allows rules to be specified that are activated for features are not selected by any other rule in a feature-type style.
 void removeSymbolizer(Symbolizer symbolizer)
          Removes a from a set of Symbolizers.
 void setAbstract(String abstract_)
          sets the human readable abstract of the rule
 void setElseFilter(boolean elseFilter)
          sets the
 void setFilter(Filter filter)
          sets the
 void setLegendGraphic(LegendGraphic legendGraphic)
          sets the LegendGraphic element
 void setMaxScaleDenominator(double maxScaleDenominator)
          sets the
 void setMinScaleDenominator(double minScaleDenominator)
          sets the
 void setName(String name)
          sets the name of the rule. this for machine interpreting.
 void setSymbolizers(Symbolizer[] symbolizers)
          sets the
 void setTitle(String title)
          sets the human readable title of the rule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rule

Rule()
default constructor


Rule

Rule(Symbolizer[] symbolizers,
     String name,
     String title,
     String abstract_,
     LegendGraphic legendGraphic,
     Filter filter,
     boolean elseFilter,
     double minScaleDenominator,
     double maxScaleDenominator)
constructor initializing the class with the Rule

Parameters:
symbolizers -
name -
title -
abstract_ -
legendGraphic -
filter -
elseFilter -
minScaleDenominator -
maxScaleDenominator -
Method Detail

getName

public String getName()
returns the name of the rule. this for machine interpreting.

Returns:
the name of the rule

setName

public void setName(String name)
sets the name of the rule. this for machine interpreting.

Parameters:
name - the name of the rule

getTitle

public String getTitle()
returns the human readable title of the rule

Returns:
the title of the rule

setTitle

public void setTitle(String title)
sets the human readable title of the rule

Parameters:
title - the title of the rule

getAbstract

public String getAbstract()
returns the human readable abstract of the rule

Returns:
the abstract of the rule

setAbstract

public void setAbstract(String abstract_)
sets the human readable abstract of the rule

Parameters:
abstract_ - the abstract of the rule

getLegendGraphic

public LegendGraphic getLegendGraphic()
The LegendGraphic element gives an optional explicit Graphic symbol to be displayed in a legend for this rule.

Returns:
the legendGraphic of the rule

setLegendGraphic

public void setLegendGraphic(LegendGraphic legendGraphic)
sets the LegendGraphic element

Parameters:
legendGraphic - the legendGraphic of the rule

getFilter

public Filter getFilter()
The Filter element has a relatively straightforward meaning. The syntax of the Filter element is defined in the WFS specification and allows both attribute (property) and spatial filtering.

Returns:
the filter element

setFilter

public void setFilter(Filter filter)
sets the

Parameters:
filter - the filter element

hasElseFilter

public boolean hasElseFilter()
The ElseFilter allows rules to be specified that are activated for features are not selected by any other rule in a feature-type style.

Returns:
true if the rule has an elseFilter

setElseFilter

public void setElseFilter(boolean elseFilter)
sets the

Parameters:
elseFilter - an elseFilter

getMinScaleDenominator

public double getMinScaleDenominator()
The MinScaleDenominator and MaxScaleDenominator elements of a Rule define the range of map-rendering scales for which the rule should be applied. The MinScaleDenominator and MaxScaleDenominator elements, as their names suggest, are simply the minimum and maximum ranges of scale (denominators) of maps for which a rule should apply.

Returns:
the MinScaleDenominator for the rule

setMinScaleDenominator

public void setMinScaleDenominator(double minScaleDenominator)
sets the

Parameters:
minScaleDenominator - the MinScaleDenominator for the rule

getMaxScaleDenominator

public double getMaxScaleDenominator()
The MinScaleDenominator and MaxScaleDenominator elements of a Rule define the range of map-rendering scales for which the rule should be applied. The MinScaleDenominator and MaxScaleDenominator elements, as their names suggest, are simply the minimum and maximum ranges of scale (denominators) of maps for which a rule should apply.

Returns:
the MaxScaleDenominator for the rule

setMaxScaleDenominator

public void setMaxScaleDenominator(double maxScaleDenominator)
sets the

Parameters:
maxScaleDenominator - the MaxScaleDenominator for the rule

getSymbolizers

public Symbolizer[] getSymbolizers()
Embedded inside of Rules, which group conditions for styling features, are Symbolizers. A symbolizer describes how a feature is to appear on a map. The symbolizer describes not just the shape that should appear but also such graphical properties as color and opacity. A symbol is obtained by specifying one of a small number of different types of symbolizer and then supplying parameters to override its default behaviour. Currently, five types of symbolizers are defined.

The Symbolizers will be returned in the sequece of their occurence with in the rule definition. Its the users function to determine what type of Symbolizer(s) are returned. This can be done for example by using the instanceof operator of Java.

Returns:
the Symbolizer for the rule

setSymbolizers

public void setSymbolizers(Symbolizer[] symbolizers)
sets the

Parameters:
symbolizers - symbolizers for the rule

addSymbolizer

public void addSymbolizer(Symbolizer symbolizer)
adds a

Parameters:
symbolizer - symbolizer to add

removeSymbolizer

public void removeSymbolizer(Symbolizer symbolizer)
Removes a from a set of Symbolizers.

Parameters:
symbolizer - symbolizer to remove

exportAsXML

public String exportAsXML()
exports the content of the Rule as XML formated String

Specified by:
exportAsXML in interface Marshallable
Returns:
xml representation of the Rule

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org