public abstract class ALspStampLabelLocationProvider extends ALspLabelLocationProvider
Modifier | Constructor and Description |
---|---|
protected |
ALspStampLabelLocationProvider()
Creates a new
ALspStampLabelLocationProvider , with the view dependent flag off. |
protected |
ALspStampLabelLocationProvider(boolean aViewDependent)
Creates a new
ALspStampLabelLocationProvider , with the given view dependent flag. |
Modifier and Type | Method and Description |
---|---|
abstract double |
calculateLocation(int aLocationIndex,
TLspLabelID aLabel,
ILcdPoint aObjectAnchorPoint,
Dimension2D aDimension,
TLspContext aContext,
ILcd3DEditablePoint aUpperLeftPointSFCT)
Returns the rotation and calculates the upper left corner of the bounds for the given domain
object and sublabel ID, given the dimension.
|
boolean |
equals(Object aObject)
An object is considered equal to this shape if it has the same class.
|
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 |
hashCode()
The hash code of this shape is the hash code of its class, in order to be consistent with the
equals(Object) method. |
protected boolean |
isValidLocation(TLspLabelID aLabelID,
ILcdPoint aObjectAnchorPoint,
Dimension2D aDimension,
TLspContext aContext,
ILcdPoint aUpperLeftPoint,
double aRotation)
Checks if the given upper left point and rotation are valid.
|
boolean |
isValidLocation(TLspLabelPlacement aLocation,
ALspLabelLocations aCurrentLabelLocations,
TLspPaintState aPaintState,
ILspLabelingAlgorithm.LabelContext aLabelContext,
ILspView aView)
Checks if the given location is a valid location.
|
getMaxLocationCount
protected ALspStampLabelLocationProvider()
ALspStampLabelLocationProvider
, with the view dependent flag off.ALspStampLabelLocationProvider(boolean)
protected ALspStampLabelLocationProvider(boolean aViewDependent)
ALspStampLabelLocationProvider
, with the given view dependent flag.
The flag indicates whether the label locations created by this instance are view dependent:
false
(the default) if the locations are always the same, regardless of the view's camera settings.
In particular, getLocationData
must always return the same result,
even when navigating the view.true
if the locations from this provider depend on the view's camera settings.
getLocationData
can return different data when navigating the view.
Note that this may cause the locations to be re-evaluated
on every
paint, and therefore may have a large impact on painting performance!
When extending from this class, the hashCode
and equals
method should be overridden as well.
aViewDependent
- indicates whether the locations from this provider are view dependent or not.ALspStampLabelLocation.getLocationData(com.luciad.view.lightspeed.painter.label.TLspLabelID, com.luciad.view.lightspeed.label.location.ALspLabelLocations, com.luciad.view.lightspeed.painter.label.location.ILspStampLocationLabelPainter, com.luciad.view.lightspeed.layer.TLspPaintState, com.luciad.view.lightspeed.TLspContext, com.luciad.view.lightspeed.painter.label.location.ALspStampLabelLocation.LocationData)
public final TLspLabelPlacement getLocation(TLspLabelID aLabel, int aLocationIndex, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
ALspLabelLocationProvider
getLocation
in class ALspLabelLocationProvider
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 final boolean isValidLocation(TLspLabelPlacement aLocation, ALspLabelLocations aCurrentLabelLocations, TLspPaintState aPaintState, ILspLabelingAlgorithm.LabelContext aLabelContext, ILspView aView)
true
. This method calls isValidLocation
.isValidLocation
in class ALspLabelLocationProvider
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.public abstract double calculateLocation(int aLocationIndex, TLspLabelID aLabel, ILcdPoint aObjectAnchorPoint, Dimension2D aDimension, TLspContext aContext, ILcd3DEditablePoint aUpperLeftPointSFCT) throws TLcdNoBoundsException
aLocationIndex
- the location index, can be a number from 0
to getMaxLocationCount
.aLabel
- the label for which a location should be calculated.aObjectAnchorPoint
- the object anchor point for the given label, in view coordinates.aDimension
- the dimension of the label.aContext
- the context.aUpperLeftPointSFCT
- the point in which the upper left corner of the label bounds should
be stored. The upper left corner of the label should be specified
in view coordinates.TLcdNoBoundsException
- when the rotation or upper left corner could not be calculated.protected boolean isValidLocation(TLspLabelID aLabelID, ILcdPoint aObjectAnchorPoint, Dimension2D aDimension, TLspContext aContext, ILcdPoint aUpperLeftPoint, double aRotation)
calculateLocation
method is capable of producing the given point and
rotation. Labeling algorithms may use this method for previous label locations. I.e. when using
a previous label locations, this method can be used to verify if the previous label location
can be used.
By default, this method returns true
.aLabelID
- the labelaObjectAnchorPoint
- the object anchor point for the given label, in view coordinates.aDimension
- the dimension of the label.aContext
- the context.aUpperLeftPoint
- the upper left corner of the labelaRotation
- the rotationpublic boolean equals(Object aObject)
public int hashCode()
equals(Object)
method. Extensions should refine this implementation, based on their
properties.