Logo Search packages:      
Sourcecode: wims version File versions

ptolemy::plot::PlotLive Class Reference

Inheritance diagram for ptolemy::plot::PlotLive:

ptolemy::plot::Plot ptolemy::plot::PlotBox

List of all members.

Detailed Description

Plot signals dynamically, where points can be added at any time and the display will be updated. This should be normally used with some finite persistence so that old points are erased as new points are added. Unfortunately, the most efficient way to erase old points is to draw graphics using the "exclusive or" mode, which introduces quite a number of artifacts. When lines are drawn between points, where they overlap the points the line becomes white. Moreover, if two lines or points overlap completely, they disappear.

This class is abstract, so it must be used by creating a derived class. To use it, create a derived class with an addPoints() method. Your class may also set graph parameters like titles and axis labels in the constructor by calling methods in the Plot or PlotBox classes (both of which are base classes). The addPoints() method should call addPoint() of the Plot base class to dynamically add points to the plot. This method is called within a thread separate from the applet thread, so the zooming mechanism and buttons remain live.

Edward A. Lee, Christopher Brooks, Contributor: Jeff Lane
PlotLive.java,v 1.67 2005/07/28 18:49:32 cxh Exp
Ptolemy II 0.2 .ProposedRating Yellow (cxh) .AcceptedRating Yellow (cxh)

Definition at line 65 of file PlotLive.java.

Public Member Functions

synchronized void addLegend (int dataset, String legend)
synchronized void addPoint (final int dataset, final double x, final double y, final boolean connected)
abstract void addPoints ()
synchronized void addPointWithErrorBars (final int dataset, final double x, final double y, final double yLowEB, final double yHighEB, final boolean connected)
synchronized void addXTick (String label, double position)
synchronized void addYTick (String label, double position)
synchronized void clear (boolean axes)
synchronized void clear (final int dataset)
synchronized void clear (final boolean format)
synchronized void clearLegends ()
void deferIfNecessary (Runnable action)
synchronized void erasePoint (final int dataset, final int index)
synchronized void export (OutputStream out)
synchronized BufferedImage exportImage (BufferedImage bufferedImage)
synchronized BufferedImage exportImage (BufferedImage bufferedImage, Rectangle rectangle, RenderingHints hints, boolean transparent)
synchronized BufferedImage exportImage (Rectangle rectangle)
synchronized BufferedImage exportImage ()
synchronized void fillPlot ()
boolean getColor ()
Color[] getColors ()
boolean getConnected ()
String getDataurl ()
URL getDocumentBase ()
boolean getGrid ()
boolean getImpulses ()
synchronized String getLegend (int dataset)
synchronized int getLegendDataset (String legend)
synchronized String getMarksStyle ()
int getMaxDataSets ()
synchronized int getNumDataSets ()
Rectangle getPlotRectangle ()
synchronized Dimension getPreferredSize ()
boolean getReuseDatasets ()
synchronized String getTitle ()
synchronized double[] getXAutoRange ()
synchronized String getXLabel ()
boolean getXLog ()
synchronized double[] getXRange ()
synchronized Vector[] getXTicks ()
synchronized double[] getYAutoRange ()
String getYLabel ()
boolean getYLog ()
synchronized double[] getYRange ()
synchronized Vector[] getYTicks ()
void init ()
void makeButtons ()
synchronized void paintComponent (Graphics graphics)
void parseFile (String filespec)
void parseFile (String filespec, URL documentBase)
void pause ()
synchronized int print (Graphics graphics, PageFormat format, int index) throws PrinterException
synchronized void read (String command)
synchronized void read (InputStream inputStream) throws IOException
String ReadPlotApplet ()
synchronized void removeLegend (int dataset)
synchronized void renameLegend (int dataset, String newName)
synchronized void resetAxes ()
void run ()
synchronized void samplePlot ()
synchronized void setBackground (Color background)
synchronized void setBars (double width, double offset)
void setBars (boolean on)
synchronized void setBounds (int x, int y, int width, int height)
void setButtons (boolean visible)
synchronized void setColor (boolean useColor)
synchronized void setColors (Color[] colors)
synchronized void setConnected (boolean on, int dataset)
void setConnected (boolean on)
void setDataurl (String filespec)
void setDocumentBase (URL documentBase)
synchronized void setForeground (Color foreground)
synchronized void setGrid (boolean grid)
synchronized void setImpulses (boolean on, int dataset)
synchronized void setImpulses (boolean on)
synchronized void setLabelFont (String name)
synchronized void setMarksStyle (String style, int dataset)
synchronized void setMarksStyle (String style)
void setNumSets (int numSets)
synchronized void setPlotRectangle (Rectangle rectangle)
void setPointsPersistence (int persistence)
void setReuseDatasets (boolean on)
synchronized void setSize (int width, int height)
synchronized void setTitle (String title)
synchronized void setTitleFont (String name)
synchronized void setWrap (boolean wrap)
synchronized void setXLabel (String label)
synchronized void setXLog (boolean xlog)
void setXPersistence (double persistence)
synchronized void setXRange (double min, double max)
synchronized void setYLabel (String label)
synchronized void setYLog (boolean ylog)
synchronized void setYRange (double min, double max)
synchronized void start ()
void stop ()
synchronized void write (Writer out, String dtd)
synchronized void write (OutputStream out, String dtd)
void write (OutputStream out)
synchronized void writeData (PrintWriter output)
synchronized void writeFormat (PrintWriter output)
synchronized void writeOldSyntax (OutputStream out)
synchronized void zoom (double lowx, double lowy, double highx, double highy)

Static Public Member Functions

static Color getColorByName (String name)

Public Attributes

URL _documentBase = null

Static Public Attributes

static final String PTPLOT_RELEASE = "5.7"

Protected Member Functions

synchronized void _checkDatasetIndex (int dataset)
void _drawBar (Graphics graphics, int dataset, long xpos, long ypos, boolean clip)
void _drawErrorBar (Graphics graphics, int dataset, long xpos, long yLowEBPos, long yHighEBPos, boolean clip)
void _drawImpulse (Graphics graphics, long xpos, long ypos, boolean clip)
void _drawLine (Graphics graphics, int dataset, long startx, long starty, long endx, long endy, boolean clip, float width)
void _drawLine (Graphics graphics, int dataset, long startx, long starty, long endx, long endy, boolean clip)
synchronized void _drawPlot (Graphics graphics, boolean clearfirst)
synchronized void _drawPlot (Graphics graphics, boolean clearfirst, Rectangle drawRectangle)
void _drawPoint (Graphics graphics, int dataset, long xpos, long ypos, boolean clip)
void _help ()
boolean _parseLine (String line)
void _setButtonsVisibility (boolean vis)
void _setPadding (double padding)
void _setWidth (Graphics graphics, float width)
void _writeOldSyntax (PrintWriter output)

Protected Attributes

Color _background = Color.white
int _bottomPadding = 5
int _currentdataset = -1
Color _foreground = Color.black
boolean _grid = true
int _height = 300
int _leftPadding = 10
int _lrx = 100
int _lry = 100
int _marks
double _padding = 0.05
transient BufferedImage _plotImage = null
Vector _points = new Vector()
int _preferredHeight = 300
int _preferredWidth = 500
transient boolean _rangesGivenByZooming = false
int _rightPadding = 10
Rectangle _specifiedPlotRectangle = null
int _topPadding = 10
int _ulx = 1
int _uly = 1
boolean _usecolor = true
int _width = 500
boolean _wrap = false
double _wrapHigh
double _wrapLow
double _xBottom = Double.MAX_VALUE
double _xhighgiven
boolean _xlog = false
double _xlowgiven
transient double _xMax = 0
transient double _xMin = 0
transient boolean _xRangeGiven = false
double _xscale = 1.0
double _xTop = -Double.MAX_VALUE
double _yBottom = Double.MAX_VALUE
double _yhighgiven
boolean _ylog = false
double _ylowgiven
transient double _yMax = 0
transient double _yMin = 0
transient boolean _yRangeGiven = false
double _yscale = 1.0
double _yTop = -Double.MAX_VALUE

Static Protected Attributes

static Color[] _colors
static final double _LOG10SCALE = 1 / Math.log(10)

Package Functions

void _zoom (int x, int y)
void _zoomBox (int x, int y)
void _zoomStart (int x, int y)

Package Attributes

double _originalXhigh = 0.0
double _originalXlow = 0.0
boolean _originalXRangeGiven = false
double _originalYhigh = 0.0
double _originalYlow = 0.0
boolean _originalYRangeGiven = false

Private Attributes

boolean _paused = false
Thread _plotLiveThread = null
boolean _plotting = false
JButton _startButton
JButton _stopButton


class  StartButtonListener
class  StopButtonListener

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index