public interface PlotBoxInterface
Modifier and Type | Method and Description |
---|---|
void |
addCaptionLine(java.lang.String captionLine)
Add a line to the caption (displayed at below graph) .
|
void |
addLegend(int dataset,
java.lang.String legend)
Add a legend (displayed at the upper right) for the specified
data set with the specified string.
|
void |
addXTick(java.lang.String label,
double position)
Specify a tick mark for the X axis.
|
void |
addYTick(java.lang.String label,
double position)
Specify a tick mark for the Y axis.
|
void |
clear(boolean axes)
If the argument is true, clear the axes.
|
void |
clearCaptions()
Clear all the captions.
|
void |
clearLegends()
Clear all legends.
|
void |
deferIfNecessary(java.lang.Runnable action)
If this method is called in the event thread, then simply
execute the specified action.
|
void |
destroy()
Destroy the plotter.
|
void |
fillPlot()
Rescale so that the data that is currently plotted just fits.
|
java.util.Vector |
getCaptions()
Get the captions.
|
boolean |
getColor()
Return whether the plot uses color.
|
java.lang.Object[] |
getColors()
Get the point colors.
|
java.lang.String |
getDataurl()
Deprecated.
Use read() instead.
|
java.net.URL |
getDocumentBase()
Deprecated.
Use read() instead.
|
boolean |
getGrid()
Return whether the grid is drawn.
|
java.lang.String |
getLegend(int dataset)
Get the legend for a dataset, or null if there is none.
|
int |
getLegendDataset(java.lang.String legend)
Given a legend string, return the corresponding dataset or -1 if no
legend was added with that legend string
The legend would have been set by addLegend().
|
java.lang.Object |
getPlotRectangle()
Get the current plot rectangle.
|
java.lang.String |
getTitle()
Get the title of the graph, or an empty string if there is none.
|
double[] |
getXAutoRange()
Get the range for X values of the data points registered so far.
|
java.lang.String |
getXLabel()
Get the label for the X (horizontal) axis, or null if none has
been set.
|
boolean |
getXLog()
Return whether the X axis is drawn with a logarithmic scale.
|
double[] |
getXRange()
Get the X range.
|
java.util.Vector[] |
getXTicks()
Get the X ticks that have been specified, or null if none.
|
double[] |
getYAutoRange()
Get the range for Y values of the data points registered so far.
|
java.lang.String |
getYLabel()
Get the label for the Y (vertical) axis, or null if none has
been set.
|
boolean |
getYLog()
Return whether the Y axis is drawn with a logarithmic scale.
|
double[] |
getYRange()
Get the Y range.
|
java.util.Vector[] |
getYTicks()
Get the Y ticks that have been specified, or null if none.
|
void |
init()
Deprecated.
|
void |
parseFile(java.lang.String filespec)
Deprecated.
Use read() to read the old file
format, or use one of the classes in the plotml package to
read the XML-based file format.
|
void |
parseFile(java.lang.String filespec,
java.net.URL documentBase)
Deprecated.
Use read() instead.
|
void |
read(java.io.InputStream in)
Read commands and/or plot data from an input stream in the old
(non-XML) file syntax.
|
void |
read(java.lang.String command)
Read a single line command provided as a string.
|
void |
removeLegend(int dataset)
Remove the legend (displayed at the upper right) for the specified
data set.
|
void |
renameLegend(int dataset,
java.lang.String newName)
Rename a legend.
|
void |
repaint()
Repaint the object.
|
void |
resetAxes()
Reset the X and Y axes to the ranges that were first specified
using setXRange() and setYRange().
|
void |
samplePlot()
Do nothing in this base class.
|
void |
setAutomaticRescale(boolean automaticRescale)
Set automatic rescale.
|
void |
setBackground(java.lang.Object background)
Set the background color.
|
void |
setButtons(boolean visible)
If the argument is true, make a fill button visible at the upper
right.
|
void |
setCaptions(java.util.Vector captionStrings)
Set the strings of the caption.
|
void |
setColor(boolean useColor)
If the argument is false, draw the plot without using color
(in black and white).
|
void |
setColors(java.lang.Object[] colors)
Set the point colors.
|
void |
setDataurl(java.lang.String filespec)
Deprecated.
Use read() instead.
|
void |
setDocumentBase(java.net.URL documentBase)
Deprecated.
Use read() instead.
|
void |
setForeground(java.lang.Object foreground)
Set the foreground color.
|
void |
setGrid(boolean grid)
Control whether the grid is drawn.
|
void |
setLabelFont(java.lang.String name)
Set the label font, which is used for axis labels and legend labels.
|
void |
setPlotRectangle(java.lang.Object rectangle)
Set the plot rectangle inside the axes.
|
void |
setSize(int width,
int height)
Set the size of the plot.
|
void |
setTimedRepaint(boolean timedRepaint)
Set repainting with a certain fixed refresh rate.
|
void |
setTitle(java.lang.String title)
Set the title of the graph.
|
void |
setTitleFont(java.lang.String name)
Set the title font.
|
void |
setWrap(boolean wrap)
Specify whether the X axis is wrapped.
|
void |
setXLabel(java.lang.String label)
Set the label for the X (horizontal) axis.
|
void |
setXLog(boolean xlog)
Specify whether the X axis is drawn with a logarithmic scale.
|
void |
setXRange(double min,
double max)
Set the X (horizontal) range of the plot.
|
void |
setYLabel(java.lang.String label)
Set the label for the Y (vertical) axis.
|
void |
setYLog(boolean ylog)
Specify whether the Y axis is drawn with a logarithmic scale.
|
void |
setYRange(double min,
double max)
Set the Y (vertical) range of the plot.
|
void |
write(java.io.OutputStream out)
Write the current data and plot configuration to the
specified stream in PlotML syntax.
|
void |
write(java.io.OutputStream out,
java.lang.String dtd)
Write the current data and plot configuration to the
specified stream in PlotML syntax.
|
void |
write(java.io.Writer out,
java.lang.String dtd)
Write the current data and plot configuration to the
specified stream in PlotML syntax.
|
void |
writeData(java.io.PrintWriter output)
Write plot data information to the specified output stream in PlotML.
|
void |
writeFormat(java.io.PrintWriter output)
Write plot format information to the specified output stream in PlotML.
|
void |
writeOldSyntax(java.io.OutputStream out)
Deprecated.
|
void |
zoom(double lowx,
double lowy,
double highx,
double highy)
Zoom in or out to the specified rectangle.
|
void addCaptionLine(java.lang.String captionLine)
captionLine
- The string to be added.getCaptions()
void addLegend(int dataset, java.lang.String legend)
dataset
- The dataset index.legend
- The label for the dataset.renameLegend(int, String)
void addXTick(java.lang.String label, double position)
Note that if setXLog(boolean)
has been called, then
the position value should be in log units.
So, addXTick("1K", 3) will display the string
1Kat the 1000 mark.
label
- The label for the tick mark.position
- The position on the X axis.void addYTick(java.lang.String label, double position)
Note that if setYLog(boolean)
has been called, then
the position value should be in log units.
So, addYTick("1K", 3) will display the string
1Kat the 1000 mark.
label
- The label for the tick mark.position
- The position on the Y axis.void clear(boolean axes)
axes
- If true, clear the axes parameters.void clearCaptions()
setCaptions(Vector)
void clearLegends()
void deferIfNecessary(java.lang.Runnable action)
action
- The Runnable object to execute.void destroy()
void fillPlot()
java.util.Vector getCaptions()
addCaptionLine(String)
,
setCaptions(Vector)
boolean getColor()
setColor(boolean)
java.lang.Object[] getColors()
setColors(Object[])
@Deprecated java.lang.String getDataurl()
setDataurl(String)
@Deprecated java.net.URL getDocumentBase()
setDocumentBase(URL)
boolean getGrid()
setGrid(boolean)
java.lang.String getLegend(int dataset)
dataset
- The dataset index.int getLegendDataset(java.lang.String legend)
legend
- The String naming the legendjava.lang.Object getPlotRectangle()
setPlotRectangle(Object)
java.lang.String getTitle()
setTitle(String)
double[] getXAutoRange()
getXRange()
java.lang.String getXLabel()
setXLabel(String)
boolean getXLog()
setXLog(boolean)
double[] getXRange()
setXRange(double, double)
has been
called, then this method returns the values passed in as
arguments to setXRange(double, double). If setXRange(double,
double) has not been called, then this method returns the
range of the data to be plotted, which might not be all of the
data due to zooming.getXAutoRange()
,
setXRange(double, double)
java.util.Vector[] getXTicks()
double[] getYAutoRange()
getYRange()
java.lang.String getYLabel()
setYLabel(String)
boolean getYLog()
setYLog(boolean)
double[] getYRange()
setYRange(double, double)
has been
called, then this method returns the values passed in as
arguments to setYRange(double, double). If setYRange(double,
double) has not been called, then this method returns the
range of the data to be plotted, which might not be all of the
data due to zooming.getYAutoRange()
,
setYRange(double, double)
java.util.Vector[] getYTicks()
@Deprecated void init()
@Deprecated void parseFile(java.lang.String filespec)
filespec
- The file to be read.@Deprecated void parseFile(java.lang.String filespec, java.net.URL documentBase)
filespec
- The file to be read.documentBase
- The base of the URLvoid read(java.io.InputStream in) throws java.io.IOException
To read from standard input, use:
read(System.in);To read from a url, use:
read(url.openStream());To read a URL from within an applet, use:
URL url = new URL(getDocumentBase(), urlSpec); read(url.openStream());Within an application, if you have an absolute URL, use:
URL url = new URL(urlSpec); read(url.openStream());To read from a file, use:
read(new FileInputStream(filename));
in
- The input stream.java.io.IOException
- If the stream cannot be read.void read(java.lang.String command)
command
- A command.void removeLegend(int dataset)
dataset
- The dataset index.void renameLegend(int dataset, java.lang.String newName)
dataset
- The dataset of the legend to be renamed.
If there is no dataset with this value, then nothing happens.newName
- The new name of legend.addLegend(int, String)
void repaint()
void resetAxes()
void samplePlot()
void setAutomaticRescale(boolean automaticRescale)
automaticRescale
- The boolean that specifies whether
plots should be automatic rescaled.void setBackground(java.lang.Object background)
background
- The background color.void setButtons(boolean visible)
visible
- If true, make the fill button appear.destroy()
void setCaptions(java.util.Vector captionStrings)
captionStrings
- A Vector where each element contains a String
that is one line of the caption.getCaptions()
,
clearCaptions()
void setColor(boolean useColor)
useColor
- False to draw in back and white.getColor()
void setColors(java.lang.Object[] colors)
colors
- Array of colors to use in succession for data sets.getColors()
@Deprecated void setDataurl(java.lang.String filespec)
filespec
- the file to be readgetDataurl()
@Deprecated void setDocumentBase(java.net.URL documentBase)
documentBase
- The document base to be used.getDocumentBase()
void setForeground(java.lang.Object foreground)
foreground
- The foreground color.void setGrid(boolean grid)
grid
- If true, a grid is drawn.getGrid()
void setLabelFont(java.lang.String name)
name
- A font name.void setPlotRectangle(java.lang.Object rectangle)
rectangle
- Rectangle space inside axes.getPlotRectangle()
void setSize(int width, int height)
width
- The width, in pixels.height
- The height, in pixels.void setTimedRepaint(boolean timedRepaint)
timedRepaint
- The boolean that specifies whether
repainting should happen with a certain fixed refresh rate.void setTitle(java.lang.String title)
title
- The title.getTitle()
void setTitleFont(java.lang.String name)
name
- A font name.void setWrap(boolean wrap)
wrap
- If true, wrapping of the X axis is enabled.void setXLabel(java.lang.String label)
label
- The label.getXLabel()
void setXLog(boolean xlog)
xlog
- If true, logarithmic axis is used.getXLog()
void setXRange(double min, double max)
Note that if setXLog(boolean)
has been called, then
the min and max values should be in log units.
min
- The left extent of the range.max
- The right extent of the range.getXRange()
void setYLabel(java.lang.String label)
label
- The label.getYLabel()
void setYLog(boolean ylog)
ylog
- If true, logarithmic axis is used.getYLog()
void setYRange(double min, double max)
Note that if setYLog(boolean)
has been called, then
the min and max values should be in log units.
min
- The bottom extent of the range.max
- The top extent of the range.getYRange()
void write(java.io.OutputStream out)
out
- An output stream.void write(java.io.OutputStream out, java.lang.String dtd)
out
- An output stream.dtd
- The reference (URL) for the DTD, or null to use the
PUBLIC DTD.void write(java.io.Writer out, java.lang.String dtd)
out
- An output writer.dtd
- The reference (URL) for the DTD, or null to use the
PUBLIC DTD.void writeData(java.io.PrintWriter output)
output
- A buffered print writer.void writeFormat(java.io.PrintWriter output)
output
- A buffered print writer.@Deprecated void writeOldSyntax(java.io.OutputStream out)
out
- An output stream.void zoom(double lowx, double lowy, double highx, double highy)
lowx
- The low end of the new X range.lowy
- The low end of the new Y range.highx
- The high end of the new X range.highy
- The high end of the new Y range.