Class cam.visuals.plots.PlotFrame

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----cam.visuals.plots.PlotFrame

public class PlotFrame
extends Frame
A frame which plots x and y data and has controls for viewing the plot. The plotting functionality is provided by an internal instance of the Plot class. In addition to the output control provided by the user interface, one can set plot formatting by invoking methods of the internal Plot instance. For example if PF is a PlotFrame instance, then the code
Plot P = PF.getPlot();
P.setXlabelFormat(Plot.FIXED);
P.setXlabelPrecision(3);
P.setYlabelFormat(Plot.SCIENTIFIC);
P.setYlabelPrecision(2);
sets the X label format to fixed output and 3 decimal digits and the Y label format to scientific format with 2 decimal digits.

Version:
Oct. 18, 1998
Author:
Mark Hoefer, Chris Anderson

Variable Index

 o currentXMax
 o currentXMin
 o currentYMax
 o currentYMin
 o legend
 o plotCanvas
 o PlotCharAction
 o xmax
 o xmin
 o ymax
 o ymin

Constructor Index

 o PlotFrame()
 o PlotFrame(String)

Method Index

 o addNotify()
 o addPlot(double[], double[], String)
Plots the input data in the current plot and associates a name with the plot.
 o addPlot(Vector, Vector, String)
Plots the input data in the current plot and associates a name with the plot.
 o clearPlots()
Remotes all plots
 o getPlot()
Returns the contained Plot instance.
 o setAxisLabels(String, String, Font, Color)
Sets the axis labels (or titles).
 o setPlotTitle(String, Font, Color)
Sets the title of the plot
 o setXbounds(double, double)
Sets the x axis limits for the plot.
 o setXYBounds(double, double, double, double)
Sets the x and y axis limits for the plot.
 o show()
 o zoom(double, double)

Variables

 o plotCanvas
 protected Plot plotCanvas
 o currentXMin
 protected double currentXMin
 o currentYMin
 protected double currentYMin
 o currentXMax
 protected double currentXMax
 o currentYMax
 protected double currentYMax
 o xmin
 protected double xmin
 o ymin
 protected double ymin
 o xmax
 protected double xmax
 o ymax
 protected double ymax
 o legend
 protected LegendDialog legend
 o PlotCharAction
 protected PlotFrame. PlotPropertiesAction PlotCharAction

Constructors

 o PlotFrame
 public PlotFrame()
 o PlotFrame
 public PlotFrame(String title)

Methods

 o show
 public void show()
Overrides:
show in class Window
 o addNotify
 public void addNotify()
Overrides:
addNotify in class Frame
 o setPlotTitle
 public void setPlotTitle(String title,
                          Font f,
                          Color c)
Sets the title of the plot

 o setAxisLabels
 public void setAxisLabels(String xLabel,
                           String yLabel,
                           Font f,
                           Color c)
Sets the axis labels (or titles).

 o setXYBounds
 public void setXYBounds(double xmin,
                         double xmax,
                         double ymin,
                         double ymax)
Sets the x and y axis limits for the plot.

 o setXbounds
 public void setXbounds(double xmin,
                        double xmax)
Sets the x axis limits for the plot.

 o addPlot
 public void addPlot(double xdata[],
                     double ydata[],
                     String plotName)
Plots the input data in the current plot and associates a name with the plot.

Parameters:
xdata - double array containing the x-coordinates for the plot
ydata - double array containing the y-coordinates for the plot
plotName - string name of the plot
 o addPlot
 public void addPlot(Vector xdata,
                     Vector ydata,
                     String plotName)
Plots the input data in the current plot and associates a name with the plot.

Parameters:
xdata - Vector of Doubles containing the x-coordinates for the plot
ydata - Vector of Doubles containing the y-coordinates for the plot
plotName - string name of the plot
 o clearPlots
 public void clearPlots()
Remotes all plots

 o getPlot
 public Plot getPlot()
Returns the contained Plot instance.

 o zoom
 protected void zoom(double xPercent,
                     double yPercent)