public abstract class ALspLabelLocationProvider extends Object
TLspLabelingAlgorithm
.
The algorithm will first call getMaxLocationCount
and will then call
getLocation
.Constructor and Description |
---|
ALspLabelLocationProvider() |
Modifier and Type | Method and Description |
---|---|
abstract TLspLabelPlacement |
getLocation(TLspLabelID aLabel,
int aLocationIndex,
ALspLabelLocations aCurrentLabelLocations,
TLspPaintState aPaintState,
ILspLabelingAlgorithm.LabelContext aLabelContext,
ILspView aView)
This method returns a location for the given label using the given location index.
|
int |
getMaxLocationCount(TLspLabelID aLabel,
TLspPaintState aPaintState,
ILspLabelingAlgorithm.LabelContext aLabelContext,
ILspView aView)
Returns the maximal number of locations to be tried for the given label.
|
boolean |
isValidLocation(TLspLabelPlacement aLocation,
ALspLabelLocations aCurrentLabelLocations,
TLspPaintState aPaintState,
ILspLabelingAlgorithm.LabelContext aLabelContext,
ILspView aView)
Checks if the given location is a valid location.
|
public int getMaxLocationCount(TLspLabelID aLabel, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
getLocation
method can create the same number of
locations as returned by this method. By default, this method returns 1
.aLabel
- the label.aPaintState
- the paint state.aLabelContext
- provides context information, such as priorities, PaintState, ...aView
- the view.public abstract TLspLabelPlacement getLocation(TLspLabelID aLabel, int aLocationIndex, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
aLabel
- a label.aLocationIndex
- the location index.aCurrentLabelLocations
- an ALspLabelLocations object containing locations for the
currently placed labels.aPaintState
- the paint stateaLabelContext
- provides context information, such as priorities, PaintState, ...aView
- the view.null
if no location
could be calculated.public boolean isValidLocation(TLspLabelPlacement aLocation, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
true
.aLocation
- the location to check.aCurrentLabelLocations
- an ALspLabelLocations object containing locations for the
currently placed labels.aPaintState
- the paint state.aLabelContext
- provides context information, such as priorities, PaintState, ...aView
- the view.