Package edu.wisc.ssec.mcidasv.data.hydra
Class ImageRGBDisplayable
java.lang.Object
ucar.visad.display.Displayable
ucar.visad.display.DisplayableData
edu.wisc.ssec.mcidasv.data.hydra.ImageRGBDisplayable
- All Implemented Interfaces:
GridDisplayable
Provides support for a Displayable that needs a map to
(Display.Red,Display.Green,Display.Blue)
- Version:
- $Revision$
- Author:
- IDV development team
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ScalarMap[]
color ScalarMapsprivate float[][]
color paletteprivate RealTupleType
color MathTypeprivate boolean
flag for whether we use Alpha channel or notprivate DisplayRealType
What do we map withFields 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
ConstructorsModifierConstructorDescriptionprotected
Constructs from another instance.ImageRGBDisplayable
(String name) Constructs from a name for the Displayable and the type of the RGB parameter.ImageRGBDisplayable
(String name, boolean doAlpha) Constructs from a name for the Displayable and the type of the RGB parameter.ImageRGBDisplayable
(String name, float[][] colorPalette, boolean doAlpha) Constructs from a name for the Displayable and the type of the RGB parameter.ImageRGBDisplayable
(String name, float[][] colorPalette, boolean doAlpha, FieldImpl field) -
Method Summary
Modifier and TypeMethodDescriptionfloat[][]
Return the current color palette in this DisplayableGet the RealTupleType of the RGB parameter.protected DataRenderer
Deprecated.use getColorTupleType()void
Set the data into the Displayable; set RGB Typevoid
setAlpha
(float alpha) Set the alpha.void
setColoredByAnother
(boolean yesno) Set whether this GridDisplayable should have the data colored by another parameter.private void
creates the ScalarMaps for color for this Displayable.void
setColorPalette
(float[][] colorPalette) This method sets the color palette according to the color table in argument; pair this method with setRange(lo,high) to get a fixed association of color table and range of values.private void
setColorsInControls
(float[][] colorPalette) Set colors for the controls of all color maps.private void
setColorsInControls
(float[][] colorPalette, int colorMapIndex) Set colors for the control defined by the given colorMapIndex (0, 1, or 2).protected void
setColorTupleType
(RealTupleType realTupleType) Sets the RealTupleType of the RGB parameter.void
setDisplay
(LocalDisplay display) Set the display.protected void
setScalarMaps
(ScalarMapSet maps) Sets the set of ScalarMap-s of this instance.Methods inherited from class ucar.visad.display.DisplayableData
addAction, cloneForDisplay, dataChange, destroy, getActive, getAnimationSet, getData, getLineWidth, getName, getPointSize, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, 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, setColor, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplayActive, setDisplayInactive, setDisplayMaster, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
-
Field Details
-
colorMaps
color ScalarMaps -
colorTupleType
color MathType -
colorPalette
color palette -
mapType
What do we map with -
doAlpha
flag for whether we use Alpha channel or not
-
-
Constructor Details
-
ImageRGBDisplayable
Constructs from a name for the Displayable and the type of the RGB parameter.- Parameters:
name
- The name for the displayable.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
ImageRGBDisplayable
Constructs from a name for the Displayable and the type of the RGB parameter.- Parameters:
name
- The name for the displayable.doAlpha
- true to map to RGBA- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
ImageRGBDisplayable
public ImageRGBDisplayable(String name, float[][] colorPalette, boolean doAlpha) throws VisADException, RemoteException Constructs from a name for the Displayable and the type of the RGB parameter.- Parameters:
name
- The name for the displayable.colorPalette
- The color palettedoAlpha
- true to map to RGBA- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
ImageRGBDisplayable
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.
-
ImageRGBDisplayable
public ImageRGBDisplayable(String name, float[][] colorPalette, boolean doAlpha, FieldImpl field) throws VisADException, RemoteException - Throws:
VisADException
RemoteException
-
-
Method Details
-
loadData
Set the data into the Displayable; set RGB Type- Specified by:
loadData
in interfaceGridDisplayable
- Parameters:
field
- an image or sequence of images- Throws:
VisADException
- from construction of VisAd objectsRemoteException
- from construction of VisAD objects
-
getColorTupleType
Get the RealTupleType of the RGB parameter.- Returns:
- The RealTupleType of the RGB parameters.
May be
null
.
-
setColorTupleType
protected void setColorTupleType(RealTupleType realTupleType) throws RemoteException, VisADException Sets the RealTupleType of the RGB parameter.- Parameters:
realTupleType
- The RealTupleType of the RGB parameters. May not benull
.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
getRGBRealTupleType
Deprecated.use getColorTupleType()Returns the RealTupleType of the RGB parameter.- Returns:
- The RealTupleType of the color parameter. May
be
null
.
-
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 color parameter has not been set or its ScalarMap is already in the set.
-
setAlpha
Set the alpha. Unused.- Parameters:
alpha
- alpha- Throws:
RemoteException
- On badnessVisADException
- On badness
-
setColorMaps
creates the ScalarMaps for color for this Displayable.- Throws:
VisADException
- VisAD failure.RemoteException
- Java RMI failure.
-
setDisplay
public void setDisplay(LocalDisplay display) throws DisplayException, VisADException, RemoteException Set the display.- Overrides:
setDisplay
in classDisplayable
- Parameters:
display
- display to set this into- Throws:
DisplayException
- Display type exceptionRemoteException
- 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 setRange(lo,high) to get a fixed association of color table and range of values.- Overrides:
setColorPalette
in classDisplayable
- Parameters:
colorPalette
- the color table or color-alpha table desired- Throws:
VisADException
- if a core VisAD failure occurs.RemoteException
- if a Java RMI failure occurs.
-
getColorPalette
Return the current color palette in this Displayable- Returns:
- a color table float[3][len] or color-alpha table float[4][len]
-
setColorsInControls
Set colors for the controls of all color maps.- Parameters:
colorPalette
- The 3xN color palette array- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
setColorsInControls
private void setColorsInControls(float[][] colorPalette, int colorMapIndex) throws RemoteException, VisADException Set colors for the control defined by the given colorMapIndex (0, 1, or 2).- Parameters:
colorPalette
- The 3xN color palette arraycolorMapIndex
- Which of the color maps are we setting the color of.- Throws:
RemoteException
- Java RMI errorVisADException
- problem creating VisAD object
-
getDataRenderer
- Overrides:
getDataRenderer
in classDisplayableData
- Throws:
VisADException
-
setColoredByAnother
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
-