Class TLcdGXYHaloLabelPainter2
- All Implemented Interfaces:
ILcdPropertyChangeSource
,ILcdGXYLabelPainter
,ILcdGXYLabelPainter2
,ILcdGXYLabelPainterProvider
,ILcdGXYMultiLabelPainter
,Serializable
,Cloneable
TLcdGXYHaloLabelPainter
that supports ILcdGXYLabelPainter2
.- Since:
- 7.0.17
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTED
Fields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter2
BODY, CREATING, HANDLES, RESHAPING, SNAPS, TRANSLATING
-
Constructor Summary
ConstructorDescriptionTLcdGXYHaloLabelPainter2
(ILcdGXYLabelPainter2 aLabelPainter2) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter, with default halo parameters (Color = white, thickness = 1).TLcdGXYHaloLabelPainter2
(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter, configured with the given halo color and thickness.TLcdGXYHaloLabelPainter2
(ILcdGXYLabelPainterProvider aLabelPainter2Provider) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter provider, with default halo parameters (Color = white, thickness = 1).TLcdGXYHaloLabelPainter2
(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter provider, configured with the given halo color and thickness. -
Method Summary
Modifier and TypeMethodDescriptiongetLabelCursor
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Returns aCursor
to indicate the type of editingaMode
andaGXYContext
.Returns theTLcdLabelLocation
that was previously set that contains the information on the whereabouts of the label.boolean
isLabelTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Tests if the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
is touched at view location(specified by aGXYContext.getX()
andaGXYContext.getY()
), considering the mode and theILcdGXYContext
instance.void
labelAnchorPointSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) SetsaPointSFCT
to the anchor point of the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
.labelSnapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns anObject
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents.void
setDelegateLabelPainter
(ILcdGXYLabelPainter aDelegateLabelPainter) Sets theILcdGXYLabelPainter
to which the rendering of the labels is to be delegated.void
setDelegateLabelPainterProvider
(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider) Sets theILcdGXYLabelPainterProvider
to which the rendering of the labels is to be delegated.void
setLabelLocation
(TLcdLabelLocation aLabelLocation) Sets the label location of the label.boolean
supportLabelSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns whether this label painter supports snapping for the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
, considering the givenILcdGXYContext
instance.Methods inherited from class com.luciad.view.gxy.TLcdGXYHaloLabelPainter
addPropertyChangeListener, clearImageCache, clearImageCache, clone, getDelegateLabelPainter, getDelegateLabelPainterProvider, getGXYLabelPainter, getHaloAlgorithm, getHaloColor, getHaloThickness, getLabelCount, getLabelIndex, getLocationIndex, getObject, getPossibleLocationCount, getSubLabelCount, getSubLabelIndex, isHaloEnabled, isUseImageCache, labelBoundsSFCT, paintLabel, removePropertyChangeListener, setHaloAlgorithm, setHaloColor, setHaloEnabled, setHaloThickness, setLabelIndex, setLocationIndex, setObject, setSubLabelIndex, setUseImageCache
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
getLocationIndex, getObject, getPossibleLocationCount, setLocationIndex
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter2
clone, labelBoundsSFCT, paintLabel, setObject
Methods inherited from interface com.luciad.view.gxy.ILcdGXYMultiLabelPainter
getLabelCount, getLabelIndex, getSubLabelCount, getSubLabelIndex, setLabelIndex, setSubLabelIndex
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdGXYHaloLabelPainter2
Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter, with default halo parameters (Color = white, thickness = 1).- Parameters:
aLabelPainter2
- theILcdGXYLabelPainter2
rendering the label.
-
TLcdGXYHaloLabelPainter2
public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter, configured with the given halo color and thickness.- Parameters:
aLabelPainter2
- theILcdGXYLabelPainter2
rendering the label.aHaloColor
- the halo coloraHaloThickness
- the halo thickness
-
TLcdGXYHaloLabelPainter2
Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter provider, with default halo parameters (Color = white, thickness = 1).- Parameters:
aLabelPainter2Provider
- theILcdGXYLabelPainterProvider
returningILcdGXYLabelPainter2
instances.
-
TLcdGXYHaloLabelPainter2
public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2
wrapping the given label painter provider, configured with the given halo color and thickness.- Parameters:
aLabelPainter2Provider
- theILcdGXYLabelPainterProvider
returningILcdGXYLabelPainter2
instances.aHaloColor
- the halo coloraHaloThickness
- the halo thickness
-
-
Method Details
-
setDelegateLabelPainter
Sets theILcdGXYLabelPainter
to which the rendering of the labels is to be delegated. The delegate painter must be an instance ofILcdGXYLabelPainter2
. If this is not the case, use aTLcdGXYHaloLabelPainter
instead.- Overrides:
setDelegateLabelPainter
in classTLcdGXYHaloLabelPainter
- Parameters:
aDelegateLabelPainter
- theILcdGXYLabelPainter2
to which the rendering of the labels is delegated.
-
setDelegateLabelPainterProvider
public void setDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider) Sets theILcdGXYLabelPainterProvider
to which the rendering of the labels is to be delegated. This delegate must return painters implementingILcdGXYLabelPainter2
. If this is not the case, use aTLcdGXYHaloLabelPainter
instead.- Overrides:
setDelegateLabelPainterProvider
in classTLcdGXYHaloLabelPainter
- Parameters:
aDelegateLabelPainterProvider
- painter provider returningILcdGXYLabelPainter2
to which the rendering of the labels is delegated.
-
setLabelLocation
Description copied from interface:ILcdGXYLabelPainter2
Sets the label location of the label. This label location will be used to determine what the bounds of the label are, where it must be painted, etc.
Note that
aLabelLocation
also contains a label location index. This is independent of theILcdGXYLabelPainter.getLocationIndex()
of the super interface. Contrary to the location index returned bygetLocationIndex
, the location index inaLabelLocation
can be less than0
, in which case the labels are freely placed.This method has to be called after
ILcdGXYLabelPainter2.setObject(java.lang.Object)
has been called, as callingsetObject
clears this label location.- Specified by:
setLabelLocation
in interfaceILcdGXYLabelPainter2
- Parameters:
aLabelLocation
- TheTLcdLabelLocation
instance containing all the information about the location of the label.- See Also:
-
getLabelLocation
Description copied from interface:ILcdGXYLabelPainter2
Returns theTLcdLabelLocation
that was previously set that contains the information on the whereabouts of the label.- Specified by:
getLabelLocation
in interfaceILcdGXYLabelPainter2
- Returns:
- The label location that was previously set.
- See Also:
-
isLabelTouched
Description copied from interface:ILcdGXYLabelPainter2
Tests if the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
is touched at view location(specified by aGXYContext.getX()
andaGXYContext.getY()
), considering the mode and theILcdGXYContext
instance.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
isLabelTouched
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- the mode to consider. This is a bitwise combinations of several constants. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- theILcdGXYContext
to consider.- Returns:
- true if the representation of the Object returned by getObject() is touched, false otherwise
- See Also:
-
labelAnchorPointSFCT
public void labelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException Description copied from interface:ILcdGXYLabelPainter2
Sets
aPointSFCT
to the anchor point of the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
.If the location index is less than 0, the label anchor point is unambiguously determined by the
label location
. The actual label is to be painted somewhere around this anchor point. This method is typically called to compare the result with the label bounds, thus determining the exact relation between thelabel
and itslocation
.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
labelAnchorPointSFCT
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- The mode to consider. This can be a bitwise combination of several constants. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- TheILcdGXYContext
that can be used to retrieve extra information.aPointSFCT
- The point which will be updated to reflect the location of the anchor point.- Throws:
TLcdNoBoundsException
- if the Object doesn't have any valid anchor point, e.g. if it is always invisible in the current projection.- See Also:
-
supportLabelSnap
Description copied from interface:ILcdGXYLabelPainter2
Returns whether this label painter supports snapping for the label specified by
setObject
,setLabelIndex
andsetSubLabelIndex
, considering the givenILcdGXYContext
instance. When the label painter supports snap for the specified label and context, it can return a snap target for this label and context.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
supportLabelSnap
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.- Returns:
true
if this label painter supports snapping for the specified label.- See Also:
-
labelSnapTarget
Description copied from interface:ILcdGXYLabelPainter2
Returns anObject
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents. The returnedObject
can be theObject
this ILcdGXYLabelPainter2 represents or any other (e.g. anILcdPoint
if getObject() is anILcdPointList
).- Specified by:
labelSnapTarget
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.- Returns:
- an
Object
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents (returned by getObject()). This object can benull
.
-
getLabelCursor
Description copied from interface:ILcdGXYLabelPainter2
Returns aCursor
to indicate the type of editingaMode
andaGXYContext
.- Specified by:
getLabelCursor
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- The mode to consider. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, ILcdGXYContext)
for more information.aGXYContext
- TheILcdGXYContext
containing extra information, such as the layer, the view and the mouse position.- Returns:
- a
Cursor
to indicate the type of editingaMode
andaGXYContext
. Returnsnull
if no particularCursor
is required.
-
getDisplayName
- Specified by:
getDisplayName
in interfaceILcdGXYLabelPainter2
- Returns:
- the display name of this
ILcdGXYLabelPainter2
-