ucar.unidata.view.sounding
Class WindProfileDisplay

java.lang.Object
  extended by ucar.visad.display.DisplayMaster
      extended by ucar.unidata.view.sounding.WindProfileDisplay
Direct Known Subclasses:
Hodograph3DDisplay, WindStaffDisplay

public abstract class WindProfileDisplay
extends DisplayMaster

Provides support for displaying vertical profiles of the horizontal wind.

Version:
$Id: WindProfileDisplay.java,v 1.27 2005/05/13 18:33:41 jeffmc Exp $
Author:
Don Murray, Steven R. Emmerson

Field Summary
static String ACTIVE_MEAN_WIND
          The name of the active mean-wind property.
static String ACTIVE_PROFILE
          The name of the active profile property.
static String GEOPOTENTIAL_ALTITUDE
          The name of the geopotential altitude property.
static String PROFILE_DIRECTION
          The name of the profile wind-direction property.
static String PROFILE_SPEED
          The name of the profile wind-speed property.
 
Fields inherited from class ucar.visad.display.DisplayMaster
behavior, defaultMouseFunctions, log_, POINT_MODE
 
Constructor Summary
protected WindProfileDisplay(DisplayImpl displayImpl, Real minZ, Real maxZ, int displayableCount, DisplayRealType verticalDisplayRealType)
          Constructs with limits on min and max geopotential altitudes.
 
Method Summary
 void addProfile(int index, Field field)
          Adds a wind profile.
 void clear()
          Clears the wind data.
protected  double computeIncrement(double extent, int maxCount)
          Computes the increment for displaying an extent.
protected abstract  void displayAltitudeExtentChange()
          Handles a change to the extent of the displayed altitudes.
 Unit getAltitudeUnit()
          Returns the displayed, altitude unit.
 double[] getCursorPosition()
          Returns the cursor position.
protected static Real getDefaultMaxAltitude()
          Returns the default, maximum altitude.
protected static Real getDefaultMinAltitude()
          Returns the default, minimum altitude.
 Real getGeopotentialAltitude()
          Returns the geopotential altitude property.
 Real getMaxDisplayAltitude()
          Returns the maximum, display altitude.
 Real getMaxProfileAltitude()
          Returns the maximum profile altitude.
 Real getMinDisplayAltitude()
          Returns the minimum, display altitude.
 Real getMinProfileAltitude()
          Returns the minimum profile altitude.
protected  Real getProfileDirection()
          Returns the profile-wind-direction property.
protected  Real getProfileSpeed()
          Returns the profile-wind-speed property.
 Field getWindProfile()
          Gets the currently active wind profile.
protected  WindProfileSet getWindProfileSet()
          Returns the set of wind profiles.
 boolean isAutoscaleAltitude()
          Gets the state of automatic altitude-scaling.
protected abstract  Displayable newMeanWind()
          Returns the MeanWind Displayable with a missing mean-wind.
protected abstract  Displayable newMeanWind(DataReference meanWindRef)
          Returns a MeanWind Displayable corresponding to a mean-wind Tuple.
protected abstract  Displayable newMeanWind(Tuple meanWind)
          Returns a MeanWind Displayable corresponding to a mean-wind Tuple.
protected abstract  WindProfile newWindProfile()
          Creates the displayable WindProfile appropriate to this instance.
 void removeMeanWind(int index)
          Removes a given mean-wind.
 void removeProfile(int index)
          Removes a given wind profile.
 void setActiveMeanWind(int index)
          Sets the active mean-wind.
 void setActiveWindProfile(int index)
          Sets the active wind profile.
protected  void setAltitudeColorMapRange()
          Scales the altitude-color ScalarMap.
protected  void setAltitudeMapRange()
          Scales the altitude ScalarMap.
 void setAltitudeScaleVisible(boolean visible)
          Sets the visiblity of the altitude scale.
 void setAltitudeUnit(Unit geoAltUnit)
          Sets the displayed, altitude unit.
 void setAutoscaleAltitude(boolean value)
          Toggles automatic altitude-scaling.
 void setBackgroundVisible(boolean b)
          Display or hide the background
protected abstract  void setCursorPosition(double[] position)
          Sets the cursor position.
protected  void setDisplayAltitudeExtent()
          Sets the extent of the displayed altitudes.
 void setDisplayAltitudeExtent(RealTuple extent)
          Sets the extent of the displayed altitudes.
 void setGeopotentialAltitude(Real geoAlt)
          Sets the geopotential altitude property.
 void setMeanWind(int index, DataReference meanWindRef)
          Sets the mean wind.
 void setMeanWind(int index, Tuple meanWind)
          Sets the mean wind.
 void setMeanWindVisible(int index, boolean visible)
          Sets the visibility of a given mean wind.
 void setProfileVisible(int index, boolean visible)
          Sets the visibility of a given wind profile.
 
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, getDestroyed, getDisplay, getDisplayableCount, getDisplayables, getDisplayables, getDisplayAspect, getDisplayComponent, getDisplayScale, getForeground, getImage, getMouseBehavior, getMouseFunctionMap, getOffscreenDimension, getProjectionMatrix, getRotation, getSavedProjectionMatrix, getScale, 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
 

Field Detail

GEOPOTENTIAL_ALTITUDE

public static String GEOPOTENTIAL_ALTITUDE
The name of the geopotential altitude property.


PROFILE_SPEED

public static String PROFILE_SPEED
The name of the profile wind-speed property.


PROFILE_DIRECTION

public static String PROFILE_DIRECTION
The name of the profile wind-direction property.


ACTIVE_PROFILE

public static String ACTIVE_PROFILE
The name of the active profile property.


ACTIVE_MEAN_WIND

public static String ACTIVE_MEAN_WIND
The name of the active mean-wind property.

Constructor Detail

WindProfileDisplay

protected WindProfileDisplay(DisplayImpl displayImpl,
                             Real minZ,
                             Real maxZ,
                             int displayableCount,
                             DisplayRealType verticalDisplayRealType)
                      throws VisADException,
                             RemoteException
Constructs with limits on min and max geopotential altitudes.

Parameters:
displayImpl - The VisAD display.
minZ - The minimum altitude.
maxZ - The maximum altitude.
displayableCount - The anticipated numer of Displayable-s.
verticalDisplayRealType - The type of the display vertical dimension.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
Method Detail

getDefaultMinAltitude

protected static Real getDefaultMinAltitude()
Returns the default, minimum altitude.

Returns:
The default, minimum altitude.

getDefaultMaxAltitude

protected static Real getDefaultMaxAltitude()
Returns the default, maximum altitude.

Returns:
The default, maximum altitude.

getWindProfileSet

protected WindProfileSet getWindProfileSet()
Returns the set of wind profiles.

Returns:
The set of wind profiles.

setAutoscaleAltitude

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

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

isAutoscaleAltitude

public boolean isAutoscaleAltitude()
Gets the state of automatic altitude-scaling.

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

addProfile

public void addProfile(int index,
                       Field field)
                throws VisADException,
                       RemoteException
Adds a wind profile. The profile will be inserted at the given index. The profile will be invisible.

Parameters:
index - The index of the profile.
field - The wind profile.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

removeProfile

public void removeProfile(int index)
                   throws IndexOutOfBoundsException,
                          RemoteException,
                          VisADException
Removes a given wind profile.

Parameters:
index - The index of the profile to be removed.
Throws:
IndexOutOfBoundsException - The index was out of range.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setActiveWindProfile

public void setActiveWindProfile(int index)
                          throws VisADException,
                                 RemoteException
Sets the active wind profile.

Parameters:
index - The index of the active wind profile.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setProfileVisible

public void setProfileVisible(int index,
                              boolean visible)
                       throws VisADException,
                              RemoteException
Sets the visibility of a given wind profile.

Parameters:
index - The wind profile index.
visible - Whether or not the wind profile is to be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

newWindProfile

protected abstract WindProfile newWindProfile()
                                       throws VisADException,
                                              RemoteException
Creates the displayable WindProfile appropriate to this instance. This is a template method.

Returns:
The displayable WindProfile appropriate to this instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getWindProfile

public Field getWindProfile()
                     throws RemoteException,
                            VisADException
Gets the currently active wind profile. The function type of the returned profile is a CartesianHorizontalWindOfGeopotentialAltitude.

Returns:
wind profile
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
CartesianHorizontalWindOfGeopotentialAltitude

setMeanWind

public void setMeanWind(int index,
                        Tuple meanWind)
                 throws VisADException,
                        RemoteException
Sets the mean wind.

Parameters:
index - Which mean wind.
meanWind - The mean wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setMeanWind

public void setMeanWind(int index,
                        DataReference meanWindRef)
                 throws VisADException,
                        RemoteException
Sets the mean wind.

Parameters:
index - The index of the mean wind.
meanWindRef - The data reference for the mean wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

removeMeanWind

public void removeMeanWind(int index)
                    throws IndexOutOfBoundsException,
                           VisADException,
                           RemoteException
Removes a given mean-wind.

Parameters:
index - The index of the mean-wind to be removed.
Throws:
IndexOutOfBoundsException - The index was out of range.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setMeanWindVisible

public void setMeanWindVisible(int index,
                               boolean visible)
                        throws VisADException,
                               RemoteException
Sets the visibility of a given mean wind.

Parameters:
index - The index of the mean wind.
visible - Whether or not the mean wind is to be visible.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setActiveMeanWind

public void setActiveMeanWind(int index)
                       throws VisADException,
                              RemoteException
Sets the active mean-wind.

Parameters:
index - The index of the active mean-wind.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

clear

public void clear()
           throws VisADException,
                  RemoteException
Clears the wind data.

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

getMinProfileAltitude

public Real getMinProfileAltitude()
                           throws VisADException,
                                  RemoteException
Returns the minimum profile altitude.

Returns:
The minimum profile altitude.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMaxProfileAltitude

public Real getMaxProfileAltitude()
                           throws VisADException,
                                  RemoteException
Returns the maximum profile altitude.

Returns:
The maximum profile altitude.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setGeopotentialAltitude

public void setGeopotentialAltitude(Real geoAlt)
                             throws VisADException,
                                    RemoteException
Sets the geopotential altitude property.

Parameters:
geoAlt - The new value.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getGeopotentialAltitude

public Real getGeopotentialAltitude()
Returns the geopotential altitude property.

Returns:
The geopotential altitude property.

getProfileSpeed

protected Real getProfileSpeed()
Returns the profile-wind-speed property.

Returns:
The profile-wind-speed property.

getProfileDirection

protected Real getProfileDirection()
Returns the profile-wind-direction property.

Returns:
The profile-wind-direction property.

setBackgroundVisible

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

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

setAltitudeScaleVisible

public void setAltitudeScaleVisible(boolean visible)
                             throws VisADException,
                                    RemoteException
Sets the visiblity of the altitude scale.

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

computeIncrement

protected double computeIncrement(double extent,
                                  int maxCount)
Computes the increment for displaying an extent.

Parameters:
extent - The extent.
maxCount - The maximum number of intervals.
Returns:
The increment for displaying the extent.

setAltitudeMapRange

protected void setAltitudeMapRange()
                            throws RemoteException,
                                   VisADException
Scales the altitude ScalarMap.

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

setAltitudeColorMapRange

protected void setAltitudeColorMapRange()
                                 throws RemoteException,
                                        VisADException
Scales the altitude-color ScalarMap.

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

setDisplayAltitudeExtent

protected void setDisplayAltitudeExtent()
                                 throws VisADException,
                                        RemoteException
Sets the extent of the displayed altitudes.

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

setDisplayAltitudeExtent

public void setDisplayAltitudeExtent(RealTuple extent)
                              throws VisADException,
                                     RemoteException
Sets the extent of the displayed altitudes.

Parameters:
extent - The extent of the displayed altitudes.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

displayAltitudeExtentChange

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

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

getMinDisplayAltitude

public Real getMinDisplayAltitude()
                           throws VisADException,
                                  RemoteException
Returns the minimum, display altitude.

Returns:
The minimum, display altitude.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getMaxDisplayAltitude

public Real getMaxDisplayAltitude()
                           throws VisADException,
                                  RemoteException
Returns the maximum, display altitude.

Returns:
The maximum, display altitude.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setAltitudeUnit

public void setAltitudeUnit(Unit geoAltUnit)
                     throws UnitException,
                            VisADException,
                            RemoteException
Sets the displayed, altitude unit.

Parameters:
geoAltUnit - The displayed, altitude unit.
Throws:
UnitException - Argument has incompatible unit.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getAltitudeUnit

public Unit getAltitudeUnit()
Returns the displayed, altitude unit.

Returns:
The displayed, altitude unit.

setCursorPosition

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

Parameters:
position - The cursor position.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getCursorPosition

public double[] getCursorPosition()
Returns the cursor position.

Returns:
The cursor position.

newMeanWind

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

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 abstract Displayable newMeanWind(DataReference meanWindRef)
                                    throws VisADException,
                                           RemoteException
Returns a MeanWind Displayable corresponding to a mean-wind Tuple.

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 abstract Displayable newMeanWind()
Returns the MeanWind Displayable with a missing mean-wind.

Returns:
The MeanWind Displayable with a missing mean-wind.