ucar.unidata.view.sounding
Class Hodograph3DDisplay

java.lang.Object
  extended by ucar.visad.display.DisplayMaster
      extended by ucar.unidata.view.sounding.WindProfileDisplay
          extended by ucar.unidata.view.sounding.Hodograph3DDisplay

public class Hodograph3DDisplay
extends WindProfileDisplay

Provides support for displaying a 3D wind hodograph.

Version:
$Id: Hodograph3DDisplay.java,v 1.25 2005/05/13 18:33:30 jeffmc Exp $
Author:
Don Murray, Steven R. Emmerson

Field Summary
 
Fields inherited from class ucar.unidata.view.sounding.WindProfileDisplay
ACTIVE_MEAN_WIND, ACTIVE_PROFILE, GEOPOTENTIAL_ALTITUDE, PROFILE_DIRECTION, PROFILE_SPEED
 
Fields inherited from class ucar.visad.display.DisplayMaster
behavior, defaultMouseFunctions, log_, POINT_MODE
 
Constructor Summary
Hodograph3DDisplay()
          Default constructor.
Hodograph3DDisplay(Real minZ, Real maxZ, Real maxW)
          Constructs with given altitude extent and maximum wind speed.
 
Method Summary
protected  void displayAltitudeExtentChange()
          Handles a change to the extent of the displayed altitude.
static Real getDefaultMaxSpeed()
          Returns the default, maximum displayed wind speed.
 Real getMaxDisplaySpeed()
          Returns the maximum, displayed, wind speed.
 Real getMaxProfileSpeed()
          Returns the maximum profile wind speed.
 Real getRingIncrement()
          Returns the speed increment between rings.
 Linear1DSet getRingSpeeds()
          Returns the set of ring speeds.
 Unit getSpeedUnit()
          Returns the displayed, speed unit.
 boolean isAutoscaleSpeed()
          Get the state of automatic speed-scaling.
static void main(String[] args)
          Tests this class.
protected  Displayable newMeanWind()
          Returns the MeanWind Displayable with a missing mean-wind.
protected  Displayable newMeanWind(DataReference meanWindRef)
          Returns a MeanWind Displayable corresponding to a data reference for a mean-wind Tuple.
protected  Displayable newMeanWind(Tuple meanWind)
          Returns a MeanWind Displayable corresponding to a mean-wind Tuple.
protected  WindProfile newWindProfile()
          Constructs the displayable WindProfile appropriate to this WindProfileDisplay.
 void setAutoscaleSpeed(boolean value)
          Toggle automatic speed-scaling.
 void setBackgroundVisible(boolean b)
          Display or hide the background
protected  void setCenterPoleExtent()
          Sets the extent of the center pole
 void setCenterPoleVisible(boolean visible)
          Sets the visiblity of the center pole.
 void setCompassLabelsVisible(boolean visible)
          Sets the visiblity of the compass labels.
protected  void setCrossHairs()
          Sets the cross hairs.
 void setCrossHairsVisible(boolean visible)
          Sets the visiblity of the cross hairs.
protected  void setCursorPosition(double[] position)
          Sets the cursor position.
protected  void setDisplayAltitudes()
          Sets the displayed altitudes.
protected  void setDisplayAltitudes(Gridded1DSet altitudes)
          Sets the displayed altitudes.
 void setIntermediateRingsVisible(boolean visible)
          Sets the visiblity of the intermediate-level rings.
protected  void setMaxDisplaySpeed()
          Sets the maximum, displayed, wind speed.
 void setMaxDisplaySpeed(Real speed)
          Sets the maximum, displayed, wind speed from a Real.
protected  void setRingIncrement()
          Sets the speed increment between rings.
 void setRingIncrement(Real increment)
          Sets the speed increment between rings.
protected  void setRingSpeeds()
          Sets the ring speeds.
 void setRingSpeeds(Linear1DSet speeds)
          Sets the ring speeds from a set of speeds.
 void setRingsVisible(boolean visible)
          Sets the visiblity of the upper and lower rings.
protected  void setSpeedLabels()
          Sets the speed labels.
 void setSpeedLabelsVisible(boolean visible)
          Sets the visiblity of the speed labels.
protected  void setSpeedRings()
          Sets the speed-rings for the background based on the maximum wind speed for the display and the display speed unit.
 void setSpeedUnit(Unit unit)
          Sets the displayed, speed unit.
protected  void setWindScalarMapRanges()
          Sets the extents of the wind ScalarMap-s.
 
Methods inherited from class ucar.unidata.view.sounding.WindProfileDisplay
addProfile, clear, computeIncrement, getAltitudeUnit, getCursorPosition, getDefaultMaxAltitude, getDefaultMinAltitude, getGeopotentialAltitude, getMaxDisplayAltitude, getMaxProfileAltitude, getMinDisplayAltitude, getMinProfileAltitude, getProfileDirection, getProfileSpeed, getWindProfile, getWindProfileSet, isAutoscaleAltitude, removeMeanWind, removeProfile, setActiveMeanWind, setActiveWindProfile, setAltitudeColorMapRange, setAltitudeMapRange, setAltitudeScaleVisible, setAltitudeUnit, setAutoscaleAltitude, setDisplayAltitudeExtent, setDisplayAltitudeExtent, setGeopotentialAltitude, setMeanWind, setMeanWind, setMeanWindVisible, setProfileVisible
 
Methods inherited from class ucar.visad.display.DisplayMaster
addDisplayable, addDisplayListener, addKeyboardBehavior, addPropertyChangeListener, addPropertyChangeListener, addScalarMap, addScalarMaps, addVetoableChangeListener, addVetoableChangeListener, buildAnimationSet, dataChange, destroy, draw, ensureInactive, equals, finalize, firePropertyChange, firePropertyChange, getAnimationSetFromDisplayables, getAnimationStringVisible, getBackground, getComponent, getDisplay, getDisplayableCount, getDisplayables, getDisplayables, getDisplayAspect, getDisplayComponent, getForeground, getImage, getMouseBehavior, getOffscreenDimension, getProjectionMatrix, getSavedProjectionMatrix, getScreenBounds, getStereoAvailable, getWaitMessageVisible, handleMouseWheelMoved, hashCode, indexOf, init, is3D, isActive, isPointMode, printMatrix, printMe, rebuild, rebuildDisplay, reDisplayAll, removeDisplayable, removeDisplayables, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, removeScalarMaps, removeVetoableChangeListener, removeVetoableChangeListener, replaceScalarMap, reScale, resetMouseFunctions, resetProjection, rotate, rotateX, rotateY, rotateZ, saveCurrentDisplay, saveCurrentDisplay, saveCurrentDisplay, saveProjection, setActive, setAnimation, setAnimationStringVisible, setBackground, setDefaultMouseFunctions, setDisplayables, setDisplayables, setDisplayActive, setDisplayAspect, setDisplayInactive, setEyePosition, setForeground, setKeyboardBehavior, setKeyboardEventMap, setKeyboardEventMap, setMouseFunctions, setOffscreenDimension, setPointMode, setProjectionMatrix, setRebuildNecessary, setWaitMessageVisible, setWheelEventMap, translate, zoom, zoom
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hodograph3DDisplay

public Hodograph3DDisplay()
                   throws VisADException,
                          RemoteException
Default constructor. Use default min, max geopotential altitudes and default max wind speed.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

Hodograph3DDisplay

public Hodograph3DDisplay(Real minZ,
                          Real maxZ,
                          Real maxW)
                   throws VisADException,
                          RemoteException
Constructs with given altitude extent and maximum wind speed.

Parameters:
minZ - The minimum displayed altitude.
maxZ - The maximum displayed altitude.
maxW - The maximum wind speed.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
Method Detail

getDefaultMaxSpeed

public static Real getDefaultMaxSpeed()
                               throws VisADException
Returns the default, maximum displayed wind speed.

Returns:
The default, maximum displayed wind speed.
Throws:
VisADException - VisAD failure.

setAutoscaleSpeed

public void setAutoscaleSpeed(boolean value)
Toggle automatic speed-scaling. When autoscaling is on, the speed scale will automatically be adjusted when a new profile is set in the display.

Parameters:
value - Autoscale speed if true, otherwise keep speed scale the same.

isAutoscaleSpeed

public boolean isAutoscaleSpeed()
Get the state of automatic speed-scaling.

Returns:
true if automatic speed-scaling is on, otherwise false

newWindProfile

protected WindProfile newWindProfile()
                              throws VisADException,
                                     RemoteException
Constructs the displayable WindProfile appropriate to this WindProfileDisplay. Template method.

Specified by:
newWindProfile in class WindProfileDisplay
Returns:
The displayable WindProfile appropriate to this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setBackgroundVisible

public void setBackgroundVisible(boolean b)
                          throws VisADException,
                                 RemoteException
Display or hide the background

Overrides:
setBackgroundVisible in class WindProfileDisplay
Parameters:
b - display background if true, otherwise hide the background
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setCompassLabelsVisible

public void setCompassLabelsVisible(boolean visible)
                             throws VisADException,
                                    RemoteException
Sets the visiblity of the compass labels.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setSpeedLabelsVisible

public void setSpeedLabelsVisible(boolean visible)
                           throws VisADException,
                                  RemoteException
Sets the visiblity of the speed labels.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setCrossHairsVisible

public void setCrossHairsVisible(boolean visible)
                          throws VisADException,
                                 RemoteException
Sets the visiblity of the cross hairs.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRingsVisible

public void setRingsVisible(boolean visible)
                     throws VisADException,
                            RemoteException
Sets the visiblity of the upper and lower rings.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setIntermediateRingsVisible

public void setIntermediateRingsVisible(boolean visible)
                                 throws VisADException,
                                        RemoteException
Sets the visiblity of the intermediate-level rings.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setCenterPoleVisible

public void setCenterPoleVisible(boolean visible)
                          throws VisADException,
                                 RemoteException
Sets the visiblity of the center pole.

Parameters:
visible - Whether or not the displayable should be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setDisplayAltitudes

protected void setDisplayAltitudes(Gridded1DSet altitudes)
                            throws VisADException,
                                   RemoteException
Sets the displayed altitudes.

Parameters:
altitudes - The altitudes to display.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setWindScalarMapRanges

protected void setWindScalarMapRanges()
                               throws RemoteException,
                                      VisADException
Sets the extents of the wind ScalarMap-s.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setCenterPoleExtent

protected void setCenterPoleExtent()
                            throws RemoteException,
                                   VisADException
Sets the extent of the center pole

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setDisplayAltitudes

protected void setDisplayAltitudes()
                            throws VisADException,
                                   RemoteException
Sets the displayed altitudes.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRingSpeeds

protected void setRingSpeeds()
                      throws RemoteException,
                             VisADException
Sets the ring speeds.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRingSpeeds

public void setRingSpeeds(Linear1DSet speeds)
                   throws VisADException,
                          RemoteException
Sets the ring speeds from a set of speeds.

Parameters:
speeds - The set of speeds for the rings.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getRingSpeeds

public Linear1DSet getRingSpeeds()
Returns the set of ring speeds.

Returns:
The set of ring speeds.

setSpeedRings

protected void setSpeedRings()
                      throws VisADException,
                             RemoteException
Sets the speed-rings for the background based on the maximum wind speed for the display and the display speed unit.

Throws:
VisADException - necessary VisAD object couldn't be created.
RemoteException - Java RMI Exception

setCrossHairs

protected void setCrossHairs()
                      throws VisADException,
                             RemoteException
Sets the cross hairs.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setSpeedLabels

protected void setSpeedLabels()
                       throws VisADException,
                              RemoteException
Sets the speed labels.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

displayAltitudeExtentChange

protected void displayAltitudeExtentChange()
                                    throws VisADException,
                                           RemoteException
Handles a change to the extent of the displayed altitude.

Specified by:
displayAltitudeExtentChange in class WindProfileDisplay
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMaxProfileSpeed

public Real getMaxProfileSpeed()
Returns the maximum profile wind speed.

Returns:
The maximum profile wind speed.

setMaxDisplaySpeed

protected void setMaxDisplaySpeed()
                           throws VisADException,
                                  RemoteException
Sets the maximum, displayed, wind speed.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setMaxDisplaySpeed

public void setMaxDisplaySpeed(Real speed)
                        throws VisADException,
                               RemoteException
Sets the maximum, displayed, wind speed from a Real.

Parameters:
speed - the new, maximum, displayed, wind speed.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMaxDisplaySpeed

public Real getMaxDisplaySpeed()
Returns the maximum, displayed, wind speed.

Returns:
The maximum, displayed, wind speed.

setRingIncrement

protected void setRingIncrement()
                         throws VisADException,
                                RemoteException
Sets the speed increment between rings.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setRingIncrement

public void setRingIncrement(Real increment)
                      throws VisADException,
                             RemoteException
Sets the speed increment between rings.

Parameters:
increment - The speed increment between rings.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getRingIncrement

public Real getRingIncrement()
Returns the speed increment between rings.

Returns:
The increment between rings.

setSpeedUnit

public void setSpeedUnit(Unit unit)
                  throws UnitException,
                         VisADException,
                         RemoteException
Sets the displayed, speed unit.

Parameters:
unit - The displayed, speed unit.
Throws:
UnitException - Argument has invalid unit.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getSpeedUnit

public Unit getSpeedUnit()
Returns the displayed, speed unit.

Returns:
The displayed, speed unit.

setCursorPosition

protected void setCursorPosition(double[] position)
                          throws VisADException,
                                 RemoteException
Sets the cursor position.

Specified by:
setCursorPosition in class WindProfileDisplay
Parameters:
position - The (speed,direction,altitude) cursor position
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

newMeanWind

protected Displayable newMeanWind(Tuple meanWind)
                           throws VisADException,
                                  RemoteException
Returns a MeanWind Displayable corresponding to a mean-wind Tuple.

Specified by:
newMeanWind in class WindProfileDisplay
Parameters:
meanWind - the mean-wind Tuple
Returns:
The MeanWind Displayable corresponding to the input mean-wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

newMeanWind

protected Displayable newMeanWind(DataReference meanWindRef)
                           throws VisADException,
                                  RemoteException
Returns a MeanWind Displayable corresponding to a data reference for a mean-wind Tuple.

Specified by:
newMeanWind in class WindProfileDisplay
Parameters:
meanWindRef - The data reference for the mean-wind Tuple
Returns:
The MeanWind Displayable corresponding to the input mean-wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

newMeanWind

protected Displayable newMeanWind()
Returns the MeanWind Displayable with a missing mean-wind.

Specified by:
newMeanWind in class WindProfileDisplay
Returns:
The MeanWind Displayable with a missing mean-wind.

main

public static void main(String[] args)
                 throws Exception
Tests this class.

Parameters:
args - Test arguments. Ignored.
Throws:
Exception - Something went wrong.