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 class
FlyViewInputHandler.ResetPitchActionListener
class
FlyViewInputHandler.RollActionListener
Input 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 void
addAnimator(Animator animator)
Add anAnimator
to thisViewInputHandler
.void
apply()
Implementations are expected to apply any changes to theView
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
handleViewStopped()
boolean
isAnimating()
Determine if there are any animations active in theView
.void
lookAt(Position lookAtPos, long timeToMove)
protected void
onHorizontalTranslateRel(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
protected void
onHorizontalTranslateRel(Angle forwardChange, Angle sideChange, ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onMoveTo(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onRoll(double rollInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
Called when the roll changes due to user input.protected void
onRoll(Angle rollChange, ViewInputAttributes.ActionAttributes actionAttribs)
Called when the roll changes due to user input.protected void
onRotateView(double headingInput, double pitchInput, double totalHeadingInput, double totalPitchInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
protected void
onRotateView(Angle headingChange, Angle pitchChange, ViewInputAttributes.ActionAttributes actionAttribs)
protected void
onVerticalTranslate(double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, 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)
protected void
setRoll(View view, AnimationController animControl, Angle roll, ViewInputAttributes.ActionAttributes attrib)
Set the roll in a view.void
stopAnimators()
Stops any animations that are active in thisView
protected void
stopGoToAnimators()
protected void
stopUserInputAnimators()
-
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:
onMoveTo
in classBasicViewInputHandler
-
onHorizontalTranslateRel
protected void onHorizontalTranslateRel(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
- Specified by:
onHorizontalTranslateRel
in classBasicViewInputHandler
-
onHorizontalTranslateRel
protected void onHorizontalTranslateRel(Angle forwardChange, Angle sideChange, ViewInputAttributes.ActionAttributes actionAttribs)
-
onResetHeading
protected void onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
- Specified by:
onResetHeading
in classBasicViewInputHandler
-
onResetPitch
protected void onResetPitch(ViewInputAttributes.ActionAttributes actionAttribs)
-
onResetHeadingPitchRoll
protected void onResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs)
- Specified by:
onResetHeadingPitchRoll
in classBasicViewInputHandler
-
onRotateView
protected void onRotateView(double headingInput, double pitchInput, double totalHeadingInput, double totalPitchInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
- Specified by:
onRotateView
in 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:
onVerticalTranslate
in classBasicViewInputHandler
-
apply
public void apply()
Description copied from interface:ViewInputHandler
Implementations are expected to apply any changes to theView
state prior to the View setting the modelview matrix for rendering the current frame.- Specified by:
apply
in interfaceViewInputHandler
- Overrides:
apply
in classBasicViewInputHandler
-
handleViewStopped
protected void handleViewStopped()
- Overrides:
handleViewStopped
in 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:ViewInputHandler
Animate to the specified position. The implementation is expected to animate theView
to 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 theposition
from.
-
lookAt
public void lookAt(Position lookAtPos, long timeToMove)
-
stopAnimators
public void stopAnimators()
Description copied from interface:ViewInputHandler
Stops any animations that are active in thisView
-
isAnimating
public boolean isAnimating()
Description copied from interface:ViewInputHandler
Determine 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:ViewInputHandler
Add anAnimator
to thisViewInputHandler
. This method does not start theAnimator
. Starting theAnimator
is 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
- theAnimator
to be added
-
stopGoToAnimators
protected void stopGoToAnimators()
-
stopUserInputAnimators
protected void stopUserInputAnimators()
-
-