Class TLspInteractiveLabelsController
- All Implemented Interfaces:
ILcdAWTEventListener
,ILspController
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:
- This controller only works for layers that are
ILspInteractivePaintableLayer
. - This controller only works for AWT views: see
ILspAWTView
.
- When using this controller, it is advised to use
ALspSwingLabelStyler
, initialized with the sameALspInteractiveLabelProvider
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 Summary
ConstructorDescriptionTLspInteractiveLabelsController
(ALspInteractiveLabelProvider aInteractiveLabelProvider) Creates a new interactive labels controller using the given interactive label provider. -
Method Summary
Modifier and TypeMethodDescriptionhandleAWTEventImpl
(AWTEvent aAWTEvent) Called byhandleAWTEvent
.boolean
Returns if interactive labels are also activated when hovering over the domain object.boolean
Returns if the object is automatically selected during interaction.protected TLspPaintProgress
paintImpl
(ILcdGLDrawable aGLDrawable, ILspView aView, TLspPaintPhase aPaintPhase) The specific implementation ofpaint
for this controller.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.void
setSelectObjectDuringInteraction
(boolean aSelectObjectDuringInteraction) Sets if the object should automatically be selected during interaction.protected void
startInteractionImpl
(ILspView aView) The specific implementation ofstartInteraction
for this controller.protected void
terminateInteractionImpl
(ILspView aView) The specific implementation ofterminateInteraction
for this controller.Methods inherited from class com.luciad.view.lightspeed.controller.ALspController
addPropertyChangeListener, addStatusListener, appendController, firePropertyChange, fireStatusEvent, getAWTFilter, getCursor, getFXCursor, getFXFilter, getIcon, getLayered, getName, getNextController, getShortDescription, getView, handleAWTEvent, handleFXEvent, handleFXEventImpl, paint, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteraction, terminateInteraction
-
Constructor Details
-
TLspInteractiveLabelsController
Creates a new interactive labels controller using the given interactive label provider.- Parameters:
aInteractiveLabelProvider
- an interactive label provider. Should not benull
.
-
-
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 istrue
.- 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
Description copied from class:ALspController
The specific implementation ofstartInteraction
for this controller.- Overrides:
startInteractionImpl
in classALspController
- Parameters:
aView
- the view to start interaction with.
-
terminateInteractionImpl
Description copied from class:ALspController
The specific implementation ofterminateInteraction
for this controller.- Overrides:
terminateInteractionImpl
in classALspController
- Parameters:
aView
- the view to terminate interaction with.
-
handleAWTEventImpl
Description copied from class:ALspController
Called byhandleAWTEvent
. Returnsnull
when the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen withTLcdTouchEvent
s). When the controller did not use the given event, it is returned unaltered.- Specified by:
handleAWTEventImpl
in classALspController
- 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 ofpaint
for this controller.- Overrides:
paintImpl
in classALspController
- Parameters:
aGLDrawable
- the drawable that should be painted onaView
- the view that is painted onaPaintPhase
- the current paint phase- Returns:
- whether or not the painting was finished
-