Package com.luciad.view.gxy
Class TLcdGXYViewLabelPainter
java.lang.Object
com.luciad.view.gxy.TLcdGXYViewLabelPainter
- All Implemented Interfaces:
ILcdGXYViewLabelPainter
,Serializable
,Cloneable
Deprecated.
ILcdGXYViewLabelPlacer offers more powerful and flexible decluttering functionality
A greedy view label painter based on the label locations provided by
each label's
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.- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdGXYViewLabelPainter.Quality
Deprecated.static final TLcdGXYViewLabelPainter.Quality
Deprecated.Fields inherited from interface com.luciad.view.gxy.ILcdGXYViewLabelPainter
ALL, SELECTION
-
Constructor Summary
ConstructorDescriptionDeprecated.TLcdGXYViewLabelPainter
(TLcdGXYViewLabelPainter aGXYViewLabelPainter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Deprecated.RedefinesObject.clone
to make it public.double
Deprecated.allowedCluttering
defines the fraction (a double located between 0 and 1 ) of the area (pixels) that the labels may occupy.int
Deprecated.Returns the threshold priority for forced label painting.Deprecated.Returns theILcdGXYLabelPriorityProvider
that is used by this label painter.Deprecated.Returns the quality of the placement of the labels.void
Deprecated.Invalidate any stored information about label locations in order to recalculate the label positions.boolean
Deprecated.fineTuning determines whether to apply fine grain (thus more time consuming) label placement algorithms.boolean
Deprecated.Use a layer implementing ILcdGXYEditableLabelsLayer instead.boolean
Deprecated.boolean
Deprecated.somewhatOverlapping determines whether the labels may overlap a bit, thus allowing for more labels to be placed.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 variousILcdGXYLayer
of the givenILcdGXYView
, in the given mode.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 variousILcdGXYLayer
of the given Enumeration, on the givenILcdGXYView
, 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 theILcdGXYLabelPriorityProvider
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.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.
-
Field Details
-
LOW
Deprecated. -
HIGH
Deprecated.
-
-
Constructor Details
-
TLcdGXYViewLabelPainter
public TLcdGXYViewLabelPainter()Deprecated. -
TLcdGXYViewLabelPainter
Deprecated.
-
-
Method Details
-
getQuality
Deprecated.Returns the quality of the placement of the labels. Can be either LOW or HIGH.- Returns:
- the quality of the placement of the labels. Can be either LOW or HIGH.
- See Also:
-
setQuality
Deprecated.Sets the quality of the algorithm to place the labels. Accepted values are LOW and HIGH. The HIGH quality algorithm will place more labels without overlapping, while the LOW quality algorithm is faster. The default value is LOW.- Parameters:
aQuality
-- See Also:
-
paintLabel
Deprecated.Description copied from interface:ILcdGXYViewLabelPainter
The implementation of this method shall define how to paint the labels of all the objects in the variousILcdGXYLayer
of the givenILcdGXYView
, 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 theALcdLabelLocations
associated with that layer which labels have been drawn and which haven't been.- Specified by:
paintLabel
in interfaceILcdGXYViewLabelPainter
- Parameters:
aGraphics
- TheGraphics
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 ofILcdGXYEditableLabelsLayer
, 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 ofILcdGXYViewLabelPainter.ALL
orILcdGXYViewLabelPainter.SELECTION
- See Also:
-
paintLabel
public void paintLabel(Graphics aGraphics, Enumeration aGXYLayerEnumeration, ILcdGXYView aGXYView, int aViewLabelPainterMode) Deprecated.Description copied from interface:ILcdGXYViewLabelPainter
The implementation of this method shall define how to paint the labels of all the objects in the variousILcdGXYLayer
of the given Enumeration, on the givenILcdGXYView
, 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 theALcdLabelLocations
associated with that layer which labels have been drawn and which haven't been.- Specified by:
paintLabel
in interfaceILcdGXYViewLabelPainter
- Parameters:
aGraphics
- TheGraphics
instance on which to paint the labels.aGXYLayerEnumeration
- Only the labels for the layers contained in thisEnumeration
will be drawn.aGXYView
- The ILcdGXYView instance for which to paint the layers.aViewLabelPainterMode
- Determines which labels should be drawn. Should be one ofILcdGXYViewLabelPainter.ALL
orILcdGXYViewLabelPainter.SELECTION
- See Also:
-
isFineTuning
public boolean isFineTuning()Deprecated.fineTuning determines whether to apply fine grain (thus more time consuming) label placement algorithms.- Returns:
true
if fineTuning istrue
, elsefalse
is returned.
-
setFineTuning
public void setFineTuning(boolean aFineTune) Deprecated.fineTuning determines whether to apply fine grain (thus more time consuming) label placement algorithms. Sets fineTuning to aFineTune. -
isSomewhatOverlapping
public boolean isSomewhatOverlapping()Deprecated.somewhatOverlapping determines whether the labels may overlap a bit, thus allowing for more labels to be placed. The amount of overlap depends on the width and the height of the label. It varies between a few percent to up to twenty percent of the surface of the label.- Returns:
true
if somewhatOverlapping istrue
, elsefalse
is returned.
-
setSomewhatOverlapping
public void setSomewhatOverlapping(boolean aOverlap) Deprecated.somewhatOverlapping determines whether the labels may overlap a bit, thus allowing for more labels to be placed. The amount of overlap depends on the width and the height of the label. It varies between a few percent to up to twenty percent of the surface of the label. Sets somewhatOverlapping to aOverlap. -
getAllowedCluttering
public double getAllowedCluttering()Deprecated.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.- Returns:
- allowedCluttering.
-
setAllowedCluttering
public 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.allowedCluttering
equal to zero means no labels may be drawn.allowedCluttering
equal to one allows the view to be filled by labels. SetsallowedCluttering
to aCluttering. -
setReusePreviousLocation
Deprecated.Use a layer implementing ILcdGXYEditableLabelsLayer instead. ALcdLabelLocations is more flexible and its default implementation automatically removes locations for removed objects.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 methodinvalidate()
to clear the cached positions of all objects.- Parameters:
aReusePreviousLocation
- true to cache relative label position.- See Also:
-
isReusePreviousLocation
Deprecated.Use a layer implementing ILcdGXYEditableLabelsLayer instead. ALcdLabelLocations is more flexible and its default implementation automatically removes locations for removed objects.Returns whether relative positions for labels were cached.- Returns:
- true if relative positions for labels were cached.
- See Also:
-
setSelectionLabeled
public void setSelectionLabeled(boolean aSelectionLabeled) Deprecated.Determines whether an object should be labeled regardless of whether the label was visible before. If false, labels of selected objects are put in the same location as when the object was not selected. As a result the label of a selected object will not be shown if the object was not displayed in default mode. If true, selected labels will always be visible, but they will not be declutted.- Parameters:
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.
-
isSelectionLabeled
public boolean isSelectionLabeled()Deprecated.- See Also:
-
setLabelPriorityProvider
Deprecated.Sets theILcdGXYLabelPriorityProvider
to be used by this label painter. Ifnull
, no priorities will be used (default behavior).- Parameters:
aLabelPriorityProvider
- theILcdGXYLabelPriorityProvider
to be used.- See Also:
-
getLabelPriorityProvider
Deprecated.Returns theILcdGXYLabelPriorityProvider
that is used by this label painter.- Returns:
- the
ILcdGXYLabelPriorityProvider
that is used. - See Also:
-
setForcedPaintingThresholdPriority
public void setForcedPaintingThresholdPriority(int aPriority) Deprecated.Sets the threshold priority for forced label painting. The labels of objects with a priority value less than or equal to the threshold priority value will always be painted, even if the decluttering algorithm could not find any suitable place for the label. The default value is-1
, in which case no forced painting is done.- Parameters:
aPriority
- the threshold priority for forced label painting.- See Also:
-
getForcedPaintingThresholdPriority
public int getForcedPaintingThresholdPriority()Deprecated.Returns the threshold priority for forced label painting.- Returns:
- the threshold priority for forced label painting.
- See Also:
-
invalidate
public void invalidate()Deprecated.Invalidate any stored information about label locations in order to recalculate the label positions. To be used in cooperation with the propertyreusePreviousLocation
if it is true. -
clone
Deprecated.Description copied from interface:ILcdGXYViewLabelPainter
RedefinesObject.clone
to make it public.- Specified by:
clone
in interfaceILcdGXYViewLabelPainter
- Overrides:
clone
in classObject
-