ucar.unidata.view.geoloc
Class ViewpointControl

java.lang.Object
  extended by ucar.unidata.view.geoloc.ViewpointControl
All Implemented Interfaces:
ActionListener, EventListener

public class ViewpointControl
extends Object
implements ActionListener

This class has a menu and ToolBar to control the viewpoint of a 3D display.

Version:
$Revision: 1.31 $
Author:
IDV Development team

Constructor Summary
ViewpointControl(NavigatedDisplay navDisplay)
          Construct a new ViewpointControl for the NavigatedDisplay.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Handle the action
protected  void applyVerticalScale(VertScaleInfo transfer)
          Apply the vertical scale
 void changeAutoRotate(boolean v)
          A method that is called when the user changes the state of autorotation through the menu or button.
 void changeEyePosition()
          Change the eye position for stereo systems
 void changePerspectiveView(boolean v)
          A method that is called when the user changes the perspective view through the menu or button.
 void changeVerticalScale(VertScaleInfo transfer)
          Change the vertical scale
 boolean getAutoRotate()
          Get whether the display should autorotate or not
 double getEyePosition()
          Get the eye position
 JMenu getMenu()
          Make a Viewpoint controls menu
 boolean getPerspectiveView()
          Get whether the view is perspective or parallel.
 JToolBar getToolBar()
          Make a Viewpoint controls toolbar.
 JToolBar getToolBar(boolean floatable)
          Make a Viewpoint controls toolbar.
 VertScaleDialog getVerticalScaleWidget()
          Get the vertical scale widget
 ViewpointInfo getViewpointInfo()
          Get the view point information.
protected  JMenu makeMenu()
          Make the view point controls menu.
protected  JToolBar makeToolBar()
          Make the toolbar for this control.
protected  JToolBar makeToolBar(boolean floatable)
          Make the toolbar for this control.
 void makeVerticalScaleMenuItem(JMenu viewMenu)
          Add the vertical scale menu item to the menu
 ViewpointInfo rotateViewpoint(ViewpointInfo transfer)
          Rotate the viewpoint to the parameters in transfer
 void setAutoRotate(boolean rotate)
          Set the auto rotate value
 void setBottomView()
          Set the view to the bottom.
 void setEastView()
          Set the view to the east.
 void setEyePosition(double position)
          Set the eye position
 void setNorthView()
          Set the view to the north.
 void setPerspectiveView(boolean perspective)
          Set the perspective view.
 void setSouthView()
          Set the view to the south.
 void setTopView()
          Set the view to the top.
 void setViewpointInfo(ViewpointInfo vpi)
          Set the view point information
 void setWestView()
          Set the view to the west.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewpointControl

public ViewpointControl(NavigatedDisplay navDisplay)
Construct a new ViewpointControl for the NavigatedDisplay.

Parameters:
navDisplay - display to use (cannot be null)
Method Detail

getToolBar

public JToolBar getToolBar()
Make a Viewpoint controls toolbar.

Returns:
the toolbar

getToolBar

public JToolBar getToolBar(boolean floatable)
Make a Viewpoint controls toolbar.

Parameters:
floatable - Is the toolbar floatable
Returns:
the toolbar

actionPerformed

public void actionPerformed(ActionEvent ae)
Handle the action

Specified by:
actionPerformed in interface ActionListener
Parameters:
ae - The action

makeToolBar

protected JToolBar makeToolBar()
Make the toolbar for this control.

Returns:
the toolbar

makeToolBar

protected JToolBar makeToolBar(boolean floatable)
Make the toolbar for this control.

Parameters:
floatable - Is the toolbar floatable
Returns:
the toolbar

getMenu

public JMenu getMenu()
Make a Viewpoint controls menu

Returns:
the menu

makeMenu

protected JMenu makeMenu()
Make the view point controls menu.

Returns:
the menu

makeVerticalScaleMenuItem

public void makeVerticalScaleMenuItem(JMenu viewMenu)
Add the vertical scale menu item to the menu

Parameters:
viewMenu - Menu to add item to

setTopView

public void setTopView()
Set the view to the top.


setBottomView

public void setBottomView()
Set the view to the bottom.


setNorthView

public void setNorthView()
Set the view to the north.


setSouthView

public void setSouthView()
Set the view to the south.


setEastView

public void setEastView()
Set the view to the east.


setWestView

public void setWestView()
Set the view to the west.


setEyePosition

public void setEyePosition(double position)
Set the eye position

Parameters:
position - the eye position

getEyePosition

public double getEyePosition()
Get the eye position

Returns:
the eye position

changeEyePosition

public void changeEyePosition()
Change the eye position for stereo systems


getPerspectiveView

public boolean getPerspectiveView()
Get whether the view is perspective or parallel.

Returns:
true if perspective

changePerspectiveView

public void changePerspectiveView(boolean v)
A method that is called when the user changes the perspective view through the menu or button. It can be overridden so other code can be notified.

Parameters:
v - true to set perspective view

setPerspectiveView

public void setPerspectiveView(boolean perspective)
Set the perspective view.

Parameters:
perspective - true for perspective

getAutoRotate

public boolean getAutoRotate()
Get whether the display should autorotate or not

Returns:
true if autorotate

changeAutoRotate

public void changeAutoRotate(boolean v)
A method that is called when the user changes the state of autorotation through the menu or button. It can be overridden so other code can be notified.

Parameters:
v - true to set auto rotation

setAutoRotate

public void setAutoRotate(boolean rotate)
Set the auto rotate value

Parameters:
rotate - true to rotate

rotateViewpoint

public ViewpointInfo rotateViewpoint(ViewpointInfo transfer)
Rotate the viewpoint to the parameters in transfer

Parameters:
transfer - holder of the new view point information
Returns:
the transfer

getViewpointInfo

public ViewpointInfo getViewpointInfo()
Get the view point information.

Returns:
the view point information

setViewpointInfo

public void setViewpointInfo(ViewpointInfo vpi)
Set the view point information

Parameters:
vpi - new view point info

getVerticalScaleWidget

public VertScaleDialog getVerticalScaleWidget()
Get the vertical scale widget

Returns:
vertical scale widget

changeVerticalScale

public void changeVerticalScale(VertScaleInfo transfer)
Change the vertical scale

Parameters:
transfer - vertical scale information

applyVerticalScale

protected void applyVerticalScale(VertScaleInfo transfer)
                           throws Exception
Apply the vertical scale

Parameters:
transfer - The info
Throws:
Exception - On badness