gov.noaa.pmel.sgt.dm
Class SimplePoint

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

public class SimplePoint
extends java.lang.Object
implements SGTPoint, Cartesian, java.lang.Cloneable, java.io.Serializable

SimplePoint provides an implementation of the SGTPoint and Cartesian interfaces.

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

Field Summary
protected  boolean hasValue_
           
protected  java.lang.String id_
           
protected  SGLabel keyTitle_
           
protected  java.lang.String title_
           
protected  long tloc_
           
protected  double value_
           
protected  SGTMetaData valueMetaData_
           
protected  double xloc_
           
protected  SGTMetaData xMetaData_
           
protected  boolean xTime_
           
protected  double yloc_
           
protected  SGTMetaData yMetaData_
           
protected  boolean yTime_
           
 
Constructor Summary
SimplePoint()
          Default constructor.
SimplePoint(double xloc, double yloc, java.lang.String title)
          Simple Point constructor.
SimplePoint(SoTPoint loc, java.lang.String title)
          Simple Point constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the listener list.
 SGTData copy()
          Create a copy.
 java.lang.String getId()
          Get the unique identifier.
 SGLabel getKeyTitle()
          Get a title formatted for a Key.
 long getLongTime()
          Get the time in long referenced to 1970-01-01
 GeoDate getTime()
          Get the time coordinate.
 java.lang.String getTitle()
          Get the title.
 double getValue()
          Get the associated value.
 SGTMetaData getValueMetaData()
          Get the associated value SGTMetaData.
 double getX()
          Get the X coordinate.
 SGTMetaData getXMetaData()
          Returns the X SGTMetaData.
 SoTRange getXRange()
          Returns the range of the X coordinates.
 double getY()
          Get the Y coordinate
 SGTMetaData getYMetaData()
          Returns the Y SGTMetaData.
 SoTRange getYRange()
          Returns the range of the Y coordinates.
 boolean hasValue()
          Is there an associated value?
 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 setId(java.lang.String ident)
          Set the unique identifier.
 void setKeyTitle(SGLabel title)
          Set the title formatted for the VectorKey.
 void setTime(GeoDate date)
          Set the time coordinate
 void setTime(long t)
           
 void setTitle(java.lang.String title)
          Set the title.
 void setValue(double value, java.lang.String name, java.lang.String units)
          The the associated value and basic metadata.
 void setX(double xloc)
          Set the X coordinate.
 void setXMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the x coordinate
 void setY(double yloc)
          Set the Y coordinate.
 void setYMetaData(SGTMetaData md)
          Set the SGTMetaData associated with the y coordinate
 
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 long tloc_

xTime_

protected boolean xTime_

yTime_

protected boolean yTime_

value_

protected double value_

title_

protected java.lang.String title_

keyTitle_

protected SGLabel keyTitle_

id_

protected java.lang.String id_

valueMetaData_

protected SGTMetaData valueMetaData_

xMetaData_

protected SGTMetaData xMetaData_

yMetaData_

protected SGTMetaData yMetaData_

hasValue_

protected boolean hasValue_
Constructor Detail

SimplePoint

public SimplePoint()
Default constructor.


SimplePoint

public SimplePoint(double xloc,
                   double yloc,
                   java.lang.String title)
Simple Point constructor.

Parameters:
xloc - X coordinate
yloc - Y coordinate
title - the title

SimplePoint

public SimplePoint(SoTPoint loc,
                   java.lang.String title)
Simple Point constructor.

Parameters:
loc - SoTPoint
title - the title
Since:
3.0
Method Detail

copy

public SGTData copy()
Create a copy.

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

getX

public double getX()
Get the X coordinate.

Specified by:
getX in interface SGTPoint

getY

public double getY()
Get the Y coordinate

Specified by:
getY in interface SGTPoint

getValue

public double getValue()
Get the associated value.

Specified by:
getValue in interface SGTPoint

hasValue

public boolean hasValue()
Is there an associated value?

Specified by:
hasValue in interface SGTPoint

getTime

public GeoDate getTime()
Get the time coordinate.

Specified by:
getTime in interface SGTPoint

getLongTime

public long getLongTime()
Get the time in long referenced to 1970-01-01

Specified by:
getLongTime in interface SGTPoint
Since:
3.0

setTime

public void setTime(GeoDate date)
Set the time coordinate

Since:
3.0

setTime

public void setTime(long t)
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

getTitle

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

Specified by:
getTitle in interface SGTData

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.


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.


getValueMetaData

public SGTMetaData getValueMetaData()
Get the associated value SGTMetaData.

Specified by:
getValueMetaData in interface SGTPoint

setX

public void setX(double xloc)
Set the X coordinate.
Property Change: dataModified.


setY

public void setY(double yloc)
Set the Y coordinate.
Property Change: dataModified.


setValue

public void setValue(double value,
                     java.lang.String name,
                     java.lang.String units)
The the associated value and basic metadata.
Property Change: associatedDataModified.

Parameters:
value - associated data
name - values name
units - values units

setXMetaData

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

Since:
2.0

setYMetaData

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

Since:
2.0

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

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