Class TLcdGXYDependantLabelsRemovalWrapper

All Implemented Interfaces:
ILcdCloneable, ILcdGXYLabelingAlgorithm, Cloneable

public class TLcdGXYDependantLabelsRemovalWrapper extends ALcdGXYDiscretePlacementsLabelingAlgorithmWrapper
This wrapper used a dependency relation between labels to add extra behavior to the labeling. When label 1 depends on a label 2, and label 2 is removed from the labeling results, label 1 is also removed.

It is also possible to define circular dependencies, e.g. label 1 and label 2 depend on each other. When label 1 is removed, label 2 is also removed, and vice versa.

This wrapper only supports dependencies between labels and sublabels from the same object. Not respecting this will cause this wrapper to perform worse, labels that should disappear will not always disappear.

This wrapper works best when the labels returned by the LabelIterator of the delegate algorithm are ordered as follows :

  • Clusters of labels should are kept together. If one label of a label cluster is returned, others should follow right after.
  • Labels that depend on another label should be returned after this label.
Not having this order doesn't stop the wrapper from working correctly. However the label placement will not be optimal : more labels may be dropped than necessary.

The implementation of this labeling algorithm is thread-safe if the wrapped labeling algorithm is thread safe.

Since:
10.1