Class TLspZoomController

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

public class TLspZoomController extends ALspController
Allows the user to zoom in and out on a view by clicking and dragging the mouse. Rolling the mouse wheel also changes the zoom level and additionally uses an animated transition to do so. Pressing ctrl while rolling the mouse wheel snaps the a set of scale levels, returned by getScaleLevelProvider.

In 3D, the controller navigates around and toward the object that is under the mouse. This allows convenient navigation around tall or air-borne objects. For instance, air tracks or airspaces.

Since:
2012.0
  • Constructor Details

    • TLspZoomController

      public TLspZoomController()
      Creates a new TLspZoomController with a default zoom controller model.
  • Method Details

    • getMouseWheelZoomFactor

      public double getMouseWheelZoomFactor()
      Returns the mouse wheel zoom factor used to handle mouse wheel movements.
      Returns:
      the mouse wheel zoom factor.
      See Also:
    • setMouseWheelZoomFactor

      public void setMouseWheelZoomFactor(double aMouseWheelZoomFactor)
      Sets the mouse wheel zoom factor used to handle mouse wheel movements. Typically this is a value (strictly) larger than 1.0. This value controls the change in scale. E.g. if this value is 2.0 and the current scale is 1.0, then the scale after zooming in will be 2.0. The scale after zooming out will be 0.5.

      By default this value is 1.1.

      Note: the zoom factor will also be influenced by MouseWheelEvent.getScrollAmount().

      Parameters:
      aMouseWheelZoomFactor - the mouse wheel zoom factor.
    • getMouseWheelZoomExaggeration

      public double getMouseWheelZoomExaggeration()
      Returns the zoom exaggeration sensitivity which is used to determine the magnitude of the speed-up effect that occurs when rapidly zooming in or out using the mouse wheel.
      Returns:
      the zoom exaggeration sensitivity.
      See Also:
    • setMouseWheelZoomExaggeration

      public void setMouseWheelZoomExaggeration(double aMouseWheelZoomExaggeration)

      Sets the zoom exaggeration which is used to determine the magnitude of the speed-up effect that occurs when rapidly zooming in or out using the mouse wheel. The zoom exaggeration sensitivity allows users to tweak the sensitivity of the speed-up effect without having to alter any algorithms.

      Typically this is a value larger than or equal to 1.0. By default this value is 1.0. When using a larger value, zooming in/out will accelerate faster when rapidly using the mouse wheel.

      Parameters:
      aMouseWheelZoomExaggeration - the zoom exaggeration sensitivity.
    • setEnableSnapToScaleLevels

      public void setEnableSnapToScaleLevels(boolean aEnableSnapToScaleLevels)
      Enables or disables snapping to scale levels when holding the control key. If enabled, the configured scale level provider will be used to determine the scale to snap to.
      Parameters:
      aEnableSnapToScaleLevels - true to enable snapping to scale levels.
      See Also:
    • isEnableSnapToScaleLevels

      public boolean isEnableSnapToScaleLevels()
      Returns if snapping to scale levels is enabled when holding the control key.
      Returns:
      if snapping to scale levels is enabled.
      See Also:
    • getScaleLevelProvider

      public ILspScaleLevelProvider getScaleLevelProvider()
      Returns the scale level provider used for ctrl-zoom, if enabled.
      Returns:
      the scale level provider used for ctrl-zoom.
      See Also:
    • setScaleLevelProvider

      public void setScaleLevelProvider(ILspScaleLevelProvider aScaleLevelProvider)

      Sets the scale level provider used for ctrl-zoom.

      By default, TLspRasterBasedScaleLevelProvider is used.

      When an empty array, or null is returned, no zooming will be performed.

      Parameters:
      aScaleLevelProvider - the scale level provider used for ctrl-zoom.
      See Also:
    • startInteraction

      public void startInteraction(ILspView aView)
      Description copied from class: ALspController
      Called to start interacting with the controller. This automatically happens when setting the controller on the view using ILspView.setController(com.luciad.view.lightspeed.controller.ILspController).

      This implementation sends out a status event based on the short description. It also calls startInteraction on the next controller. Override startInteractionImpl if you want to add your own behavior to this controller.

      Specified by:
      startInteraction in interface ILspController
      Overrides:
      startInteraction in class ALspController
      Parameters:
      aView - the view the controller operates on
    • terminateInteraction

      public void terminateInteraction(ILspView aView)
      Description copied from class: ALspController
      Terminates interaction with this controller. This automatically happens when setting a different controller on the view using ILspView.setController(com.luciad.view.lightspeed.controller.ILspController).

      This implementation also calls terminateInteraction on the next controller. Override terminateInteractionImpl if you want to add your own behavior to this controller.

      Specified by:
      terminateInteraction in interface ILspController
      Overrides:
      terminateInteraction in class ALspController
      Parameters:
      aView - the view the controller was operating on
    • handleAWTEventImpl

      public AWTEvent handleAWTEventImpl(AWTEvent aEvent)
      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:
      aEvent - the event to be handled.
      Returns:
      null when the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
    • handleFXEventImpl

      public Event handleFXEventImpl(Event aEvent)
      Description copied from class: ALspController
      Called by handleFXEvent. Returns null when the controller consumed the event. When the controller did not use the given event, it is returned unaltered.
      Overrides:
      handleFXEventImpl in class ALspController
      Parameters:
      aEvent - the event to be handled.
      Returns:
      null when the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
    • setZoomSpotIcon

      public void setZoomSpotIcon(ILcdAnchoredIcon aZoomSpotIcon)
      Returns the icon that is used to denote to which spot the view is zooming.
      Parameters:
      aZoomSpotIcon - The icon which will be used to denote to which spot the view is zooming.
    • getZoomSpotIcon

      public ILcdAnchoredIcon getZoomSpotIcon()
      Returns the icon that is used to denote to which spot the view is zooming.
      Returns:
      The icon that is used to denote to which spot the view is zooming.
    • getCursorWhileZooming

      public Cursor getCursorWhileZooming()
      Returns the cursor to be used while zooming (while the triggering mouse button is pressed). Note that this cursor is only used while zooming by dragging, not zooming by scrolling the mouse wheel.
      Returns:
      the zoom cursor
    • setCursorWhileZooming

      public void setCursorWhileZooming(Cursor aCursor)
      Sets the cursor to be used while zooming (while the triggering mouse button is pressed). Note that this cursor is only used while zooming by dragging, not zooming by scrolling the mouse wheel.
      Parameters:
      aCursor - the new Cursor to use.
      See Also: