gov.noaa.pmel.sgt
Class ContourLevels

java.lang.Object
  extended by gov.noaa.pmel.sgt.ContourLevels
All Implemented Interfaces:
java.lang.Cloneable

public class ContourLevels
extends java.lang.Object
implements java.lang.Cloneable

Contains levels and line styles for contour graphics.

Since:
2.0
Version:
$Revision$, $Date$
Author:
Donald Denbo

Constructor Summary
ContourLevels()
           
 
Method Summary
 void addLevel(double val)
          Add a contour level with default ContourLineAttribute.
 void addLevel(double val, ContourLineAttribute l)
          Add a contour level with a specified ContourLineAttribute.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add listener to changes in ColorMap properties.
 ContourLevels copy()
          Create a deep copy.
 ContourLineAttribute getContourLineAttribute(double val)
          Get the ContourLineAttribute for a value.
 ContourLineAttribute getContourLineAttribute(int indx)
          Get the ContourLineAttribute for an index.
static ContourLevels getDefault(double[] array)
          Construct a default ContourLevels object from a double[].
static ContourLevels getDefault(Range2D range)
          Construct a default ContourLevels object from a Range2D.
 DefaultContourLineAttribute getDefaultContourLineAttribute()
          Get the DefaultContourLineAtrribute
 DefaultContourLineAttribute getDefaultContourLineAttribute(double val)
          Get the DefaultContourLineAttribute for value.
 DefaultContourLineAttribute getDefaultContourLineAttribute(int indx)
          Get the DefaultContourLineAttribute for index.
 int getIndex(double val)
          Get the index of a level by value
 int getIndex(java.lang.Double dval)
          Get the index of a level by value
 double getLevel(int indx)
          Get the value of level by index.
 int getMaximumIndex()
          Get the maximum level index.
 Range2D getRange()
          Get the range of levels
 java.util.Enumeration levelElements()
          Get the contour level elements.
 void removeLevel(double val)
          Remove a level by value.
 void removeLevel(int indx)
          Remove a level by index.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setContourLineAttribute(double val, ContourLineAttribute l)
          Set a the ContourLineAttribute for a value.
 void setContourLineAttribute(int indx, ContourLineAttribute l)
          Set a the ContourLineAttribute for an index.
 void setDefaultContourLineAttribute(DefaultContourLineAttribute attr)
          Set the DefaultContourLineAttribute
 int size()
          Get the number of levels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContourLevels

public ContourLevels()
Method Detail

getDefault

public static ContourLevels getDefault(double[] array)
Construct a default ContourLevels object from a double[].


getDefault

public static ContourLevels getDefault(Range2D range)
Construct a default ContourLevels object from a Range2D.


copy

public ContourLevels copy()
Create a deep copy.


levelElements

public java.util.Enumeration levelElements()
Get the contour level elements.


setContourLineAttribute

public void setContourLineAttribute(double val,
                                    ContourLineAttribute l)
                             throws ContourLevelNotFoundException
Set a the ContourLineAttribute for a value.

Throws:
ContourLevelNotFoundException

setContourLineAttribute

public void setContourLineAttribute(int indx,
                                    ContourLineAttribute l)
                             throws ContourLevelNotFoundException
Set a the ContourLineAttribute for an index.

Throws:
ContourLevelNotFoundException

getContourLineAttribute

public ContourLineAttribute getContourLineAttribute(double val)
                                             throws ContourLevelNotFoundException
Get the ContourLineAttribute for a value.

Throws:
ContourLevelNotFoundException

getContourLineAttribute

public ContourLineAttribute getContourLineAttribute(int indx)
                                             throws ContourLevelNotFoundException
Get the ContourLineAttribute for an index.

Throws:
ContourLevelNotFoundException

getDefaultContourLineAttribute

public DefaultContourLineAttribute getDefaultContourLineAttribute()
Get the DefaultContourLineAtrribute


getDefaultContourLineAttribute

public DefaultContourLineAttribute getDefaultContourLineAttribute(int indx)
                                                           throws ContourLevelNotFoundException
Get the DefaultContourLineAttribute for index.

Throws:
ContourLevelNotFoundException

getDefaultContourLineAttribute

public DefaultContourLineAttribute getDefaultContourLineAttribute(double val)
                                                           throws ContourLevelNotFoundException
Get the DefaultContourLineAttribute for value.

Throws:
ContourLevelNotFoundException

setDefaultContourLineAttribute

public void setDefaultContourLineAttribute(DefaultContourLineAttribute attr)
Set the DefaultContourLineAttribute


addLevel

public void addLevel(double val)
Add a contour level with default ContourLineAttribute.


addLevel

public void addLevel(double val,
                     ContourLineAttribute l)
Add a contour level with a specified ContourLineAttribute.


getLevel

public double getLevel(int indx)
                throws ContourLevelNotFoundException
Get the value of level by index.

Throws:
ContourLevelNotFoundException

removeLevel

public void removeLevel(double val)
                 throws ContourLevelNotFoundException
Remove a level by value.

Throws:
ContourLevelNotFoundException

removeLevel

public void removeLevel(int indx)
                 throws ContourLevelNotFoundException
Remove a level by index.

Throws:
ContourLevelNotFoundException

getIndex

public int getIndex(java.lang.Double dval)
Get the index of a level by value


getIndex

public int getIndex(double val)
Get the index of a level by value


getMaximumIndex

public int getMaximumIndex()
Get the maximum level index.


getRange

public Range2D getRange()
Get the range of levels


size

public int size()
Get the number of levels.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes in ColorMap properties.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)