public interface ILspLabelPainter extends ILspPainter
ILspPainter
paints and locates a label for an object in a
view. Labels can be any visual
item that is drawn in view space rather than world space. The labelAnchorPointSFCT
and labelBoundsSFCT
methods give an indication of where
the visual representation of an object will be painted. These methods
return information in view coordinates.TLspLabelPainter
ILspPaintGroupsChangeListener.Callback
Modifier and Type | Method and Description |
---|---|
Object |
getAnchorObject(TLspLabelID aLabel,
TLspPaintState aPaintState,
TLspContext aContext)
Returns the anchor object of the given label.
|
Iterable<TLspLabelID> |
getLabelIDs(Object aObject,
TLspPaintRepresentationState aPaintRepresentationState,
TLspContext aContext)
Enumerates all the desired labels associated with a domain object.
|
void |
labelAnchorPointSFCT(TLspLabelID aLabel,
ALspLabelLocation aLabelLocation,
ALspLabelLocations aLabelLocations,
TLspPaintState aPaintState,
TLspContext aContext,
ILcd3DEditablePoint aAnchorPointSFCT)
Retrieves the anchor point of the given label.
|
double |
labelBoundsSFCT(TLspLabelID aLabel,
ALspLabelLocation aLabelLocation,
ALspLabelLocations aLocations,
TLspPaintState aPaintState,
TLspContext aContext,
ILcd3DEditableBounds aBoundsSFCT)
Calculates the bounds of the given label for the given label location.
|
addPropertyChangeListener, getRequiredOpenGLProfile, getStyler, paintObjects, query, registerLayer, removePropertyChangeListener, unregisterLayer
commitChanges, prepareChanges
Iterable<TLspLabelID> getLabelIDs(Object aObject, TLspPaintRepresentationState aPaintRepresentationState, TLspContext aContext)
aObject
- the domain objectaPaintRepresentationState
- the paint representationaContext
- the contextdouble labelBoundsSFCT(TLspLabelID aLabel, ALspLabelLocation aLabelLocation, ALspLabelLocations aLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
Calculates the bounds of the given label for the given label location.
This method returns the axis aligned bounds using aBoundsSFCT
and returns
a rotation. This rotation rotates the bounds around its origin. The rotation of the bounds
is defined in radians, clockwise, with 0 at 3 'o clock.
It is possible that the bounds of this label depends on the location
of an other label. In that case, it is possible to use the given view
locations to retrieve an other location. Note that the given ALspLabelLocations
should not be modified in this method.
aLabel
- the label for which to calculate the bounds.aLabelLocation
- the location of the label.aLocations
- possible context information. This object can for example be used when
these bounds depend on bounds of an other label.aPaintState
- the paint state.aContext
- the context.aBoundsSFCT
- the object in which to store the axis aligned bounds.TLcdNoBoundsException
- when the bounds could not be calculated.void labelAnchorPointSFCT(TLspLabelID aLabel, ALspLabelLocation aLabelLocation, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aAnchorPointSFCT) throws TLcdNoBoundsException
aLabel
- the label for which to calculate the bounds.aLabelLocation
- the location of the label.aLabelLocations
- possible context information. This object can for example be used when
these bounds depend on bounds of an other label.aPaintState
- the paint state.aContext
- the context.aAnchorPointSFCT
- the point in which to store the anchor point.TLcdNoBoundsException
- when the anchor point could not be calculated.Object getAnchorObject(TLspLabelID aLabel, TLspPaintState aPaintState, TLspContext aContext) throws TLcdNoBoundsException
TLspLabelID
, an ILcdShape
, and ALspStyleTargetProvider
or null
. In the latter case, the painter interprets the anchor itself,
i.e. by using the focus point of the domain object.
The various labeling algorithms use this anchor object to determine the label's location.
You can specify this anchor object using a ALspLabelStyler
:
ALspLabelStyleCollector.anchorLabel(java.lang.Object)
to make place label relative to another label.ALspLabelStyleCollector.geometry(ILcdShape)
to specify a specific geometry to be used.ALspLabelStyleCollector.geometry(ALspStyleTargetProvider)
to specify a style target provider to be used. Using
this method has the advantage that it is possible to specify a different shape reference than the model reference.null
, and the algorithms use the domain
object itself to determine the location.aLabel
- the label.aPaintState
- the paint state.aContext
- the context.TLcdNoBoundsException
- if there is no anchor object for the given label.