Package ucar.visad.display
Class ContourLines
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
ucar.visad.display.LineDrawing
ucar.visad.display.ContourLines
- Direct Known Subclasses:
BackgroundContours
,Contour2DDisplayable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The name of the "color fill" property.static final String
The name of the "contour levels" property.static final String
The name of the "contour real-type" property.static final String
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, renderer, VISIBLE
Fields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET
-
Constructor Summary
ConstructorsConstructorDescriptionContourLines
(String name, RealType contourRealType) Constructs from a name for the Displayable and the type of the contour parameter.ContourLines
(ContourLines that) Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Ask if color filled contours are enabled.final ContourLevels
Returns the contour levels.Returns the RealType of the contoured parameter.final float[]
Gets the contour values.int
Set the dashed style.final boolean
Returns the labeling of contour lines.void
setColorFill
(boolean yesorno) Set whether the contours should be displayed as color-filled contours.void
setContourInfo
(ContourInfo contourInfo) Set appropriate contour levels infofinal void
setContourInterval
(float inter, float base, float min, float max) Sets the contour values, with interval, min, max, base.final void
setContourInterval
(float inter, float base, float min, float max, boolean dash) Sets the contour values, with interval, min, max, base and dash.final void
setContourLevels
(ContourLevels contourLevels) Sets the contour values.protected void
setContourRealType
(RealType realType) Sets the RealType of the contoured parameter.void
setDashedStyle
(int style) Set the dashed style.void
setDisplayUnit
(Unit unit) Set the units for the displayed rangevoid
Set the fontvoid
setLabelFreq
(int freq) Set the label frequencyfinal void
setLabeling
(boolean on) Sets the labeling of contour lines.void
setLabelSkip
(int skip) Set the label skipprotected 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, setDragAdapter, setManipulable, setPickable, setPointMode, setUseFastRendering, setVisible, showme, toString
Methods inherited from class ucar.visad.display.Displayable
addConstantMap, addConstantMaps, addDataReferences, addPropertyChangeListener, addPropertyChangeListener, addRefsInvoked, addScalarMap, addScalarMaps, applyColorUnit, applyDisplayUnit, checkUnit, combineConstantMaps, destroyDisplayable, firePropertyChange, firePropertyChange, fireScalarMapSetChange, getColorUnit, getConstantMaps, getDestroyed, 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, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
-
Field Details
-
CONTOUR_LEVELS
The name of the "contour levels" property.- See Also:
-
LABELING
The name of the "labeling" property.- See Also:
-
CONTOUR_REAL_TYPE
The name of the "contour real-type" property.- See Also:
-
COLOR_FILL
The name of the "color fill" property.- See Also:
-
-
Constructor Details
-
ContourLines
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 benull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
ContourLines
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 Details
-
setContourRealType
Sets the RealType of the contoured parameter.- Parameters:
realType
- The RealType of the contoured parameter. May not benull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getContourRealType
Returns the RealType of the contoured parameter.- Returns:
- The RealType of the contoured parameter. May
be
null
.
-
setRange
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:
-
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.base
- The base contour value.min
- The minimum contour value.max
- The maximum contour value.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.- See Also:
-
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.base
- The base contour value.min
- The minimum contour value.max
- The maximum 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:
-
setScalarMaps
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 withnull
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 invokesuper.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 already in the set.
-
getContourLevels
Returns the contour levels.- Returns:
- The Contour levels. The default value is an empty set of levels.
-
getContourValues
Gets the contour values.- Returns:
- The contour values.
- Throws:
VisADException
- VisAD failure.
-
setContourInfo
Set appropriate contour levels info- Overrides:
setContourInfo
in classDisplayable
- Parameters:
contourInfo
- Contains contour and labeling information- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setColorFill
Set whether the contours should be displayed as color-filled contours.- Parameters:
yesorno
- true for color fill- Throws:
VisADException
- unable to set thisRemoteException
- 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
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
Set the units for the displayed range- Overrides:
setDisplayUnit
in classDisplayable
- Parameters:
unit
- Unit for display- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setLabelFreq
Set the label frequency- Parameters:
freq
- label frequency- Throws:
RemoteException
- Java RMI ExceptionVisADException
- Problem setting the dashed style
-
setLabelSkip
Set the label skip- Parameters:
skip
- label skip- Throws:
RemoteException
- Java RMI ExceptionVisADException
- Problem setting the dashed style
-
setDashedStyle
Set the dashed style.- Parameters:
style
- dashed line style- Throws:
RemoteException
- Java RMI ExceptionVisADException
- Problem setting the dashed style
-
setFont
Set the font- Parameters:
font
- the font name/weightsize
- the label (font) sizealign
- _more_- Throws:
RemoteException
- Java RMI ExceptionVisADException
- Problem setting the dashed style
-
getDashedStyle
public int getDashedStyle()Set the dashed style.- Returns:
- dashed line style
-