Package ucar.visad.display
Class Grid2DDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
ucar.visad.display.RGBDisplayable
ucar.visad.display.Grid2DDisplayable
- All Implemented Interfaces:
GridDisplayable
- Direct Known Subclasses:
ImageSequenceDisplayable
A class to support showing 2D gridded data as color on a plane
in a DisplayMaster.
- Version:
- $Revision: 1.33 $
- Author:
- Stuart Wier
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter -
Field Summary
Fields 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
ConstructorsModifierConstructorDescriptionGrid2DDisplayable(String name, boolean alphaflag) Constructs an instance with the supplied name.Grid2DDisplayable(String name, RealType rgbRealType, float[][] colorPalette, boolean alphaflag) Constructs from a name for the Displayable and the type of the RGB parameter.protectedConstructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of this instance suitable for another VisAD display.intGet the default texture curve sizeprotected DataRendererObtains the DataRenderer for this displayable.booleanGet whether this is textured or smoothedbooleanGet whether this is textured or smoothedbooleanGet whether to always use default renderer instead of specialized one.voidSet the data into the Displayable; set RGB Typeprotected ConstantMapmakeTextureMap(boolean enable) Create a ConstantMap for texture mappingprotected voidmyAddConstantMaps(ConstantMap[] newMaps) Adds this instance's data references to the associated VisAD display if possible.voidsetColoredByAnother(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.voidsetCurvedSize(int size) Set the default texture curve sizevoidSet the data into the DisplayablevoidsetMissingTransparent(boolean enable) Set whether missing values should be shown as transparent or notvoidsetTextureEnable(boolean enable) Set whether this should be shown as color shading or as a texture map.voidA method that subclasses can call to set the texture properties on aGrid2DDisplayable.voidsetUseDefaultRenderer(boolean use) Set whether to always use default renderer instead of specialized one.Methods inherited from class ucar.visad.display.RGBDisplayable
getAutoScaleColorRange, getColorPalette, getPolygonMode, getRangeforColor, getRangeForColor, getRGBRealType, getSelectRealType, getUseRGBTypeForSelect, hasRange, hasSelectedRange, makeCurvedSizeMap, setAutoScaleColorRange, setColor, setColorPalette, setColorUnit, setDisplayUnit, setGreyPalette, setPolygonMode, setRange, setRangeForColor, setRangeForSelect, setRGBRealType, setScalarMaps, setSelectedRange, setSelectRealType, setUseRGBTypeForSelect, setVisADPalette, useDisplayUnitForColorMethods inherited from class ucar.visad.display.DisplayableData
addAction, dataChange, destroy, getActive, getAnimationSet, getData, getLineWidth, getName, getPointSize, hasData, hasDataObject, isManipulable, isPickable, 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, setAdjustFlow, setColorPalette, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setScalarMapSet, setSelectedRange, setUseTimesInAnimation, toFront
-
Constructor Details
-
Grid2DDisplayable
Constructs an instance with the supplied name.- Parameters:
name- a String identifieralphaflag- boolean flag whether to use transparency- Throws:
VisADException- from construction of super classRemoteException- from construction of super class
-
Grid2DDisplayable
public Grid2DDisplayable(String name, RealType rgbRealType, float[][] colorPalette, boolean alphaflag) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the RGB parameter.- Parameters:
name- The name for the displayable.rgbRealType- The type of the RGB parameter. May benull.colorPalette- The initial colorPalette to use. May benull(Vis5D palette used as default).alphaflag- boolean - use Display.RBGA if true- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
Grid2DDisplayable
Constructs from another instance. The following attributes are set from the other instance: color palette, the color RealType.- Parameters:
that- The other instance.- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
-
Method Details
-
setGrid2D
Set the data into the Displayable- Parameters:
field- a VisAD FlatField with a 2D nature- Throws:
VisADException- from construction of VisAd objectsRemoteException- from construction of VisAD objects deprecated Should use setData now.
-
loadData
Set the data into the Displayable; set RGB Type- 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
-
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.
-
getDataRenderer
Obtains the DataRenderer for this displayable.- Overrides:
getDataRendererin classDisplayableData- Returns:
- The DataRenderer for this displayable.
- Throws:
VisADException- VisAD failure.
-
setTextureEnable
Set whether this should be shown as color shading or as a texture map.- Parameters:
enable- true to enable texturing- Throws:
RemoteExceptionVisADException
-
myAddConstantMaps
Adds this instance's data references to the associated VisAD display if possible. This method does not verify that the VisAD display has been set.- Overrides:
myAddConstantMapsin classDisplayableData- Parameters:
newMaps- new maps- Throws:
VisADException- VisAD failure.RemoteException- Java RMI failure.
-
makeTextureMap
Create a ConstantMap for texture mapping- Parameters:
enable- true to enable texture mapping- Returns:
- ConstantMap for Texture mapping based on enable
- Throws:
RemoteException- Java RMI errorVisADException- problem creating VisAD object
-
getTextureEnable
public boolean getTextureEnable()Get whether this is textured or smoothed- Returns:
- true is textured
-
setMissingTransparent
Set whether missing values should be shown as transparent or not- Parameters:
enable- true enable missing transparency- Throws:
RemoteExceptionVisADException
-
getMissingTransparent
public boolean getMissingTransparent()Get whether this is textured or smoothed- Returns:
- true is textured
-
setUseDefaultRenderer
public void setUseDefaultRenderer(boolean use) Set whether to always use default renderer instead of specialized one.- Parameters:
use- true to always use the default renderer
-
getUseDefaultRenderer
public boolean getUseDefaultRenderer()Get whether to always use default renderer instead of specialized one.- Returns:
- true to always use the default renderer
-
setTextureProperties
A method that subclasses can call to set the texture properties on aGrid2DDisplayable. Checks to see if the grid is too big to not do texture mapping.- Parameters:
grid- grid to use to set the properties. Can be null.- Throws:
RemoteExceptionVisADException
-
setColoredByAnother
public void setColoredByAnother(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter. This implementation is a no-op.- Specified by:
setColoredByAnotherin interfaceGridDisplayable- Parameters:
yesno- true if colored by another
-
setCurvedSize
public void setCurvedSize(int size) Set the default texture curve size- Overrides:
setCurvedSizein classRGBDisplayable- Parameters:
size- size of texture
-
getCurvedSize
public int getCurvedSize()Get the default texture curve size- Overrides:
getCurvedSizein classRGBDisplayable- Returns:
- size of curved texture
-