Class FlyViewInputHandler
- java.lang.Object
-
- gov.nasa.worldwind.awt.AbstractViewInputHandler
-
- gov.nasa.worldwind.awt.BasicViewInputHandler
-
- 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
public class FlyViewInputHandler extends BasicViewInputHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classFlyViewInputHandler.ResetPitchActionListenerclassFlyViewInputHandler.RollActionListenerInput handler to handle user input that changes Roll.-
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
-
Fields inherited from class gov.nasa.worldwind.awt.AbstractViewInputHandler
attributes, DEFAULT_DRAG_SLOPE_FACTOR, DEFAULT_PER_FRAME_INPUT_INTERVAL, dragSlopeFactor, enableSmoothing, GENERATE_EVENTS, keyActionMap, keyEventState, keyModsActionMap, lastMousePoint, lastPerFrameInputTime, lockHeading, modifierList, mouseActionMap, mouseDownModelview, mouseDownPoint, mouseDownProjection, mouseDownViewport, mouseModsActionMap, mousePoint, mouseWheelModsActionMap, NUM_MODIFIERS, perFrameInputInterval, QUERY_EVENTS, SCALE_FUNC_EYE_ALTITUDE, SCALE_FUNC_EYE_ALTITUDE_EXP, SCALE_FUNC_ZOOM, SCALE_FUNC_ZOOM_EXP, selectedPosition, stopOnFocusLost, wwd, wwdFocusOwner
-
-
Constructor Summary
Constructors Constructor Description FlyViewInputHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnimator(Animator animator)Add anAnimatorto thisViewInputHandler.voidapply()Implementations are expected to apply any changes to theViewstate prior to the View setting the modelview matrix for rendering the current frame.voidgoTo(Position lookAtPos, double distance)Animate to the specified position.protected voidhandleViewStopped()booleanisAnimating()Determine if there are any animations active in theView.voidlookAt(Position lookAtPos, long timeToMove)protected voidonHorizontalTranslateRel(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)protected voidonHorizontalTranslateRel(Angle forwardChange, Angle sideChange, ViewInputAttributes.ActionAttributes actionAttribs)protected voidonMoveTo(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)protected voidonResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)protected voidonResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs)protected voidonResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)protected voidonRoll(double rollInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)Called when the roll changes due to user input.protected voidonRoll(Angle rollChange, ViewInputAttributes.ActionAttributes actionAttribs)Called when the roll changes due to user input.protected voidonRotateView(double headingInput, double pitchInput, double totalHeadingInput, double totalPitchInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)protected voidonRotateView(Angle headingChange, Angle pitchChange, ViewInputAttributes.ActionAttributes actionAttribs)protected voidonVerticalTranslate(double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)protected voidsetEyePosition(AnimationController animControl, View view, Position position, ViewInputAttributes.ActionAttributes attrib)protected voidsetHeading(View view, AnimationController animControl, Angle heading, ViewInputAttributes.ActionAttributes attrib)protected voidsetPitch(View view, AnimationController animControl, Angle pitch, ViewInputAttributes.ActionAttributes attrib)protected voidsetRoll(View view, AnimationController animControl, Angle roll, ViewInputAttributes.ActionAttributes attrib)Set the roll in a view.voidstopAnimators()Stops any animations that are active in thisViewprotected voidstopGoToAnimators()protected voidstopUserInputAnimators()-
Methods inherited from class gov.nasa.worldwind.awt.BasicViewInputHandler
callActionListener, callActionListListeners, callActionListListeners, callMouseActionListListeners, callMouseWheelActionListListeners, handleKeyPressed, handleMouseClicked, handleMouseDragged, handleMouseWheelMoved, handlePerFrameKeyState, handlePerFrameMouseState, handlePropertyChange
-
Methods inherited from class gov.nasa.worldwind.awt.AbstractViewInputHandler
computeDragSlope, computeSelectedPointAt, computeSelectedPosition, constrainToSourceBounds, evaluateScaleFuncEyeAltitude, evaluateScaleFuncZoom, focusGained, focusLost, getAttributes, getChangeInLocation, getDragSlopeFactor, getLastMousePoint, getMouseDownPoint, getMousePoint, getPerFrameInputInterval, getScaledValue, getScaleValue, getScaleValueElevation, getSelectedPosition, getView, getWorldWindow, handleFocusGained, handleFocusLost, handleKeyReleased, handleMouseMoved, handleMousePressed, handleMouseReleased, handlePerFrameAnimation, isEnableSmoothing, isLockHeading, isStopOnFocusLost, isWorldWindowFocusOwner, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, onStopView, propertyChange, rawInputToChangeInValue, setAttributes, setDragSlopeFactor, setEnableSmoothing, setLockHeading, setMouseDownPoint, setMouseDownView, setPerFrameInputInterval, setSelectedPosition, setStopOnFocusLost, setWorldWindow, setWorldWindowFocusOwner, updateMousePoint, viewApplied
-
-
-
-
Field Detail
-
VIEW_ANIM_HEADING
protected static final java.lang.String VIEW_ANIM_HEADING
- See Also:
- Constant Field Values
-
VIEW_ANIM_PITCH
protected static final java.lang.String VIEW_ANIM_PITCH
- See Also:
- Constant Field Values
-
VIEW_ANIM_ROLL
protected static final java.lang.String VIEW_ANIM_ROLL
- See Also:
- Constant Field Values
-
VIEW_ANIM_POSITION
protected static final java.lang.String VIEW_ANIM_POSITION
- See Also:
- Constant Field Values
-
VIEW_ANIM_PAN
protected static final java.lang.String VIEW_ANIM_PAN
- See Also:
- Constant Field Values
-
VIEW_ANIM_APP
protected static final java.lang.String VIEW_ANIM_APP
- See Also:
- Constant Field Values
-
ACTION_RESET_PITCH
protected static final java.lang.String ACTION_RESET_PITCH
- 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_ROTATE_MAX_VALUE
protected static final double DEFAULT_MOUSE_ROTATE_MAX_VALUE
- 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_HORIZONTAL_TRANSLATE_MAX_VALUE
protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE
- 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_HORIZONTAL_TRANSLATE_MAX_VALUE_SLOW
protected static final double DEFAULT_KEY_HORIZONTAL_TRANSLATE_MAX_VALUE_SLOW
- See Also:
- Constant Field Values
-
DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MIN_VALUE
protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MIN_VALUE
-
DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MAX_VALUE
protected static double DEFAULT_MOUSE_HORIZONTAL_TRANSLATE_MAX_VALUE
-
DEFAULT_MOUSE_VERTICAL_TRANSLATE_MIN_VALUE
protected static final double DEFAULT_MOUSE_VERTICAL_TRANSLATE_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_KEY_VERTICAL_TRANSLATE_MIN_VALUE
protected static final double DEFAULT_KEY_VERTICAL_TRANSLATE_MIN_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_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN_OSX
protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MIN_OSX
- 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_MAX
protected static final double DEFAULT_MOUSE_WHEEL_VERTICAL_TRANSLATE_VALUE_MAX
- See Also:
- Constant Field Values
-
DEFAULT_RESET_PITCH_KEY_ACT
protected static final ViewInputAttributes.ActionAttributes.KeyAction DEFAULT_RESET_PITCH_KEY_ACT
-
resetPitchEvents
public static final ViewInputAttributes.ActionAttributes.KeyAction[] resetPitchEvents
-
-
Method Detail
-
onMoveTo
protected void onMoveTo(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
- Specified by:
onMoveToin classBasicViewInputHandler
-
onHorizontalTranslateRel
protected void onHorizontalTranslateRel(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)- Specified by:
onHorizontalTranslateRelin classBasicViewInputHandler
-
onHorizontalTranslateRel
protected void onHorizontalTranslateRel(Angle forwardChange, Angle sideChange, ViewInputAttributes.ActionAttributes actionAttribs)
-
onResetHeading
protected void onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
- Specified by:
onResetHeadingin classBasicViewInputHandler
-
onResetPitch
protected void onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)
-
onResetHeadingPitchRoll
protected void onResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs)
- Specified by:
onResetHeadingPitchRollin classBasicViewInputHandler
-
onRotateView
protected void onRotateView(double headingInput, double pitchInput, double totalHeadingInput, double totalPitchInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)- Specified by:
onRotateViewin classBasicViewInputHandler
-
onRotateView
protected void onRotateView(Angle headingChange, Angle pitchChange, ViewInputAttributes.ActionAttributes actionAttribs)
-
onRoll
protected void onRoll(double rollInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)Called when the roll changes due to user input.- Parameters:
rollInput- Change in roll.deviceAttributes- Attributes of the input device.actionAttributes- Action that caused the change.
-
onRoll
protected void onRoll(Angle rollChange, ViewInputAttributes.ActionAttributes actionAttribs)
Called when the roll changes due to user input.- Parameters:
rollChange- Change in roll.actionAttribs- Action that caused the change.
-
onVerticalTranslate
protected void onVerticalTranslate(double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)- Specified by:
onVerticalTranslatein classBasicViewInputHandler
-
apply
public void apply()
Description copied from interface:ViewInputHandlerImplementations are expected to apply any changes to theViewstate prior to the View setting the modelview matrix for rendering the current frame.- Specified by:
applyin interfaceViewInputHandler- Overrides:
applyin classBasicViewInputHandler
-
handleViewStopped
protected void handleViewStopped()
- Overrides:
handleViewStoppedin classBasicViewInputHandler
-
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)
-
setRoll
protected void setRoll(View view, AnimationController animControl, Angle roll, ViewInputAttributes.ActionAttributes attrib)
Set the roll in a view.- Parameters:
view- View to modify.animControl- Animator controller for the view.roll- new roll value.attrib- action that caused the roll to change.
-
setEyePosition
protected void setEyePosition(AnimationController animControl, View view, Position position, ViewInputAttributes.ActionAttributes attrib)
-
goTo
public void goTo(Position lookAtPos, double distance)
Description copied from interface:ViewInputHandlerAnimate to the specified position. The implementation is expected to animate theViewto look at the given position from the given elevation.- Parameters:
lookAtPos- The position to animate the view to look at.distance- The elevation to look at thepositionfrom.
-
lookAt
public void lookAt(Position lookAtPos, long timeToMove)
-
stopAnimators
public void stopAnimators()
Description copied from interface:ViewInputHandlerStops any animations that are active in thisView
-
isAnimating
public boolean isAnimating()
Description copied from interface:ViewInputHandlerDetermine if there are any animations active in theView.- Returns:
- true if there are active animations, false otherwise.
-
addAnimator
public void addAnimator(Animator animator)
Description copied from interface:ViewInputHandlerAdd anAnimatorto thisViewInputHandler. This method does not start theAnimator. Starting theAnimatoris the responsibility of the application. This method is here primarily for use by theView. Applications should callView.addAnimator(gov.nasa.worldwind.animation.Animator)to add an animtion to the view.- Parameters:
animator- theAnimatorto be added
-
stopGoToAnimators
protected void stopGoToAnimators()
-
stopUserInputAnimators
protected void stopUserInputAnimators()
-
-