public interface PlotInterface extends PlotBoxInterface
Modifier and Type | Method and Description |
---|---|
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.
|
default void |
addPoint(int dataset,
double x,
double y,
boolean connected)
In the specified data set, add the specified x, y point to the
plot.
|
void |
addPoint(int dataset,
double x,
double y,
double[] derivatives,
boolean connected)
In the specified data set, add the specified x, y point to the
plot, with derivatives optionally provided for polynomial
extrapolation.
|
void |
addPointWithErrorBars(int dataset,
double x,
double y,
double[] derivatives,
double yLowEB,
double yHighEB,
boolean connected)
In the specified data set, add the specified x, y point to the
plot with error bars.
|
void |
clear(boolean format)
Clear the plot of all data points.
|
void |
clear(int dataset)
Clear the plot of data points in the specified dataset.
|
void |
erasePoint(int dataset,
int index)
Erase the point at the given index in the given dataset.
|
void |
fillPlot()
Rescale so that the data that is currently plotted just fits.
|
boolean |
getConnected()
Return whether the default is to connect
subsequent points with a line.
|
boolean |
getImpulses()
Return whether a line will be drawn from any
plotted point down to the x axis.
|
boolean |
getLineStyles()
Return false if setLineStyles() has not yet been called or if
setLineStyles(false) has been called, which signifies that
different line styles are not to be used.
|
java.lang.String |
getMarksStyle()
Get the marks style, which is one of
"none", "points", "dots", or "various".
|
int |
getMaxDataSets()
Deprecated.
|
int |
getNumDataSets()
Return the actual number of data sets.
|
boolean |
getReuseDatasets()
Return false if setReuseDatasets() has not yet been called
or if setReuseDatasets(false) has been called.
|
void |
markDisconnections(boolean value)
Mark the disconnections with a Dot in case value equals true, otherwise these
points are not marked.
|
void |
parseFile(java.lang.String filespec,
java.net.URL documentBase)
Deprecated.
|
void |
read(java.io.InputStream inputStream)
Read a file with the old syntax (non-XML).
|
void |
samplePlot()
Create a sample plot.
|
void |
setBars(boolean on)
Turn bars on or off (for bar charts).
|
void |
setBars(double width,
double offset)
Turn bars on and set the width and offset.
|
void |
setConnected(boolean on)
If the argument is true, then the default is to connect
subsequent points with a line.
|
void |
setConnected(boolean on,
int dataset)
If the first argument is true, then by default for the specified
dataset, points will be connected by a line.
|
void |
setImpulses(boolean on)
If the argument is true, then a line will be drawn from any
plotted point down to the x axis.
|
void |
setImpulses(boolean on,
int dataset)
If the first argument is true, then a line will be drawn from any
plotted point in the specified dataset down to the x axis.
|
void |
setLineStyle(java.lang.String styleString,
int dataset)
Set the style of the lines joining marks.
|
void |
setLineStyles(boolean lineStyles)
If the argument is true, draw the data sets with different line
styles.
|
void |
setMarksStyle(java.lang.String style)
Set the marks style to "none", "points", "dots", or "various".
|
void |
setMarksStyle(java.lang.String style,
int dataset)
Set the marks style to "none", "points", "dots", "various",
or "pixels" for the specified dataset.
|
void |
setNumSets(int numSets)
Deprecated.
|
void |
setPointsPersistence(int persistence)
Calling this method with a positive argument sets the
persistence of the plot to the given number of points.
|
void |
setReuseDatasets(boolean on)
If the argument is true, then datasets with the same name
are merged into a single dataset.
|
void |
setXPersistence(double persistence)
Calling this method with a positive argument sets the
persistence of the plot to the given width in units of the
horizontal axis.
|
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, an XML scheme.
|
addCaptionLine, addXTick, addYTick, clearCaptions, clearLegends, deferIfNecessary, destroy, getCaptions, getColor, getColors, getDataurl, getDocumentBase, getGrid, getLegend, getLegendDataset, getPlotRectangle, getTitle, getXAutoRange, getXLabel, getXLog, getXRange, getXTicks, getYAutoRange, getYLabel, getYLog, getYRange, getYTicks, init, parseFile, read, removeLegend, renameLegend, repaint, resetAxes, setAutomaticRescale, setBackground, setButtons, setCaptions, setColor, setColors, setDataurl, setDocumentBase, setForeground, setGrid, setLabelFont, setPlotRectangle, setSize, setTimedRepaint, setTitle, setTitleFont, setWrap, setXLabel, setXLog, setXRange, setYLabel, setYLog, setYRange, write, write, write, writeOldSyntax, zoom
void addLegend(int dataset, java.lang.String legend)
PlotBoxInterface
addLegend
in interface PlotBoxInterface
dataset
- The dataset index.legend
- The label for the dataset.PlotBoxInterface.renameLegend(int, String)
default void addPoint(int dataset, double x, double y, boolean connected)
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the point will not be added immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
dataset
- The data set index.x
- The X position of the new point.y
- The Y position of the new point.connected
- If true, a line is drawn to connect to the previous
point.void addPoint(int dataset, double x, double y, double[] derivatives, boolean connected)
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the point will not be added immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
dataset
- The data set index.x
- The X position of the new point.y
- The Y position of the new point.derivatives
- The derivatives at the new point (optional).
(The array will be copied as needed.)connected
- If true, a line is drawn to connect to the previous
point.void addPointWithErrorBars(int dataset, double x, double y, double[] derivatives, double yLowEB, double yHighEB, boolean connected)
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the point will not be added immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
dataset
- The data set index.x
- The X position of the new point.y
- The Y position of the new point.derivatives
- The derivatives at the new point.
(The array will be copied as needed.)yLowEB
- The low point of the error bar.yHighEB
- The high point of the error bar.connected
- If true, a line is drawn to connect to the previous
point.void clear(boolean format)
clear
in interface PlotBoxInterface
format
- If true, clear the format controls as well.
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the clear will not be executed immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
void clear(int dataset)
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the point will not be added immediately (unless you call this method from within the event dispatch thread). If you call this method, the addPoint() method, and the erasePoint() method in any order, they are assured of being processed in the order that you called them.
dataset
- The dataset to clear.void erasePoint(int dataset, int index)
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the point will not be erased immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
dataset
- The data set index.index
- The index of the point to erase.void fillPlot()
In order to work well with swing and be thread safe, this method actually defers execution to the event dispatch thread, where all user interface actions are performed. Thus, the fill will not occur immediately (unless you call this method from within the event dispatch thread). All the methods that do this deferring coordinate so that they are executed in the order that you called them.
fillPlot
in interface PlotBoxInterface
boolean getConnected()
setConnected(boolean)
boolean getImpulses()
setImpulses(boolean)
boolean getLineStyles()
setLineStyles(boolean)
java.lang.String getMarksStyle()
setMarksStyle(java.lang.String)
@Deprecated int getMaxDataSets()
int getNumDataSets()
boolean getReuseDatasets()
setReuseDatasets(boolean)
@Deprecated void parseFile(java.lang.String filespec, java.net.URL documentBase)
parseFile
in interface PlotBoxInterface
filespec
- The file to be read.documentBase
- The base of the URLvoid markDisconnections(boolean value)
value
- True when disconnections should be marked.void read(java.io.InputStream inputStream) throws java.io.IOException
read
in interface PlotBoxInterface
inputStream
- The input stream.java.io.IOException
- If the stream cannot be read.void samplePlot()
samplePlot
in interface PlotBoxInterface
void setBars(boolean on)
on
- If true, turn bars on.void setBars(double width, double offset)
width
- The width of the bars.offset
- The offset per data set.void setConnected(boolean on)
on
- If true, draw lines between points.setConnected(boolean, int)
,
getConnected()
void setConnected(boolean on, int dataset)
on
- If true, draw lines between points.dataset
- The dataset to which this should apply.setConnected(boolean)
,
getConnected()
void setImpulses(boolean on)
on
- If true, draw a stem plot.getImpulses()
void setImpulses(boolean on, int dataset)
on
- If true, draw a stem plot.dataset
- The dataset to which this should apply.getImpulses()
void setLineStyle(java.lang.String styleString, int dataset)
styleString
- A string specifying the color for points.
The following styles are permitted: "solid", "dotted",
"dashed", "dotdashed", "dotdotdashed".dataset
- The data set index.void setLineStyles(boolean lineStyles)
lineStyles
- True if the data sets are to be drawn in different
line styles.getLineStyles()
void setMarksStyle(java.lang.String style)
style
- A string specifying the style for points.getMarksStyle()
void setMarksStyle(java.lang.String style, int dataset)
style
- A string specifying the style for points.dataset
- The dataset to which this should apply.getMarksStyle()
@Deprecated void setNumSets(int numSets)
numSets
- The number of data sets.void setPointsPersistence(int persistence)
Setting the persistence greater than zero forces the plot to be drawn in XOR mode, which allows points to be quickly and efficiently erased. However, there is a bug in Java (as of version 1.3), where XOR mode does not work correctly with double buffering. Thus, if you call this with an argument greater than zero, then we turn off double buffering for this panel and all of its parents. This actually happens on the next call to addPoint().
persistence
- Number of points to persist for.void setReuseDatasets(boolean on)
on
- If true, then merge datasets.getReuseDatasets()
void setXPersistence(double persistence)
Setting the X persistence greater than zero forces the plot to be drawn in XOR mode, which allows points to be quickly and efficiently erased. However, there is a bug in Java (as of version 1.3), where XOR mode does not work correctly with double buffering. Thus, if you call this with an argument greater than zero, then we turn off double buffering for this panel and all of its parents. This actually happens on the next call to addPoint().
persistence
- Persistence in units of the horizontal axis.void writeData(java.io.PrintWriter output)
writeData
in interface PlotBoxInterface
output
- A buffered print writer.void writeFormat(java.io.PrintWriter output)
writeFormat
in interface PlotBoxInterface
output
- A buffered print writer.