gov.noaa.pmel.sgt.contour
Class Contour

java.lang.Object
  extended by gov.noaa.pmel.sgt.contour.Contour
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class Contour
extends java.lang.Object
implements java.beans.PropertyChangeListener

Contour constructs a set of ContourLine objects based on the ContourLevels, SGTGrid, and mask supplied. Used by GridCartesianRenderer for GridAttribute types of CONTOUR.

Since:
2.0
Version:
$Revision$, $Date$
Author:
D. W. Denbo
See Also:
ContourLine, ContourLevels, GridCartesianRenderer, GridAttribute, ContourLineAttribute, DefaultContourLineAttribute

Constructor Summary
Contour(CartesianGraph cg, SGTGrid grid, ContourLevels conLevels)
          Construct a Contour object using a ContourLevels object.
Contour(CartesianGraph cg, SGTGrid grid, double[] levels)
          Construct a Contour object using an array of levels to define the ContourLevels.
Contour(CartesianGraph cg, SGTGrid grid, Range2D range)
          Construct a Contour object using a range to define the ContourLevels.
 
Method Summary
 java.util.Enumeration elements()
          Return the Enumeration of a Vector containing the ContourLine objects.
 void generateContourLabels(java.awt.Graphics g)
          Given the computed ContourLines and the ContourLineAttribute generate the contour labels.
 void generateContourLines()
          Given the current ContourLevels, mask, and SGTGrid generate the ContourLines.
 ContourLevels getContourLevels()
          Get a reference to the ContourLevels object.
 SGTGrid getMask()
          Get the mask.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Reponds to changes in the ContourLevels object.
 void setMask(SGTGrid mask)
          Set a SGTGrid object to be used to mask the data grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Contour

public Contour(CartesianGraph cg,
               SGTGrid grid,
               Range2D range)
Construct a Contour object using a range to define the ContourLevels.


Contour

public Contour(CartesianGraph cg,
               SGTGrid grid,
               double[] levels)
Construct a Contour object using an array of levels to define the ContourLevels.


Contour

public Contour(CartesianGraph cg,
               SGTGrid grid,
               ContourLevels conLevels)
Construct a Contour object using a ContourLevels object.

Method Detail

getContourLevels

public ContourLevels getContourLevels()
Get a reference to the ContourLevels object.


setMask

public void setMask(SGTGrid mask)
Set a SGTGrid object to be used to mask the data grid. The Z values are used to determine the masking, values of NaN and non-zero are set as MISSING.


getMask

public SGTGrid getMask()
Get the mask.


elements

public java.util.Enumeration elements()
Return the Enumeration of a Vector containing the ContourLine objects.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Reponds to changes in the ContourLevels object.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

generateContourLines

public void generateContourLines()
Given the current ContourLevels, mask, and SGTGrid generate the ContourLines.


generateContourLabels

public void generateContourLabels(java.awt.Graphics g)
Given the computed ContourLines and the ContourLineAttribute generate the contour labels. Must be only invoked after generateConourLines().