Interface ILcdGXYViewLabelPlacer
- All Superinterfaces:
Cloneable
,ILcdCloneable
- All Known Implementing Classes:
TLcdGXYAsynchronousLabelPlacer
,TLcdGXYCompositeViewLabelPlacer
,TLcdGXYLabelPlacer
ILcdGXYView
.
ILcdGXYViewLabelPlacer
can manage the free screen space and avoid that the
labels stemming from objects in different ILcdGXYLayer
s overlap. The label painters
of the objects have the knowledge regarding painting the label(s)
of a given object.
The ILcdGXYViewLabelPlacer
has knowledge about the free space in the view.
Notes:
- The implementations of this class should set the label locations of the placed labels and
mark them as painted in the layers
ALcdLabelLocations
. This way the layer knows which labels need to be painted. Therefore the layers passed in this interface should beILcdGXYEditableLabelsLayer
s. - All methods of this interface should be called on the AWT-thread.
- Since:
- 10.1
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A callback interface used byILcdGXYViewLabelPlacer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusListener
(ILcdStatusListener aListener) Adds the given status listener to this view label placer.void
placeLabels
(Graphics aGraphics, ILcdGXYView aGXYView, ILcdGXYViewLabelPlacer.ViewLabelPlacerCallback aCallback) The implementation of this method shall define how to place the labels of all objects in the variousILcdGXYLayer
s of the givenILcdGXYView
.void
placeLabels
(Graphics aGraphics, List<ILcdGXYLayer> aGXYLayers, ILcdGXYView aGXYView, ILcdGXYViewLabelPlacer.ViewLabelPlacerCallback aCallback) The implementation of this method shall define how to place the labels of all objects in the variousILcdGXYLayer
s from the givenList
.void
removeStatusListener
(ILcdStatusListener aListener) Removes the given status listener from this view label placer.Methods inherited from interface com.luciad.util.ILcdCloneable
clone
-
Method Details
-
placeLabels
void placeLabels(Graphics aGraphics, ILcdGXYView aGXYView, ILcdGXYViewLabelPlacer.ViewLabelPlacerCallback aCallback) The implementation of this method shall define how to place the labels of all objects in the variousILcdGXYLayer
s of the givenILcdGXYView
. Here one can implement or use various smart algorithms to check whether or not to place a label at a certain location.Layers for which labels are placed should be
ILcdGXYEditableLabelsLayer
s. This method should then inform theALcdLabelLocations
associated with that layer which labels were placed, and where they were placed.This method should only be called once every time the view is invalidated.
- Parameters:
aGraphics
- The currentGraphics
instance.aGXYView
- The view for which to place the labels.aCallback
- Will be invoked when labels are updated, and when the label placing has ended.- See Also:
-
placeLabels
void placeLabels(Graphics aGraphics, List<ILcdGXYLayer> aGXYLayers, ILcdGXYView aGXYView, ILcdGXYViewLabelPlacer.ViewLabelPlacerCallback aCallback) The implementation of this method shall define how to place the labels of all objects in the variousILcdGXYLayer
s from the givenList
. Here one can implement or use various smart algorithms to check whether or not to place a label at a certain location.Layers for which labels are placed should be
ILcdGXYEditableLabelsLayer
s. This method should then inform theALcdLabelLocations
associated with that layer which labels were placed, and where they were placed.This method should only be called once every time the view is invalidated.
- Parameters:
aGraphics
- The currentGraphics
instance.aGXYLayers
- Only the labels for the layers in thisList
will be placed.aGXYView
- The view for which to place the labels.aCallback
- Will be invoked when labels are updated, and when the label placing has ended.- See Also:
-
addStatusListener
Adds the given status listener to this view label placer. Whenever an event occurs concerning the labeling process, this listener is notified.- Parameters:
aListener
- a labeling listener.
-
removeStatusListener
Removes the given status listener from this view label placer. After calling this method, the given listener will not be notified anymore.- Parameters:
aListener
- a labeling listener.
-