Interface ILcdGXYMultiLabelPainter
- All Superinterfaces:
Cloneable
,ILcdGXYLabelPainter
,Serializable
- All Known Subinterfaces:
ILcdGXYLabelPainter2
- All Known Implementing Classes:
ALcdGXYLabelPainter
,TLcdAIXM51AirspaceLabelPainter
,TLcdAIXM51NavaidLabelPainter
,TLcdAIXM51XPathLabelPainter
,TLcdGXYCompositeLabelPainter
,TLcdGXYCurvedPathLabelPainter
,TLcdGXYDataObjectLabelPainter
,TLcdGXYDataObjectPolygonLabelPainter
,TLcdGXYDataObjectPolylineLabelPainter
,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
A ILcdGXYMultiLabelPainter
can paint multiple labels per object.
More specifically, it supports multiple labels, each of which consists of one or more sublabels.
Multiple labels
In contrast to an ILcdGXYLabelPainter
which could also be implemented to paint multiple
labels per object, the labels of a ILcdGXYMultiLabelPainter
are painted one after the other in
the current view implementations. As a consequence the label bounds are computed sequentially per label
(setLabelIndex(int)
) and are smaller than the the combined bounds of the labels. This is mainly used
in label decluttering.
Labels and sublabels
One label consists of one or more sublabels. It is up to the user of this interface
(e.g. a ILcdLabelingAlgorithm
) to
decide how to interpret labels and sublabels.
One possible interpretation is to decide that if a label is painted, all of its sublabels are painted, if not, none of its sublabels are painted. A scenario for this interpretation could be street labeling, where the full street name is displayed every few segments. Here, the labels of the ILcdGXYMultiLabelPainter would be the street name, and the sublabels would be the individual words of the street name.
One other possible interpretation could be to fix the location of sublabels of a single label so that they move together. A scenario for this is when the object's representation is painted as one or more offset labels, with some extra text labels attached to each of them. Here, the labels of the ILcdGXYMultiLabelPainter would be the offset labels, and the sublabels would be the extra text labels surrounding each offset label.
Usage
This interface requires to set an object
, a location index
and the label-
and sublabel-
index before the other methods can be used.
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTED
-
Method Summary
Modifier and TypeMethodDescriptionint
getLabelCount
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns the number of labels for the object set to this label painter.int
Returns the index of the label that is currently painted or scheduled to paint.int
getSubLabelCount
(int aLabelIndex) Return the number of sublabels in a label.int
Returns the index of the sublabel to paint.void
setLabelIndex
(int aLabelIndex) Sets the label.void
setSubLabelIndex
(int aSubLabelIndex) Sets the sublabel index.Methods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
clone, getLocationIndex, getObject, getPossibleLocationCount, labelBoundsSFCT, paintLabel, setLocationIndex, setObject
-
Method Details
-
setLabelIndex
void setLabelIndex(int aLabelIndex) Sets the label. The results of any subsequent method calls to
ILcdGXYLabelPainter.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
andILcdGXYLabelPainter.labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle)
etc. will apply to the label and sublabel indicated by this label index.- Parameters:
aLabelIndex
- The label index. This should be larger than or equal to0
and less than the resultgetLabelCount(java.awt.Graphics, com.luciad.view.gxy.ILcdGXYContext)
.- See Also:
-
getLabelIndex
int getLabelIndex()Returns the index of the label that is currently painted or scheduled to paint.- Returns:
- the index of the label that is currently painted or scheduled to paint.
- See Also:
-
getLabelCount
Returns the number of labels for the object set to this label painter.
Note: when returning multiple (moveable) labels for the same object, it might be useful to useTLcdGXYEditControllerModel2.EDIT_WHAT_FIRST_TOUCHED_LABEL
to avoid that a mouse drag moves them all together.- Parameters:
aGraphics
- The Graphics currently painting onaGXYContext
- The ILcdGXYContext currently valid- Returns:
- The number of label for the given object.
-
getSubLabelIndex
int getSubLabelIndex()Returns the index of the sublabel to paint.- Returns:
- the index of the sublabel to paint.
- See Also:
-
setSubLabelIndex
void setSubLabelIndex(int aSubLabelIndex) Sets the sublabel index. The results of any subsequent method calls toILcdGXYLabelPainter.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
andILcdGXYLabelPainter.labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle)
etc. will apply to the label and sublabel indicated by this sublabel index.- Parameters:
aSubLabelIndex
- The sub label index. This should be larger than or equal to0
and less than the resultgetSubLabelCount(int)
.- See Also:
-
getSubLabelCount
int getSubLabelCount(int aLabelIndex) Return the number of sublabels in a label. The value should be 1 or higher.- Parameters:
aLabelIndex
- the index of the label.- Returns:
- The number of sublabels of the label with the given index.
-