gov.noaa.pmel.sgt
Class GridAttribute

java.lang.Object
  extended by gov.noaa.pmel.sgt.GridAttribute
All Implemented Interfaces:
Attribute, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class GridAttribute
extends java.lang.Object
implements Attribute, java.lang.Cloneable, java.beans.PropertyChangeListener

Sets the rendering style for grid data. ColorMap, ContourLevels are GridAttribute properties.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
GridCartesianRenderer, ContourLevels, Serialized Form

Field Summary
static int AREA_FILL
          Area fill style.
static int AREA_FILL_CONTOUR
          Area fill and Contour style.
static int CONTOUR
          Contour line style.
static int RASTER
          Raster style.
static int RASTER_CONTOUR
          Raster and Contour style.
 
Constructor Summary
GridAttribute()
          Default constructor.
GridAttribute(ContourLevels clev)
          GridAttribute constructor for CONTOUR style.
GridAttribute(int style, ColorMap cmap)
          GridAttribute constructor for RASTER and AREA_FILL styles.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add listener to changes in GridAttribute properties.
 GridAttribute copy()
          Copy the GridAttribute.
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
 ColorMap getColorMap()
          Get the ColorMap.
 ContourLevels getContourLevels()
          Get the ContourLevels.
 java.lang.String getId()
          Get attribute id.
 int getStyle()
          Get grid style.
 boolean isAreaFill()
          Tests if GridAttribute style is eigther AREA_FILL or AREA_FILL_CONTOUR.
 boolean isBatch()
          Is the attribute in batch mode?
 boolean isContour()
          Tests if GridAttribute style is either CONTOUR, RASTER_CONTOUR, or AREA_FILL_CONTOUR.
 boolean isRaster()
          Tests if GridAttribute style is either RASTER or RASTER_CONTOUR.
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove change listener.
 void setBatch(boolean batch)
          Batch the changes to the attribute.
 void setBatch(boolean batch, boolean local)
          Batch the changes to the attribute and set local flag.
 void setColorMap(ColorMap cmap)
          Set the ColorMap.
 void setContourLevels(ContourLevels clev)
          Set the ContourLevels.
 void setId(java.lang.String id)
          Set attribute id.
 void setStyle(int st)
          Set the grid style.
 java.lang.String toString()
          Get a String representation of the GridAttribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RASTER

public static final int RASTER
Raster style.

See Also:
Constant Field Values

AREA_FILL

public static final int AREA_FILL
Area fill style.

See Also:
Constant Field Values

CONTOUR

public static final int CONTOUR
Contour line style.

See Also:
Constant Field Values

RASTER_CONTOUR

public static final int RASTER_CONTOUR
Raster and Contour style.

Since:
2.0
See Also:
Constant Field Values

AREA_FILL_CONTOUR

public static final int AREA_FILL_CONTOUR
Area fill and Contour style.

Since:
2.0
See Also:
Constant Field Values
Constructor Detail

GridAttribute

public GridAttribute()
Default constructor. Default style is RASTER and default ColorMap is null.


GridAttribute

public GridAttribute(int style,
                     ColorMap cmap)
GridAttribute constructor for RASTER and AREA_FILL styles.

Parameters:
style - grid style
cmap - ColorMap

GridAttribute

public GridAttribute(ContourLevels clev)
GridAttribute constructor for CONTOUR style.

Parameters:
clev - ContourLevels
Method Detail

setContourLevels

public void setContourLevels(ContourLevels clev)
Set the ContourLevels.
Property Change: contourLevels.

Parameters:
clev - ContourLevels

getContourLevels

public ContourLevels getContourLevels()
Get the ContourLevels.

Returns:
ContourLevels

copy

public GridAttribute copy()
Copy the GridAttribute.

Returns:
new GridAttribute

setStyle

public void setStyle(int st)
Set the grid style.
Property Change: style.

Parameters:
st - grid style

getStyle

public int getStyle()
Get grid style.

Returns:
grid style

isRaster

public boolean isRaster()
Tests if GridAttribute style is either RASTER or RASTER_CONTOUR.

Since:
2.0

isContour

public boolean isContour()
Tests if GridAttribute style is either CONTOUR, RASTER_CONTOUR, or AREA_FILL_CONTOUR.

Since:
2.0

isAreaFill

public boolean isAreaFill()
Tests if GridAttribute style is eigther AREA_FILL or AREA_FILL_CONTOUR.

Since:
2.0

getColorMap

public ColorMap getColorMap()
Get the ColorMap.

Returns:
the ColorMap

setColorMap

public void setColorMap(ColorMap cmap)
Set the ColorMap.
Property Change: colorMap.

Parameters:
cmap - the ColorMap

toString

public java.lang.String toString()
Get a String representation of the GridAttribute.

Specified by:
toString in interface Attribute
Overrides:
toString in class java.lang.Object
Returns:
String representation

addPropertyChangeListener

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

Specified by:
addPropertyChangeListener in interface Attribute

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Attribute
Remove change listener.

Specified by:
removePropertyChangeListener in interface Attribute

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

setId

public void setId(java.lang.String id)
Description copied from interface: Attribute
Set attribute id.

Specified by:
setId in interface Attribute
Since:
3.0

getId

public java.lang.String getId()
Description copied from interface: Attribute
Get attribute id.

Specified by:
getId in interface Attribute
Since:
3.0

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

setBatch

public void setBatch(boolean batch)
Description copied from interface: Attribute
Batch the changes to the attribute.

Specified by:
setBatch in interface Attribute
Since:
3.0

setBatch

public void setBatch(boolean batch,
                     boolean local)
Description copied from interface: Attribute
Batch the changes to the attribute and set local flag. Determines whether AttributeChangeEvent will be set local.

Specified by:
setBatch in interface Attribute
Since:
3.0

isBatch

public boolean isBatch()
Description copied from interface: Attribute
Is the attribute in batch mode?

Specified by:
isBatch in interface Attribute
Since:
3.0