Package ucar.unidata.view.geoloc
Class ViewpointControl
java.lang.Object
ucar.unidata.view.geoloc.ViewpointControl
- All Implemented Interfaces:
ActionListener
,EventListener
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
ConstructorsConstructorDescriptionViewpointControl
(NavigatedDisplay navDisplay) Construct a new ViewpointControl for the NavigatedDisplay. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Handle the actionprotected void
applyVerticalRange
(VertScaleInfo transfer) Apply the vertical range informationprotected void
applyVerticalScale
(VertScaleInfo transfer) Apply the vertical scalevoid
changeAutoRotate
(boolean v) A method that is called when the user changes the state of autorotation through the menu or button.void
Change the eye position for stereo systemsvoid
changePerspectiveView
(boolean v) A method that is called when the user changes the perspective view through the menu or button.void
changeVerticalRange
(VertScaleInfo transfer) Change the vertical rangevoid
changeVerticalScale
(VertScaleInfo transfer) Change the vertical scaleboolean
Get whether the display should autorotate or notdouble
Get the eye positiongetMenu()
Make a Viewpoint controls menuboolean
Get whether the view is perspective or parallel.Make a Viewpoint controls toolbar.getToolBar
(boolean floatable) Make a Viewpoint controls toolbar.getToolBar
(boolean floatable, int orientation) Make a Viewpoint controls toolbar.getToolBar
(int orientation) Make a Viewpoint controls toolbar.Get the view point information.protected VertScaleInfo
getVsi()
protected JMenu
makeMenu()
Make the view point controls menu.protected JToolBar
Make the toolbar for this control.protected JToolBar
makeToolBar
(boolean floatable) Make the toolbar for this control.void
makeVerticalRangeMenuItem
(JMenu viewMenu) Add the vertical range menu item to the menumakeVerticalRangeWidget
(boolean visible) Make the vertical range widgetvoid
makeVerticalScaleMenuItem
(JMenu viewMenu) Add the vertical scale menu item to the menumakeVerticalScaleWidget
(boolean visible) Make the vertical scale widgetrotateViewpoint
(ViewpointInfo transfer) Rotate the viewpoint to the parameters intransfer
void
setAutoRotate
(boolean rotate) Set the auto rotate valuevoid
Set the view to the bottom.void
Set the view to the east.void
setEyePosition
(double position) Set the eye positionvoid
Set the view to the north.void
setPerspectiveView
(boolean perspective) Set the perspective view.void
Set the rotate directionvoid
Set the view to the south.void
Set the view to the top.void
Set the view point informationvoid
Set the view to the west.
-
Constructor Details
-
Method Details
-
getToolBar
Make a Viewpoint controls toolbar.- Returns:
- the toolbar
-
getToolBar
Make a Viewpoint controls toolbar.- Parameters:
orientation
- JToolBar.VERTICAL or JToolBar.HORIZONTAL- Returns:
- the toolbar
-
getToolBar
Make a Viewpoint controls toolbar.- Parameters:
floatable
- Is the toolbar floatable- Returns:
- the toolbar
-
getToolBar
Make a Viewpoint controls toolbar.- Parameters:
floatable
- Is the toolbar floatableorientation
- JToolBar.VERTICAL or JToolBar.HORIZONTAL- Returns:
- the toolbar
-
actionPerformed
Handle the action- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
ae
- The action
-
makeToolBar
Make the toolbar for this control.- Returns:
- the toolbar
-
makeToolBar
Make the toolbar for this control.- Parameters:
floatable
- Is the toolbar floatable- Returns:
- the toolbar
-
setRotate
Set the rotate direction- Parameters:
dir
- the direction
-
getMenu
Make a Viewpoint controls menu- Returns:
- the menu
-
makeMenu
Make the view point controls menu.- Returns:
- the menu
-
makeVerticalScaleMenuItem
Add the vertical scale menu item to the menu- Parameters:
viewMenu
- Menu to add item to deprecated seemakeVerticalRangeMenuItem(JMenu)
-
makeVerticalRangeMenuItem
Add the vertical range 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
Rotate the viewpoint to the parameters intransfer
- Parameters:
transfer
- holder of the new view point information- Returns:
- the transfer
-
getViewpointInfo
Get the view point information.- Returns:
- the view point information
-
setViewpointInfo
Set the view point information- Parameters:
vpi
- new view point info
-
getVsi
- Returns:
- the vsi
-
makeVerticalScaleWidget
Make the vertical scale widget- Parameters:
visible
- true to be visible- Returns:
- vertical scale widget
deprecated see
makeVerticalRangeWidget(boolean)
-
makeVerticalRangeWidget
Make the vertical range widget- Parameters:
visible
- true to be visible- Returns:
- vertical range widget
-
changeVerticalScale
Change the vertical scale- Parameters:
transfer
- vertical scale information deprecated seechangeVerticalRange(VertScaleInfo)
-
changeVerticalRange
Change the vertical range- Parameters:
transfer
- vertical range information
-
applyVerticalScale
Apply the vertical scale- Parameters:
transfer
- The info- Throws:
Exception
- On badness deprecated seeapplyVerticalRange(VertScaleInfo)
-
applyVerticalRange
Apply the vertical range information- Parameters:
transfer
- The info- Throws:
Exception
- On badness
-