Package ucar.visad.display
Class Contour2DDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
ucar.visad.display.LineDrawing
ucar.visad.display.ContourLines
ucar.visad.display.Contour2DDisplayable
- All Implemented Interfaces:
GridDisplayable
A class to support showing 2D gridded data as colored contours on a plane
in a NavigatedDisplay.
- Version:
- $Revision: 1.40 $
- Author:
- IDV Development Team
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
-
Field Summary
FieldsFields inherited from class ucar.visad.display.ContourLines
COLOR_FILL, CONTOUR_LEVELS, CONTOUR_REAL_TYPE, LABELING
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
ConstructorsModifierConstructorDescriptionContour2DDisplayable
(String name) Constructs an instance with the supplied name and null initial RealType.Contour2DDisplayable
(String name, boolean alphaFlag) Constructs an instance with the supplied name and null initial RealType and given alphaFlagContour2DDisplayable
(String name, boolean alphaFlag, boolean colorFill) Constructs an instance with the supplied name and null initial RealType and given alphaFlag and colorFillContour2DDisplayable
(String name, RealType c2dRealType, float[][] colorPalette) Constructs from a name for the Displayable and the type of the parameter.Contour2DDisplayable
(String name, RealType c2dRealType, float[][] colorPalette, boolean alphaFlag) Constructs from a name for the Displayable and the type of the parameter.Contour2DDisplayable
(String name, RealType c2dRealType, float[][] colorPalette, float[] rangeLimits) Constructs from a name for the Displayable and the type of the parameter.protected
Constructs from a Contour2DDisplayable. -
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of this instance suitable for another VisAD display.float[][]
Return the current color palette (color table).double[]
Get the color rangedouble[]
Get the color rangeReturns the RealType of the RGB parameter.boolean
hasRange()
Returns whether this Displayable has a valid range (i.e., lowRange and highRange are both not NaN'svoid
Set the appropriate ScalarMaps based on the data and then load the data into the DataReference.void
setC2DRealType
(RealType realType) Sets the RealType of the parameter.void
Override setColor to actually set a color palette since this class has bothvoid
setColoredByAnother
(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.void
setColorFill
(boolean yesorno) Set whether the contours should be displayed as color-filled contours.void
This method with no argument sets the default Vis5D color spectrum.void
setColorPalette
(float[][] colorPalette) This method sets the color palette according to the color table in argument; pair this method with setRangeForColor below to get a fixed association of color table and range of values.void
setColorUnit
(Unit unit) Set the units for the displayed rangevoid
setContourLevels
(float interval, float base, float min, float max) Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); invalid input: '&' setContourLevels (interval, base, min, max);void
setContourLevels
(float interval, float base, float min, float max, boolean dash) Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); setContourLevels (interval, base, min, max);void
setDisplayUnit
(Unit unit) Set the units for the displayed rangevoid
Set the data into the Displayablevoid
setRangeForColor
(double low, double high) To make a connection between a particular color and a particular data value or a range of data values ...protected void
setRGBRealType
(RealType realType) Sets the RealType of the RGB parameter.protected boolean
Does this object use the displayUnit (or the colorUnit) for its display unit.Methods inherited from class ucar.visad.display.ContourLines
getColorFillEnabled, getContourLevels, getContourRealType, getContourValues, getDashedStyle, isLabeling, setContourInfo, setContourInterval, setContourInterval, setContourLevels, setContourRealType, setDashedStyle, setFont, setLabelFreq, setLabeling, setLabelSkip, setRange, setScalarMaps
Methods inherited from class ucar.visad.display.LineDrawing
getColor, getLineStyle, getLineWidth, getPointSize, setHSV, setHSV, setLineStyle, setLineWidth, setPointSize, setRGB, setRGB, setRGBA, setRGBA
Methods inherited from class ucar.visad.display.DisplayableData
addAction, 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, setConstantPosition, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
-
Field Details
-
RGB_REAL_TYPE
The name of the "RGB real-type" property.- See Also:
-
-
Constructor Details
-
Contour2DDisplayable
Constructs an instance with the supplied name and null initial RealType.- Parameters:
name
- a String identifier- Throws:
VisADException
- from construction of super classRemoteException
- from construction of super class
-
Contour2DDisplayable
Constructs an instance with the supplied name and null initial RealType and given alphaFlag- Parameters:
name
- a String identifieralphaFlag
- true if should use RGBA- Throws:
VisADException
- from construction of super classRemoteException
- from construction of super class
-
Contour2DDisplayable
public Contour2DDisplayable(String name, boolean alphaFlag, boolean colorFill) throws VisADException, RemoteException Constructs an instance with the supplied name and null initial RealType and given alphaFlag and colorFill- Parameters:
name
- a String identifieralphaFlag
- true if should use RGBAcolorFill
- true if contours should be color filled- Throws:
VisADException
- from construction of super classRemoteException
- from construction of super class
-
Contour2DDisplayable
public Contour2DDisplayable(String name, RealType c2dRealType, float[][] colorPalette, float[] rangeLimits) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the parameter.- Parameters:
name
- The name for the displayable.c2dRealType
- The type of the parameter. May benull
.colorPalette
- The initial colorPalette to use. May benull
(Vis5D palette used as default).rangeLimits
- limits of the color range- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure. deprecated rangeLimits not needed
-
Contour2DDisplayable
public Contour2DDisplayable(String name, RealType c2dRealType, float[][] colorPalette) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the parameter.- Parameters:
name
- The name for the displayable.c2dRealType
- The type of the parameter. May benull
.colorPalette
- The initial colorPalette to use. May benull
(Vis5D palette used as default).- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
Contour2DDisplayable
public Contour2DDisplayable(String name, RealType c2dRealType, float[][] colorPalette, boolean alphaFlag) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the parameter.- Parameters:
name
- The name for the displayable.c2dRealType
- The type of the parameter. May benull
.colorPalette
- The initial colorPalette to use. May benull
(Vis5D palette used as default).alphaFlag
- true if should use RGBA- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
Contour2DDisplayable
Constructs from a Contour2DDisplayable.- Parameters:
that
- a Contour2DDisplayable.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
-
Method Details
-
useDisplayUnitForColor
protected boolean useDisplayUnitForColor()Does this object use the displayUnit (or the colorUnit) for its display unit.- Returns:
- false if contour lines are colored by another field otherwise true
-
setC2DRealType
Sets the RealType of the parameter.- Parameters:
realType
- The RealType of the parameter. May not benull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setColorPalette
This method with no argument sets the default Vis5D color spectrum.- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setColor
Override setColor to actually set a color palette since this class has both- Overrides:
setColor
in classLineDrawing
- Parameters:
color
- Color to use- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setColorPalette
This method sets the color palette according to the color table in argument; pair this method with setRangeForColor below to get a fixed association of color table and range of values.- Overrides:
setColorPalette
in classDisplayable
- Parameters:
colorPalette
- The initial colorPalette to use. May benull
(Vis5D palette used as default).- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setRangeForColor
To make a connection between a particular color and a particular data value or a range of data values ... "This mapping is determined by the low and high values passed to ScalarMap.setRange(), and by the 'float[][] table' array passed to BaseColorControl.setTable(). The table values (length = table[0].length) are distributed evenly over the (low, high) range. If an application does not call setRange(), then the range is determined by the range of values in displayed data objects." (BH)- Overrides:
setRangeForColor
in classDisplayable
- Parameters:
low
- The minimum value of the parameter matched to the low end of the color table.high
- The maximum value of the parameter matched to the high end of the color table.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getRangeforColor
public double[] getRangeforColor()Get the color range- Returns:
- an array of the low and high values for the range deprecated use #getRangeForColor()
-
getRangeForColor
public double[] getRangeForColor()Get the color range- Returns:
- an array of the low and high values for the range
-
getColorPalette
public float[][] getColorPalette()Return the current color palette (color table).- Returns:
- float[][] a VisAD color table
-
setGrid2D
Set the data into the Displayable- Parameters:
field
- a VisAD FieldImpl with a 2D nature.- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object deprecated Should use loadData now
-
loadData
Set the appropriate ScalarMaps based on the data and then load the data into the DataReference.- Specified by:
loadData
in interfaceGridDisplayable
- Parameters:
field
- a 2D VisAD Field representing the data- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setRGBRealType
Sets the RealType of the RGB parameter.- Parameters:
realType
- The RealType of the RGB parameter. May not benull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setColorFill
Set whether the contours should be displayed as color-filled contours. Need to override because if color filled is turned on, we need to make sure that the RGB type is the same as the Contour type.- Overrides:
setColorFill
in classContourLines
- Parameters:
yesorno
- true for color fill- Throws:
VisADException
- unable to set thisRemoteException
- unable to set this on remote display
-
getRGBRealType
Returns the RealType of the RGB parameter.- Returns:
- The RealType of the color parameter. May
be
null
.
-
setContourLevels
public void setContourLevels(float interval, float base, float min, float max) throws VisADException, RemoteException Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); invalid input: '&' setContourLevels (interval, base, min, max);- Parameters:
interval
- delta value between contoursbase
- one contour must be of this valuemin
- no contour below this valuemax
- no contour above this value- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setContourLevels
public void setContourLevels(float interval, float base, float min, float max, boolean dash) throws VisADException, RemoteException Set appropriate contour levels with super class's methods (BOTH REQUIRED IN THIS ORDER) setRange(min, max); setContourLevels (interval, base, min, max);- Parameters:
interval
- delta value between contoursbase
- one contour must be of this valuemin
- no contour below this valuemax
- no contour above this valuedash
- dash contours below base- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
hasRange
public boolean hasRange()Returns whether this Displayable has a valid range (i.e., lowRange and highRange are both not NaN's- Returns:
- true if the range for color has been set (i.e. not NaN)
-
setDisplayUnit
Set the units for the displayed range- Overrides:
setDisplayUnit
in classContourLines
- Parameters:
unit
- Unit for display- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setColorUnit
Set the units for the displayed range- Overrides:
setColorUnit
in classDisplayable
- Parameters:
unit
- Unit for display- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.- Overrides:
cloneForDisplay
in classDisplayableData
- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setColoredByAnother
public void setColoredByAnother(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.- Specified by:
setColoredByAnother
in interfaceGridDisplayable
- Parameters:
yesno
- true if colored by another
-