Interface ILcdGXYLabelPainter
- All Superinterfaces:
Cloneable,Serializable
- All Known Subinterfaces:
ILcdGXYLabelPainter2,ILcdGXYMultiLabelPainter
- All Known Implementing Classes:
ALcdGXYLabelPainter,ALcdSLDFeatureTypeStylePainter,ALcdSLDRulePainter,TLcdAIXM51AirspaceLabelPainter,TLcdAIXM51NavaidLabelPainter,TLcdAIXM51XPathLabelPainter,TLcdGXYCompositeLabelPainter,TLcdGXYCurvedPathLabelPainter,TLcdGXYDataObjectLabelPainter,TLcdGXYDataObjectPolygonLabelPainter,TLcdGXYDataObjectPolylineLabelPainter,TLcdGXYEditableLabelPainter,TLcdGXYFeaturedLabelPainter,TLcdGXYFeaturedPolygonLabelPainter,TLcdGXYFeaturedPolylineLabelPainter,TLcdGXYHaloLabelPainter,TLcdGXYHaloLabelPainter2,TLcdGXYLabelPainter,TLcdGXYLabelPainterAdapter,TLcdGXYMultiFontLabelPainter,TLcdGXYOffsetIconPainter,TLcdGXYOutlinePolylineLabelPainter,TLcdGXYPolygonLabelPainter,TLcdGXYPolygonStampLabelPainter,TLcdGXYPolylineLabelPainter,TLcdGXYPolylineStampLabelPainter,TLcdGXYProcedureTrajectoryLegLabelPainter,TLcdGXYStampLabelPainter,TLcdICAOAirspaceDetailedLabelPainter,TLcdICAOAirspaceLabelPainter,TLcdICAOAreaMinimumAltitudeLabelPainter,TLcdICAODMELabelPainter,TLcdICAONavaidLabelPainter,TLcdICAONDBLabelPainter,TLcdICAOTACANLabelPainter,TLcdICAOVORLabelPainter,TLcdMagneticNorthGXYLabelPainter,TLcdSLDFeatureTypeStylePainter,TLcdSLDRulePainter,TLcdUTMZonePainter
possible locations
for the label.
Usage
This interface requires to set anobject and a location before the paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext) and labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle) methods can be used.
Note that, if you implement this interface, it is recommended to also implement
ILcdGXYLabelPainter2.- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclone()RedefinesObject.cloneto make it public.intGets the index of location where to paint the label(s) of the set Object.Gets the Object this ILcdGXYLabelPainter can label.intgetPossibleLocationCount(Graphics aGraphics) Returns the number of possible locations where thisILcdGXYLabelPaintercan paint/draw the labels of the set domainObject.doublelabelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) Calculates the bounds of the label that can be painted.voidpaintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Paints the label of the set Object onaGraphics.voidsetLocationIndex(int aLocationIndex) Sets the index of location where to paint the label(s) of the set Object.voidSets the Object to be labeled by this ILcdGXYLabelPainter.
-
Field Details
-
DEFAULT
static final int DEFAULTThe default label representation of anObject.- See Also:
-
SELECTED
static final int SELECTEDThe label representation of anObjectwhen it is selected. This is typically painted on top of the default label representation of the same object.- See Also:
-
-
Method Details
-
setObject
Sets the Object to be labeled by this ILcdGXYLabelPainter.- Parameters:
aObject- The object to be labeled.- See Also:
-
getObject
Object getObject()Gets the Object this ILcdGXYLabelPainter can label.- Returns:
- the Object this ILcdGXYLabelPainter can label.
- See Also:
-
setLocationIndex
void setLocationIndex(int aLocationIndex) Sets the index of location where to paint the label(s) of the set Object.- Parameters:
aLocationIndex- the index of the location. Must be between 0 and getPossibleLocationCount() - 1.- See Also:
-
getLocationIndex
int getLocationIndex()Gets the index of location where to paint the label(s) of the set Object.- Returns:
- the index of the position. Must be between 0 and getPossibleLocationCount() - 1.
- See Also:
-
paintLabel
Paints the label of the set Object on
aGraphics.aGXYContextshould contain theILcdGXYViewfor which the label is painted andILcdGXYLayerto which the object belongsThe implementation of this method shall define how to paint the label of the set Object in the given mode, considering
aGXYContextand the possible locationsaLocationIndex(of multiple alternatives).The domain
Objectof the label to be painted and the location index should be set before calling this method using thesetObjectandsetLocationIndexmethods respectively.- Parameters:
aGraphics- theGraphicsinstance on which to paint.aMode- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aGXYContext- theILcdGXYContextin which the label painting has to be performed.- See Also:
-
getPossibleLocationCount
Returns the number of possible locations where thisILcdGXYLabelPaintercan paint/draw the labels of the set domainObject.The domain
Objectfor which the location count is retrieved should be set before calling this method using thesetObject(java.lang.Object)method.- Parameters:
aGraphics- the Graphics the label will be painted on.- Returns:
- the number of possible locations where this
ILcdGXYLabelPaintercan paint/draw the labels of the set Object. - See Also:
-
labelBoundsSFCT
double labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) throws TLcdNoBoundsException Calculates the bounds of the label that can be painted. The bounds are set as a side effect in
aRectangleSFCT, the orientation ofaRectangleSFCTis returned as an angle.The bounds represent the upper left point of the label, and a width and a height. The rotation value represents the rotation of the label bounds around the upper left point.
The object for which the bounds are retrieved and the location index of the label should be set before calling this method using the
setObject(java.lang.Object)andsetLocationIndex(int)methods respectively.- Parameters:
aGraphics- theaGraphicsto consider.aMode- the representation mode of the label.aGXYContext- theILcdGXYContextthe drawing depends on.aRectangleSFCT- theRectanglecontaining the bounds of the label in view / graphics coordinates as side effect.- Returns:
- the angle orientation of the rectangle around the labels in RADIANs, clockwise, 0 at 3 o'clock.
- Throws:
TLcdNoBoundsException- if the Object doesn't have any valid bounds, e.g. if it is always invisible in the current projection.- See Also:
-
clone
Object clone()RedefinesObject.cloneto make it public.
-