ucar.visad.display
Class ContourLines

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by ucar.visad.display.LineDrawing
              extended by ucar.visad.display.ContourLines
Direct Known Subclasses:
BackgroundContours, Contour2DDisplayable

public abstract class ContourLines
extends LineDrawing

Provides support for a Displayable that comprises a set of contour lines.

Instances of this class have the following bound properties:

Name Type Access Default Description
contourLevels ContourLevels set/get no contour levels The displayed contour levels associated with this instance.
labeling boolean set/is false Whether or not the contour lines should be labeled.
contourRealType visad.RealType set/get null The VisAD type of the contoured quantity.
colorFill boolean set/get null Whether or not the contour lines are color filled.

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

Field Summary
static String COLOR_FILL
          The name of the "color fill" property.
static String CONTOUR_LEVELS
          The name of the "contour levels" property.
static String CONTOUR_REAL_TYPE
          The name of the "contour real-type" property.
static String LABELING
          The name of the "labeling" property.
 
Fields inherited from class ucar.visad.display.LineDrawing
COLOR, LINE_STYLE, LINE_WIDTH, POINT_SIZE
 
Fields inherited from class ucar.visad.display.DisplayableData
MANIPULABLE, VISIBLE
 
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
 
Constructor Summary
ContourLines(ContourLines that)
          Constructs from another instance.
ContourLines(String name, RealType contourRealType)
          Constructs from a name for the Displayable and the type of the contour parameter.
 
Method Summary
 boolean getColorFillEnabled()
          Ask if color filled contours are enabled.
 ContourLevels getContourLevels()
          Returns the contour levels.
 RealType getContourRealType()
          Returns the RealType of the contoured parameter.
 float[] getContourValues()
          Gets the contour values.
 boolean isLabeling()
          Returns the labeling of contour lines.
 void setColorFill(boolean yesorno)
          Set whether the contours should be displayed as color-filled contours.
 void setContourInterval(float inter, float base, float min, float max)
          Sets the contour values, with interval, min, max, base.
 void setContourInterval(float inter, float base, float min, float max, boolean dash)
          Sets the contour values, with interval, min, max, base and dash.
 void setContourLevels(ContourLevels contourLevels)
          Sets the contour values.
protected  void setContourRealType(RealType realType)
          Sets the RealType of the contoured parameter.
 void setDisplayUnit(Unit unit)
          Set the units for the displayed range
 void setLabeling(boolean on)
          Sets the labeling of contour lines.
protected  void setRange(float min, float max)
          Sets the range of contour values.
protected  void setScalarMaps(ScalarMapSet maps)
          Sets the set of ScalarMap-s of this instance.
 
Methods inherited from class ucar.visad.display.LineDrawing
getColor, getLineStyle, getLineWidth, getPointSize, setColor, setHSV, setHSV, setLineStyle, setLineWidth, setPointSize, setRGB, setRGB, setRGBA, setRGBA
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, cloneForDisplay, dataChange, destroy, getActive, getAnimationSet, getData, getDataRenderer, getName, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, toString
 
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDisplay, getDisplayMaster, getDisplayUnit, getPointMode, getScalarMap, getScalarMap, getScalarMap, getScalarMapSet, getUseFastRendering, getUseTimesInAnimation, getVisible, isActive, isUnitCompatible, isVisible, logException, removeConstantMap, removeDataReferences, removePropertyChangeListener, removePropertyChangeListener, removeScalarMap, replaceScalarMap, setAdjustFlow, setColorPalette, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTOUR_LEVELS

public static final String CONTOUR_LEVELS
The name of the "contour levels" property.

See Also:
Constant Field Values

LABELING

public static final String LABELING
The name of the "labeling" property.

See Also:
Constant Field Values

CONTOUR_REAL_TYPE

public static final String CONTOUR_REAL_TYPE
The name of the "contour real-type" property.

See Also:
Constant Field Values

COLOR_FILL

public static final String COLOR_FILL
The name of the "color fill" property.

See Also:
Constant Field Values
Constructor Detail

ContourLines

public ContourLines(String name,
                    RealType contourRealType)
             throws VisADException,
                    RemoteException
Constructs from a name for the Displayable and the type of the contour parameter. The contour levels will be the VisAD default and the lines will not be labeled.

Parameters:
name - The name for the displayable.
contourRealType - The type of the contour parameter. May be null.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

ContourLines

public ContourLines(ContourLines that)
             throws VisADException,
                    RemoteException
Constructs from another instance. The following attributes are set from the other instance: contour levels, labeling, the contour RealType, the range minimum, and the range maximum.

Parameters:
that - The other instance.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
Method Detail

setContourRealType

protected void setContourRealType(RealType realType)
                           throws RemoteException,
                                  VisADException
Sets the RealType of the contoured parameter.

Parameters:
realType - The RealType of the contoured parameter. May not be null.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getContourRealType

public RealType getContourRealType()
Returns the RealType of the contoured parameter.

Returns:
The RealType of the contoured parameter. May be null.

setRange

protected void setRange(float min,
                        float max)
                 throws RemoteException,
                        VisADException
Sets the range of contour values.

Parameters:
min - The minimum contour value.
max - The maximum contour value.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setContourLevels

public final void setContourLevels(ContourLevels contourLevels)
                            throws RemoteException,
                                   VisADException
Sets the contour values. This method fires a PropertyChangeEvent for CONTOUR_LEVELS.

Parameters:
contourLevels - The contour values.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
CONTOUR_LEVELS

setContourInterval

public final void setContourInterval(float inter,
                                     float base,
                                     float min,
                                     float max)
                              throws RemoteException,
                                     VisADException
Sets the contour values, with interval, min, max, base. This method fires a PropertyChangeEvent for CONTOUR_LEVELS.

Parameters:
inter - The contour interval.
min - The minimum contour value.
max - The maximum contour value.
base - The base contour value.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
CONTOUR_LEVELS

setContourInterval

public final void setContourInterval(float inter,
                                     float base,
                                     float min,
                                     float max,
                                     boolean dash)
                              throws RemoteException,
                                     VisADException
Sets the contour values, with interval, min, max, base and dash. This method fires a PropertyChangeEvent for CONTOUR_LEVELS.

Parameters:
inter - The contour interval.
min - The minimum contour value.
max - The maximum contour value.
base - The base contour value.
dash - Whether or not to draw dashed lines for contours less than the base contour value.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.
See Also:
CONTOUR_LEVELS

setScalarMaps

protected void setScalarMaps(ScalarMapSet maps)
                      throws BadMappingException
Sets the set of ScalarMap-s of this instance. The ScalarMap-s of this instance will be added to the set before the SCALAR_MAP_SET property is set. This method fires a PropertyChangeEvent for SCALAR_MAP_SET with null for the old value and the new set of ScalarMap-s for the new Value. Intermediate subclasses that have their own ScalarMap-s should override this method and invoke super.setScalarMaps(ScalarMapSet).

Parameters:
maps - The set of ScalarMap-s to be added.
Throws:
BadMappingException - The RealType of the contour parameter has not been set or its ScalarMap is alread in the set.

getContourLevels

public final ContourLevels getContourLevels()
Returns the contour levels.

Returns:
The Contour levels. The default value is an empty set of levels.

getContourValues

public final float[] getContourValues()
                               throws VisADException
Gets the contour values.

Returns:
The contour values.
Throws:
VisADException - VisAD failure.

setColorFill

public void setColorFill(boolean yesorno)
                  throws VisADException,
                         RemoteException
Set whether the contours should be displayed as color-filled contours.

Parameters:
yesorno - true for color fill
Throws:
VisADException - unable to set this
RemoteException - unable to set this on remote display

getColorFillEnabled

public boolean getColorFillEnabled()
Ask if color filled contours are enabled.

Returns:
true if using color-filled contours.

setLabeling

public final void setLabeling(boolean on)
                       throws VisADException,
                              RemoteException
Sets the labeling of contour lines.

Parameters:
on - Whether or not the contour lines should be labeled.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

isLabeling

public final boolean isLabeling()
Returns the labeling of contour lines.

Returns:
true if and only if the contour lines should be labeled.

setDisplayUnit

public void setDisplayUnit(Unit unit)
                    throws VisADException,
                           RemoteException
Set the units for the displayed range

Overrides:
setDisplayUnit in class Displayable
Parameters:
unit - Unit for display
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.