|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gov.noaa.pmel.sgt.demo.PseudoRealTimeData
Generates a real-time data stream using SGTLine
and
javax.swing.Timer
. PseudoRealTimeData
generates PropertyCchangeEvent
s
whenever data is added "dataModified" or the data range changes
"rangeModified". The "dataModified" event is directly handled by
sgt
and the "rangeModified" event needs to be handled
by the graphics application.
PseudoRealTimeData
demonstrates how a class that
implements the SGTLine
interface can use the
getXRange()
and getYRange()
methods to
produce "nice" plots. This class updates the data each time step,
but updates the range only after a day has passed.
Constructor Summary | |
PseudoRealTimeData(java.lang.String id,
java.lang.String title)
Constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
Handle timer ActionEvents Property Change: rangeModified and
DataModified |
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. |
java.lang.String |
getId()
Get the unique identifier. |
SGLabel |
getKeyTitle()
Get a title formatted for a Key. |
GeoDate[] |
getTimeArray()
Get the array of Time values. |
java.lang.String |
getTitle()
Get the title. |
double[] |
getXArray()
Get x data array. |
SGTMetaData |
getXMetaData()
Returns the X SGTMetaData. |
SoTRange |
getXRange()
Returns the range of the X coordinates. |
double[] |
getYArray()
Get y data values. |
SGTMetaData |
getYMetaData()
Returns the Y SGTMetaData. |
SoTRange |
getYRange()
Returns the range of the Y coordinates. |
boolean |
hasAssociatedData()
Is there associated data 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 |
resetData()
Reset the demonstration to the begining. |
void |
startData()
Start the timer and begin/continue generating property change events. |
void |
stopData()
Stop the timer. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PseudoRealTimeData(java.lang.String id, java.lang.String title)
Method Detail |
public double[] getXArray()
null
.getXArray
in interface SGTLine
public double[] getYArray()
getYArray
in interface SGTLine
public GeoDate[] getTimeArray()
SGTLine
getTimeArray
in interface SGTLine
public SGTLine getAssociatedData()
SGTLine
getAssociatedData
in interface SGTLine
public boolean hasAssociatedData()
SGTLine
hasAssociatedData
in interface SGTLine
public java.lang.String getTitle()
SGTData
getTitle
in interface SGTData
public SGLabel getKeyTitle()
SGTData
JPlotLayout
will use this
if an explicit Key title is not given in the addData
method.getKeyTitle
in interface SGTData
gov.noaa.pmel.sgt.dm.SGTData
SGLabel
,
ColorKey
,
LineKey
,
PointCollectionKey
,
VectorKey
public java.lang.String getId()
SGTData
getId
in interface SGTData
gov.noaa.pmel.sgt.dm.SGTData
Pane
,
Layer
public SGTData copy()
SGTData
For example,
public SGTData copy() { SGTData newData; try { newData = (SGTData)clone(); } catch (CloneNotSupportedException e) { newData = null; } return newData; }
copy
in interface SGTData
gov.noaa.pmel.sgt.dm.SGTData
Object
public boolean isXTime()
SGTData
isXTime
in interface SGTData
public boolean isYTime()
SGTData
isYTime
in interface SGTData
public SGTMetaData getXMetaData()
SGTData
getXMetaData
in interface SGTData
public SGTMetaData getYMetaData()
SGTData
getYMetaData
in interface SGTData
public SoTRange getXRange()
SGTData
Double.NaN
as the start and end values for data of type double
and return GeoDate(Long.MIN_VALUE)
for data of type
GeoDate
.getXRange
in interface SGTData
gov.noaa.pmel.sgt.dm.SGTData
GeoDate.isMissing()
public SoTRange getYRange()
SGTData
getYRange
in interface SGTData
gov.noaa.pmel.sgt.dm.SGTData
SGTData.getXRange()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
SGTData
addPropertyChangeListener
in interface SGTData
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
SGTData
removePropertyChangeListener
in interface SGTData
public void startData()
public void stopData()
public void resetData()
public void actionPerformed(java.awt.event.ActionEvent e)
rangeModified
and
DataModified
actionPerformed
in interface java.awt.event.ActionListener
|
SGT Home | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |