org.deegree_impl.graphics.sld
Class Fill_Impl

java.lang.Object
  extended byorg.deegree_impl.graphics.sld.Drawing_Impl
      extended byorg.deegree_impl.graphics.sld.Fill_Impl
All Implemented Interfaces:
Drawing, Fill, Marshallable

public class Fill_Impl
extends Drawing_Impl
implements Fill, Marshallable

A Fill allows area geometries to be filled. There are two types of fills: solid-color and repeated GraphicFill. In general, if a Fill element is omitted in its containing element, no fill will be rendered. The default is a solid 50%-gray (color "#808080") opaque fill.

Version:
$Revision: 1.8 $ $Date: 2004/01/16 07:57:02 $
Author:
Katharina Lupp, Markus Schneider

Field Summary
 
Fields inherited from class org.deegree_impl.graphics.sld.Drawing_Impl
cssParams, graphicFill
 
Fields inherited from interface org.deegree.graphics.sld.Fill
FILL_DEFAULT, OPACITY_DEFAULT
 
Constructor Summary
protected Fill_Impl()
          Constructs a new Fill_Impl.
protected Fill_Impl(java.util.HashMap cssParams, GraphicFill graphicFill)
          Constructs a new Fill_Impl.
 
Method Summary
 java.lang.String exportAsXML()
          exports the content of the CssParameter as XML formated String
 java.awt.Color getFill(Feature feature)
          Returns the (evaluated) value of the fill's CssParameter 'fill'.
 double getOpacity(Feature feature)
          Returns the (evaluated) value of the fill's CssParameter 'fill-opacity'.
 void setFill(java.awt.Color color)
          sets the value of the fill's CssParameter 'fill' as a simple color
 void setOpacity(double opacity)
          sets the value of the opacity's CssParameter 'opacity' as a value.
 
Methods inherited from class org.deegree_impl.graphics.sld.Drawing_Impl
addCssParameter, getCssParameters, getGraphicFill, removeCssParameter, setCssParameters, setGraphicFill
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.graphics.sld.Drawing
addCssParameter, getCssParameters, getGraphicFill, removeCssParameter, setCssParameters, setGraphicFill
 

Constructor Detail

Fill_Impl

protected Fill_Impl()
Constructs a new Fill_Impl.


Fill_Impl

protected Fill_Impl(java.util.HashMap cssParams,
                    GraphicFill graphicFill)
Constructs a new Fill_Impl.

Method Detail

getFill

public java.awt.Color getFill(Feature feature)
                       throws FilterEvaluationException
Returns the (evaluated) value of the fill's CssParameter 'fill'.

Specified by:
getFill in interface Fill
Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
the (evaluated) value of the parameter
Throws:
FilterEvaluationException - if the evaluation fails or the value is invalid

setFill

public void setFill(java.awt.Color color)
sets the value of the fill's CssParameter 'fill' as a simple color

Specified by:
setFill in interface Fill
Parameters:
color - color to be set

getOpacity

public double getOpacity(Feature feature)
                  throws FilterEvaluationException
Returns the (evaluated) value of the fill's CssParameter 'fill-opacity'.

Specified by:
getOpacity in interface Fill
Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
the (evaluated) value of the parameter
Throws:
FilterEvaluationException - if the evaluation fails or the value is invalid

setOpacity

public void setOpacity(double opacity)
sets the value of the opacity's CssParameter 'opacity' as a value. Valid values ranges from 0 .. 1. If a value < 0 is passed it will be set to 0. If a value > 1 is passed it will be set to 1.

Specified by:
setOpacity in interface Fill
Parameters:
opacity - opacity to be set

exportAsXML

public java.lang.String exportAsXML()
exports the content of the CssParameter as XML formated String

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