Package ucar.visad.display
Class FlowDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
ucar.visad.display.RGBDisplayable
ucar.visad.display.FlowDisplayable
- All Implemented Interfaces:
GridDisplayable
- Direct Known Subclasses:
WindBarbDisplayable
Provides support for a Displayable displays wind data (u,v) or
(spd, dir) as wind vectors.
- Author:
- IDV Development Team
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringThe name of the color property.static final StringThe name of the "real-type" property.static final intValue for Northern Hemisphere orientationstatic final intValue for Southern Hemisphere orientationprotected intspeed indexprotected Unitmax flow rangeFields inherited from class ucar.visad.display.RGBDisplayable
COLOR_PALETTE, POLYGON_FILL, POLYGON_LINE, POLYGON_POINT, RGB_REAL_TYPEFields inherited from class ucar.visad.display.DisplayableData
LINE_WIDTH, MANIPULABLE, renderer, VISIBLEFields inherited from class ucar.visad.display.Displayable
DISPLAY, parent, SCALAR_MAP_SET -
Constructor Summary
ConstructorsModifierConstructorDescriptionFlowDisplayable(String name, RealTupleType rTT) Constructs from a name for the Displayable and the type of the parameter.FlowDisplayable(String name, RealTupleType rTT, float flowscale) Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"FlowDisplayable(String name, RealTupleType rTT, float flowscale, boolean useSpeedForColor) Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"protectedConstructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of this instance suitable for another VisAD display.booleanCheck to see if this is 3D flowbooleanReturns indicator whether the flow should be adjusted to the earthintReturns indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.Returns the RealTupleType of the parameter.boolean_more_float_more_intGet the index of the speed type if this is not a cartesian windbooleanReturns boolean whether streamlines are enabled.int_more_float[][]_more__more_float_more_intgetZskip()_more_booleanCheck to see if the wind data is cartesian (u,v) or if it's polar (spd, dir).voidSet the data into the DisplayablevoidloadTopoData(FieldImpl topo) _more_voidresets trajectory parmsvoidset3DFlow(boolean threeD) Set to use 3D flowvoidsetAdjustFlow(boolean adjust) Set indicator whether winds should be adusted or notvoidsetArrowHead(boolean onoff) _more_voidsetArrowHeadSize(float size) _more_voidsetAutoScale(boolean auto) Set the autoscale propertyvoidsetBarbOrientation(int style) Set indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.voidSets the color of the vectors.voidsetColoredByAnother(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.protected voidMake ScalarMaps for flow, for 1st and 2nd components of wind vector input data.voidsetFlowRange(double min, double max) Set the range of the flow mapsvoidsetFlowRange(Range flowRange) Set the range of the flow mapsvoidsetFlowScale(float scale) Set the length of shaft on vector or on wind barb.voidsetForward(boolean forw) _more_voidSet the 3d grid (a FlatField) data into the DisplayablevoidsetIgnoreExtraParameters(boolean yesno) Set whether this GridDisplayable should ignore extra parametersvoidsetIsTrajectories(boolean isTrajectories) _more_voidsetRibbonWidth(float width) _more_protected voidsetScalarMaps(ScalarMapSet maps) Sets the set of ScalarMap-s of this instance.voidsetSmoothFactor(int factor) _more_voidsetStartLevel(int startLevel) _more_voidsetStartPoints(RealTupleType types, float[][] stp) _more_voidsetStreamline(boolean streamline) _more_voidsetStreamlineDensity(float density) Set the density of the streamlinesvoidsetStreamlinesEnabled(boolean enable) Sets whether streamlines are enabled.voidsetTracerType(int type) _more_voidsetTrajFormType(int formType) _more_voidsetTrajOffset(float offset) _more_voidsetTrajStartLevel(int startLevel) _more_voidsetTrajStartPoints(float[][] pts) _more_void_more_voidsetTrajWidth(float width) _more_voidsetTrojectoriesEnabled(boolean enable, boolean markerOn, float mSize, boolean refresh) sets trajectory parms if the enable is true.voidsetTrojectoriesEnabled(boolean enable, float mSize, boolean refresh) sets trajectory parms if the enable is true.protected voidsetType(RealTupleType rTT) Sets the RealType of the parameter.voidsetUseSpeedForColor(boolean yesno) Set whether this GridDisplayable should have the data colored by speed.voidsetVectorLength(float len) _more_voidsetZskip(int skip) _more_protected booleanDoes this object use the displayUnit (or the colorUnit) for its display unit.Methods inherited from class ucar.visad.display.RGBDisplayable
getAutoScaleColorRange, getColorPalette, getCurvedSize, getPolygonMode, getRangeforColor, getRangeForColor, getRGBRealType, getSelectRealType, getUseRGBTypeForSelect, hasRange, hasSelectedRange, makeCurvedSizeMap, setAutoScaleColorRange, setColorPalette, setColorUnit, setCurvedSize, setDisplayUnit, setGreyPalette, setPolygonMode, setRange, setRangeForColor, setRangeForSelect, setRGBRealType, setSelectedRange, setSelectRealType, setUseRGBTypeForSelect, setVisADPaletteMethods inherited from class ucar.visad.display.DisplayableData
addAction, dataChange, destroy, getActive, getAnimationSet, getData, getDataRenderer, getLineWidth, getName, getPointSize, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setDragAdapter, setLineWidth, setManipulable, setPickable, setPointMode, setPointSize, setUseFastRendering, setVisible, showme, toStringMethods 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, setColorPalette, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setScalarMapSet, setSelectedRange, setUseTimesInAnimation, toFront
-
Field Details
-
FLOW_TYPE
The name of the "real-type" property.- See Also:
-
COLOR
The name of the color property. -
NH_ORIENTATION
public static final int NH_ORIENTATIONValue for Northern Hemisphere orientation- See Also:
-
SH_ORIENTATION
public static final int SH_ORIENTATIONValue for Southern Hemisphere orientation- See Also:
-
speedUnit
max flow range -
spdIndex
protected int spdIndexspeed index
-
-
Constructor Details
-
FlowDisplayable
public FlowDisplayable(String name, RealTupleType rTT, float flowscale, boolean useSpeedForColor) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"- Parameters:
name- The name for the displayable.rTT- The VisAD RealTupleType of the parameter. May benull.flowscale- A float size for the "flow scale".useSpeedForColor- set to true if you want to color by speed- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
FlowDisplayable
public FlowDisplayable(String name, RealTupleType rTT, float flowscale) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the parameter, and the desired size of "scale"- Parameters:
name- The name for the displayable.rTT- The VisAD RealTupleType of the parameter. May benull.flowscale- A float size for the "flow scale".- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
FlowDisplayable
Constructs from a name for the Displayable and the type of the parameter.- Parameters:
name- The name for the displayable.rTT- The VisAD RealTupleType of the parameter. May benull.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
FlowDisplayable
Constructs from another instance.- Parameters:
that- The other instance.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
-
Method Details
-
getFlowTuple
Returns the RealTupleType of the parameter.- Returns:
- The RealTupleType of the parameter. May
be
null.
-
getStreamlinesEnabled
public boolean getStreamlinesEnabled()Returns boolean whether streamlines are enabled.- Returns:
- boolean whether streamlines are enabled.
-
setStreamlinesEnabled
public void setStreamlinesEnabled(boolean enable) Sets whether streamlines are enabled.- Parameters:
enable- boolean whether streamlines are enabled.
-
setTrojectoriesEnabled
public void setTrojectoriesEnabled(boolean enable, float mSize, boolean refresh) sets trajectory parms if the enable is true.- Parameters:
enable- boolean whether trajectories are enabled.mSize- _more_refresh- _more_
-
setTrojectoriesEnabled
public void setTrojectoriesEnabled(boolean enable, boolean markerOn, float mSize, boolean refresh) sets trajectory parms if the enable is true.- Parameters:
enable- boolean is true if it is traj or cvector.markerOn- _more_mSize- _more_refresh- _more_
-
setIsTrajectories
public void setIsTrajectories(boolean isTrajectories) _more_- Parameters:
isTrajectories- _more_
-
setStreamline
public void setStreamline(boolean streamline) _more_- Parameters:
streamline- _more_
-
resetTrojectories
public void resetTrojectories()resets trajectory parms -
getBarbOrientation
public int getBarbOrientation()Returns indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.- Returns:
- NH_ORIENTATION or SH_ORIENTATION
-
setBarbOrientation
public void setBarbOrientation(int style) Set indicator whether wind barb style is that used in the northern hemisphere or the southern hemisphere.- Parameters:
style- either NH_ORIENTATION or SH_ORIENTATION.
-
getAdjustFlow
public boolean getAdjustFlow()Returns indicator whether the flow should be adjusted to the earth- Returns:
- true to adjust
-
setAdjustFlow
public void setAdjustFlow(boolean adjust) Set indicator whether winds should be adusted or not- Overrides:
setAdjustFlowin classDisplayable- Parameters:
adjust- true to adjust
-
setStreamlineDensity
public void setStreamlineDensity(float density) Set the density of the streamlines- Parameters:
density- typically roughly .1 to 2.
-
setFlowScale
public void setFlowScale(float scale) Set the length of shaft on vector or on wind barb.- Parameters:
scale- typically roughly 0.05 to 0.15.
-
setArrowHead
public void setArrowHead(boolean onoff) _more_- Parameters:
onoff- _more_
-
setArrowHeadSize
public void setArrowHeadSize(float size) _more_- Parameters:
size- _more_
-
setTracerType
public void setTracerType(int type) _more_- Parameters:
type- _more_
-
setVectorLength
public void setVectorLength(float len) _more_- Parameters:
len- _more_
-
setTrajOffset
public void setTrajOffset(float offset) _more_- Parameters:
offset- _more_
-
setSmoothFactor
public void setSmoothFactor(int factor) _more_- Parameters:
factor- _more_
-
setTrajFormType
public void setTrajFormType(int formType) _more_- Parameters:
formType- _more_
-
setTrajStartLevel
public void setTrajStartLevel(int startLevel) _more_- Parameters:
startLevel- _more_
-
getTrajStartLevel
public int getTrajStartLevel()_more_- Returns:
- _more_
-
setTrajWidth
public void setTrajWidth(float width) _more_- Parameters:
width- _more_
-
getTrajWidth
public float getTrajWidth()_more_- Returns:
- _more_
-
setRibbonWidth
public void setRibbonWidth(float width) _more_- Parameters:
width- _more_
-
getRibbonWidth
public float getRibbonWidth()_more_- Returns:
- _more_
-
setZskip
public void setZskip(int skip) _more_- Parameters:
skip- _more_
-
getZskip
public int getZskip()_more_- Returns:
- _more_
-
getForward
public boolean getForward()_more_- Returns:
- _more_
-
setForward
public void setForward(boolean forw) _more_- Parameters:
forw- _more_
-
setTrajStartPointType
_more_- Parameters:
type- _more_
-
getTrajStartPointType
_more_- Returns:
- _more_
-
setTrajStartPoints
public void setTrajStartPoints(float[][] pts) _more_- Parameters:
pts- _more_
-
getTrajStartPoints
public float[][] getTrajStartPoints()_more_- Returns:
- _more_
-
setAutoScale
public void setAutoScale(boolean auto) Set the autoscale property- Parameters:
auto- the autoscale property
-
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 withnullfor 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).- Overrides:
setScalarMapsin classRGBDisplayable- Parameters:
maps- The set of ScalarMap-s to be added.- Throws:
BadMappingException- The types of the maps have not been set or its ScalarMap is already in the set.
-
getSpeedTypeIndex
public int getSpeedTypeIndex()Get the index of the speed type if this is not a cartesian wind- Returns:
- the speed index or -1 if cartesian or not set
-
setFlowMaps
Make ScalarMaps for flow, for 1st and 2nd components of wind vector input data. If data is of form u,v (both components have units convertible with m/s) make map for 1st comp to Display.Flow1X and 2nd comp to Display.Flow1Y. If data is dir,spd or spd, dir, make map for dir comp to Display.Flow1Azimuth and spd comp to Display.Flow1Radial. Note - makes bad plot if data is v,u form- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setFlowRange
Set the range of the flow maps- Parameters:
flowRange- range for flow maps- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setFlowRange
Set the range of the flow maps- Parameters:
min- min valuemax- max value- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setGrid3D
Set the 3d grid (a FlatField) data into the Displayable- Parameters:
field- a VisAD FlatField with a 3D nature- Throws:
VisADException- from construction of VisAd objectsRemoteException- from construction of VisAD objects
-
loadData
Set the data into the Displayable- Specified by:
loadDatain interfaceGridDisplayable- Parameters:
field- a VisAD FlatField with a 2D nature- Throws:
VisADException- from construction of VisAd objectsRemoteException- from construction of VisAD objects
-
loadTopoData
_more_- Parameters:
topo- _more_- Throws:
RemoteException- _more_VisADException- _more_
-
setColor
Sets the color of the vectors. Only overrides super.setColor to fire the property change event for backward compatibility.- Overrides:
setColorin classRGBDisplayable- Parameters:
color- color for the vectors.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
setType
Sets the RealType of the parameter.- Parameters:
rTT- The new RealTupleType of the parameter. May not benull.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
cloneForDisplay
Returns a clone of this instance suitable for another VisAD display. Underlying data objects are not cloned.- Overrides:
cloneForDisplayin classDisplayableData- Returns:
- A semi-deep clone of this instance.
- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
isCartesianWind
public boolean isCartesianWind()Check to see if the wind data is cartesian (u,v) or if it's polar (spd, dir).- Returns:
- true if the wind is cartesian
-
get3DFlow
public boolean get3DFlow()Check to see if this is 3D flow- Returns:
- true if the flow is 3D
-
set3DFlow
public void set3DFlow(boolean threeD) Set to use 3D flow- Parameters:
threeD- true if the flow is 3D
-
useDisplayUnitForColor
protected boolean useDisplayUnitForColor()Does this object use the displayUnit (or the colorUnit) for its display unit. If we have the case where this wind field is colored by another field then this returns false.- Overrides:
useDisplayUnitForColorin classRGBDisplayable- Returns:
- true if the display unit should be used for color
-
setColoredByAnother
public void setColoredByAnother(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.- Specified by:
setColoredByAnotherin interfaceGridDisplayable- Parameters:
yesno- true if colored by another
-
setUseSpeedForColor
public void setUseSpeedForColor(boolean yesno) Set whether this GridDisplayable should have the data colored by speed.- Parameters:
yesno- true if colored by speed
-
setIgnoreExtraParameters
public void setIgnoreExtraParameters(boolean yesno) Set whether this GridDisplayable should ignore extra parameters- Parameters:
yesno- true if extra params should be ignored
-
setStartPoints
_more_- Parameters:
types- _more_stp- _more_
-
setStartLevel
public void setStartLevel(int startLevel) _more_- Parameters:
startLevel- _more_
-