Class ViewpointControl

java.lang.Object
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 Details

    • ViewpointControl

      public ViewpointControl(NavigatedDisplay navDisplay)
      Construct a new ViewpointControl for the NavigatedDisplay.
      Parameters:
      navDisplay - display to use (cannot be null)
  • Method Details

    • getToolBar

      public JToolBar getToolBar()
      Make a Viewpoint controls toolbar.
      Returns:
      the toolbar
    • getToolBar

      public JToolBar getToolBar(int orientation)
      Make a Viewpoint controls toolbar.
      Parameters:
      orientation - JToolBar.VERTICAL or JToolBar.HORIZONTAL
      Returns:
      the toolbar
    • getToolBar

      public JToolBar getToolBar(boolean floatable)
      Make a Viewpoint controls toolbar.
      Parameters:
      floatable - Is the toolbar floatable
      Returns:
      the toolbar
    • getToolBar

      public JToolBar getToolBar(boolean floatable, int orientation)
      Make a Viewpoint controls toolbar.
      Parameters:
      floatable - Is the toolbar floatable
      orientation - JToolBar.VERTICAL or JToolBar.HORIZONTAL
      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
    • setRotate

      public void setRotate(String dir)
      Set the rotate direction
      Parameters:
      dir - the direction
    • 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 deprecated see makeVerticalRangeMenuItem(JMenu)
    • makeVerticalRangeMenuItem

      public void makeVerticalRangeMenuItem(JMenu viewMenu)
      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

      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
    • getVsi

      protected VertScaleInfo getVsi()
      Returns:
      the vsi
    • makeVerticalScaleWidget

      public VertScaleDialog makeVerticalScaleWidget(boolean visible)
      Make the vertical scale widget
      Parameters:
      visible - true to be visible
      Returns:
      vertical scale widget deprecated see makeVerticalRangeWidget(boolean)
    • makeVerticalRangeWidget

      public VertScaleDialog makeVerticalRangeWidget(boolean visible)
      Make the vertical range widget
      Parameters:
      visible - true to be visible
      Returns:
      vertical range widget
    • changeVerticalScale

      public void changeVerticalScale(VertScaleInfo transfer)
      Change the vertical scale
      Parameters:
      transfer - vertical scale information deprecated see changeVerticalRange(VertScaleInfo)
    • changeVerticalRange

      public void changeVerticalRange(VertScaleInfo transfer)
      Change the vertical range
      Parameters:
      transfer - vertical range information
    • applyVerticalScale

      protected void applyVerticalScale(VertScaleInfo transfer) throws Exception
      Apply the vertical scale
      Parameters:
      transfer - The info
      Throws:
      Exception - On badness deprecated see applyVerticalRange(VertScaleInfo)
    • applyVerticalRange

      protected void applyVerticalRange(VertScaleInfo transfer) throws Exception
      Apply the vertical range information
      Parameters:
      transfer - The info
      Throws:
      Exception - On badness