NASA World Wind

gov.nasa.worldwind.view.firstperson
Class FlyViewInputHandler

java.lang.Object
  extended by gov.nasa.worldwind.awt.AbstractViewInputHandler
      extended by gov.nasa.worldwind.awt.BasicViewInputHandler
          extended by gov.nasa.worldwind.view.firstperson.FlyViewInputHandler
All Implemented Interfaces:
ViewInputHandler, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.beans.PropertyChangeListener, java.util.EventListener
Direct Known Subclasses:
FlyViewChangeInputActions.MyFlyViewInputHandler

public class FlyViewInputHandler
extends BasicViewInputHandler


Nested Class Summary
 class FlyViewInputHandler.ResetPitchActionListener
           
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.awt.BasicViewInputHandler
BasicViewInputHandler.HorizontalTransActionListener, BasicViewInputHandler.HorizTransMouseActionListener, BasicViewInputHandler.MoveToMouseActionListener, BasicViewInputHandler.ResetHeadingActionListener, BasicViewInputHandler.ResetHeadingPitchActionListener, BasicViewInputHandler.RotateActionListener, BasicViewInputHandler.RotateMouseActionListener, BasicViewInputHandler.StopViewActionListener, BasicViewInputHandler.VerticalTransActionListener, BasicViewInputHandler.VertTransMouseActionListener, BasicViewInputHandler.VertTransMouseWheelActionListener
 
Field Summary
protected static double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE
           
protected static double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE_SLOW
           
protected static double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE
           
protected static double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE_SLOW
           
protected static double DEFAULT_KEY_TRANSLATE_SMOOTHING_VALUE
           
protected static double DEFAULT_KEY_VERTICAL_TRANSLATE_MAX_VALUE
           
protected static double DEFAULT_KEY_VERTICAL_TRANSLATE_MIN_VALUE
           
protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MAX_VALUE
           
protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MIN_VALUE
           
protected static double DEFAULT_MOUSE_ROTATE_MAX_VALUE
           
protected static double DEFAULT_MOUSE_ROTATE_MIN_VALUE
           
protected static double DEFAULT_MOUSE_VERTICAL_TRANSLATE_MAX_VALUE
           
protected static double DEFAULT_MOUSE_VERTICAL_TRANSLATE_MIN_VALUE
           
protected static double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX
           
protected static double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX_OSX
           
protected static double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN
           
protected static double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN_OSX
           
static ViewInputAttributes.ActionAttributes.KeyAction[] resetPitchEvents
           
 
Fields inherited from class gov.nasa.worldwind.awt.AbstractViewInputHandler
GENERATE_EVENTS, keyActionMap, keyModsActionMap, modifierList, mouseActionMap, mouseModsActionMap, mouseWheelModsActionMap, NUM_MODIFIERS, QUERY_EVENTS, SCALE_FUNC_EYE_ALTITUDE, SCALE_FUNC_EYE_ALTITUDE_EXP, SCALE_FUNC_ZOOM, SCALE_FUNC_ZOOM_EXP
 
Constructor Summary
FlyViewInputHandler()
           
 
Method Summary
 void addAnimator(Animator animator)
          Add an Animator to this ViewInputHandler.
 void apply()
          Implementations are expected to apply any changes to the View state prior to the View setting the modelview matrix for rendering the current frame.
 void goTo(Position lookAtPos, double distance)
          Animate to the specified position.
protected  void handleOrbitViewCenterStopped()
           
protected  void handleViewStopped()
           
 boolean isAnimating()
          Determine if there are any animations active in the View.
 void lookAt(Position lookAtPos, long timeToMove)
           
protected  void onHorizontalTranslateAbs(Angle latitudeChange, Angle longitudeChange, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onHorizontalTranslateRel(Angle forwardChange, Angle sideChange, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onHorizontalTranslateRel(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
           
protected  void onMoveTo(Position focalPosition, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onMoveTo(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onResetHeadingAndPitch(ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onRotateView(Angle headingChange, Angle pitchChange, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onRotateView(double headingInput, double pitchInput, double totalHeadingInput, double totalPitchInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
           
protected  void onVerticalTranslate(double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void onVerticalTranslate(double translateChange, ViewInputAttributes.ActionAttributes actionAttribs)
           
protected  void setEyePosition(AnimationController animControl, View view, Position position, ViewInputAttributes.ActionAttributes attrib)
           
protected  void setHeading(View view, AnimationController animControl, Angle heading, ViewInputAttributes.ActionAttributes attrib)
           
protected  void setPitch(View view, AnimationController animControl, Angle pitch, ViewInputAttributes.ActionAttributes attrib)
           
 void stopAnimators()
          Stops any animations that are active in this View
 
Methods inherited from class gov.nasa.worldwind.awt.BasicViewInputHandler
callActionListListeners, callActionListListeners, callMouseActionListListeners, callMouseWheelActionListListeners, handleKeyPressed, handleMouseClicked, handleMouseDragged, handleMouseWheelMoved, handlePerFrameKeyState, handlePerFrameMouseState, handlePropertyChange, onHorizontalTranslateRel, onRotateView, onRotateView, onVerticalTranslate
 
Methods inherited from class gov.nasa.worldwind.awt.AbstractViewInputHandler
callActionListener, computeDragSlope, computeSelectedPointAt, computeSelectedPosition, constrainToSourceBounds, evaluateScaleFuncEyeAltitude, evaluateScaleFuncZoom, focusGained, focusLost, getAttributes, getChangeInLocation, getDragSlopeFactor, getLastMousePoint, getMouseDownPoint, getMousePoint, getScaledValue, getScaleValue, getScaleValueElevation, getSelectedPosition, getView, getWorldWindow, handleFocusGained, handleFocusLost, handleKeyReleased, handleMouseMoved, handleMousePressed, handleMouseReleased, isEnableSmoothing, isLockHeading, isStopOnFocusLost, isWorldWindowFocusOwner, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, onStopView, propertyChange, rawInputToChangeInValue, setAttributes, setDragSlopeFactor, setEnableSmoothing, setLockHeading, setMouseDownPoint, setSelectedPosition, setStopOnFocusLost, setWorldWindow, setWorldWindowFocusOwner, updateMousePoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE

protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE
See Also:
Constant Field Values

DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE_SLOW

protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE_SLOW
See Also:
Constant Field Values

DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE

protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE
See Also:
Constant Field Values

DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE_SLOW

protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MIN_VALUE_SLOW
See Also:
Constant Field Values

DEFAULT_KEY_TRANSLATE_SMOOTHING_VALUE

protected static final double DEFAULT_KEY_TRANSLATE_SMOOTHING_VALUE
See Also:
Constant Field Values

DEFAULT_KEY_VERTICAL_TRANSLATE_MAX_VALUE

protected static final double DEFAULT_KEY_VERTICAL_TRANSLATE_MAX_VALUE
See Also:
Constant Field Values

DEFAULT_KEY_VERTICAL_TRANSLATE_MIN_VALUE

protected static final double DEFAULT_KEY_VERTICAL_TRANSLATE_MIN_VALUE
See Also:
Constant Field Values

DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MAX_VALUE

protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MAX_VALUE

DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MIN_VALUE

protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MIN_VALUE

DEFAULT_MOUSE_ROTATE_MAX_VALUE

protected static final double DEFAULT_MOUSE_ROTATE_MAX_VALUE
See Also:
Constant Field Values

DEFAULT_MOUSE_ROTATE_MIN_VALUE

protected static final double DEFAULT_MOUSE_ROTATE_MIN_VALUE
See Also:
Constant Field Values

DEFAULT_MOUSE_VERTICAL_TRANSLATE_MAX_VALUE

protected static final double DEFAULT_MOUSE_VERTICAL_TRANSLATE_MAX_VALUE
See Also:
Constant Field Values

DEFAULT_MOUSE_VERTICAL_TRANSLATE_MIN_VALUE

protected static final double DEFAULT_MOUSE_VERTICAL_TRANSLATE_MIN_VALUE
See Also:
Constant Field Values

DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX

protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX
See Also:
Constant Field Values

DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX_OSX

protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX_OSX
See Also:
Constant Field Values

DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN

protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN
See Also:
Constant Field Values

DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN_OSX

protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN_OSX
See Also:
Constant Field Values

resetPitchEvents

public static final ViewInputAttributes.ActionAttributes.KeyAction[] resetPitchEvents
Constructor Detail

FlyViewInputHandler

public FlyViewInputHandler()
Method Detail

addAnimator

public void addAnimator(Animator animator)
Description copied from interface: ViewInputHandler
Add an Animator to this ViewInputHandler. This method does not start the Animator. Starting the Animator is the responsibility of the application. This method is here primarily for use by the View. Applications should call View.addAnimator(gov.nasa.worldwind.animation.Animator) to add an animtion to the view.

Parameters:
animator - the Animator to be added

apply

public void apply()
Description copied from interface: ViewInputHandler
Implementations are expected to apply any changes to the View state prior to the View setting the modelview matrix for rendering the current frame.

Specified by:
apply in interface ViewInputHandler
Overrides:
apply in class BasicViewInputHandler

goTo

public void goTo(Position lookAtPos,
                 double distance)
Description copied from interface: ViewInputHandler
Animate to the specified position. The implementation is expected to animate the View to look at the given position from the given elevation.

Specified by:
goTo in interface ViewInputHandler
Overrides:
goTo in class BasicViewInputHandler
Parameters:
lookAtPos - The position to animate the view to look at.
distance - The elevation to look at the position from.

handleOrbitViewCenterStopped

protected void handleOrbitViewCenterStopped()

handleViewStopped

protected void handleViewStopped()
Overrides:
handleViewStopped in class BasicViewInputHandler

isAnimating

public boolean isAnimating()
Description copied from interface: ViewInputHandler
Determine if there are any animations active in the View.

Returns:
true if there are active animations, false otherwise.

lookAt

public void lookAt(Position lookAtPos,
                   long timeToMove)

onHorizontalTranslateAbs

protected void onHorizontalTranslateAbs(Angle latitudeChange,
                                        Angle longitudeChange,
                                        ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onHorizontalTranslateAbs in class BasicViewInputHandler

onHorizontalTranslateRel

protected void onHorizontalTranslateRel(Angle forwardChange,
                                        Angle sideChange,
                                        ViewInputAttributes.ActionAttributes actionAttribs)
Specified by:
onHorizontalTranslateRel in class AbstractViewInputHandler

onHorizontalTranslateRel

protected void onHorizontalTranslateRel(double forwardInput,
                                        double sideInput,
                                        double totalForwardInput,
                                        double totalSideInput,
                                        ViewInputAttributes.DeviceAttributes deviceAttributes,
                                        ViewInputAttributes.ActionAttributes actionAttributes)
Overrides:
onHorizontalTranslateRel in class BasicViewInputHandler

onMoveTo

protected void onMoveTo(Position focalPosition,
                        ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onMoveTo in class BasicViewInputHandler

onMoveTo

protected void onMoveTo(Position focalPosition,
                        ViewInputAttributes.DeviceAttributes deviceAttributes,
                        ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onMoveTo in class BasicViewInputHandler

onResetHeading

protected void onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onResetHeading in class BasicViewInputHandler

onResetHeadingAndPitch

protected void onResetHeadingAndPitch(ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onResetHeadingAndPitch in class BasicViewInputHandler

onResetPitch

protected void onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)

onRotateView

protected void onRotateView(Angle headingChange,
                            Angle pitchChange,
                            ViewInputAttributes.ActionAttributes actionAttribs)
Specified by:
onRotateView in class AbstractViewInputHandler

onRotateView

protected void onRotateView(double headingInput,
                            double pitchInput,
                            double totalHeadingInput,
                            double totalPitchInput,
                            ViewInputAttributes.DeviceAttributes deviceAttributes,
                            ViewInputAttributes.ActionAttributes actionAttributes)
Specified by:
onRotateView in class AbstractViewInputHandler

onVerticalTranslate

protected void onVerticalTranslate(double translateChange,
                                   double totalTranslateChange,
                                   ViewInputAttributes.DeviceAttributes deviceAttributes,
                                   ViewInputAttributes.ActionAttributes actionAttribs)
Specified by:
onVerticalTranslate in class AbstractViewInputHandler

onVerticalTranslate

protected void onVerticalTranslate(double translateChange,
                                   ViewInputAttributes.ActionAttributes actionAttribs)
Overrides:
onVerticalTranslate in class BasicViewInputHandler

setEyePosition

protected void setEyePosition(AnimationController animControl,
                              View view,
                              Position position,
                              ViewInputAttributes.ActionAttributes attrib)

setHeading

protected void setHeading(View view,
                          AnimationController animControl,
                          Angle heading,
                          ViewInputAttributes.ActionAttributes attrib)

setPitch

protected void setPitch(View view,
                        AnimationController animControl,
                        Angle pitch,
                        ViewInputAttributes.ActionAttributes attrib)

stopAnimators

public void stopAnimators()
Description copied from interface: ViewInputHandler
Stops any animations that are active in this View


NASA World Wind