org.geotools.styling
Class RuleImpl

Object
  extended by RuleImpl
All Implemented Interfaces:
Cloneable, Rule

public class RuleImpl
extends Object
implements Rule, Cloneable

Provides the default implementation of Rule.

Author:
James Macgill
Module:

Constructor Summary
protected RuleImpl()
          Creates a new instance of DefaultRule
protected RuleImpl(Symbolizer[] symbolizers)
          Creates a new instance of DefaultRule
 
Method Summary
 void accept(StyleVisitor visitor)
           
 void addLegendGraphic(Graphic graphic)
           
 void addSymbolizer(Symbolizer symb)
           
 Object clone()
          Creates a deep copy clone of the rule.
 boolean equals(Object oth)
          Compares this Rule with another for equality.
 String getAbstract()
          Getter for property abstractStr.
 DescriptionImpl getDescription()
          Description for this style.
 Filter getFilter()
          This is the filter used to select content for this rule to display
 Graphic[] getLegendGraphic()
          A set of equivalent Graphics in different formats which can be used as a legend against features stylized by the symbolizers in this rule.
 double getMaxScaleDenominator()
          Getter for property maxScaleDenominator.
 double getMinScaleDenominator()
          Getter for property minScaleDenominator.
 String getName()
          Getter for property name.
 Symbolizer[] getSymbolizers()
          The symbolizers contain the actual styling information for different geometry types.
 String getTitle()
          Getter for property title.
 boolean hasElseFilter()
           
 int hashCode()
          Generates a hashcode for the Rule.
 void setAbstract(String abstractStr)
          Setter for property abstractStr.
 void setFilter(Filter filter)
           
 void setHasElseFilter()
           
 void setIsElseFilter(boolean flag)
           
 void setLegendGraphic(Graphic[] graphics)
          A set of equivalent Graphics in different formats which can be used as a legend against features stylized by the symbolizers in this rule.
 void setMaxScaleDenominator(double maxScaleDenominator)
          Setter for property maxScaleDenominator.
 void setMinScaleDenominator(double minScaleDenominator)
          Setter for property minScaleDenominator.
 void setName(String name)
          Setter for property name.
 void setSymbolizers(Symbolizer[] syms)
          The symbolizers contain the actual styling information for different geometry types.
 void setTitle(String title)
          Setter for property title.
 String toString()
           
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RuleImpl

protected RuleImpl()
Creates a new instance of DefaultRule


RuleImpl

protected RuleImpl(Symbolizer[] symbolizers)
Creates a new instance of DefaultRule

Parameters:
symbolizers - DOCUMENT ME!
Method Detail

getLegendGraphic

public Graphic[] getLegendGraphic()
Description copied from interface: Rule
A set of equivalent Graphics in different formats which can be used as a legend against features stylized by the symbolizers in this rule.

Specified by:
getLegendGraphic in interface Rule
Returns:
An array of Graphic objects, any of which can be used as the legend.

addLegendGraphic

public void addLegendGraphic(Graphic graphic)

setLegendGraphic

public void setLegendGraphic(Graphic[] graphics)
A set of equivalent Graphics in different formats which can be used as a legend against features stylized by the symbolizers in this rule.

Specified by:
setLegendGraphic in interface Rule
Parameters:
graphics - An array of Graphic objects, any of which can be used as the legend.

addSymbolizer

public void addSymbolizer(Symbolizer symb)

setSymbolizers

public void setSymbolizers(Symbolizer[] syms)
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:
setSymbolizers in interface Rule
Parameters:
syms - An array of symbolizers to be applied, in sequence, to all of the features addressed by the FeatureTypeStyler which contains this rule.

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 interface Rule
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 style.

Specified by:
getDescription in interface Rule
Returns:
Human readable description for use in user interfaces

getAbstract

public String getAbstract()
Getter for property abstractStr.

Specified by:
getAbstract in interface Rule
Returns:
Value of property abstractStr.

setAbstract

public void setAbstract(String abstractStr)
Setter for property abstractStr.

Specified by:
setAbstract in interface Rule
Parameters:
abstractStr - New value of property abstractStr.

getName

public String getName()
Getter for property name.

Specified by:
getName in interface Rule
Returns:
Value of property name.

setName

public void setName(String name)
Setter for property name.

Specified by:
setName in interface Rule
Parameters:
name - New value of property name.

getTitle

public String getTitle()
Getter for property title.

Specified by:
getTitle in interface Rule
Returns:
Value of property title.

setTitle

public void setTitle(String title)
Setter for property title.

Specified by:
setTitle in interface Rule
Parameters:
title - New value of property title.

getFilter

public Filter getFilter()
Description copied from interface: Rule
This is the filter used to select content for this rule to display

Specified by:
getFilter in interface Rule
Returns:
Filter use to select content for this rule to display, Filter.INCLUDES to include all content; of isElseFilter for null

setFilter

public void setFilter(Filter filter)
Specified by:
setFilter in interface Rule

hasElseFilter

public boolean hasElseFilter()
Specified by:
hasElseFilter in interface Rule

setIsElseFilter

public void setIsElseFilter(boolean flag)
Specified by:
setIsElseFilter in interface Rule

setHasElseFilter

public void setHasElseFilter()

getMaxScaleDenominator

public double getMaxScaleDenominator()
Getter for property maxScaleDenominator.

Specified by:
getMaxScaleDenominator in interface Rule
Returns:
Value of property maxScaleDenominator.

setMaxScaleDenominator

public void setMaxScaleDenominator(double maxScaleDenominator)
Setter for property maxScaleDenominator.

Specified by:
setMaxScaleDenominator in interface Rule
Parameters:
maxScaleDenominator - New value of property maxScaleDenominator.

getMinScaleDenominator

public double getMinScaleDenominator()
Getter for property minScaleDenominator.

Specified by:
getMinScaleDenominator in interface Rule
Returns:
Value of property minScaleDenominator.

setMinScaleDenominator

public void setMinScaleDenominator(double minScaleDenominator)
Setter for property minScaleDenominator.

Specified by:
setMinScaleDenominator in interface Rule
Parameters:
minScaleDenominator - New value of property minScaleDenominator.

accept

public void accept(StyleVisitor visitor)
Specified by:
accept in interface Rule

clone

public Object clone()
Creates a deep copy clone of the rule.

Overrides:
clone in class Object
See Also:
org.geotools.styling.Rule#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.

Overrides:
hashCode in class Object
Returns:
The hashcode.

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.

Overrides:
equals in class Object
Parameters:
oth - The other rule to compare with.
Returns:
True if this and oth are equal.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1996-2009 Geotools. All Rights Reserved.