org.geotools.styling
Class RuleImpl

java.lang.Object
  extended byorg.geotools.event.AbstractGTComponent
      extended byorg.geotools.styling.RuleImpl
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.util.Cloneable, GTComponent, Rule

public class RuleImpl
extends AbstractGTComponent
implements Rule, org.opengis.util.Cloneable

Provides the default implementation of Rule.

Version:
$Id: RuleImpl.java 18084 2006-02-17 21:47:49Z chorner $
Author:
James Macgill

Field Summary
 
Fields inherited from class org.geotools.event.AbstractGTComponent
notification
 
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)
           
 java.lang.Object clone()
          Creates a deep copy clone of the rule.
 boolean equals(java.lang.Object oth)
          Compares this Rule with another for equality.
 java.lang.String getAbstract()
          Getter for property abstractStr.
 Filter getFilter()
           
 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.
 java.lang.String getName()
          Getter for property name.
 Symbolizer[] getSymbolizers()
          The symbolizers contain the actual styling information for different geometry types.
 java.lang.String getTitle()
          Getter for property title.
 boolean hasElseFilter()
           
 int hashCode()
          Generates a hashcode for the Rule.
 void setAbstract(java.lang.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(java.lang.String name)
          Setter for property name.
 void setSymbolizers(Symbolizer[] syms)
          The symbolizers contain the actual styling information for different geometry types.
 void setTitle(java.lang.String title)
          Setter for property title.
 
Methods inherited from class org.geotools.event.AbstractGTComponent
changed, fireChanged, fireChildChanged, getNote, getParent, removed, setNote
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.event.GTComponent
changed, getNote, getParent, removed, setNote
 

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.

getAbstract

public java.lang.String getAbstract()
Getter for property abstractStr.

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

setAbstract

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

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

getName

public java.lang.String getName()
Getter for property name.

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

setName

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

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

getTitle

public java.lang.String getTitle()
Getter for property title.

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

setTitle

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

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

getFilter

public Filter getFilter()
Specified by:
getFilter in interface Rule

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 java.lang.Object clone()
Creates a deep copy clone of the rule.

Specified by:
clone in interface org.opengis.util.Cloneable
Overrides:
clone in class AbstractGTComponent
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.

Returns:
The hashcode.

equals

public boolean equals(java.lang.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.

Parameters:
oth - The other rule to compare with.
Returns:
True if this and oth are equal.


Copyright © GeoTools. All Rights Reserved.