Interface ILcdGXYLabelingAlgorithm
- All Superinterfaces:
Cloneable
,ILcdCloneable
- All Known Implementing Classes:
ALcdGXYDiscretePlacementsLabelingAlgorithm
,ALcdGXYDiscretePlacementsLabelingAlgorithmWrapper
,TLcdAIXM51LabelingAlgorithm
,TLcdGXYCompositeDiscretePlacementsLabelingAlgorithm
,TLcdGXYCompositeLabelingAlgorithm
,TLcdGXYContinuousLabelingAlgorithm
,TLcdGXYCurvedPathLabelingAlgorithm
,TLcdGXYDependantLabelsRemovalWrapper
,TLcdGXYInPathLabelingAlgorithm
,TLcdGXYLabelPainterLocationLabelingAlgorithm
,TLcdGXYLocationListLabelingAlgorithm
,TLcdGXYOnPathLabelingAlgorithm
,TLcdGXYSinglePlacementLabelingAlgorithm
,TLcdSLDLabelingAlgorithm
Collect Labeling Info
The first method, collectLabelInfo
, gets a list of
TLcdLabelIdentifier
s as input. These represent the labels that need
to be placed. It returns a TLcdCollectedLabelInfoList
object,
which contains information for each of these labels. So this method basically converts the list
of TLcdLabelIdentifier
s to a TLcdCollectedLabelInfoList
, using it to
store all information needed to perform the label placing itself. This is shown in the following
illustration:
In order to make asynchronous decluttering work for an specific labeling algorithm, all
information calculated using the layer and its contents (ILcdGXYPainter
,
ILcdGXYLabelPainter
, ...) should be retrieved using collectLabelInfo
.
Compute Label Placements
The second method, computeLabelPlacements
, gets the result of
collectLabelInfo
method as input and returns a list of
TLcdLabelPlacement
s, each pointing to its label. This is illustrated
in the following figure.
The given TLcdCollectedLabelInfoList
should always be an object created or returned
by collectLabelInfo
.
The returned List
of TLcdLabelPlacement
s contains label placements
that are either visible or invisible. When a placement is present in the list, it means that
the location should be stored. When a placement in the list is marked as visible, it means that
its location should be marked as to-be-painted.
- Since:
- 10.1
-
Method Summary
Modifier and TypeMethodDescriptioncollectLabelInfo
(List<TLcdLabelIdentifier> aLabelsToCollect, Graphics aGraphics, ILcdGXYView aGXYView) This method returns aTLcdCollectedLabelInfoList
object based on the given list ofTLcdLabelIdentifier
s.computeLabelPlacements
(TLcdCollectedLabelInfoList aLabelInfoList, ILcdLabelConflictChecker aLabelConflictChecker, ILcdGXYView aView) This method computes a list ofTLcdLabelPlacement
s using the givenTLcdCollectedLabelInfoList
.Methods inherited from interface com.luciad.util.ILcdCloneable
clone
-
Method Details
-
collectLabelInfo
TLcdCollectedLabelInfoList collectLabelInfo(List<TLcdLabelIdentifier> aLabelsToCollect, Graphics aGraphics, ILcdGXYView aGXYView) This method returns aTLcdCollectedLabelInfoList
object based on the given list ofTLcdLabelIdentifier
s. The returnedTLcdCollectedLabelInfoList
should contain aTLcdCollectedLabelInfo
object for each label that should be placed.Each
TLcdCollectedLabelInfo
should also contain all information needed bycomputeLabelPlacements
to place the labels. In order to enable correct asynchronous label placing, all calls to the layer and the (label) painters should be done in this method. The results should then be stored in the info objects.It is possible that the returned
TLcdCollectedLabelInfoList
doesn't contain aTLcdCollectedLabelInfo
object for every givenTLcdLabelIdentifier
. In that case the missing labels are not placed.- Parameters:
aLabelsToCollect
- the labels for which aTLcdCollectedLabelInfoList
should be created.aGraphics
- the graphics.aGXYView
- the view.- Returns:
- a
TLcdCollectedLabelInfoList
which contains all the information needed to place the labels.
-
computeLabelPlacements
List<TLcdLabelPlacement> computeLabelPlacements(TLcdCollectedLabelInfoList aLabelInfoList, ILcdLabelConflictChecker aLabelConflictChecker, ILcdGXYView aView) This method computes a list ofTLcdLabelPlacement
s using the givenTLcdCollectedLabelInfoList
. The returned label placements should contain a validTLcdLabelLocation
and label bounds. They should also point to their correspondingTLcdCollectedLabelInfo
, which in turn should point to its correspondingTLcdCollectedLabeledObjectInfo
.The given
TLcdCollectedLabelInfoList
should always be an object created or returned bycollectLabelInfo
.The returned
List
ofTLcdLabelPlacement
s contains label placements that are either visible or invisible. When a placement is present in the list, it means that the location should be stored. When a placement in the list is marked as visible, it means that its location should be marked as to-be-painted.The labels should by preference be placed in the order in which the labels are returned by
TLcdCollectedLabelInfoList.getLabels()
.- Parameters:
aLabelInfoList
- the info object that contains all information needed to place the labels.aLabelConflictChecker
- the bounds conflict checker that can be used to detect conflicts between labels.aView
- the view.- Returns:
- a list of labels to be rendered.
-