Class TLcdGXYInteractiveLabelsController

All Implemented Interfaces:
ILcdUndoableSource, ILcdAWTEventListener, ILcdStatusSource, ILcdGXYChainableController, ILcdGXYController, KeyListener, MouseListener, MouseMotionListener, Serializable, EventListener

public class TLcdGXYInteractiveLabelsController extends ALcdGXYSmartController implements ILcdGXYChainableController
Controller that shows a Component when the mouse moves over a label, to make the label interactive.

Setting up the controller

To set up interactive labels, first configure regular labeling. Next, implement an ALcdGXYInteractiveLabelProvider that returns the interactive version of the label. Make sure to call fireInteractionStartedEvent in the provide method.

Showing and hiding interactive labels

By default, the provider is shown when the mouse moves over a label. In order to start, stop or cancel the interaction manually, the used ALcdGXYInteractiveLabelProvider can be called directly. This controller will adjust its state automatically to the state of the interactive label provider.

Using your own label painter

This controller works by setting the 'interactive label' property of the labels TLcdLabelLocation to true. So in order for this controller to work, label painters should respect this property. They can do this by
  • painting the 'interactive' label instead of the 'regular' label.
  • not painting the swing components of the interactive label. These should not be painted by the label painter since this controller is responsible for showing the interactive label. The painter should paint the rest of the label (e.g. the pin) however.

Additional prerequisites

  • Because the functionality works through TLcdLabelLocation object, it will only work for layers implementing ILcdGXYEditableLabelsLayer and label painters implementing ILcdGXYLabelPainter2
  • Because the functionality is not coupled to the label painter implementation, this controller does not know the effects of temporary editing behavior (see ILcdGXYLabelPainter2's TRANSLATING, RESHAPING, and CREATING modes), Therefore, it requires instant editing in order to function correctly (see TLcdGXYEditController2.setInstantEditing(boolean)).
Since:
11.0
See Also: