public class OrbitViewInputHandler extends BasicViewInputHandler
Modifier and Type | Class and Description |
---|---|
protected static class |
OrbitViewInputHandler.CollisionAwarePitchAccessor
CollisionAwarePitchAccessor implements an
PropertyAccessor.AngleAccessor
interface onto the pitch property of an OrbitView . |
class |
OrbitViewInputHandler.ResetRollActionListener
Action handler to reset roll.
|
BasicViewInputHandler.HorizontalTransActionListener, BasicViewInputHandler.HorizTransMouseActionListener, BasicViewInputHandler.MoveToMouseActionListener, BasicViewInputHandler.ResetHeadingActionListener, BasicViewInputHandler.ResetHeadingPitchActionListener, BasicViewInputHandler.RotateActionListener, BasicViewInputHandler.RotateMouseActionListener, BasicViewInputHandler.StopViewActionListener, BasicViewInputHandler.VerticalTransActionListener, BasicViewInputHandler.VertTransMouseActionListener, BasicViewInputHandler.VertTransMouseWheelActionListener
Modifier and Type | Field and Description |
---|---|
protected AnimationController |
gotoAnimControl |
static String |
ORBITVIEW_RESET_ROLL |
protected AnimationController |
uiAnimControl |
protected static String |
VIEW_ANIM_APP |
protected static String |
VIEW_ANIM_CENTER |
protected static String |
VIEW_ANIM_EYE |
protected static String |
VIEW_ANIM_HEADING |
protected static String |
VIEW_ANIM_HEADING_PITCH |
protected static String |
VIEW_ANIM_PAN |
protected static String |
VIEW_ANIM_PITCH |
protected static String |
VIEW_ANIM_POSITION |
protected static String |
VIEW_ANIM_ROLL |
protected static String |
VIEW_ANIM_ZOOM |
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 and Description |
---|
OrbitViewInputHandler()
Create a new input handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnimator(Animator animator)
Add an
Animator to this ViewInputHandler . |
void |
addCenterAnimator(Position begin,
Position end,
boolean smoothed) |
void |
addCenterAnimator(Position begin,
Position end,
long lengthMillis,
boolean smoothed) |
void |
addEyePositionAnimator(long timeToIterate,
Position beginPosition,
Position endPosition) |
void |
addFlyToZoomAnimator(Angle heading,
Angle pitch,
double zoom) |
void |
addHeadingAnimator(Angle begin,
Angle end) |
void |
addHeadingPitchRollAnimator(Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch,
Angle beginRoll,
Angle endRoll)
Add an animator to animate heading, pitch, and roll.
|
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom) |
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position centerPos,
Angle heading,
Angle pitch,
double zoom,
long timeToMove,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position beginCenterPos,
Position endCenterPos,
Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch,
double beginZoom,
double endZoom,
boolean endCenterOnSurface) |
void |
addPanToAnimator(Position beginCenterPos,
Position endCenterPos,
Angle beginHeading,
Angle endHeading,
Angle beginPitch,
Angle endPitch,
double beginZoom,
double endZoom,
long timeToMove,
boolean endCenterOnSurface) |
void |
addPitchAnimator(Angle begin,
Angle end) |
void |
addRollAnimator(Angle begin,
Angle end)
Add an animator to animate roll.
|
void |
addZoomAnimator(double zoomStart,
double zoomEnd) |
void |
apply()
Apply the changes prior to rendering a frame.
|
protected void |
changeHeading(BasicOrbitView view,
AnimationController animControl,
Angle change,
ViewInputAttributes.ActionAttributes attrib) |
protected void |
changePitch(BasicOrbitView view,
AnimationController animControl,
Angle change,
ViewInputAttributes.ActionAttributes attrib) |
protected void |
changeZoom(BasicOrbitView view,
AnimationController animControl,
double change,
ViewInputAttributes.ActionAttributes attrib) |
protected static Angle |
computeNewHeading(OrbitView view,
Angle heading) |
protected static Angle |
computeNewPitch(OrbitView view,
Angle pitch) |
protected static Position |
computeNewPosition(OrbitView view,
Position position) |
protected static double |
computeNewZoom(OrbitView view,
double curZoom,
double change) |
protected double |
getScaleValueHorizTransRel(ViewInputAttributes.DeviceAttributes deviceAttributes,
ViewInputAttributes.ActionAttributes actionAttributes) |
protected double |
getScaleValueRotate(ViewInputAttributes.ActionAttributes actionAttributes) |
protected double |
getScaleValueZoom(ViewInputAttributes.ActionAttributes actionAttributes) |
void |
goTo(Position lookAtPos,
double distance)
Animate to the specified position.
|
protected void |
handleOrbitViewCenterStopped() |
protected void |
handlePropertyChange(PropertyChangeEvent e) |
protected void |
handleViewStopped() |
protected void |
initializeInputHandlers()
Initialize input handlers specific to ObitView.
|
boolean |
isAnimating()
Determine if there are any animations active in the
View . |
protected boolean |
isNonContinous2DGlobe() |
protected void |
onHorizontalTranslate2D(double forwardInput,
double sideInput,
double totalForwardInput,
double totalSideInput,
ViewInputAttributes.DeviceAttributes deviceAttributes,
ViewInputAttributes.ActionAttributes actionAttributes) |
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.DeviceAttributes deviceAttributes,
ViewInputAttributes.ActionAttributes actionAttribs) |
protected void |
onMoveTo2D(Position focalPosition,
ViewInputAttributes.DeviceAttributes deviceAttributes,
ViewInputAttributes.ActionAttributes actionAttribs) |
protected void |
onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs) |
protected void |
onResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs) |
protected void |
onResetRoll(ViewInputAttributes.ActionAttributes actionAttribs)
Called when user input causes the roll to reset.
|
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 actionAttributes) |
protected void |
onVerticalTranslate(double translateChange,
ViewInputAttributes.ActionAttributes actionAttribs) |
protected void |
setCenterPosition(BasicOrbitView view,
AnimationController animControl,
Position position,
ViewInputAttributes.ActionAttributes attrib) |
protected void |
setEyePoint(Vec4 eyePoint,
ViewInputAttributes.ActionAttributes attrib) |
protected void |
stopAllAnimators() |
void |
stopAnimators()
Stops any animations that are active in this
View |
protected void |
stopGoToAnimators() |
protected void |
stopUserInputAnimators(Object... names) |
callActionListener, callActionListListeners, callActionListListeners, callMouseActionListListeners, callMouseWheelActionListListeners, handleKeyPressed, handleMouseClicked, handleMouseDragged, handleMouseWheelMoved, handlePerFrameKeyState, handlePerFrameMouseState
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
protected AnimationController gotoAnimControl
public static final String ORBITVIEW_RESET_ROLL
protected AnimationController uiAnimControl
protected static final String VIEW_ANIM_APP
protected static final String VIEW_ANIM_CENTER
protected static final String VIEW_ANIM_EYE
protected static final String VIEW_ANIM_HEADING
protected static final String VIEW_ANIM_HEADING_PITCH
protected static final String VIEW_ANIM_PAN
protected static final String VIEW_ANIM_PITCH
protected static final String VIEW_ANIM_POSITION
protected static final String VIEW_ANIM_ROLL
protected static final String VIEW_ANIM_ZOOM
public void addAnimator(Animator animator)
ViewInputHandler
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.animator
- the Animator
to be addedpublic void addCenterAnimator(Position begin, Position end, long lengthMillis, boolean smoothed)
public void addEyePositionAnimator(long timeToIterate, Position beginPosition, Position endPosition)
public void addHeadingPitchRollAnimator(Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, Angle beginRoll, Angle endRoll)
beginHeading
- starting headingendHeading
- final headingbeginPitch
- starting pitchendPitch
- final pitchbeginRoll
- starting rollendRoll
- final rollpublic void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom)
public void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom, boolean endCenterOnSurface)
public void addPanToAnimator(Position centerPos, Angle heading, Angle pitch, double zoom, long timeToMove, boolean endCenterOnSurface)
public void addPanToAnimator(Position beginCenterPos, Position endCenterPos, Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, double beginZoom, double endZoom, boolean endCenterOnSurface)
public void addPanToAnimator(Position beginCenterPos, Position endCenterPos, Angle beginHeading, Angle endHeading, Angle beginPitch, Angle endPitch, double beginZoom, double endZoom, long timeToMove, boolean endCenterOnSurface)
public void addRollAnimator(Angle begin, Angle end)
begin
- starting rollend
- final rollpublic void addZoomAnimator(double zoomStart, double zoomEnd)
public void apply()
apply
in interface ViewInputHandler
apply
in class BasicViewInputHandler
protected void changeHeading(BasicOrbitView view, AnimationController animControl, Angle change, ViewInputAttributes.ActionAttributes attrib)
protected void changePitch(BasicOrbitView view, AnimationController animControl, Angle change, ViewInputAttributes.ActionAttributes attrib)
protected void changeZoom(BasicOrbitView view, AnimationController animControl, double change, ViewInputAttributes.ActionAttributes attrib)
protected static double computeNewZoom(OrbitView view, double curZoom, double change)
protected double getScaleValueHorizTransRel(ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
protected double getScaleValueRotate(ViewInputAttributes.ActionAttributes actionAttributes)
protected double getScaleValueZoom(ViewInputAttributes.ActionAttributes actionAttributes)
public void goTo(Position lookAtPos, double distance)
ViewInputHandler
View
to look
at the given position from the given elevation.lookAtPos
- The position to animate the view to look at.distance
- The elevation to look at the position
from.protected void handleOrbitViewCenterStopped()
protected void handlePropertyChange(PropertyChangeEvent e)
handlePropertyChange
in class BasicViewInputHandler
protected void handleViewStopped()
handleViewStopped
in class BasicViewInputHandler
protected void initializeInputHandlers()
public boolean isAnimating()
ViewInputHandler
View
.protected boolean isNonContinous2DGlobe()
protected void onHorizontalTranslate2D(double forwardInput, double sideInput, double totalForwardInput, double totalSideInput, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
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)
onHorizontalTranslateRel
in class BasicViewInputHandler
protected void onMoveTo(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
onMoveTo
in class BasicViewInputHandler
protected void onMoveTo2D(Position focalPosition, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttribs)
protected void onResetHeading(ViewInputAttributes.ActionAttributes actionAttribs)
onResetHeading
in class BasicViewInputHandler
protected void onResetHeadingPitchRoll(ViewInputAttributes.ActionAttributes actionAttribs)
onResetHeadingPitchRoll
in class BasicViewInputHandler
protected void onResetRoll(ViewInputAttributes.ActionAttributes actionAttribs)
actionAttribs
- input that caused the change.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)
onRotateView
in class BasicViewInputHandler
protected void onVerticalTranslate(double translateChange, double totalTranslateChange, ViewInputAttributes.DeviceAttributes deviceAttributes, ViewInputAttributes.ActionAttributes actionAttributes)
onVerticalTranslate
in class BasicViewInputHandler
protected void onVerticalTranslate(double translateChange, ViewInputAttributes.ActionAttributes actionAttribs)
protected void setCenterPosition(BasicOrbitView view, AnimationController animControl, Position position, ViewInputAttributes.ActionAttributes attrib)
protected void setEyePoint(Vec4 eyePoint, ViewInputAttributes.ActionAttributes attrib)
protected void stopAllAnimators()
public void stopAnimators()
ViewInputHandler
View
protected void stopGoToAnimators()
protected void stopUserInputAnimators(Object... names)