edu.wisc.ssec.mcidasv.data.hydra
Class HydraRGBDisplayable

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by edu.wisc.ssec.mcidasv.data.hydra.HydraRGBDisplayable

public class HydraRGBDisplayable
extends DisplayableData


Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
 
Field Summary
private  boolean alphaflag
          flag for whether alpha is used or not
private  ScalarMap animMap
          field index to Animation ScalarMap
static String COLOR_PALETTE
          The name of the "color palette" property.
private  BaseColorControl colorControl
          control for ScalarMap
private  ScalarMap colorMap
          color ScalarMap
private  float[][] colorPalette
          Color Palette
private  String colorPaletteName
           
private  int curvedSize
          default curvedSize
private  double highRange
          high range for colors
private  double highSelectedRange
          high range for select
private  RealType indexRealType
          RealType for the Animation ScalarMap
private  double lowRange
          low range for colors
private  double lowSelectedRange
          low range for select
private  double maxSelect
          high range for select map
private  double minSelect
          low range for select map
private  HydraControl multiSpecCntrl
           
private  float myPointSize
          local point size
static int POLYGON_FILL
          The polygon fill style
static int POLYGON_LINE
          The polygon line style
static int POLYGON_POINT
          The polygon point style
private  int polygonMode
          default polygonMode
static String RGB_REAL_TYPE
          The name of the "RGB real-type" property.
private  RealType rgbRealType
          RealType for the ScalarMap
private  RangeControl selectControl
          Control for select range
private  ScalarMap selectMap
          RealType for the SelectRange ScalarMap
private  RealType selectRealType
          RealType for the SelectRange ScalarMap
private  boolean useDefaultRenderer
           
 
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
protected HydraRGBDisplayable(HydraRGBDisplayable that)
          Constructs from another instance.
  HydraRGBDisplayable(String name, RealType rgbRealType, RealType indexRealType, boolean alphaflag, HydraControl multiSpecCntrl)
          Constructs from a name for the Displayable and the type of the RGB parameter.
  HydraRGBDisplayable(String name, RealType rgbRealType, RealType indexRealType, float[][] colorPalette, boolean alphaflag, Range initRange, HydraControl multiSpecCntrl)
           
  HydraRGBDisplayable(String name, RealType rgbRealType, RealType indexRealType, float[][] colorPalette, String colorPaletteName, boolean alphaflag, Range initRange, HydraControl multiSpecCntrl)
          Constructs from a name for the Displayable and the type of the RGB parameter.
 
Method Summary
private  void applyUnit(ScalarMap colorMap, RealType rgbRealType)
          Apply the correct unit (either the displayUnit or the colorUnit) to the scalar map
private  int convertToVisADPolygonMode(int myMode)
          Converts an RGBDisplayable Polygon mode to the appropriate (or default) VisAD mode
 ScalarMap getAnimationMap()
           
 ScalarMap getColorMap()
           
 float[][] getColorPalette()
          Return the current color palette in this Displayable
 String getColorPaletteName()
           
 int getCurvedSize()
          Return the size of a curved texture
protected  DataRenderer getDataRenderer()
           
 float getPointSize()
          Gets the point size associated with this LineDrawing
 int getPolygonMode()
          Return the type of polygon mode being used
 double[] getRangeforColor()
          Deprecated. use #getRangeForColor()
 double[] getRangeForColor()
          Get the color range
 RealType getRGBRealType()
          Returns the RealType of the RGB parameter.
 RealType getSelectRealType()
          Returns the RealType of the SelectRange parameter.
 boolean hasRange()
          Returns whether this Displayable has a valid range (i.e., lowRange and highRange are both not NaN's
 boolean hasSelectedRange()
          Returns whether this Displayable has a valid range (i.e., lowSelectedRange and highSelectedRange are both not NaN's
private  boolean hasSelectMinMax()
          Check to see if the range has been set for the select
protected  ConstantMap makeCurvedSizeMap(int curvedSize)
          Create the ConstantMap for the texture curve size
private  void setAnimationMap()
           
 void setColor(Color color)
          Make a color palette representing this color and set it as the color pallete.
private  void setColorMaps()
          creates the ScalarMap for color and ColorControl 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; asigns null (doesn't have a name) for the name.
 void setColorPalette(float[][] colorPalette, String name)
          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.
 void setColorUnit(Unit unit)
          Set the units for the displayed range
 void setCurvedSize(int curvedSize)
          Set the curved size for textured displays
 void setDefaultRenderer()
           
 void setDisplayUnit(Unit unit)
          Set the units for the displayed range
 void setGreyPalette()
          This method sets the color palette to shades of grey.
 void setImageRenderer()
           
 void setPointSize(float pointSize)
          Sets the size of points in this Displayable.
 void setPolygonMode(int polygonMode)
          Set the type of polygon display that should be used
 void setRange(double low, double hi)
          Deprecated. use setRangeForColor
 void setRangeForColor(double low, double hi)
          Set the upper and lower limit of the range values associated with a color table.
 void setRangeForSelect(double low, double hi)
          Set the upper and lower limit of the range values associated with a color table.
 void setRGBRealType(RealType realType)
          Sets the RealType of the RGB parameter.
protected  void setScalarMaps(ScalarMapSet maps)
          Sets the set of ScalarMap-s of this instance.
 void setSelectedRange(double low, double hi)
          Set selected range with the range for select
private  void setSelectMap()
           
private  void setSelectMaps()
          creates the ScalarMap for SelectRange and control for this Displayable.
protected  void setSelectRealType(RealType realType)
          Sets the RealType of the select parameter.
 void setVisADPalette()
          This method with no argument sets the default Vis5D color spectrum.
protected  boolean useDisplayUnitForColor()
          Does this object use the displayUnit (or the colorUnit) for its display unit.
 
Methods inherited from class ucar.visad.display.DisplayableData
addAction, cloneForDisplay, dataChange, destroy, getActive, getAnimationSet, getData, getLineWidth, getName, hasData, hasDataObject, isManipulable, isPickable, myAddConstantMaps, myAddDataReferences, myRemoveDataReferences, removeAction, setActive, setData, setDataReference, setDragAdapter, setLineWidth, 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, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayMaster, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setScalarMapSet, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLOR_PALETTE

public static final String COLOR_PALETTE
The name of the "color palette" property.

See Also:
Constant Field Values

RGB_REAL_TYPE

public static final String RGB_REAL_TYPE
The name of the "RGB real-type" property.

See Also:
Constant Field Values

POLYGON_FILL

public static final int POLYGON_FILL
The polygon fill style

See Also:
Constant Field Values

POLYGON_LINE

public static final int POLYGON_LINE
The polygon line style

See Also:
Constant Field Values

POLYGON_POINT

public static final int POLYGON_POINT
The polygon point style

See Also:
Constant Field Values

colorPalette

private float[][] colorPalette
Color Palette


colorPaletteName

private String colorPaletteName

colorMap

private volatile ScalarMap colorMap
color ScalarMap


animMap

private volatile ScalarMap animMap
field index to Animation ScalarMap


colorControl

private volatile BaseColorControl colorControl
control for ScalarMap


rgbRealType

private volatile RealType rgbRealType
RealType for the ScalarMap


selectMap

private ScalarMap selectMap
RealType for the SelectRange ScalarMap


indexRealType

private RealType indexRealType
RealType for the Animation ScalarMap


selectControl

private RangeControl selectControl
Control for select range


selectRealType

private RealType selectRealType
RealType for the SelectRange ScalarMap


alphaflag

private boolean alphaflag
flag for whether alpha is used or not


myPointSize

private float myPointSize
local point size


lowRange

private double lowRange
low range for colors


highRange

private double highRange
high range for colors


polygonMode

private int polygonMode
default polygonMode


curvedSize

private int curvedSize
default curvedSize


lowSelectedRange

private double lowSelectedRange
low range for select


highSelectedRange

private double highSelectedRange
high range for select


minSelect

private double minSelect
low range for select map


maxSelect

private double maxSelect
high range for select map


multiSpecCntrl

private HydraControl multiSpecCntrl

useDefaultRenderer

private boolean useDefaultRenderer
Constructor Detail

HydraRGBDisplayable

public HydraRGBDisplayable(String name,
                           RealType rgbRealType,
                           RealType indexRealType,
                           boolean alphaflag,
                           HydraControl multiSpecCntrl)
                    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 be null.
alphaflag - boolean - will use Display.RBGA if true otherwise only Display.RGB
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

HydraRGBDisplayable

public HydraRGBDisplayable(String name,
                           RealType rgbRealType,
                           RealType indexRealType,
                           float[][] colorPalette,
                           boolean alphaflag,
                           Range initRange,
                           HydraControl multiSpecCntrl)
                    throws VisADException,
                           RemoteException
Throws:
VisADException
RemoteException

HydraRGBDisplayable

public HydraRGBDisplayable(String name,
                           RealType rgbRealType,
                           RealType indexRealType,
                           float[][] colorPalette,
                           String colorPaletteName,
                           boolean alphaflag,
                           Range initRange,
                           HydraControl multiSpecCntrl)
                    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 be null.
colorPalette - The initial colorPalette to use. May be null (Vis5D palette used as default).
alphaflag - boolean - use Display.RBGA if true
initRange - Range to use as initial or first min,max
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

HydraRGBDisplayable

protected HydraRGBDisplayable(HydraRGBDisplayable that)
                       throws VisADException,
                              RemoteException
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 Detail

useDisplayUnitForColor

protected boolean useDisplayUnitForColor()
Does this object use the displayUnit (or the colorUnit) for its display unit. The default is true. This allows derived classes to have this class use the colorUnit.

Returns:
true if the display unit is the same as the color unit

setRGBRealType

public void setRGBRealType(RealType realType)
                    throws RemoteException,
                           VisADException
Sets the RealType of the RGB parameter.

Parameters:
realType - The RealType of the RGB parameter. May not be null.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getColorMap

public ScalarMap getColorMap()

getAnimationMap

public ScalarMap getAnimationMap()

getRGBRealType

public RealType getRGBRealType()
Returns the RealType of the RGB parameter.

Returns:
The RealType of the color parameter. May be null.

getSelectRealType

public RealType getSelectRealType()
Returns the RealType of the SelectRange parameter.

Returns:
The RealType of the select range parameter. May be null.

getDataRenderer

protected DataRenderer getDataRenderer()
                                throws VisADException
Overrides:
getDataRenderer in class DisplayableData
Throws:
VisADException

setDefaultRenderer

public void setDefaultRenderer()

setImageRenderer

public void setImageRenderer()

setScalarMaps

protected void setScalarMaps(ScalarMapSet maps)
                      throws BadMappingException
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 with null 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 invoke super.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 alread in the set.

setColorPalette

public void setColorPalette(float[][] colorPalette,
                            String name)
                     throws RemoteException,
                            VisADException
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.

Parameters:
colorPalette - the color table or color-alpha table desired
colorPaletteName - name for the color table (can be null)
Throws:
VisADException - if a core VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

setColorPalette

public void setColorPalette(float[][] colorPalette)
                     throws VisADException,
                            RemoteException
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; asigns null (doesn't have a name) for the name.

Overrides:
setColorPalette in class Displayable
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

public float[][] getColorPalette()
Return the current color palette in this Displayable

Returns:
a color table float[3][len] or color-alpha table float[4][len]

getColorPaletteName

public String getColorPaletteName()

setColor

public void setColor(Color color)
              throws RemoteException,
                     VisADException
Make a color palette representing this color and set it as the color pallete.

Overrides:
setColor in class Displayable
Parameters:
color - color to use
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setGreyPalette

public final void setGreyPalette()
                          throws RemoteException,
                                 VisADException
This method sets the color palette to shades of grey.

Throws:
VisADException - if a core VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

setVisADPalette

public final void setVisADPalette()
                           throws RemoteException,
                                  VisADException
This method with no argument sets the default Vis5D color spectrum.

Throws:
VisADException - if a core VisAD failure occurs.
RemoteException - if a Java RMI failure occurs.

setRange

public void setRange(double low,
                     double hi)
              throws VisADException,
                     RemoteException
Deprecated. use setRangeForColor

Set the upper and lower limit of the range values associated with a color table.

Parameters:
low - the minimun value
hi - the maximum value
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setRangeForColor

public void setRangeForColor(double low,
                             double hi)
                      throws VisADException,
                             RemoteException
Set the upper and lower limit of the range values associated with a color table. Matches method name in Contour2DDisplayable

Overrides:
setRangeForColor in class Displayable
Parameters:
low - The minimum value of the parameter matched to the low end of the color table.
hi - 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()
Deprecated. use #getRangeForColor()

Get the color range

Returns:
an array of the low and high values for the range

getRangeForColor

public double[] getRangeForColor()
Get the color range

Returns:
an array of the low and high values for the range

applyUnit

private void applyUnit(ScalarMap colorMap,
                       RealType rgbRealType)
                throws VisADException,
                       RemoteException
Apply the correct unit (either the displayUnit or the colorUnit) to the scalar map

Parameters:
colorMap - ScalarMap to apply to
rgbRealType - RealType for default Unit
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setDisplayUnit

public void setDisplayUnit(Unit unit)
                    throws VisADException,
                           RemoteException
Set the units for the displayed range

Overrides:
setDisplayUnit in class Displayable
Parameters:
unit - Unit for display
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setColorUnit

public void setColorUnit(Unit unit)
                  throws VisADException,
                         RemoteException
Set the units for the displayed range

Overrides:
setColorUnit in class Displayable
Parameters:
unit - Unit for display
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

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 range has been set

setPointSize

public void setPointSize(float pointSize)
                  throws VisADException,
                         RemoteException
Sets the size of points in this Displayable.

Overrides:
setPointSize in class DisplayableData
Parameters:
pointSize - Size of points (2 = normal)
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

getPointSize

public float getPointSize()
Gets the point size associated with this LineDrawing

Overrides:
getPointSize in class DisplayableData
Returns:
point size

setPolygonMode

public void setPolygonMode(int polygonMode)
                    throws VisADException,
                           RemoteException
Set the type of polygon display that should be used

Parameters:
polygonMode - polygon mode
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

convertToVisADPolygonMode

private int convertToVisADPolygonMode(int myMode)
Converts an RGBDisplayable Polygon mode to the appropriate (or default) VisAD mode

Parameters:
myMode - polygon mode
Returns:
Java3D mode

getPolygonMode

public int getPolygonMode()
Return the type of polygon mode being used

Returns:
polygon mode

setCurvedSize

public void setCurvedSize(int curvedSize)
                   throws VisADException,
                          RemoteException
Set the curved size for textured displays

Parameters:
curvedSize - size to use (> 0)
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

makeCurvedSizeMap

protected ConstantMap makeCurvedSizeMap(int curvedSize)
                                 throws VisADException,
                                        RemoteException
Create the ConstantMap for the texture curve size

Parameters:
curvedSize - size for texture curve
Returns:
ConstantMap
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

getCurvedSize

public int getCurvedSize()
Return the size of a curved texture

Returns:
curved size

setColorMaps

private void setColorMaps()
                   throws RemoteException,
                          VisADException
creates the ScalarMap for color and ColorControl for this Displayable.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setAnimationMap

private void setAnimationMap()
                      throws RemoteException,
                             VisADException
Throws:
RemoteException
VisADException

setSelectMap

private void setSelectMap()
                   throws RemoteException,
                          VisADException
Throws:
RemoteException
VisADException

setSelectRealType

protected void setSelectRealType(RealType realType)
                          throws RemoteException,
                                 VisADException
Sets the RealType of the select parameter.

Parameters:
realType - The RealType of the RGB parameter. May not be null.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

hasSelectedRange

public boolean hasSelectedRange()
Returns whether this Displayable has a valid range (i.e., lowSelectedRange and highSelectedRange are both not NaN's

Returns:
true if range has been set

setSelectedRange

public void setSelectedRange(double low,
                             double hi)
                      throws VisADException,
                             RemoteException
Set selected range with the range for select

Overrides:
setSelectedRange in class Displayable
Parameters:
low - low select value
hi - hi select value
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

setRangeForSelect

public void setRangeForSelect(double low,
                              double hi)
                       throws VisADException,
                              RemoteException
Set the upper and lower limit of the range values associated with a color table.

Parameters:
low - the minimun value
hi - the maximum value
Throws:
RemoteException - Java RMI error
VisADException - problem creating VisAD object

hasSelectMinMax

private boolean hasSelectMinMax()
Check to see if the range has been set for the select

Returns:
true if it has

setSelectMaps

private void setSelectMaps()
                    throws RemoteException,
                           VisADException
creates the ScalarMap for SelectRange and control for this Displayable.

Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.