ucar.visad.display
Class RegularContourLevels

java.lang.Object
  extended by ucar.visad.display.ContourLevels
      extended by ucar.visad.display.RegularContourLevels

public final class RegularContourLevels
extends ContourLevels

Provides support for regular contours, which are characterized by a constant contour interval.

Instances of this class are immutable.

Version:
$Revision: 1.12 $
Author:
Steven R. Emmerson

Field Summary
protected  float interval
          The contour interval.
protected  float maximum
          The maximum contour level.
protected  float minimum
          The minimum contour level.
 
Constructor Summary
RegularContourLevels(float interval)
          Constructs an instance.
RegularContourLevels(float interval, float base)
          Constructs an instance.
RegularContourLevels(float interval, float base, float minimum, float maximum)
          Constructs an instance.
RegularContourLevels(float interval, float base, float minimum, float maximum, boolean dash)
          Constructs an instance.
 
Method Summary
 float[] getLevels()
          Gets the contour levels as an array.
 float[] getLevels(float minimum, float maximum)
          Gets the contour levels given a data range.
 void setControl(ContourControl control)
          Sets a VisAD ContourControl.
 void setControl(ContourControl control, float minimum, float maximum)
          Sets a VisAD ContourControl.
 
Methods inherited from class ucar.visad.display.ContourLevels
getBase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interval

protected final float interval
The contour interval.


minimum

protected final float minimum
The minimum contour level.


maximum

protected final float maximum
The maximum contour level.

Constructor Detail

RegularContourLevels

public RegularContourLevels(float interval)
Constructs an instance. The base contour will be zero, the minimum contour will be negative infinity, and the maximum contour will be positive infinity.

Parameters:
interval - The contour interval.

RegularContourLevels

public RegularContourLevels(float interval,
                            float base)
Constructs an instance.

Parameters:
interval - The contour interval.
base - The base contour.

RegularContourLevels

public RegularContourLevels(float interval,
                            float base,
                            float minimum,
                            float maximum)
Constructs an instance.

Parameters:
interval - The contour interval.
base - The base contour. Contours below this level will be dashed.
minimum - The minimum contour. Must be a finite value.
maximum - The maximum contour. Must be a finite value.

RegularContourLevels

public RegularContourLevels(float interval,
                            float base,
                            float minimum,
                            float maximum,
                            boolean dash)
Constructs an instance.

Parameters:
interval - The contour interval.
base - The base contour. Contours below this level will be dashed.
minimum - The minimum contour. Must be a finite value.
maximum - The maximum contour. Must be a finite value.
dash - Whether or not to draw dashed lines for contours less than the base.
Method Detail

getLevels

public float[] getLevels()
                  throws VisADException
Gets the contour levels as an array. This instance must have been constructed with valid range extrema.

Returns:
Contour levels appropriate for the given data range. No contour level will lie outside the valid range. The levels will be ordered by increasing value.
Throws:
VisADException - Invalid range extrema or VisAD failure.

getLevels

public float[] getLevels(float minimum,
                         float maximum)
                  throws VisADException
Gets the contour levels given a data range.

Specified by:
getLevels in class ContourLevels
Parameters:
minimum - The minimum data value. Must be a finite value.
maximum - The maximum data value. Must be a finite value.
Returns:
Contour levels appropriate for the given data range. No contour level will lie outside the range. The levels will be ordered by increasing value.
Throws:
VisADException - Invalid range extrema or VisAD failure.

setControl

public void setControl(ContourControl control)
                throws VisADException,
                       RemoteException
Sets a VisAD ContourControl. This instance must have been constructed with minimum and maximum range values.

Specified by:
setControl in class ContourLevels
Parameters:
control - The VisAD ContourControl to be set by this object.
Throws:
VisADException - Invalid range extrema or VisAD failure.
RemoteException - Java RMI failure.

setControl

public void setControl(ContourControl control,
                       float minimum,
                       float maximum)
                throws VisADException,
                       RemoteException
Sets a VisAD ContourControl.

Specified by:
setControl in class ContourLevels
Parameters:
control - The VisAD ContourControl to be set by this object.
minimum - The minimum value. Shall be a finite value.
maximum - The maximum value. Shall be a finite value.
Throws:
VisADException - Invalid range extrema or VisAD failure.
RemoteException - Java RMI failure.