org.deegree_impl.graphics.sld
Class LinePlacement_Impl

java.lang.Object
  extended byorg.deegree_impl.graphics.sld.LinePlacement_Impl
All Implemented Interfaces:
LinePlacement, Marshallable

public class LinePlacement_Impl
extends java.lang.Object
implements LinePlacement, Marshallable

Incarnation of an sld:LinePlacement-element.

Contains some deegree-specific extensions:

Version:
$Revision: 1.5 $ $Date: 2004/03/05 16:46:49 $
Author:
Markus Schneider

Field Summary
private  ParameterValueType gap
           
private  ParameterValueType lineWidth
           
private  ParameterValueType perpendicularOffset
           
 
Fields inherited from interface org.deegree.graphics.sld.LinePlacement
TYPE_ABOVE, TYPE_ABSOLUTE, TYPE_AUTO, TYPE_BELOW, TYPE_CENTER
 
Constructor Summary
LinePlacement_Impl(ParameterValueType perpendicularOffset, ParameterValueType lineWidth, ParameterValueType gap)
           
 
Method Summary
 java.lang.String exportAsXML()
          exports the content of the Font as XML formated String
 int getGap(Feature feature)
          Defines the distance between two captions on the line string.
 double getLineWidth(Feature feature)
          Provides the thickness of the styled line (needed as information for the correct positioning of labels above and below the line string).
 double getPerpendicularOffset(Feature feature)
          The PerpendicularOffset element of a LinePlacement gives the perpendicular distance away from a line to draw a label.
 int getPlacementType(Feature feature)
          Returns the placement type (one of the constants defined in LinePlacement).
 void setGap(int gap)
          Defines the distance between two captions on the line string.
 void setLineWidth(double lineWidth)
          Provides the thickness of the styled line (needed as information for the correct positioning of labels above and below the line string).
 void setPerpendicularOffset(double perpendicularOffset)
           
 void setPlacementType(int placementType)
          Sets the placement type (one of the constants defined in LinePlacement).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

perpendicularOffset

private ParameterValueType perpendicularOffset

lineWidth

private ParameterValueType lineWidth

gap

private ParameterValueType gap
Constructor Detail

LinePlacement_Impl

public LinePlacement_Impl(ParameterValueType perpendicularOffset,
                          ParameterValueType lineWidth,
                          ParameterValueType gap)
Method Detail

getPerpendicularOffset

public double getPerpendicularOffset(Feature feature)
                              throws FilterEvaluationException
The PerpendicularOffset element of a LinePlacement gives the perpendicular distance away from a line to draw a label. The distance is in pixels and is positive to the left-hand side of the line string. Negative numbers mean right. The default offset is 0.

deegree-specific extension: if the element has one of the values: 'center', 'above', 'below', 'auto', the return value is invalid

Specified by:
getPerpendicularOffset in interface LinePlacement
Parameters:
feature - specifies the Feature to be used for evaluation of the underlying 'sld:ParameterValueType'
Returns:
the offset (only valid if type is TYPE_ABSOLUTE)
Throws:
FilterEvaluationException - if the evaluation fails

setPerpendicularOffset

public void setPerpendicularOffset(double perpendicularOffset)
Specified by:
setPerpendicularOffset in interface LinePlacement
Parameters:
perpendicularOffset -
See Also:


getPlacementType

public int getPlacementType(Feature feature)
                     throws FilterEvaluationException
Returns the placement type (one of the constants defined in LinePlacement).

Specified by:
getPlacementType in interface LinePlacement
Parameters:
feature -
Returns:
Throws:
FilterEvaluationException

setPlacementType

public void setPlacementType(int placementType)
Sets the placement type (one of the constants defined in LinePlacement).

Specified by:
setPlacementType in interface LinePlacement
Parameters:
placementType -

getLineWidth

public double getLineWidth(Feature feature)
                    throws FilterEvaluationException
Provides the thickness of the styled line (needed as information for the correct positioning of labels above and below the line string).

Specified by:
getLineWidth in interface LinePlacement
Parameters:
feature -
Returns:
Throws:
FilterEvaluationException

setLineWidth

public void setLineWidth(double lineWidth)
Provides the thickness of the styled line (needed as information for the correct positioning of labels above and below the line string).

Specified by:
setLineWidth in interface LinePlacement
Parameters:
lineWidth - the lineWidth to be set

getGap

public int getGap(Feature feature)
           throws FilterEvaluationException
Defines the distance between two captions on the line string. One unit is the width of the label caption.

Specified by:
getGap in interface LinePlacement
Parameters:
feature -
Returns:
Throws:
FilterEvaluationException

setGap

public void setGap(int gap)
Defines the distance between two captions on the line string. One unit is the width of the label caption.

Specified by:
setGap in interface LinePlacement
Parameters:
gap - the gap to be set

exportAsXML

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

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