gov.noaa.pmel.sgt.dm
Class SimpleLine

java.lang.Object
  extended by gov.noaa.pmel.sgt.dm.SimpleLine
All Implemented Interfaces:
Cartesian, CoordinateSystem, SGTData, SGTLine, java.io.Serializable, java.lang.Cloneable

public class SimpleLine
extends java.lang.Object
implements SGTLine, Cartesian, java.io.Serializable, java.lang.Cloneable

SimpleLine provides an implementation of the SGTLine and Cartesian interfaces.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
SGTLine, Cartesian, Serialized Form

Field Summary
protected  SGTLine associatedData_
           
protected  java.lang.String id_
           
protected  SGLabel keyTitle_
           
protected  java.lang.String title_
           
protected  GeoDateArray tloc_
           
protected  double[] xloc_
           
protected  SGTMetaData xMetaData_
           
protected  boolean xTime_
           
protected  double[] yloc_
           
protected  SGTMetaData yMetaData_
           
protected  boolean yTime_
           
 
Constructor Summary
SimpleLine()
          Default constuctor.
SimpleLine(double[] xloc, double[] yloc, java.lang.String title)
          Constructor for X and Y double.
SimpleLine(double[] xloc, GeoDate[] tloc, java.lang.String title)
          Constructor for X double and Y Time.
SimpleLine(double[] xloc, GeoDateArray tloc, java.lang.String title)
          Constructor for X double and Y Time.
SimpleLine(GeoDate[] tloc, double[] yloc, java.lang.String title)
          Constructor for X Time and Y double.
SimpleLine(GeoDateArray 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 shallow copy.
 SGTLine getAssociatedData()
          Get the associated data.
 GeoDateArray getGeoDateArray()
          Get the GeoDateArray object.
 java.lang.String getId()
          Get the unique identifier.
 SGLabel getKeyTitle()
          Get a title formatted for a Key.
 GeoDate[] getTimeArray()
          Get the Time coordinate array.
 java.lang.String getTitle()
          Get the Title.
 double[] getXArray()
          Get the X coordinate array.
 SGTMetaData getXMetaData()
          Get the X coordinate metadata.
 SoTRange getXRange()
          Returns the range of the X coordinates.
 double[] getYArray()
          Get the Y coordinate array.
 SGTMetaData getYMetaData()
          Get the Y coordinate metadata
 SoTRange getYRange()
          Returns the range of the Y coordinates.
 boolean hasAssociatedData()
          Is there associated data?
 boolean isXTime()
          Is the X coordinate Time?
 boolean isYTime()
          Is the Y coordinate Time?
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove a PropertyChangeListener from the listener list.
 void setAssociatedData(SGTLine assoc)
          Set the data that will be associated with SGTLine
Property Change: associatedDataModified.
 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 Time coordinate array
Property Change: dataModified.
 void setTimeArray(GeoDateArray tarray)
           
 void setTitle(java.lang.String title)
          Set the title.
 void setXArray(double[] xloc)
          Set the X coordinate array.
 void setXMetaData(SGTMetaData md)
          Set the X coordinate metadata.
 void setYArray(double[] yloc)
          Set the Y coordinate array
Property Change: dataModified.
 void setYMetaData(SGTMetaData md)
          Set the Y coordinate metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xloc_

protected double[] xloc_

yloc_

protected double[] yloc_

tloc_

protected GeoDateArray tloc_

xTime_

protected boolean xTime_

yTime_

protected boolean yTime_

title_

protected java.lang.String title_

keyTitle_

protected SGLabel keyTitle_

id_

protected java.lang.String id_

xMetaData_

protected SGTMetaData xMetaData_

yMetaData_

protected SGTMetaData yMetaData_

associatedData_

protected SGTLine associatedData_
Constructor Detail

SimpleLine

public SimpleLine()
Default constuctor.


SimpleLine

public SimpleLine(double[] xloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X and Y double.

Parameters:
xloc - X coordinates
yloc - Y coordinates
title - the Title

SimpleLine

public SimpleLine(GeoDate[] tloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X Time and Y double.

Parameters:
tloc - Time coordinates
yloc - Y coordinates
title - the Title

SimpleLine

public SimpleLine(GeoDateArray tloc,
                  double[] yloc,
                  java.lang.String title)
Constructor for X Time and Y double.

Parameters:
tloc - Time coordinates
yloc - Y coordinates
title - the Title
Since:
3.0

SimpleLine

public SimpleLine(double[] xloc,
                  GeoDateArray tloc,
                  java.lang.String title)
Constructor for X double and Y Time.

Parameters:
xloc - X coordinates
tloc - Time coordinates
title - the Title
Since:
3.0

SimpleLine

public SimpleLine(double[] xloc,
                  GeoDate[] tloc,
                  java.lang.String title)
Constructor for X double and Y Time.

Parameters:
xloc - X coordinates
tloc - Time coordinates
title - the Title
Method Detail

copy

public SGTData copy()
Create a shallow copy.

Specified by:
copy in interface SGTData
Returns:
shallow copy
Since:
2.0
See Also:
SGTData

getXArray

public double[] getXArray()
Get the X coordinate array.

Specified by:
getXArray in interface SGTLine

getYArray

public double[] getYArray()
Get the Y coordinate array.

Specified by:
getYArray in interface SGTLine

getTimeArray

public GeoDate[] getTimeArray()
Get the Time coordinate array.

Specified by:
getTimeArray in interface SGTLine

getGeoDateArray

public GeoDateArray getGeoDateArray()
Get the GeoDateArray object.

Specified by:
getGeoDateArray in interface SGTLine
Since:
3.0

isXTime

public boolean isXTime()
Is the X coordinate Time?

Specified by:
isXTime in interface SGTData

isYTime

public boolean isYTime()
Is the Y coordinate Time?

Specified by:
isYTime in interface SGTData

getXMetaData

public SGTMetaData getXMetaData()
Get the X coordinate metadata.

Specified by:
getXMetaData in interface SGTData

getYMetaData

public SGTMetaData getYMetaData()
Get the Y coordinate metadata

Specified by:
getYMetaData in interface SGTData

getTitle

public java.lang.String getTitle()
Get the Title.

Specified by:
getTitle in interface SGTData

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:
JPane, Layer

setId

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


setAssociatedData

public void setAssociatedData(SGTLine assoc)
Set the data that will be associated with SGTLine
Property Change: associatedDataModified.

Since:
2.0

getAssociatedData

public SGTLine getAssociatedData()
Get the associated data.

Specified by:
getAssociatedData in interface SGTLine

hasAssociatedData

public boolean hasAssociatedData()
Is there associated data?

Specified by:
hasAssociatedData in interface SGTLine

setXMetaData

public void setXMetaData(SGTMetaData md)
Set the X coordinate metadata.


setYMetaData

public void setYMetaData(SGTMetaData md)
Set the Y coordinate metadata.


setTitle

public void setTitle(java.lang.String title)
Set the 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
See Also:
SGLabel, ColorKey, LineKey, PointCollectionKey, VectorKey

setKeyTitle

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


setXArray

public void setXArray(double[] xloc)
Set the X coordinate array.
Property Change: dataModified.


setYArray

public void setYArray(double[] yloc)
Set the Y coordinate array
Property Change: dataModified.


setTimeArray

public void setTimeArray(GeoDate[] tloc)
Set the Time coordinate array
Property Change: dataModified.


setTimeArray

public void setTimeArray(GeoDateArray tarray)
Since:
3.0

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
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
See Also:
SGTData.getXRange()

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