|
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 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. |
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()
SGTLinegetTimeArray in interface SGTLinepublic SGTLine getAssociatedData()
SGTLinegetAssociatedData in interface SGTLinepublic boolean hasAssociatedData()
SGTLinehasAssociatedData in interface SGTLinepublic java.lang.String getTitle()
SGTDatagetTitle in interface SGTDatapublic SGLabel getKeyTitle()
SGTDataJPlotLayout will use this
if an explicit Key title is not given in the addData method.getKeyTitle in interface SGTDatagov.noaa.pmel.sgt.dm.SGTDataSGLabel,
ColorKey,
LineKey,
PointCollectionKey,
VectorKeypublic java.lang.String getId()
SGTDatagetId in interface SGTDatagov.noaa.pmel.sgt.dm.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 SGTDatagov.noaa.pmel.sgt.dm.SGTDataObjectpublic boolean isXTime()
SGTDataisXTime in interface SGTDatapublic boolean isYTime()
SGTDataisYTime in interface SGTDatapublic SGTMetaData getXMetaData()
SGTDatagetXMetaData in interface SGTDatapublic SGTMetaData getYMetaData()
SGTDatagetYMetaData 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 SGTDatagov.noaa.pmel.sgt.dm.SGTDataGeoDate.isMissing()public SoTRange getYRange()
SGTDatagetYRange in interface SGTDatagov.noaa.pmel.sgt.dm.SGTDataSGTData.getXRange()public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
SGTDataaddPropertyChangeListener in interface SGTDatapublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
SGTDataremovePropertyChangeListener in interface SGTDatapublic void startData()
public void stopData()
public void resetData()
public void actionPerformed(java.awt.event.ActionEvent e)
rangeModified and
DataModifiedactionPerformed in interface java.awt.event.ActionListener
|
SGT Home | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||