Class TLcdGXYCurvedPathLabelPainter

java.lang.Object
com.luciad.view.gxy.ALcdGXYLabelPainter
com.luciad.view.gxy.TLcdGXYCurvedPathLabelPainter
All Implemented Interfaces:
ILcdPropertyChangeSource, ILcdGXYLabelPainter, ILcdGXYLabelPainter2, ILcdGXYLabelPainterProvider, ILcdGXYMultiLabelPainter, Serializable, Cloneable

public class TLcdGXYCurvedPathLabelPainter extends ALcdGXYLabelPainter implements ILcdGXYLabelPainterProvider
This label painter paints curved text strings along a path. To do this it uses a path provider to calculate the path on which to place the text.

This label painter can paint curved labels if a TLcdGXYCurvedPathLabelLocation is used. Usually this is done by changing the layer's label locations. For a TLcdGXYLayer, this could be done as follows:


 layer.setLabelLocations( new TLcdLabelLocations( layer, new TLcdGXYCurvedPathLabelLocation() ) );
 

The curved label location class describes an exact location on an ILcdAWTPath. It defines the following 3 fields:

  • TLcdGXYCurvedPathLabelLocation.getLocationIndex()</code> : should be <code>-1.
  • TLcdGXYCurvedPathLabelLocation.getSubPathIndex()
  • TLcdGXYCurvedPathLabelLocation.getAWTPathParameter()
The rest of the fields are ignored since the position and rotation of the text are calculated using these 3 fields.

TLcdGXYCurvedPathLabelingAlgorithm can be used to place curved path labels. This labeling algorithm also works using TLcdGXYCurvedPathLabelLocations, and fills in the 'sub path index' and 'awt path parameter' fields.

This label painter also supports fixed label placement (TLcdLabelLocation.getLocationIndex() >= 0)). In that case it drapes the label at the middle of the path (sub path index = 0 and awt path parameter = 0.5). This allows this label painter to be used in combination with TLcdGXYLabelPainterLocationLabelingAlgorithm.

It also supports regular free placement, in case an invalid awt path parameter is used. I.e. if the path parameter < 0 or > 1 and if TLcdLabelLocation.getLocationIndex() == -1. In that case, the label is placed as described by

  • TLcdLabelLocation.getRotation()
  • TLcdLabelLocation.getLocationX()
  • TLcdLabelLocation.getLocationY()
The label will not be curved in this case. This allows this label painter to be used in combination with all labeling algorithms that output a free placement label location.

Note: Wrapping or extending this label painter will not always work as expected. For example, when the labelBoundsSFCT method is customized using a wrapper or an extension of this label painter, the labeling algorithm will not be able to use this information. So it will work with other bounds than the one returned by the used label painter. This might cause overlapping labels.

Since:
11.0
See Also: