deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.graphics.displayelements
Class LabelDisplayElement

java.lang.Object
  extended by org.deegree.graphics.displayelements.AbstractDisplayElement
      extended by org.deegree.graphics.displayelements.GeometryDisplayElement
          extended by org.deegree.graphics.displayelements.LabelDisplayElement
All Implemented Interfaces:
java.io.Serializable, DisplayElement

public class LabelDisplayElement
extends GeometryDisplayElement

DisplayElement that encapsulates a GM_Object (geometry), a ParameterValueType (caption) and a TextSymbolizer (style).

The graphical (say: screen) representations of this DisplayElement are Label-instances. These are generated either when the paint-method is called or assigned externally using the setLabels- or addLabels-methods.

Version:
$Revision: 24811 $ $Date: 2010-06-10 09:44:06 +0200 (Do, 10 Jun 2010) $
Author:
Andreas Poth, Markus Schneider
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.graphics.displayelements.GeometryDisplayElement
geometry, highlightSymbolizer, placement, selectedSymbolizer, symbolizer
 
Fields inherited from class org.deegree.graphics.displayelements.AbstractDisplayElement
feature
 
Constructor Summary
LabelDisplayElement(Feature feature, Geometry geometry, TextSymbolizer symbolizer)
          Creates a new LabelDisplayElement object.
 
Method Summary
 void addLabel(Label label)
          Adds a Label representation that is to be considered when the LabelDisplayElement is painted to the view.
 void addLabels(Label[] labels)
          Adds Label representations that are to be considered when the LabelDisplayElement is painted to the view.
 void clearLabels()
          Removes all Label representations for this LabelDisplayElement.
 boolean doesScaleConstraintApply(double scale)
          Returns if the DisplayElement should be painted at the current scale or not.
 ParameterValueType getLabel()
          Returns the caption of the label as ParameterValueType.
 void paint(java.awt.Graphics g, GeoTransform projection, double scale)
          Renders the DisplayElement to the submitted graphic context.
 void setLabel(ParameterValueType label)
          Sets the caption of the label.
 void setLabels(Label[] labels)
          Sets the Label representations that are to be considered when the LabelDisplayElement is painted to the view.
 
Methods inherited from class org.deegree.graphics.displayelements.GeometryDisplayElement
getGeometry, getHighlightSymbolizer, getSelectedSymbolizer, getSymbolizer, growEnvelope, setGeometry, setHighlightSymbolizer, setPlacement, setSelectedSymbolizer, setSymbolizer
 
Methods inherited from class org.deegree.graphics.displayelements.AbstractDisplayElement
getAssociateFeatureId, getFeature, isHighlighted, isSelected, setFeature, setHighlighted, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LabelDisplayElement

public LabelDisplayElement(Feature feature,
                           Geometry geometry,
                           TextSymbolizer symbolizer)
Creates a new LabelDisplayElement object.

Parameters:
feature - associated Feature
geometry - associated GM_Object
symbolizer - associated TextSymbolizer
Method Detail

setLabel

public void setLabel(ParameterValueType label)
Sets the caption of the label.

Parameters:
label -

getLabel

public ParameterValueType getLabel()
Returns the caption of the label as ParameterValueType.

Returns:
label

paint

public void paint(java.awt.Graphics g,
                  GeoTransform projection,
                  double scale)
Renders the DisplayElement to the submitted graphic context. If the Label-represenations have been assigned externally, these labels are used, else Label-instances are created automatically using the LabelFactory.

Parameters:
g - Graphics context to be used
projection - GeoTransform to be used

doesScaleConstraintApply

public boolean doesScaleConstraintApply(double scale)
Description copied from class: GeometryDisplayElement
Returns if the DisplayElement should be painted at the current scale or not.

Specified by:
doesScaleConstraintApply in interface DisplayElement
Overrides:
doesScaleConstraintApply in class GeometryDisplayElement
Parameters:
scale - scale to check
Returns:
true, if the DisplayElement has to be painted, false otherwise

clearLabels

public void clearLabels()
Removes all Label representations for this LabelDisplayElement.


addLabel

public void addLabel(Label label)
Adds a Label representation that is to be considered when the LabelDisplayElement is painted to the view.

Parameters:
label -

addLabels

public void addLabels(Label[] labels)
Adds Label representations that are to be considered when the LabelDisplayElement is painted to the view.

Parameters:
labels -

setLabels

public void setLabels(Label[] labels)
Sets the Label representations that are to be considered when the LabelDisplayElement is painted to the view.

Parameters:
labels -

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org