ucar.visad.display
Class FrontDrawer

java.lang.Object
  extended by ucar.visad.display.Displayable
      extended by ucar.visad.display.DisplayableData
          extended by ucar.visad.display.FrontDrawer

public class FrontDrawer
extends DisplayableData

FrontDrawer is the VisAD class for manipulation of fronts. Is was originally taken from the class visad.bom.FrontDrawer


Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.visad.display.DisplayableData
DisplayableData.DragAdapter
 
Field Summary
 double baseScale
          default base scale
static String[] BASETYPES
          base type to use
static String[] LABELS
          labels for types
static String TYPE_COLD_FRONT
          identifier for cold front
static String TYPE_CONVERGENCE
          identifier for convergence
static String TYPE_DRY_LINE
          identifier for dry line
static String TYPE_FRONTOGENESIS
          identifier for frontogenesis
static String TYPE_FRONTOLYSIS
          identifier for frontolysis
static String TYPE_ISOTHERMS
          identifier for isotherms
static String TYPE_LIFTED_INDEX
          identifier for lifted index
static String TYPE_LOW_LEVEL_JET
          identifier for low level jet
static String TYPE_LOWER_THERMAL_TROUGH
          identifier for lower level thermal trough
static String TYPE_MOISTURE
          identifier for moisture
static String TYPE_OCCLUDED_FRONT
          identifier for occluded front
static String TYPE_RIDGE
          identifier for ridge
static String TYPE_STATIONARY_FRONT
          identifier for stationary front
static String TYPE_THICKNESS_RIDGE
          identifier for thickness ridge
static String TYPE_TOTAL_TOTALS
          identifier for total-totals
static String TYPE_TROUGH
          identifier for trough
static String TYPE_UNEVEN_LOW_LEVEL_JET
          identifier for uneven low level jet
static String TYPE_UPPER_COLD_FRONT
          identifier for upper cold front
static String TYPE_UPPER_LEVEL_JET
          identifier for upper level jet
static String TYPE_UPPER_THERMAL_TROUGH
          identifier for upper level thermal trough
static String TYPE_UPPER_WARM_FRONT
          identifier for upper warm front
static String TYPE_WARM_FRONT
          identifier for warm front
static String[] TYPES
          all types
 
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
FrontDrawer(FrontDrawer that)
          Create a front drawer from another instance
FrontDrawer(int fw, String frontType)
          Create a front drawer with the front type
FrontDrawer(int fw, String frontType, boolean doColors)
          Create a front drawer with the front type
 
Method Summary
 Displayable cloneForDisplay()
          Clone for display
static float curveLength(float[][] curve, float[] seg_length)
          Get the curve length; assumes curve is float[2][len] and seg_length is float[len-1]
 boolean getFlipTheFlip()
          Get the FlipTheFlip property.
static String getLabel(String type)
          Get the label for the type
 void initLatLonMap()
          Initialize the lat/lon scalar maps
 FieldImpl makeFront(float[][] curve_samples)
          Make the front
static float[][] resample_curve(float[][] curve, float increment)
          Resample curve into segments approximately increment in length
 FieldImpl robustCurveToFront(float[][] curve, boolean flip)
          Robustly make a curve to a front
 void setColor(Color color)
          Sets the color of the lines for this Displayable.
 void setCurve(float[][] curve, List curveTimes)
          Set the curve
protected  void setDisplayMaster(DisplayMaster master)
          Set the display master
 void setFlipTheFlip(boolean value)
          Set the FlipTheFlip property.
 void setFrontType(String type)
          Set the front type
 void setLineWidth(float lineWidth)
          Set the line width
 void setScale(double baseScale)
          Set the scale
static float[][] smooth_curve(float[][] curve, int window)
          Smooth the curve
 
Methods 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, 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, setColorPalette, setColorUnit, setConstantPosition, setContourInfo, setDisplay, setDisplayActive, setDisplayInactive, setDisplayUnit, setOverrideAnimationSet, setOverrideAnimationSet, setParent, setRangeForColor, setRangeForColor, setScalarMapSet, setSelectedRange, setSelectedRange, setUseTimesInAnimation, toFront
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_COLD_FRONT

public static final String TYPE_COLD_FRONT
identifier for cold front

See Also:
Constant Field Values

TYPE_WARM_FRONT

public static final String TYPE_WARM_FRONT
identifier for warm front

See Also:
Constant Field Values

TYPE_OCCLUDED_FRONT

public static final String TYPE_OCCLUDED_FRONT
identifier for occluded front

See Also:
Constant Field Values

TYPE_STATIONARY_FRONT

public static final String TYPE_STATIONARY_FRONT
identifier for stationary front

See Also:
Constant Field Values

TYPE_CONVERGENCE

public static final String TYPE_CONVERGENCE
identifier for convergence

See Also:
Constant Field Values

TYPE_FRONTOGENESIS

public static final String TYPE_FRONTOGENESIS
identifier for frontogenesis

See Also:
Constant Field Values

TYPE_FRONTOLYSIS

public static final String TYPE_FRONTOLYSIS
identifier for frontolysis

See Also:
Constant Field Values

TYPE_UPPER_COLD_FRONT

public static final String TYPE_UPPER_COLD_FRONT
identifier for upper cold front

See Also:
Constant Field Values

TYPE_UPPER_WARM_FRONT

public static final String TYPE_UPPER_WARM_FRONT
identifier for upper warm front

See Also:
Constant Field Values

TYPE_TROUGH

public static final String TYPE_TROUGH
identifier for trough

See Also:
Constant Field Values

TYPE_RIDGE

public static final String TYPE_RIDGE
identifier for ridge

See Also:
Constant Field Values

TYPE_MOISTURE

public static final String TYPE_MOISTURE
identifier for moisture

See Also:
Constant Field Values

TYPE_LOW_LEVEL_JET

public static final String TYPE_LOW_LEVEL_JET
identifier for low level jet

See Also:
Constant Field Values

TYPE_UPPER_LEVEL_JET

public static final String TYPE_UPPER_LEVEL_JET
identifier for upper level jet

See Also:
Constant Field Values

TYPE_DRY_LINE

public static final String TYPE_DRY_LINE
identifier for dry line

See Also:
Constant Field Values

TYPE_TOTAL_TOTALS

public static final String TYPE_TOTAL_TOTALS
identifier for total-totals

See Also:
Constant Field Values

TYPE_LIFTED_INDEX

public static final String TYPE_LIFTED_INDEX
identifier for lifted index

See Also:
Constant Field Values

TYPE_ISOTHERMS

public static final String TYPE_ISOTHERMS
identifier for isotherms

See Also:
Constant Field Values

TYPE_THICKNESS_RIDGE

public static final String TYPE_THICKNESS_RIDGE
identifier for thickness ridge

See Also:
Constant Field Values

TYPE_LOWER_THERMAL_TROUGH

public static final String TYPE_LOWER_THERMAL_TROUGH
identifier for lower level thermal trough

See Also:
Constant Field Values

TYPE_UPPER_THERMAL_TROUGH

public static final String TYPE_UPPER_THERMAL_TROUGH
identifier for upper level thermal trough

See Also:
Constant Field Values

TYPE_UNEVEN_LOW_LEVEL_JET

public static final String TYPE_UNEVEN_LOW_LEVEL_JET
identifier for uneven low level jet

See Also:
Constant Field Values

BASETYPES

public static final String[] BASETYPES
base type to use


TYPES

public static final String[] TYPES
all types


LABELS

public static final String[] LABELS
labels for types


baseScale

public double baseScale
default base scale

Constructor Detail

FrontDrawer

public FrontDrawer(int fw,
                   String frontType)
            throws VisADException,
                   RemoteException
Create a front drawer with the front type

Parameters:
fw - window id
frontType - front type
Throws:
RemoteException - On badness
VisADException - On badness

FrontDrawer

public FrontDrawer(int fw,
                   String frontType,
                   boolean doColors)
            throws VisADException,
                   RemoteException
Create a front drawer with the front type

Parameters:
fw - window id
frontType - front type
doColors - true to use colors
Throws:
RemoteException - On badness
VisADException - On badness

FrontDrawer

public FrontDrawer(FrontDrawer that)
            throws RemoteException,
                   VisADException
Create a front drawer from another instance

Parameters:
that - the other instance
Throws:
RemoteException - On badness
VisADException - On badness
Method Detail

setColor

public void setColor(Color color)
              throws VisADException,
                     RemoteException
Sets the color of the lines for this Displayable.

Overrides:
setColor in class Displayable
Parameters:
color - color for the line.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

setLineWidth

public void setLineWidth(float lineWidth)
                  throws VisADException,
                         RemoteException
Set the line width

Overrides:
setLineWidth in class DisplayableData
Parameters:
lineWidth - the line width
Throws:
RemoteException - On badness
VisADException - On badness

cloneForDisplay

public Displayable cloneForDisplay()
                            throws RemoteException,
                                   VisADException
Clone for display

Overrides:
cloneForDisplay in class DisplayableData
Returns:
return a clone
Throws:
RemoteException - On badness
VisADException - On badness

setScale

public void setScale(double baseScale)
              throws VisADException,
                     RemoteException
Set the scale

Parameters:
baseScale - the base scale
Throws:
RemoteException - On badness
VisADException - On badness

getLabel

public static String getLabel(String type)
Get the label for the type

Parameters:
type - the type
Returns:
the label

setFrontType

public void setFrontType(String type)
                  throws VisADException,
                         RemoteException
Set the front type

Parameters:
type - the type
Throws:
RemoteException - On badness
VisADException - On badness

setDisplayMaster

protected void setDisplayMaster(DisplayMaster master)
                         throws VisADException,
                                RemoteException
Set the display master

Overrides:
setDisplayMaster in class Displayable
Parameters:
master - the display master
Throws:
RemoteException - On badness
VisADException - On badness

setCurve

public void setCurve(float[][] curve,
                     List curveTimes)
              throws VisADException,
                     RemoteException
Set the curve

Parameters:
curve - the curve coordinates
curveTimes - the curve times
Throws:
RemoteException - On badness
VisADException - On badness

initLatLonMap

public void initLatLonMap()
                   throws VisADException,
                          RemoteException
Initialize the lat/lon scalar maps

Throws:
RemoteException - On badness
VisADException - On badness

makeFront

public FieldImpl makeFront(float[][] curve_samples)
                    throws VisADException,
                           RemoteException
Make the front

Parameters:
curve_samples - the front samples (coords,rgb)
Returns:
a FieldImpl of the front
Throws:
RemoteException - On badness
VisADException - On badness

robustCurveToFront

public FieldImpl robustCurveToFront(float[][] curve,
                                    boolean flip)
                             throws RemoteException
Robustly make a curve to a front

Parameters:
curve - the curve
flip - true to flip the pips
Returns:
the resulting front as a FieldImpl
Throws:
RemoteException - On badness

smooth_curve

public static float[][] smooth_curve(float[][] curve,
                                     int window)
Smooth the curve

Parameters:
curve - the curve
window - the window id
Returns:
a smoothed curve

resample_curve

public static float[][] resample_curve(float[][] curve,
                                       float increment)
Resample curve into segments approximately increment in length

Parameters:
curve - the curve
increment - the increment
Returns:
the resampled curve

curveLength

public static float curveLength(float[][] curve,
                                float[] seg_length)
Get the curve length; assumes curve is float[2][len] and seg_length is float[len-1]

Parameters:
curve - the curve
seg_length - the segment lengths
Returns:
the length of the curve

setFlipTheFlip

public void setFlipTheFlip(boolean value)
Set the FlipTheFlip property. If true then this flips the orientation of the front

Parameters:
value - The new value for FlipTheFlip

getFlipTheFlip

public boolean getFlipTheFlip()
Get the FlipTheFlip property.

Returns:
The FlipTheFlip