@Deprecated public class TLcdGXYViewLabelPainter extends Object implementsILcdGXYViewLabelPainter
label painter
.
It tries to place all labels one by one, and when a label cannot be placed without overlap, it
is omitted. If a sublabel of a label is dropped, all the sublabels of that label are dropped.
The user can control the quality versus the labeling speed through the
properties fineTuning, overLappingAllowed and allowedCluttering.
Note that this painter does not know of a layer's TLcdGXYLayer.setSelectionLabeled(boolean)
property.
See setSelectionLabeled(boolean)
instead.
It is recommended to use an implementation of
ILcdGXYViewLabelPlacer
instead,
because it offers better decluttering behavior, more algorithm choices, support for
asynchronous
label placement, and easier customization. In particular,
TLcdGXYLabelPainterLocationLabelingAlgorithm
has behavior equivalent to this view label painter.Modifier and Type | Class and Description |
---|---|
static class |
TLcdGXYViewLabelPainter.Quality
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
static TLcdGXYViewLabelPainter.Quality |
HIGH
Deprecated.
|
static TLcdGXYViewLabelPainter.Quality |
LOW
Deprecated.
|
ALL, SELECTION
Constructor and Description |
---|
TLcdGXYViewLabelPainter()
Deprecated.
|
TLcdGXYViewLabelPainter(TLcdGXYViewLabelPainter aGXYViewLabelPainter)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Deprecated.
Redefines
Object.clone to make it public. |
double |
getAllowedCluttering()
Deprecated.
allowedCluttering defines the fraction (a double located between 0 and 1 )
of the area (pixels) that the labels
may occupy. |
int |
getForcedPaintingThresholdPriority()
Deprecated.
Returns the threshold priority for forced label painting.
|
ILcdGXYLabelPriorityProvider |
getLabelPriorityProvider()
Deprecated.
Returns the
ILcdGXYLabelPriorityProvider that is used by this label painter. |
TLcdGXYViewLabelPainter.Quality |
getQuality()
Deprecated.
Returns the quality of the placement of the labels.
|
void |
invalidate()
Deprecated.
Invalidate any stored information about label locations in order to
recalculate the label positions.
|
boolean |
isFineTuning()
Deprecated.
fineTuning determines whether to apply fine grain (thus more time consuming)
label placement algorithms.
|
boolean |
isReusePreviousLocation()
Deprecated.
Use a layer implementing ILcdGXYEditableLabelsLayer instead. ALcdLabelLocations is more flexible
and its default implementation automatically removes locations for removed objects.
|
boolean |
isSelectionLabeled()
Deprecated.
|
boolean |
isSomewhatOverlapping()
Deprecated.
somewhatOverlapping determines whether the labels may overlap a bit, thus allowing
for more labels to be placed.
|
void |
paintLabel(Graphics aGraphics,
Enumeration aGXYLayerEnumeration,
ILcdGXYView aGXYView,
int aViewLabelPainterMode)
Deprecated.
The implementation of this method shall define how to paint the labels of all the objects in
the various
ILcdGXYLayer of the given Enumeration, on the given
ILcdGXYView , in the given mode. |
void |
paintLabel(Graphics aGraphics,
ILcdGXYView aGXYView,
int aViewLabelPainterMode)
Deprecated.
The implementation of this method shall define how to paint the labels of all the objects in
the various
ILcdGXYLayer of the given ILcdGXYView , in the given mode. |
void |
setAllowedCluttering(double aCluttering)
Deprecated.
allowedCluttering defines the fraction (a double located between 0 and 1 )
of the area (pixels) that the labels
may occupy. |
void |
setFineTuning(boolean aFineTune)
Deprecated.
fineTuning determines whether to apply fine grain (thus more time consuming)
label placement algorithms.
|
void |
setForcedPaintingThresholdPriority(int aPriority)
Deprecated.
Sets the threshold priority for forced label painting.
|
void |
setLabelPriorityProvider(ILcdGXYLabelPriorityProvider aLabelPriorityProvider)
Deprecated.
Sets the
ILcdGXYLabelPriorityProvider to be used by this label painter. |
void |
setQuality(TLcdGXYViewLabelPainter.Quality aQuality)
Deprecated.
Sets the quality of the algorithm to place the labels.
|
void |
setReusePreviousLocation(boolean aReusePreviousLocation)
Deprecated.
Use a layer implementing ILcdGXYEditableLabelsLayer instead. ALcdLabelLocations is more flexible
and its default implementation automatically removes locations for removed objects.
|
void |
setSelectionLabeled(boolean aSelectionLabeled)
Deprecated.
Determines whether an object should be labeled regardless of whether the label was visible before.
|
void |
setSomewhatOverlapping(boolean aOverlap)
Deprecated.
somewhatOverlapping determines whether the labels may overlap a bit, thus allowing
for more labels to be placed.
|
public static final TLcdGXYViewLabelPainter.Quality LOW
public static final TLcdGXYViewLabelPainter.Quality HIGH
public TLcdGXYViewLabelPainter()
public TLcdGXYViewLabelPainter(TLcdGXYViewLabelPainter aGXYViewLabelPainter)
public TLcdGXYViewLabelPainter.Quality getQuality()
setQuality(com.luciad.view.gxy.TLcdGXYViewLabelPainter.Quality)
public void setQuality(TLcdGXYViewLabelPainter.Quality aQuality)
aQuality
- getQuality()
public void paintLabel(Graphics aGraphics, ILcdGXYView aGXYView, int aViewLabelPainterMode)
ILcdGXYViewLabelPainter
ILcdGXYLayer
of the given ILcdGXYView
, in the given mode.
Here one can implement various smart algorithms to check whether or not to paint a label at a
certain location.
If any layer for which labels are painted is an ILcdGXYEditableLabelsLayer
,
this method should inform the ALcdLabelLocations
associated with that layer which
labels have been drawn and which haven't been.
paintLabel
in interface ILcdGXYViewLabelPainter
aGraphics
- The Graphics
instance on which to paint the
labels.aGXYView
- The view for which to paint the labels. If labels are drawn for
a layer that is an instance of ILcdGXYEditableLabelsLayer
,
its ALcdLabelLocations instance should be informed of which
labels have been drawn and which haven't been.aViewLabelPainterMode
- Determines which labels should be drawn. Should be one of
ILcdGXYViewLabelPainter.ALL
or
ILcdGXYViewLabelPainter.SELECTION
ILcdGXYEditableLabelsLayer
,
ALcdLabelLocations.setPainted(java.lang.Object, int, int, com.luciad.view.ILcdView, boolean, int)
public void paintLabel(Graphics aGraphics, Enumeration aGXYLayerEnumeration, ILcdGXYView aGXYView, int aViewLabelPainterMode)
ILcdGXYViewLabelPainter
ILcdGXYLayer
of the given Enumeration, on the given
ILcdGXYView
, in the given mode. Here one can implement various smart algorithms to
check whether or not to paint a label at a certain location.
If any layer for which labels are painted is an ILcdGXYEditableLabelsLayer
,
this method should inform the ALcdLabelLocations
associated with that layer which
labels have been drawn and which haven't been.
paintLabel
in interface ILcdGXYViewLabelPainter
aGraphics
- The Graphics
instance on which to paint the
labels.aGXYLayerEnumeration
- Only the labels for the layers contained in this
Enumeration
will be drawn.aGXYView
- The ILcdGXYView instance for which to paint the layers.aViewLabelPainterMode
- Determines which labels should be drawn. Should be one of
ILcdGXYViewLabelPainter.ALL
or
ILcdGXYViewLabelPainter.SELECTION
ILcdGXYEditableLabelsLayer
,
ALcdLabelLocations.setPainted(java.lang.Object, int, int, com.luciad.view.ILcdView, boolean, int)
public boolean isFineTuning()
true
if fineTuning is true
, else false
is returned.public void setFineTuning(boolean aFineTune)
public boolean isSomewhatOverlapping()
true
if somewhatOverlapping is true
, else false
is returned.public void setSomewhatOverlapping(boolean aOverlap)
public double getAllowedCluttering()
allowedCluttering
defines the fraction (a double located between 0 and 1 )
of the area (pixels) that the labels
may occupy.
allowedCluttering
equal to zero means no labels may be drawn.
allowedCluttering
equal to one allows the view to be filled by labels.public void setAllowedCluttering(double aCluttering)
allowedCluttering
defines the fraction (a double located between 0 and 1 )
of the area (pixels) that the labels
may occupy.
allowedCluttering
equal to zero means no labels may be drawn.
allowedCluttering
equal to one allows the view to be filled by labels.
Sets allowedCluttering
to aCluttering.@Deprecated public void setReusePreviousLocation(boolean aReusePreviousLocation)
reusePreviousLocation
determines whether the same relative location for a label
should be used if there is one available.
Note:previous locations are cached for objects, without reference to the objects model. Therefore if
an object is removed from the model, the view label painter is not notified automatically. Use the method
invalidate()
to clear the cached positions of all objects.aReusePreviousLocation
- true to cache relative label position.isReusePreviousLocation()
,
invalidate()
@Deprecated public boolean isReusePreviousLocation()
setReusePreviousLocation(boolean)
public void setSelectionLabeled(boolean aSelectionLabeled)
aSelectionLabeled
- If false, an object will be labeled in selected mode only if
it has a location in default mode. If true, a selected object
will always be labeled even if this would cause overlap.public boolean isSelectionLabeled()
setSelectionLabeled(boolean)
public void setLabelPriorityProvider(ILcdGXYLabelPriorityProvider aLabelPriorityProvider)
ILcdGXYLabelPriorityProvider
to be used by this label painter.
If null
, no priorities will be used (default behavior).aLabelPriorityProvider
- the ILcdGXYLabelPriorityProvider
to be used.getLabelPriorityProvider()
public ILcdGXYLabelPriorityProvider getLabelPriorityProvider()
ILcdGXYLabelPriorityProvider
that is used by this label painter.ILcdGXYLabelPriorityProvider
that is used.setLabelPriorityProvider(ILcdGXYLabelPriorityProvider)
public void setForcedPaintingThresholdPriority(int aPriority)
-1
, in which case no forced painting is done.aPriority
- the threshold priority for forced label painting.getForcedPaintingThresholdPriority()
public int getForcedPaintingThresholdPriority()
setForcedPaintingThresholdPriority(int)
public void invalidate()
reusePreviousLocation
if it is true.public Object clone()
ILcdGXYViewLabelPainter
Object.clone
to make it public.clone
in interface ILcdGXYViewLabelPainter
clone
in class Object