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, SELECTEDFields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter2
BODY, CREATING, HANDLES, RESHAPING, SNAPS, TRANSLATING -
Constructor Summary
ConstructorsConstructorDescriptionTLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2) Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter, with default halo parameters (Color = white, thickness = 1).TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter, configured with the given halo color and thickness.TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider) Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter provider, with default halo parameters (Color = white, thickness = 1).TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2wrapping 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 aCursorto indicate the type of editingaModeandaGXYContext.Returns theTLcdLabelLocationthat was previously set that contains the information on the whereabouts of the label.booleanisLabelTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Tests if the label specified bysetObject,setLabelIndexandsetSubLabelIndexis touched at view location(specified by aGXYContext.getX()andaGXYContext.getY()), considering the mode and theILcdGXYContextinstance.voidlabelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) SetsaPointSFCTto the anchor point of the label specified bysetObject,setLabelIndexandsetSubLabelIndex.labelSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns anObjectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents.voidsetDelegateLabelPainter(ILcdGXYLabelPainter aDelegateLabelPainter) Sets theILcdGXYLabelPainterto which the rendering of the labels is to be delegated.voidsetDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider) Sets theILcdGXYLabelPainterProviderto which the rendering of the labels is to be delegated.voidsetLabelLocation(TLcdLabelLocation aLabelLocation) Sets the label location of the label.booleansupportLabelSnap(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns whether this label painter supports snapping for the label specified bysetObject,setLabelIndexandsetSubLabelIndex, considering the givenILcdGXYContextinstance.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, setUseImageCacheMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
getLocationIndex, getObject, getPossibleLocationCount, setLocationIndexMethods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter2
clone, labelBoundsSFCT, paintLabel, setObjectMethods inherited from interface com.luciad.view.gxy.ILcdGXYMultiLabelPainter
getLabelCount, getLabelIndex, getSubLabelCount, getSubLabelIndex, setLabelIndex, setSubLabelIndexMethods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdGXYHaloLabelPainter2
Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter, with default halo parameters (Color = white, thickness = 1).- Parameters:
aLabelPainter2- theILcdGXYLabelPainter2rendering the label.
-
TLcdGXYHaloLabelPainter2
public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter, configured with the given halo color and thickness.- Parameters:
aLabelPainter2- theILcdGXYLabelPainter2rendering the label.aHaloColor- the halo coloraHaloThickness- the halo thickness
-
TLcdGXYHaloLabelPainter2
Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter provider, with default halo parameters (Color = white, thickness = 1).- Parameters:
aLabelPainter2Provider- theILcdGXYLabelPainterProviderreturningILcdGXYLabelPainter2instances.
-
TLcdGXYHaloLabelPainter2
public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness) Creates a newTLcdGXYHaloLabelPainter2wrapping the given label painter provider, configured with the given halo color and thickness.- Parameters:
aLabelPainter2Provider- theILcdGXYLabelPainterProviderreturningILcdGXYLabelPainter2instances.aHaloColor- the halo coloraHaloThickness- the halo thickness
-
-
Method Details
-
setDelegateLabelPainter
Sets theILcdGXYLabelPainterto 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 aTLcdGXYHaloLabelPainterinstead.- Overrides:
setDelegateLabelPainterin classTLcdGXYHaloLabelPainter- Parameters:
aDelegateLabelPainter- theILcdGXYLabelPainter2to which the rendering of the labels is delegated.
-
setDelegateLabelPainterProvider
public void setDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider) Sets theILcdGXYLabelPainterProviderto which the rendering of the labels is to be delegated. This delegate must return painters implementingILcdGXYLabelPainter2. If this is not the case, use aTLcdGXYHaloLabelPainterinstead.- Overrides:
setDelegateLabelPainterProviderin classTLcdGXYHaloLabelPainter- Parameters:
aDelegateLabelPainterProvider- painter provider returningILcdGXYLabelPainter2to which the rendering of the labels is delegated.
-
setLabelLocation
Description copied from interface:ILcdGXYLabelPainter2Sets 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
aLabelLocationalso 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 inaLabelLocationcan 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 callingsetObjectclears this label location.- Specified by:
setLabelLocationin interfaceILcdGXYLabelPainter2- Parameters:
aLabelLocation- TheTLcdLabelLocationinstance containing all the information about the location of the label.- See Also:
-
getLabelLocation
Description copied from interface:ILcdGXYLabelPainter2Returns theTLcdLabelLocationthat was previously set that contains the information on the whereabouts of the label.- Specified by:
getLabelLocationin interfaceILcdGXYLabelPainter2- Returns:
- The label location that was previously set.
- See Also:
-
isLabelTouched
Description copied from interface:ILcdGXYLabelPainter2Tests if the label specified bysetObject,setLabelIndexandsetSubLabelIndexis touched at view location(specified by aGXYContext.getX()andaGXYContext.getY()), considering the mode and theILcdGXYContextinstance.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:
isLabelTouchedin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance 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- theILcdGXYContextto 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:ILcdGXYLabelPainter2Sets
aPointSFCTto the anchor point of the label specified bysetObject,setLabelIndexandsetSubLabelIndex.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 thelabeland 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:
labelAnchorPointSFCTin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance 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- TheILcdGXYContextthat 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:ILcdGXYLabelPainter2Returns whether this label painter supports snapping for the label specified by
setObject,setLabelIndexandsetSubLabelIndex, considering the givenILcdGXYContextinstance. 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:
supportLabelSnapin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- the Graphics on which is worked.aGXYContext- the ILcdGXYContext of the snapping.- Returns:
trueif this label painter supports snapping for the specified label.- See Also:
-
labelSnapTarget
Description copied from interface:ILcdGXYLabelPainter2Returns anObjectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents. The returnedObjectcan be theObjectthis ILcdGXYLabelPainter2 represents or any other (e.g. anILcdPointif getObject() is anILcdPointList).- Specified by:
labelSnapTargetin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- the Graphics on which is worked.aGXYContext- the ILcdGXYContext of the snapping.- Returns:
- an
Objectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents (returned by getObject()). This object can benull.
-
getLabelCursor
Description copied from interface:ILcdGXYLabelPainter2Returns aCursorto indicate the type of editingaModeandaGXYContext.- Specified by:
getLabelCursorin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance on which the label is painted.aMode- The mode to consider. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, ILcdGXYContext)for more information.aGXYContext- TheILcdGXYContextcontaining extra information, such as the layer, the view and the mouse position.- Returns:
- a
Cursorto indicate the type of editingaModeandaGXYContext. Returnsnullif no particularCursoris required.
-
getDisplayName
- Specified by:
getDisplayNamein interfaceILcdGXYLabelPainter2- Returns:
- the display name of this
ILcdGXYLabelPainter2
-