NASA World Wind

gov.nasa.worldwind.layers
Class ViewControlsSelectListener

java.lang.Object
  extended by gov.nasa.worldwind.layers.ViewControlsSelectListener
All Implemented Interfaces:
SelectListener, EventListener

public class ViewControlsSelectListener
extends Object
implements SelectListener

Controller for onscreen view controls.

See Also:
ViewControlsLayer

Field Summary
protected  Point lastPickPoint
           
protected  ScreenAnnotation pressedControl
           
protected  String pressedControlType
           
protected  ViewControlsLayer viewControlsLayer
           
protected  WorldWindow wwd
           
 
Constructor Summary
ViewControlsSelectListener(WorldWindow wwd, ViewControlsLayer layer)
           
 
Method Summary
protected  Angle computeLookHeading(OrbitView view, ScreenAnnotation control, double headingStep)
           
protected  Angle computeLookPitch(OrbitView view, ScreenAnnotation control, double pitchStep)
           
protected  double computeNewZoom(OrbitView view, double amount)
           
protected  Angle computePanAmount(Globe globe, OrbitView view, ScreenAnnotation control, double panStep)
           
protected  Angle computePanHeading(OrbitView view, ScreenAnnotation control)
           
protected  Vec4 computeSurfacePoint(OrbitView view, Angle heading, Angle pitch)
          Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.
 double getFovIncrement()
          Get the field of view increment factor.
 double getHeadingIncrement()
          Get the heading increment value in decimal degrees.
 double getPanIncrement()
          Get the panning distance factor.
 double getPitchIncrement()
          Get the pitch increment value in decimal degrees.
 int getReapeatTimerDelay()
          Get the repeat timer delay in milliseconds.
 double getVeIncrement()
          Get the vertical exaggeration increment.
 double getZoomIncrement()
          Get the zooming distance factor.
protected  void resetOrbitView(OrbitView view)
          Reset the view to an orbit view state if in first person mode (zoom = 0)
 void selected(SelectEvent event)
           
 void setFovIncrement(double value)
          Set the field of view increment factor.
 void setHeadingIncrement(double value)
          Set the heading increment value in decimal degrees.
 void setPanIncrement(double value)
          Set the panning distance factor.
 void setPitchIncrement(double value)
          Set the pitch increment value in decimal degrees.
 void setRepeatTimerDelay(int delay)
          Set the repeat timer delay in milliseconds.
protected  void setupFirstPersonView(OrbitView view)
          Setup the view to a first person mode (zoom = 0)
 void setVeIncrement(double value)
          Set the vertical exaggeration increment.
 void setZoomIncrement(double value)
          Set the zoom distance factor.
protected  void updateView(ScreenAnnotation control, String controlType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastPickPoint

protected Point lastPickPoint

pressedControl

protected ScreenAnnotation pressedControl

pressedControlType

protected String pressedControlType

viewControlsLayer

protected ViewControlsLayer viewControlsLayer

wwd

protected WorldWindow wwd
Constructor Detail

ViewControlsSelectListener

public ViewControlsSelectListener(WorldWindow wwd,
                                  ViewControlsLayer layer)
Method Detail

computeLookHeading

protected Angle computeLookHeading(OrbitView view,
                                   ScreenAnnotation control,
                                   double headingStep)

computeLookPitch

protected Angle computeLookPitch(OrbitView view,
                                 ScreenAnnotation control,
                                 double pitchStep)

computeNewZoom

protected double computeNewZoom(OrbitView view,
                                double amount)

computePanAmount

protected Angle computePanAmount(Globe globe,
                                 OrbitView view,
                                 ScreenAnnotation control,
                                 double panStep)

computePanHeading

protected Angle computePanHeading(OrbitView view,
                                  ScreenAnnotation control)

computeSurfacePoint

protected Vec4 computeSurfacePoint(OrbitView view,
                                   Angle heading,
                                   Angle pitch)
Find out where on the terrain surface the eye would be looking at with the given heading and pitch angles.

Parameters:
view - the orbit view
heading - heading direction clockwise from north.
pitch - view pitch angle from the surface normal at the center point.
Returns:
the terrain surface point the view would be looking at in the viewport center.

getFovIncrement

public double getFovIncrement()
Get the field of view increment factor.

Returns:
the field of view increment factor.

getHeadingIncrement

public double getHeadingIncrement()
Get the heading increment value in decimal degrees.

Returns:
the heading increment value in decimal degrees.

getPanIncrement

public double getPanIncrement()
Get the panning distance factor.

Returns:
the panning distance factor.

getPitchIncrement

public double getPitchIncrement()
Get the pitch increment value in decimal degrees.

Returns:
the pitch increment value in decimal degrees.

getReapeatTimerDelay

public int getReapeatTimerDelay()
Get the repeat timer delay in milliseconds.

Returns:
the repeat timer delay in milliseconds.

getVeIncrement

public double getVeIncrement()
Get the vertical exaggeration increment.

Returns:
the vertical exaggeration increment.

getZoomIncrement

public double getZoomIncrement()
Get the zooming distance factor.

Returns:
the zooming distance factor.

resetOrbitView

protected void resetOrbitView(OrbitView view)
Reset the view to an orbit view state if in first person mode (zoom = 0)

Parameters:
view - the orbit view to reset

selected

public void selected(SelectEvent event)
Specified by:
selected in interface SelectListener

setFovIncrement

public void setFovIncrement(double value)
Set the field of view increment factor. At each iteration the current field of view will be multiplied or divided by this value. Must be greater then or equal to one. Default value is 1.05.

Parameters:
value - the field of view increment factor.
Throws:
IllegalArgumentException

setHeadingIncrement

public void setHeadingIncrement(double value)
Set the heading increment value in decimal degrees. Doubling this value will double the heading change speed. Negating it will reverse the heading change direction. Default value is 1 degree.

Parameters:
value - the heading increment value in decimal degrees.

setPanIncrement

public void setPanIncrement(double value)
Set the panning distance factor. Doubling this value will double the panning speed. Negating it will reverse the panning direction. Default value is .6.

Parameters:
value - the panning distance factor.

setPitchIncrement

public void setPitchIncrement(double value)
Set the pitch increment value in decimal degrees. Doubling this value will double the pitch change speed. Must be positive. Default value is 1 degree.

Parameters:
value - the pitch increment value in decimal degrees.
Throws:
IllegalArgumentException

setRepeatTimerDelay

public void setRepeatTimerDelay(int delay)
Set the repeat timer delay in milliseconds.

Parameters:
delay - the repeat timer delay in milliseconds.
Throws:
IllegalArgumentException

setupFirstPersonView

protected void setupFirstPersonView(OrbitView view)
Setup the view to a first person mode (zoom = 0)

Parameters:
view - the orbit view to set into a first person view.

setVeIncrement

public void setVeIncrement(double value)
Set the vertical exaggeration increment. At each iteration the current vertical exaggeration will be increased or decreased by this amount. Must be greater then or equal to one. Default value is 0.05.

Parameters:
value - the vertical exaggeration increment.
Throws:
IllegalArgumentException

setZoomIncrement

public void setZoomIncrement(double value)
Set the zoom distance factor. Doubling this value will double the zooming speed. Negating it will reverse the zooming direction. Default value is .8.

Parameters:
value - the zooming distance factor.

updateView

protected void updateView(ScreenAnnotation control,
                          String controlType)

NASA World Wind