public class IlvOverlappingLabelMovementPolicy extends Object implements IlvLabelMovementPolicy
IlvAnnealingLabelLayout.setLabelMovementPolicy(IlvLabelMovementPolicy)
Constructor and Description |
---|
IlvOverlappingLabelMovementPolicy()
Creates a new label movement policy that prohibits the movement of
labels that are overlap-free.
|
IlvOverlappingLabelMovementPolicy(double maxOverlapValue,
boolean checkOverlapWithLabels,
boolean considerOffsets)
Creates a new label movement policy that prohibits the movement of
labels that are nearly overlap-free.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowMove(IlvLabelingModel labelingModel,
Object label)
Allows or prohibits the movement of a
label . |
public IlvOverlappingLabelMovementPolicy()
public IlvOverlappingLabelMovementPolicy(double maxOverlapValue, boolean checkOverlapWithLabels, boolean considerOffsets)
0
if you
want only overlapping labels to move.
The decision whether a label is allowed to move depends on the
overlaps with obstacles. If the parameter
checkOverlapWithLabels
is true
, it also
depends on the overlaps with other labels. If the parameter is
false
, overlaps between label pairs are ignored. In this
case, labels that only overlap other labels will be prohibited to
move.
The policy can consider or ignore the label and obstacle offset parameters of the layout algorithm. If the offsets are considered, the overlap value is calculated by using the label and obstacle offset parameters. This means that a label gets also a high overlap value and hence is allowed to move if it is too close to another obstacle or label while not yet really overlapping it. If the offsets are ignored, a label gets only a nonzero overlap value if it really overlaps another obstacle or label, therefore labels that are closer than the specified offsets to obstacles or other labels but don't overlap anything are prohibited to move.
Notice that this label movement policy works only for the annealing label layout.
maxOverlapValue
- The maximum overlap value so that a label is
prohibited to move.checkOverlapWithLabels
- If true
, the overlap value is
calculated including overlaps between label pairs. If
false
, the overlap value is calculated excluding
overlaps between label pairs.considerOffsets
- If true
, the label and obstacle
offset parameters of the layout algorithm are considered, otherwise
they are ignored in the decision whether it is allowed to move a
label.public boolean allowMove(IlvLabelingModel labelingModel, Object label)
label
.
allowMove
in interface IlvLabelMovementPolicy
labelingModel
- The labeling model to which the label belongs.label
- The label.true
if it is allowed to move the label, and
false
otherwise.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.