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_TYPE
Fields inherited from class ucar.visad.display.DisplayableData
LINE_WIDTH, MANIPULABLE, renderer, VISIBLE
Fields 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.protected
Constructs from another instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of this instance suitable for another VisAD display.int
Get the default texture curve sizeprotected DataRenderer
Obtains the DataRenderer for this displayable.boolean
Get whether this is textured or smoothedboolean
Get whether this is textured or smoothedboolean
Get whether to always use default renderer instead of specialized one.void
Set the data into the Displayable; set RGB Typeprotected ConstantMap
makeTextureMap
(boolean enable) Create a ConstantMap for texture mappingprotected void
myAddConstantMaps
(ConstantMap[] newMaps) Adds this instance's data references to the associated VisAD display if possible.void
setColoredByAnother
(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.void
setCurvedSize
(int size) Set the default texture curve sizevoid
Set the data into the Displayablevoid
setMissingTransparent
(boolean enable) Set whether missing values should be shown as transparent or notvoid
setTextureEnable
(boolean enable) Set whether this should be shown as color shading or as a texture map.void
A method that subclasses can call to set the texture properties on aGrid2DDisplayable
.void
setUseDefaultRenderer
(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, useDisplayUnitForColor
Methods 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, 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, 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:
loadData
in 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:
cloneForDisplay
in 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:
getDataRenderer
in 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:
RemoteException
VisADException
-
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:
myAddConstantMaps
in 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:
RemoteException
VisADException
-
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:
RemoteException
VisADException
-
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:
setColoredByAnother
in interfaceGridDisplayable
- Parameters:
yesno
- true if colored by another
-
setCurvedSize
public void setCurvedSize(int size) Set the default texture curve size- Overrides:
setCurvedSize
in classRGBDisplayable
- Parameters:
size
- size of texture
-
getCurvedSize
public int getCurvedSize()Get the default texture curve size- Overrides:
getCurvedSize
in classRGBDisplayable
- Returns:
- size of curved texture
-