public interface ILcdGXYLabelPainter extends Serializable, Cloneable
possible locations
for the label.
object
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.ILcdGXYPainter
,
ILcdGXYLabelPainter2
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT
The default label representation of an
Object . |
static int |
SELECTED
The label representation of an
Object when it is selected. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Redefines
Object.clone to make it public. |
int |
getLocationIndex()
Gets the index of location where to paint the label(s) of the set Object.
|
Object |
getObject()
Gets the Object this ILcdGXYLabelPainter can label.
|
int |
getPossibleLocationCount(Graphics aGraphics)
Returns the number of possible locations where this
ILcdGXYLabelPainter can
paint/draw the labels of the set domain Object . |
double |
labelBoundsSFCT(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext,
Rectangle aRectangleSFCT)
Calculates the bounds of the label that can be painted.
|
void |
paintLabel(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Paints the label of the set Object on
aGraphics . |
void |
setLocationIndex(int aLocationIndex)
Sets the index of location where to paint the label(s) of the set Object.
|
void |
setObject(Object aObject)
Sets the Object to be labeled by this ILcdGXYLabelPainter.
|
static final int DEFAULT
Object
.static final int SELECTED
Object
when it is selected.
This is typically painted on top of the default label representation of the same object.void setObject(Object aObject)
aObject
- The object to be labeled.getObject()
Object getObject()
setObject(java.lang.Object)
void setLocationIndex(int aLocationIndex)
aLocationIndex
- the index of the location. Must be between 0 and getPossibleLocationCount()
- 1.getLocationIndex()
int getLocationIndex()
setLocationIndex(int)
void paintLabel(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
Paints the label of the set Object on aGraphics
. aGXYContext
should
contain the ILcdGXYView
for which the label is painted and
ILcdGXYLayer
to which the object belongs
The implementation of this method shall define how to paint the label of the set Object in
the given mode, considering aGXYContext
and the possible locations
aLocationIndex
(of multiple alternatives).
The domain Object
of the label to be painted and the location index should be
set before calling this method using the setObject
and
setLocationIndex
methods respectively.
int getPossibleLocationCount(Graphics aGraphics)
ILcdGXYLabelPainter
can
paint/draw the labels of the set domain Object
.
The domain Object
for which the location count is retrieved should be set
before calling this method using the setObject(java.lang.Object)
method.
aGraphics
- the Graphics the label will be painted on.ILcdGXYLabelPainter
can
paint/draw the labels of the set Object.setLocationIndex(int)
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 of
aRectangleSFCT
is 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)
and setLocationIndex(int)
methods respectively.
aGraphics
- the aGraphics
to consider.aMode
- the representation mode of the label.aGXYContext
- the ILcdGXYContext
the drawing depends on.aRectangleSFCT
- the Rectangle
containing the bounds of the label in view /
graphics coordinates as side effect.TLcdNoBoundsException
- if the Object doesn't have any valid bounds, e.g. if it is always
invisible in the current projection.DEFAULT
,
SELECTED
Object clone()
Object.clone
to make it public.