|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | 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 PropertyCchangeEvents
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. |
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 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 SGTLinepublic double[] getYArray()
getYArray in interface SGTLinepublic GeoDate[] getTimeArray()
SGTLine
getTimeArray in interface SGTLinepublic GeoDateArray getGeoDateArray()
SGTLineGeoDateArray object.
getGeoDateArray in interface SGTLinepublic SGTLine getAssociatedData()
SGTLine
getAssociatedData in interface SGTLinepublic boolean hasAssociatedData()
SGTLine
hasAssociatedData in interface SGTLinepublic java.lang.String getTitle()
SGTData
getTitle in interface SGTDatapublic SGLabel getKeyTitle()
SGTDataJPlotLayout will use this
if an explicit Key title is not given in the addData method.
getKeyTitle in interface SGTDataSGLabel,
ColorKey,
LineKey,
PointCollectionKey,
VectorKeypublic java.lang.String getId()
SGTData
getId in interface SGTDataPane,
Layerpublic SGTData copy()
SGTDataFor example,
public SGTData copy() {
SGTData newData;
try {
newData = (SGTData)clone();
} catch (CloneNotSupportedException e) {
newData = null;
}
return newData;
}
copy in interface SGTDataObjectpublic boolean isXTime()
SGTData
isXTime in interface SGTDatapublic boolean isYTime()
SGTData
isYTime in interface SGTDatapublic SGTMetaData getXMetaData()
SGTData
getXMetaData in interface SGTDatapublic SGTMetaData getYMetaData()
SGTData
getYMetaData in interface SGTDatapublic SoTRange getXRange()
SGTDataDouble.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 SGTDataGeoDate.isMissing()public SoTRange getYRange()
SGTData
getYRange in interface SGTDataSGTData.getXRange()public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
SGTData
addPropertyChangeListener in interface SGTDatapublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
SGTData
removePropertyChangeListener in interface SGTDatapublic 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||