public class TLcdGXYHaloLabelPainter2 extends TLcdGXYHaloLabelPainter implements ILcdGXYLabelPainter2
TLcdGXYHaloLabelPainter
that supports ILcdGXYLabelPainter2
.TLcdGXYHaloLabelPainter
,
ILcdGXYLabelPainter2
,
Serialized FormBODY, CREATING, HANDLES, RESHAPING, SNAPS, TRANSLATING
DEFAULT, SELECTED
Constructor and Description |
---|
TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2)
Creates a new
TLcdGXYHaloLabelPainter2 wrapping the given label painter, with default
halo parameters (Color = white, thickness = 1). |
TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2,
Color aHaloColor,
int aHaloThickness)
Creates a new
TLcdGXYHaloLabelPainter2 wrapping the given label painter, configured
with the given halo color and thickness. |
TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider)
Creates a new
TLcdGXYHaloLabelPainter2 wrapping the given label painter provider, with default
halo parameters (Color = white, thickness = 1). |
TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider,
Color aHaloColor,
int aHaloThickness)
Creates a new
TLcdGXYHaloLabelPainter2 wrapping the given label painter provider, configured
with the given halo color and thickness. |
Modifier and Type | Method and Description |
---|---|
String |
getDisplayName() |
Cursor |
getLabelCursor(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Returns a
Cursor to indicate the type of editing aMode and
aGXYContext . |
TLcdLabelLocation |
getLabelLocation()
Returns the
TLcdLabelLocation that was previously set that contains the
information on the whereabouts of the label. |
boolean |
isLabelTouched(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext)
Tests if the label specified by
setObject , setLabelIndex and
setSubLabelIndex is touched at view location (specified by
aGXYContext.getX() and aGXYContext.getY() ), considering the mode and the
ILcdGXYContext instance. |
void |
labelAnchorPointSFCT(Graphics aGraphics,
int aMode,
ILcdGXYContext aGXYContext,
Point aPointSFCT)
Sets
aPointSFCT to the anchor point of the label specified by
setObject , setLabelIndex and setSubLabelIndex . |
Object |
labelSnapTarget(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Returns an
Object that can be used as snapping target when graphically editing
another Object or label than the one this ILcdGXYLabelPainter2 represents. |
void |
setDelegateLabelPainter(ILcdGXYLabelPainter aDelegateLabelPainter)
Sets the
ILcdGXYLabelPainter to which the rendering of the
labels is to be delegated. |
void |
setDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider)
Sets the
ILcdGXYLabelPainterProvider to which the rendering of the
labels is to be delegated. |
void |
setLabelLocation(TLcdLabelLocation aLabelLocation)
Sets the label location of the label.
|
boolean |
supportLabelSnap(Graphics aGraphics,
ILcdGXYContext aGXYContext)
Returns whether this label painter supports snapping for the label specified by
setObject , setLabelIndex and setSubLabelIndex ,
considering the given ILcdGXYContext instance. |
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, setUseImageCache
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone, labelBoundsSFCT, paintLabel, setObject
getLabelCount, getLabelIndex, getSubLabelCount, getSubLabelIndex, setLabelIndex, setSubLabelIndex
getLocationIndex, getObject, getPossibleLocationCount, setLocationIndex
addPropertyChangeListener, removePropertyChangeListener
public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2)
TLcdGXYHaloLabelPainter2
wrapping the given label painter, with default
halo parameters (Color = white, thickness = 1).aLabelPainter2
- the ILcdGXYLabelPainter2
rendering the label.public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainter2 aLabelPainter2, Color aHaloColor, int aHaloThickness)
TLcdGXYHaloLabelPainter2
wrapping the given label painter, configured
with the given halo color and thickness.aLabelPainter2
- the ILcdGXYLabelPainter2
rendering the label.aHaloColor
- the halo coloraHaloThickness
- the halo thicknesspublic TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider)
TLcdGXYHaloLabelPainter2
wrapping the given label painter provider, with default
halo parameters (Color = white, thickness = 1).aLabelPainter2Provider
- the ILcdGXYLabelPainterProvider
returning ILcdGXYLabelPainter2
instances.public TLcdGXYHaloLabelPainter2(ILcdGXYLabelPainterProvider aLabelPainter2Provider, Color aHaloColor, int aHaloThickness)
TLcdGXYHaloLabelPainter2
wrapping the given label painter provider, configured
with the given halo color and thickness.aLabelPainter2Provider
- the ILcdGXYLabelPainterProvider
returning ILcdGXYLabelPainter2
instances.aHaloColor
- the halo coloraHaloThickness
- the halo thicknesspublic void setDelegateLabelPainter(ILcdGXYLabelPainter aDelegateLabelPainter)
ILcdGXYLabelPainter
to which the rendering of the
labels is to be delegated. The delegate painter must be an instance of
ILcdGXYLabelPainter2
. If this is not the case, use a
TLcdGXYHaloLabelPainter
instead.setDelegateLabelPainter
in class TLcdGXYHaloLabelPainter
aDelegateLabelPainter
- the ILcdGXYLabelPainter2
to which the rendering of the labels is delegated.public void setDelegateLabelPainterProvider(ILcdGXYLabelPainterProvider aDelegateLabelPainterProvider)
ILcdGXYLabelPainterProvider
to which the rendering of the
labels is to be delegated. This delegate must return painters implementing
ILcdGXYLabelPainter2
. If this is not the case, use a
TLcdGXYHaloLabelPainter
instead.setDelegateLabelPainterProvider
in class TLcdGXYHaloLabelPainter
aDelegateLabelPainterProvider
- painter provider returning ILcdGXYLabelPainter2
to which the rendering of the labels is delegated.public void setLabelLocation(TLcdLabelLocation aLabelLocation)
ILcdGXYLabelPainter2
Sets 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 aLabelLocation
also contains a label location index. This is
independent of the ILcdGXYLabelPainter.getLocationIndex()
of the super interface. Contrary to the location
index returned by getLocationIndex
, the location index in
aLabelLocation
can be less than 0
, in which case the labels are
freely placed.
This method has to be called after ILcdGXYLabelPainter2.setObject(java.lang.Object)
has been called, as calling
setObject
clears this label location.
setLabelLocation
in interface ILcdGXYLabelPainter2
aLabelLocation
- The TLcdLabelLocation
instance containing all the
information about the location of the label.ILcdGXYLabelPainter2.setObject(java.lang.Object)
public TLcdLabelLocation getLabelLocation()
ILcdGXYLabelPainter2
TLcdLabelLocation
that was previously set that contains the
information on the whereabouts of the label.getLabelLocation
in interface ILcdGXYLabelPainter2
ILcdGXYLabelPainter2.setLabelLocation(com.luciad.view.TLcdLabelLocation)
public boolean isLabelTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYLabelPainter2
setObject
, setLabelIndex
and
setSubLabelIndex
is touched at view location (specified by
aGXYContext.getX()
and aGXYContext.getY()
), considering the mode and the
ILcdGXYContext
instance.
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.
isLabelTouched
in interface ILcdGXYLabelPainter2
aGraphics
- The Graphics
instance on which the label is painted.aMode
- the mode to consider. This is a bitwise combinations of several constants.
See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- the ILcdGXYContext
to consider.ILcdGXYContext
public void labelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException
ILcdGXYLabelPainter2
Sets aPointSFCT
to the anchor point of the label specified by
setObject
, setLabelIndex
and setSubLabelIndex
.
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 the label
and its location
.
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.
labelAnchorPointSFCT
in interface ILcdGXYLabelPainter2
aGraphics
- The Graphics
instance on which the label is painted.aMode
- The mode to consider. This can be a bitwise combination of several
constants. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- The ILcdGXYContext
that can be used to retrieve extra
information.aPointSFCT
- The point which will be updated to reflect the location of the anchor
point.TLcdNoBoundsException
- if the Object doesn't have any valid anchor point, e.g. if it is
always invisible in the current projection.ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
,
ILcdGXYLabelPainter2.getLabelLocation()
,
ILcdGXYLabelPainter2.labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle)
public boolean supportLabelSnap(Graphics aGraphics, ILcdGXYContext aGXYContext)
ILcdGXYLabelPainter2
Returns whether this label painter supports snapping for the label specified by
setObject
, setLabelIndex
and setSubLabelIndex
,
considering the given ILcdGXYContext
instance. 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.
supportLabelSnap
in interface ILcdGXYLabelPainter2
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.true
if this label painter supports snapping for the specified label.labelSnapTarget
public Object labelSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)
ILcdGXYLabelPainter2
Object
that can be used as snapping target when graphically editing
another Object
or label than the one this ILcdGXYLabelPainter2 represents. The
returned Object
can be the Object
this ILcdGXYLabelPainter2
represents or any other (e.g. an ILcdPoint
if getObject() is an
ILcdPointList
).labelSnapTarget
in interface ILcdGXYLabelPainter2
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.Object
that can be used as snapping target when graphically editing
another Object
or label than the one this ILcdGXYLabelPainter2 represents
(returned by getObject()). This object can be null
.public Cursor getLabelCursor(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext)
ILcdGXYLabelPainter2
Cursor
to indicate the type of editing aMode
and
aGXYContext
.getLabelCursor
in interface ILcdGXYLabelPainter2
aGraphics
- The Graphics
instance on which the label is painted.aMode
- The mode to consider. See ILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int,
ILcdGXYContext)
for more information.aGXYContext
- The ILcdGXYContext
containing extra information, such as the
layer, the view and the mouse position.Cursor
to indicate the type of editing aMode
and
aGXYContext
. Returns null
if no particular
Cursor
is required.public String getDisplayName()
getDisplayName
in interface ILcdGXYLabelPainter2
ILcdGXYLabelPainter2