org.deegree_impl.graphics.sld
Class Halo_Impl

java.lang.Object
  extended byorg.deegree_impl.graphics.sld.Halo_Impl
All Implemented Interfaces:
Halo, Marshallable

public class Halo_Impl
extends java.lang.Object
implements Halo, Marshallable

Incarnation of a sld:Halo-element. A Halo is a type of Fill that is applied to the backgrounds of font glyphs. The use of halos greatly improves the readability of text labels.

Version:
$Revision: 1.9 $ $Date: 2004/03/05 16:46:49 $
Author:
Andreas Poth, Markus Schneider

Field Summary
private  Fill fill
           
private  ParameterValueType radius
           
private  Stroke stroke
           
 
Constructor Summary
(package private) Halo_Impl(ParameterValueType radius, Fill fill, Stroke stroke)
          Create a new Halo-instance.
 
Method Summary
 java.lang.String exportAsXML()
          exports the content of the Halo as XML formated String
 Fill getFill()
          A Fill allows area geometries to be filled.
 ParameterValueType getRadius()
          The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number.
 double getRadius(Feature feature)
          The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number.
 Stroke getStroke()
          Returns the underlying Stroke-instance.
 void setFill(Fill fill)
          Sets the underlying Fill-instance.
 void setRadius(double radius)
           
 void setRadius(ParameterValueType radius)
          Sets the value for the radius of the halo.
 void setStroke(Stroke stroke)
          Sets the underlying Stroke-instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fill

private Fill fill

radius

private ParameterValueType radius

stroke

private Stroke stroke
Constructor Detail

Halo_Impl

Halo_Impl(ParameterValueType radius,
          Fill fill,
          Stroke stroke)
Create a new Halo-instance.

Parameters:
radius - radius to be used for the halo, use null for a rectangle styled halo
fill - defines the fill style, use null for default style
stroke - defines the stroke style, use null for default style
Method Detail

getFill

public Fill getFill()
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.

Specified by:
getFill in interface Halo
Returns:
the underlying Fill-object or null

setFill

public void setFill(Fill fill)
Sets the underlying Fill-instance.

Specified by:
setFill in interface Halo
Parameters:
fill - defines the fill color and pattern

getRadius

public ParameterValueType getRadius()
The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number. The radius is taken from the outside edge of a font glyph to extend the area of coverage of the glyph (and the inside edge of holes in the glyphs). The halo of a text label is considered to be a single shape. The default radius is one pixel. Negative values are not allowed.

Specified by:
getRadius in interface Halo
Returns:
the radius definition as ParameterValueType, or null if it has not been specified

setRadius

public void setRadius(ParameterValueType radius)
Sets the value for the radius of the halo.

Specified by:
setRadius in interface Halo
Parameters:
radius - radius to be used for the halo, use null for a rectangle styled halo

getRadius

public double getRadius(Feature feature)
                 throws FilterEvaluationException
The Radius element gives the absolute size of a halo radius in pixels encoded as a floating-point number. The radius is taken from the outside edge of a font glyph to extend the area of coverage of the glyph (and the inside edge of holes in the glyphs). The halo of a text label is considered to be a single shape. The default radius is one pixel. Negative values are not allowed.

Specified by:
getRadius in interface Halo
Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
the radius value, or -1 if it has not been specified
Throws:
FilterEvaluationException - if the evaluation fails

setRadius

public void setRadius(double radius)
Specified by:
setRadius in interface Halo
Parameters:
radius - radius to be set for the halo
See Also:


getStroke

public Stroke getStroke()
Returns the underlying Stroke-instance.

Specified by:
getStroke in interface Halo
Returns:
the underlying Stroke-object or null

setStroke

public void setStroke(Stroke stroke)
Sets the underlying Stroke-instance.

Specified by:
setStroke in interface Halo
Parameters:
stroke - defines the stroke color and pattern

exportAsXML

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

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