Class TLspInteractiveLabelsController

java.lang.Object
com.luciad.view.lightspeed.controller.ALspController
com.luciad.view.lightspeed.controller.manipulation.TLspInteractiveLabelsController
All Implemented Interfaces:
ILcdAWTEventListener, ILspController

public class TLspInteractiveLabelsController extends ALspController

This controller provides the option of showing a java.awt.Component when the mouse moves over a label. This enables more extensive manipulation of the labeled object.

In order to start, stop or cancel the interaction manually, the used ALspInteractiveLabelProvider can be called directly. This controller will adjust its state automatically to the state of the interactive label provider.

When a label is edited interactively, its object is set to 'edited'. This controller also paints the edited labels. In order to make sure that only the swing component used in the controller is displayed, the used label painter should not paint interactively edited label. It should however paint other parts of the label that can't be painted by the controller itself. E.g. the pin.

This controller has the following pre-requisites:

Notes:
  • When using this controller, it is advised to use ALspSwingLabelStyler, initialized with the same ALspInteractiveLabelProvider as this controller.
  • When using this controller in a controller chain, it should come before the select and navigate controllers, but after the edit controller. Not doing the latter may result in labels not moving reliably.
Since:
2012.0
  • Constructor Details

    • TLspInteractiveLabelsController

      public TLspInteractiveLabelsController(ALspInteractiveLabelProvider aInteractiveLabelProvider)
      Creates a new interactive labels controller using the given interactive label provider.
      Parameters:
      aInteractiveLabelProvider - an interactive label provider. Should not be null.
  • Method Details

    • isSelectObjectDuringInteraction

      public boolean isSelectObjectDuringInteraction()
      Returns if the object is automatically selected during interaction.
      Returns:
      if the object is automatically selected during interaction.
      See Also:
    • setSelectObjectDuringInteraction

      public void setSelectObjectDuringInteraction(boolean aSelectObjectDuringInteraction)
      Sets if the object should automatically be selected during interaction.

      The default value is true.

      Parameters:
      aSelectObjectDuringInteraction - true to automatically select the object during interaction.
      See Also:
    • isActivateOnObjectHover

      public boolean isActivateOnObjectHover()
      Returns if interactive labels are also activated when hovering over the domain object.
      Returns:
      if interactive labels are also activated when hovering over the domain object.
      See Also:
    • setActivateOnObjectHover

      public void setActivateOnObjectHover(boolean aActivateOnObjectHover)

      Sets if labels should start interaction when hovering over their domain object, so not only when hovering over the label itself. Note that this setting only works for domain objects with exactly one label that can be made interactive.

      The default value is false.

      Parameters:
      aActivateOnObjectHover - true to start label interaction when hovering the mouse over a domain object.
      See Also:
    • startInteractionImpl

      protected void startInteractionImpl(ILspView aView)
      Description copied from class: ALspController
      The specific implementation of startInteraction for this controller.
      Overrides:
      startInteractionImpl in class ALspController
      Parameters:
      aView - the view to start interaction with.
    • terminateInteractionImpl

      protected void terminateInteractionImpl(ILspView aView)
      Description copied from class: ALspController
      The specific implementation of terminateInteraction for this controller.
      Overrides:
      terminateInteractionImpl in class ALspController
      Parameters:
      aView - the view to terminate interaction with.
    • handleAWTEventImpl

      public AWTEvent handleAWTEventImpl(AWTEvent aAWTEvent)
      Description copied from class: ALspController
      Called by handleAWTEvent. Returns null when the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen with TLcdTouchEvents). When the controller did not use the given event, it is returned unaltered.
      Specified by:
      handleAWTEventImpl in class ALspController
      Parameters:
      aAWTEvent - the event to be handled.
      Returns:
      null when the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
    • paintImpl

      protected TLspPaintProgress paintImpl(ILcdGLDrawable aGLDrawable, ILspView aView, TLspPaintPhase aPaintPhase)
      Description copied from class: ALspController
      The specific implementation of paint for this controller.
      Overrides:
      paintImpl in class ALspController
      Parameters:
      aGLDrawable - the drawable that should be painted on
      aView - the view that is painted on
      aPaintPhase - the current paint phase
      Returns:
      whether or not the painting was finished