public interface ILcdGXYMultiLabelPainter extends ILcdGXYLabelPainter
ILcdGXYMultiLabelPainter can paint multiple labels per object.
More specifically, it supports multiple labels, each of which consists of one or more sublabels.
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.
One label consists of one or more sublabels. It is up to the user of this interface
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.
|Modifier and Type||Method and Description|
Returns the number of labels for the object set to this label painter.
Returns the index of the label that is currently painted or scheduled to paint.
Return the number of sublabels in a label.
Returns the index of the sublabel to paint.
Sets the label.
Sets the sublabel index.
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) and
ILcdGXYLabelPainter.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.
aLabelIndex- The label index. This should be larger than or equal to
0and less than the result
int getLabelCount(Graphics aGraphics, ILcdGXYContext aGXYContext)
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 use
TLcdGXYEditControllerModel2.EDIT_WHAT_FIRST_TOUCHED_LABELto avoid that a mouse drag moves them all together.
aGraphics- The Graphics currently painting on
aGXYContext- The ILcdGXYContext currently valid
void setSubLabelIndex(int aSubLabelIndex)
ILcdGXYLabelPainter.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)and
ILcdGXYLabelPainter.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.
int getSubLabelCount(int aLabelIndex)
aLabelIndex- the index of the label.