Class TLspZoomController
java.lang.Object
com.luciad.view.lightspeed.controller.ALspController
com.luciad.view.lightspeed.controller.navigation.TLspZoomController
- All Implemented Interfaces:
ILcdAWTEventListener,ILspController
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 Summary
ConstructorsConstructorDescriptionCreates a new TLspZoomController with a default zoom controller model. -
Method Summary
Modifier and TypeMethodDescriptionReturns the cursor to be used while zooming (while the triggering mouse button is pressed).doubleReturns 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.doubleReturns the mouse wheel zoom factor used to handle mouse wheel movements.Returns the scale level provider used for ctrl-zoom, if enabled.Returns the icon that is used to denote to which spot the view is zooming.handleAWTEventImpl(AWTEvent aEvent) Called byhandleAWTEvent.handleFXEventImpl(Event aEvent) Called byhandleFXEvent.booleanReturns if snapping to scale levels is enabled when holding the control key.voidsetCursorWhileZooming(Cursor aCursor) Sets the cursor to be used while zooming (while the triggering mouse button is pressed).voidsetEnableSnapToScaleLevels(boolean aEnableSnapToScaleLevels) Enables or disables snapping to scale levels when holding the control key.voidsetMouseWheelZoomExaggeration(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.voidsetMouseWheelZoomFactor(double aMouseWheelZoomFactor) Sets the mouse wheel zoom factor used to handle mouse wheel movements.voidsetScaleLevelProvider(ILspScaleLevelProvider aScaleLevelProvider) Sets the scale level provider used for ctrl-zoom.voidsetZoomSpotIcon(ILcdAnchoredIcon aZoomSpotIcon) Returns the icon that is used to denote to which spot the view is zooming.voidstartInteraction(ILspView aView) Called to start interacting with the controller.voidterminateInteraction(ILspView aView) Terminates interaction with 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, paint, paintImpl, registerViewPropertyNameForReset, removePropertyChangeListener, removeStatusListener, setAWTFilter, setCursor, setFXCursor, setFXFilter, setIcon, setName, setShortDescription, startInteractionImpl, terminateInteractionImpl
-
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 than1.0. This value controls the change in scale. E.g. if this value is2.0and the current scale is1.0, then the scale after zooming in will be2.0. The scale after zooming out will be0.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-trueto 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
Returns the scale level provider used for ctrl-zoom, if enabled.- Returns:
- the scale level provider used for ctrl-zoom.
- See Also:
-
startInteraction
Description copied from class:ALspControllerCalled to start interacting with the controller. This automatically happens when setting the controller on the view usingILspView.setController(com.luciad.view.lightspeed.controller.ILspController). This implementation sends out a status event based on theshort description. It also callsstartInteractionon the next controller. OverridestartInteractionImplif you want to add your own behavior to this controller.- Specified by:
startInteractionin interfaceILspController- Overrides:
startInteractionin classALspController- Parameters:
aView- the view the controller operates on
-
terminateInteraction
Description copied from class:ALspControllerTerminates interaction with this controller. This automatically happens when setting a different controller on the view usingILspView.setController(com.luciad.view.lightspeed.controller.ILspController). This implementation also callsterminateInteractionon the next controller. OverrideterminateInteractionImplif you want to add your own behavior to this controller.- Specified by:
terminateInteractionin interfaceILspController- Overrides:
terminateInteractionin classALspController- Parameters:
aView- the view the controller was operating on
-
handleAWTEventImpl
Description copied from class:ALspControllerCalled byhandleAWTEvent. Returnsnullwhen the controller consumed the event or a partially consumed event when the controller partially consumed the event (which could happen withTLcdTouchEvents). When the controller did not use the given event, it is returned unaltered.- Specified by:
handleAWTEventImplin classALspController- Parameters:
aEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-
handleFXEventImpl
Description copied from class:ALspControllerCalled byhandleFXEvent. Returnsnullwhen the controller consumed the event. When the controller did not use the given event, it is returned unaltered.- Overrides:
handleFXEventImplin classALspController- Parameters:
aEvent- the event to be handled.- Returns:
nullwhen the input event was consumed, the (possibly modified) input event when it was (partially) consumed.
-
setZoomSpotIcon
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
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
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
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:
-