visad
Class ContourControl

java.lang.Object
  extended byvisad.Control
      extended byvisad.ContourControl
All Implemented Interfaces:
Cloneable, Serializable

public class ContourControl
extends Control

ContourControl is the VisAD class for controlling IsoContour display scalars.

See Also:
Serialized Form

Nested Class Summary
(package private)  class ContourControl.ZoomDoneListener
           
 
Field Summary
(package private)  boolean contourFill
           
 
Fields inherited from class visad.Control
display, displayRenderer
 
Constructor Summary
ContourControl(DisplayImpl d)
          Construct a new ContourControl for the display
 
Method Summary
 void addProjectionControlListener(ControlListener cl, ProjectionControl pcntrl)
          remove previous projListener from pcntrl, and save cl as new projListener
 Object clone()
           
 boolean contourFilled()
           
 void enableContours(boolean on)
          set contour enable
 void enableLabels(boolean on)
          set label enable
 boolean equals(Object o)
          Indicates whether or not this instance equals an Object
 boolean getAutoSizeLabels()
           
static double getInitScale()
           
 double getLabelSize()
           
 float[] getLevels(float[] lowhibase, boolean[] dashes)
          get 'new' descriptors for 2-D contour lines
 void getMainContours(boolean[] bvalues, float[] fvalues)
          get parameters for IsoContour depictions
 boolean getPublicSet()
           
 String getSaveString()
           
 void nullControl()
          End this control (called by ScalarMap.nullDisplay()).
 void reLabel()
          if zoom scale has changed sufficiently, re-transform in order to recompute labels
 void setAutoScaleLabels(boolean flag)
          set enable for label auto-size
 void setContourFill(boolean flag)
           
 void setContourInterval(float interval, float low, float hi, float ba)
          Sets the parameters for contour iso-lines.
 void setContourLimits(float low, float hi)
          Set low and high iso-line levels
 void setLabelSize(double factor)
          set size for label auto-size
 void setLevels(float[] levels, float base, boolean dash)
          Set arbitrary levels for 2-D contour lines; levels below base are dashed if dash == true
(package private)  void setMainContours(boolean[] bvalues, float[] fvalues)
          set parameters for IsoContour depictions, if not already set
(package private)  void setMainContours(boolean[] bvalues, float[] fvalues, boolean noChange)
          set parameters for IsoContour depictions, if not already set
(package private)  void setMainContours(boolean[] bvalues, float[] fvalues, boolean noChange, boolean override)
          set parameters for IsoContour depictions
 void setSaveString(String save)
          reconstruct this ContourControl using the specified save string
 void setSurfaceValue(float value)
          Set level for iso-surfaces
 void setSurfaceValue(float value, boolean setLevels)
          Set level for iso-surfaces
 void syncControl(Control rmt)
          copy the state of a remote control to this control
 
Methods inherited from class visad.Control
addControlListener, animation_string, changeControl, checkTicks, getDisplay, getDisplayRenderer, getIndex, getInstanceNumber, incTick, peekTicks, removeControlListener, resetTicks, setIndex, setInstanceNumber, setTicks, subCheckTicks, subPeekTicks, subResetTicks, subSetTicks, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contourFill

boolean contourFill
Constructor Detail

ContourControl

public ContourControl(DisplayImpl d)
Construct a new ContourControl for the display

Parameters:
d - Display to associate with this
Method Detail

setMainContours

void setMainContours(boolean[] bvalues,
                     float[] fvalues)
               throws VisADException,
                      RemoteException
set parameters for IsoContour depictions, if not already set

Parameters:
bvalues - must be dimensioned boolean[2], where bvalues[0] enable contours bvalues[1] enable labels (if applicable)
fvalues - must be dimensioned float[5], where fvalues[0] level for iso-surface fvalues[1] interval for iso-lines fvalues[2] low limit for iso-lines fvalues[3] high limit for iso-lines fvalues[4] base for iso-lines
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

setMainContours

void setMainContours(boolean[] bvalues,
                     float[] fvalues,
                     boolean noChange)
               throws VisADException,
                      RemoteException
set parameters for IsoContour depictions, if not already set

Parameters:
bvalues - must be dimensioned boolean[2], where bvalues[0] enable contours bvalues[1] enable labels (if applicable)
fvalues - must be dimensioned float[5], where fvalues[0] level for iso-surface fvalues[1] interval for iso-lines fvalues[2] low limit for iso-lines fvalues[3] high limit for iso-lines fvalues[4] base for iso-lines
noChange - true to not trigger re-transform (false for auto-scale)
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

setMainContours

void setMainContours(boolean[] bvalues,
                     float[] fvalues,
                     boolean noChange,
                     boolean override)
               throws VisADException,
                      RemoteException
set parameters for IsoContour depictions

Parameters:
bvalues - must be dimensioned boolean[2], where bvalues[0] enable contours bvalues[1] enable labels (if applicable)
fvalues - must be dimensioned float[5], where fvalues[0] level for iso-surface fvalues[1] interval for iso-lines fvalues[2] low limit for iso-lines fvalues[3] high limit for iso-lines fvalues[4] base for iso-lines
noChange - true to not trigger re-transform (false for auto-scale)
override - true to set float values even if already set (i.e., not NaNs)
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

setSurfaceValue

public void setSurfaceValue(float value)
                     throws VisADException,
                            RemoteException
Set level for iso-surfaces

Parameters:
value - value of the iso-surface to display
Throws:
VisADException - VisAD error
RemoteException - Java RMI failure.

setSurfaceValue

public void setSurfaceValue(float value,
                            boolean setLevels)
                     throws VisADException,
                            RemoteException
Set level for iso-surfaces

Parameters:
value - value of the iso-surface to display
setLevels - true if this should be used for contour levels
Throws:
VisADException - VisAD error
RemoteException - Java RMI failure.

setContourInterval

public void setContourInterval(float interval,
                               float low,
                               float hi,
                               float ba)
                        throws VisADException,
                               RemoteException
Sets the parameters for contour iso-lines. This method invokes the ControlListener.controlChanged(ControlEvent) method of all registered listeners;

Parameters:
interval - The contour interval. Must be non-zero. If negative, then contour lines below the base will be dashed. Must not be NaN.
low - The minimum contour value. No contour line less than this value will be drawn. Must not be NaN.
hi - The maximum contour value. No contour line greater than this value will be drawn. Must not be NaN.
ba - The base contour value. The contour lines will be integer multiples of the interval away from this value. Must not be NaN.
Throws:
VisADException - The interval is zero or too small.
RemoteException - Java RMI failure.

setContourLimits

public void setContourLimits(float low,
                             float hi)
                      throws VisADException,
                             RemoteException
Set low and high iso-line levels

Parameters:
low - The minimum contour value. No contour line less than this value will be drawn. Must not be NaN.
hi - The maximum contour value. No contour line greater than this value will be drawn. Must not be NaN.
Throws:
VisADException - VisAD error
RemoteException - Java RMI failure.

getPublicSet

public boolean getPublicSet()
Returns:
boolean indicating whether levels have been set by other than auto-scale

setLevels

public void setLevels(float[] levels,
                      float base,
                      boolean dash)
               throws VisADException,
                      RemoteException
Set arbitrary levels for 2-D contour lines; levels below base are dashed if dash == true

Parameters:
levels - An array of contour values to display.
base - The base contour value for dashing. Levels below base are dashed if dash is true
dash - flag for making dashed contours below the base contour value.
Throws:
VisADException - VisAD error
RemoteException - Java RMI failure.

getLevels

public float[] getLevels(float[] lowhibase,
                         boolean[] dashes)
get 'new' descriptors for 2-D contour lines

Parameters:
lowhibase - must be dimensioned float[3], where lowhibase[0] used to return low limit lowhibase[1] used to return high limit lowhibase[2] used to return base
Returns:
float[] array of levels for contour curves

enableLabels

public void enableLabels(boolean on)
                  throws VisADException,
                         RemoteException
set label enable

Parameters:
on - new value for label enable
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

enableContours

public void enableContours(boolean on)
                    throws VisADException,
                           RemoteException
set contour enable

Parameters:
on - new value for contour enable
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

getMainContours

public void getMainContours(boolean[] bvalues,
                            float[] fvalues)
                     throws VisADException
get parameters for IsoContour depictions

Parameters:
bvalues - must be dimensioned boolean[2], where bvalues[0] used to return contour enable bvalues[1] used to return label enable
fvalues - must be dimensioned float[5], where fvalues[0] used to return level for iso-surface fvalues[1] used to return interval for iso-lines fvalues[2] used to return low limit for iso-lines fvalues[3] used to return high limit for iso-lines fvalues[4] used to return base for iso-lines
Throws:
VisADException - a VisAD error occurred

setContourFill

public void setContourFill(boolean flag)
                    throws VisADException,
                           RemoteException
Throws:
VisADException
RemoteException

contourFilled

public boolean contourFilled()
Returns:
contourFill enable

getInitScale

public static double getInitScale()
Returns:
initial scale for label auto-size

setAutoScaleLabels

public void setAutoScaleLabels(boolean flag)
set enable for label auto-size

Parameters:
flag - new value for label auto-size enable

getAutoSizeLabels

public boolean getAutoSizeLabels()
Returns:
label auto-size enable

setLabelSize

public void setLabelSize(double factor)
                  throws VisADException,
                         RemoteException
set size for label auto-size

Parameters:
factor - new size for label auto-size
Throws:
VisADException - a VisAD error occurred
RemoteException - an RMI error occurred

getLabelSize

public double getLabelSize()
Returns:
size for label auto-size

getSaveString

public String getSaveString()
Specified by:
getSaveString in class Control
Returns:
String representation of this ContourControl

setSaveString

public void setSaveString(String save)
                   throws VisADException,
                          RemoteException
reconstruct this ContourControl using the specified save string

Specified by:
setSaveString in class Control
Parameters:
save - - String representation for reconstruction
Throws:
VisADException - if a VisAD error occurs
RemoteException - if an RMI error occurs

addProjectionControlListener

public void addProjectionControlListener(ControlListener cl,
                                         ProjectionControl pcntrl)
remove previous projListener from pcntrl, and save cl as new projListener

Parameters:
cl - new ControlListener for projListener
pcntrl - ProjectionControl

syncControl

public void syncControl(Control rmt)
                 throws VisADException
copy the state of a remote control to this control

Specified by:
syncControl in class Control
Parameters:
rmt - remote Control whose state is copied
Throws:
VisADException - if a VisAD error occurs

equals

public boolean equals(Object o)
Indicates whether or not this instance equals an Object

Overrides:
equals in class Control
Parameters:
o - an Object
Returns:
true if and only if this instance is equal to o

clone

public Object clone()
Overrides:
clone in class Control
Returns:
a copy of this ContourControl

reLabel

public void reLabel()
             throws VisADException,
                    RemoteException
if zoom scale has changed sufficiently, re-transform in order to recompute labels

Throws:
VisADException - if a VisAD error occurs
RemoteException - if an RMI error occurs

nullControl

public void nullControl()
End this control (called by ScalarMap.nullDisplay()). Override to remove zoom control listener.

Overrides:
nullControl in class Control