gov.noaa.pmel.sgt.dm
Class SimpleGrid

java.lang.Object
  |
  +--gov.noaa.pmel.sgt.dm.SimpleGrid
All Implemented Interfaces:
Cartesian, java.lang.Cloneable, CoordinateSystem, SGTData, SGTGrid

public class SimpleGrid
extends java.lang.Object
implements SGTGrid, Cartesian, java.lang.Cloneable

SimpleGrid provides an implementation of the SGTGrid and Cartesian interfaces.

Since:
1.0
Version:
$Revision: 1.17 $, $Date: 2001/12/13 19:07:05 $
Author:
Donald Denbo
See Also:
SGTGrid, Cartesian

Constructor Summary
SimpleGrid()
          Default constructor.
SimpleGrid(double[] grid, double[] xloc, double[] yloc, java.lang.String title)
          Constructor for X and Y coordinates as double.
SimpleGrid(double[] grid, double[] xloc, GeoDate[] tloc, java.lang.String title)
          Constructor for X double and Y time.
SimpleGrid(double[] grid, GeoDate[] tloc, double[] yloc, java.lang.String title)
          Constructor for X time and Y double.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the listener list.
 SGTData copy()
          Create a copy of the grid.
 SGTGrid getAssociatedData()
          Get the associated data.
 java.lang.String getId()
          Get the unique identifier.
 SGLabel getKeyTitle()
          Get a title formatted for a Key.
 GeoDate[] getTimeArray()
          Get the array of temporal values.
 GeoDate[] getTimeEdges()
          Get the Time edges.
 java.lang.String getTitle()
          Get the title.
 int getTSize()
          Get the length of the Time axis
 double[] getXArray()
          Get the array of X values.
 double[] getXEdges()
          Get the X coordinate edges.
 SoTRange getXEdgesRange()
          Return the range of the x edges
 SGTMetaData getXMetaData()
          Returns the X SGTMetaData.
 SoTRange getXRange()
          Returns the range of the X coordinates.
 int getXSize()
          Get the length of the x axis
 double[] getYArray()
          Get the array of Y values.
 double[] getYEdges()
          Get the Y coordinate edges.
 SoTRange getYEdgesRange()
          Return the range of the y edges
 SGTMetaData getYMetaData()
          Returns the Y SGTMetaData.
 SoTRange getYRange()
          Returns the range of the Y coordinates.
 int getYSize()
          Get the length of the y axis
 double[] getZArray()
          Get the array of Z values.
 SGTMetaData getZMetaData()
          Get the Z SGTMetaData.
 Range2D getZRange()
          Get the range of Z values.
 boolean hasAssociatedData()
          Is there associated data available?
 boolean hasXEdges()
          Are X edges available?
 boolean hasYEdges()
          Are Y edges available?
 boolean isXTime()
          Returns true if the X coordinate is Time.
 boolean isYTime()
          Returns true if the Y coordinate is Time.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a PropertyChangeListener from the listener list.
 void setAssociatedData(SGTGrid assoc)
          Set the associated data grid.
 void setId(java.lang.String ident)
          Set the unique identifier.
 void setKeyTitle(SGLabel title)
          Set the title formatted for the VectorKey.
 void setTimeArray(GeoDate[] tloc)
          set the temporal grid centers
Property Change: dataModified.
 void setTimeEdges(GeoDate[] edge)
          Set the values for the temporal grid edges.
 void setTitle(java.lang.String title)
          Set the grid title
 void setXArray(double[] xloc)
          Set the x coordinate grid centers
Property Change: dataModified.
 void setXEdges(double[] edge)
          Set the values for the x grid edges.
 void setXMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the x coordinate.
 void setYArray(double[] yloc)
          Set the y coordinate grid centers
Property Change: dataModified.
 void setYEdges(double[] edge)
          Set the values for the y grid edges.
 void setYMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the y coordinate.
 void setZArray(double[] grid)
          Set the z grid values.
 void setZMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the z coordinate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGrid

public SimpleGrid()
Default constructor.

SimpleGrid

public SimpleGrid(double[] grid,
                  double[] xloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X and Y coordinates as double.
Parameters:
grid - Z values
xloc - X coordinates
yloc - Y coordinates
title - the title

SimpleGrid

public SimpleGrid(double[] grid,
                  GeoDate[] tloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X time and Y double.
Parameters:
grid - Z values
tloc - Time coordinates
yloc - Y coordinates
title - the title

SimpleGrid

public SimpleGrid(double[] grid,
                  double[] xloc,
                  GeoDate[] tloc,
                  java.lang.String title)
Constructor for X double and Y time.
Parameters:
grid - Z values
xloc - X coordinates
tloc - Time coordinates
title - the title
Method Detail

copy

public SGTData copy()
Create a copy of the grid.
Specified by:
copy in interface SGTData
Since:
2.0
See Also:
SGTData

getXArray

public double[] getXArray()
Description copied from interface: SGTGrid
Get the array of X values.
Specified by:
getXArray in interface SGTGrid

getXSize

public int getXSize()
Get the length of the x axis
Specified by:
getXSize in interface SGTGrid
Since:
2.0

getYArray

public double[] getYArray()
Description copied from interface: SGTGrid
Get the array of Y values.
Specified by:
getYArray in interface SGTGrid

getYSize

public int getYSize()
Get the length of the y axis
Specified by:
getYSize in interface SGTGrid
Since:
2.0

getZArray

public double[] getZArray()
Description copied from interface: SGTGrid
Get the array of Z values.
Specified by:
getZArray in interface SGTGrid

getTimeArray

public GeoDate[] getTimeArray()
Description copied from interface: SGTGrid
Get the array of temporal values.
Specified by:
getTimeArray in interface SGTGrid

getTSize

public int getTSize()
Get the length of the Time axis
Specified by:
getTSize in interface SGTGrid
Since:
2.0

isXTime

public boolean isXTime()
Description copied from interface: SGTData
Returns true if the X coordinate is Time.
Specified by:
isXTime in interface SGTData

isYTime

public boolean isYTime()
Description copied from interface: SGTData
Returns true if the Y coordinate is Time.
Specified by:
isYTime in interface SGTData

getXMetaData

public SGTMetaData getXMetaData()
Description copied from interface: SGTData
Returns the X SGTMetaData.
Specified by:
getXMetaData in interface SGTData

getYMetaData

public SGTMetaData getYMetaData()
Description copied from interface: SGTData
Returns the Y SGTMetaData.
Specified by:
getYMetaData in interface SGTData

getZMetaData

public SGTMetaData getZMetaData()
Description copied from interface: SGTGrid
Get the Z SGTMetaData.
Specified by:
getZMetaData in interface SGTGrid

getTitle

public java.lang.String getTitle()
Description copied from interface: SGTData
Get the title.
Specified by:
getTitle in interface SGTData

setAssociatedData

public void setAssociatedData(SGTGrid assoc)
Set the associated data grid.
Property Change: associatedDataModified.
Since:
2.0

getAssociatedData

public SGTGrid getAssociatedData()
Description copied from interface: SGTGrid
Get the associated data. The associated data must be of the same type (SGTGrid) and shape.
Specified by:
getAssociatedData in interface SGTGrid

hasAssociatedData

public boolean hasAssociatedData()
Description copied from interface: SGTGrid
Is there associated data available?
Specified by:
hasAssociatedData in interface SGTGrid

hasXEdges

public boolean hasXEdges()
Description copied from interface: SGTGrid
Are X edges available?
Specified by:
hasXEdges in interface SGTGrid

getXEdges

public double[] getXEdges()
Description copied from interface: SGTGrid
Get the X coordinate edges. The XEdge length will be one greater than the XArray length.
Specified by:
getXEdges in interface SGTGrid

setXEdges

public void setXEdges(double[] edge)
Set the values for the x grid edges.

hasYEdges

public boolean hasYEdges()
Description copied from interface: SGTGrid
Are Y edges available?
Specified by:
hasYEdges in interface SGTGrid

getYEdges

public double[] getYEdges()
Description copied from interface: SGTGrid
Get the Y coordinate edges. The YEdge length will be one greater than the YArray length.
Specified by:
getYEdges in interface SGTGrid

setYEdges

public void setYEdges(double[] edge)
Set the values for the y grid edges.

getTimeEdges

public GeoDate[] getTimeEdges()
Description copied from interface: SGTGrid
Get the Time edges. The TimeEdge length will be one greater than the TimeArray length.
Specified by:
getTimeEdges in interface SGTGrid

setTimeEdges

public void setTimeEdges(GeoDate[] edge)
Set the values for the temporal grid edges.

setXMetaData

public void setXMetaData(SGTMetaData md)
Set the SGTMetaData associated with the x coordinate.

setYMetaData

public void setYMetaData(SGTMetaData md)
Set the SGTMetaData associated with the y coordinate.

setZMetaData

public void setZMetaData(SGTMetaData md)
Set the SGTMetaData associated with the z coordinate.

setTitle

public void setTitle(java.lang.String title)
Set the grid title

getKeyTitle

public SGLabel getKeyTitle()
Description copied from interface: SGTData
Get a title formatted for a Key. JPlotLayout will use this if an explicit Key title is not given in the addData method.
Specified by:
getKeyTitle in interface SGTData
Following copied from interface: gov.noaa.pmel.sgt.dm.SGTData
See Also:
SGLabel, ColorKey, LineKey, PointCollectionKey, VectorKey

setKeyTitle

public void setKeyTitle(SGLabel title)
Set the title formatted for the VectorKey.

getId

public java.lang.String getId()
Get the unique identifier. The presence of the identifier is optional, but if it is present it should be unique. This field is used to search for the layer that contains the data.
Specified by:
getId in interface SGTData
Returns:
unique identifier
Since:
2.0
See Also:
Pane, Layer

setId

public void setId(java.lang.String ident)
Set the unique identifier.

setXArray

public void setXArray(double[] xloc)
Set the x coordinate grid centers
Property Change: dataModified.

setYArray

public void setYArray(double[] yloc)
Set the y coordinate grid centers
Property Change: dataModified.

setZArray

public void setZArray(double[] grid)
Set the z grid values.
Property Change: dataModified.

setTimeArray

public void setTimeArray(GeoDate[] tloc)
set the temporal grid centers
Property Change: dataModified.

getXRange

public SoTRange getXRange()
Description copied from interface: SGTData
Returns the range of the X coordinates. If all the data in the array is missing, this method will return Double.NaN as the start and end values for data of type double and return GeoDate(Long.MIN_VALUE) for data of type GeoDate.
Specified by:
getXRange in interface SGTData
Following copied from interface: gov.noaa.pmel.sgt.dm.SGTData
See Also:
GeoDate.isMissing()

getYRange

public SoTRange getYRange()
Description copied from interface: SGTData
Returns the range of the Y coordinates.
Specified by:
getYRange in interface SGTData
Following copied from interface: gov.noaa.pmel.sgt.dm.SGTData
See Also:
SGTData.getXRange()

getZRange

public Range2D getZRange()
Description copied from interface: SGTGrid
Get the range of Z values.
Specified by:
getZRange in interface SGTGrid

getXEdgesRange

public SoTRange getXEdgesRange()
Return the range of the x edges
Specified by:
getXEdgesRange in interface SGTGrid
Since:
2.0

getYEdgesRange

public SoTRange getYEdgesRange()
Return the range of the y edges
Specified by:
getYEdgesRange in interface SGTGrid
Since:
2.0

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Add a PropertyChangeListener to the listener list.
Specified by:
addPropertyChangeListener in interface SGTData

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: SGTData
Remove a PropertyChangeListener from the listener list.
Specified by:
removePropertyChangeListener in interface SGTData


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001