Class TLcdGXYLocationListLabelingAlgorithm

java.lang.Object
com.luciad.view.gxy.labeling.algorithm.discrete.ALcdGXYDiscretePlacementsLabelingAlgorithm
com.luciad.view.gxy.labeling.algorithm.discrete.TLcdGXYLocationListLabelingAlgorithm
All Implemented Interfaces:
ILcdCloneable, ILcdGXYLabelingAlgorithm, Cloneable

public class TLcdGXYLocationListLabelingAlgorithm extends ALcdGXYDiscretePlacementsLabelingAlgorithm
This labeling is a greedy labeling algorithm that uses free placement (see ILcdGXYLabelPainter2) to determine label locations. It tries to place labels in the order provided by the input TLcdCollectedLabelInfoList object (see TLcdCollectedLabelInfoList.getLabels()). It tries to place the labels one by one, and when a label cannot be placed without overlap, it is omitted.

This algorithm uses free placements to determine the location and bounds of the labels. So this algorithm gives full control over where labels are actually placed. This labeling algorithm can be extended to provide custom locations for a label. To do this, 2 methods need to be overridden :

After retrieving bounds for a label position, the returned bounds are converted to a TLcdLabelLocation. One of these label location is eventually chosen for the label.

The default implementations of these methods use the following methods : getLocationList() and getShiftLabelLocation(). So the default behavior of this class can be customized by using setLocationList(Location[]) and setShiftLabelLocation(int). When overriding getMaxLocationCount() and getLocationBounds(), getLocationList() and getShiftLabelLocation() will not be used anymore.

This algorithm also uses a forced painting threshold priority to force labels to be placed, even if they overlap with other labels, see setForcedPaintingThresholdPriority(int).

The used label painter must be an ILcdGXYLabelPainter2. If not, labels will be painted at an incorrect location.

The implementation of this labeling algorithm is thread-safe.

Since:
10.1