|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthalo.userinterface.gui.graphhandler.XYGraphConstructor
public class XYGraphConstructor
Class for the generation and displaying of an XY graph with JFreeChart Provides methods for generating a plot from a file, but also for direct adding of number pairs or a whole list of number pairs
Constructor Summary | |
---|---|
XYGraphConstructor(java.lang.String title,
java.lang.String xlabel,
java.lang.String ylabel)
Constructs an empty graph constructor with a given title and axis labels |
Method Summary | |
---|---|
void |
addData(double x,
java.util.ArrayList<java.lang.Double> y)
Adds a number of numerical (x,y) pairs to the graph (scatterplot) , but only if the number is the same as the number of existing series; this method should be used after 'addEmptySeries' to ensure no messing up of data that does not belong together |
void |
addData(double x,
double y)
Adds one single numerical pair to the graph, but only if there is only one series of data; this method should be used after 'addEmptySeries' to ensure no messing up of data that does not belong together |
void |
addEmptySeries(java.util.ArrayList<java.lang.String> titles)
Creates a number of empty series and adds them to those yet existing |
void |
addEmptySeries(java.lang.String title)
Creates one empty series and adds them to the existing ones |
void |
addSeries(java.util.ArrayList<Tuple<java.lang.Double,java.lang.Double>> list,
java.lang.String title)
Adds a list of numerical pairs to the graph |
void |
generateGraph()
Generates a graph from the loaded data and displays it |
java.util.ArrayList<org.jfree.data.xy.XYSeries> |
getSeries()
Returns the list of series |
void |
readInData(java.io.File dataSource)
Reads in data from a given file and prepares it for plotting Structure of the input file has to be tabular, with first column giving the x-axis value, other columns giving corresponding y-axis values |
void |
saveGraph(java.io.File output)
Saves the graph as a JPEG picture |
void |
savePlotFile(java.io.File output)
Generates a plotting file with tab separations |
void |
setPoints(boolean[] points)
Sets the point definitions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XYGraphConstructor(java.lang.String title, java.lang.String xlabel, java.lang.String ylabel)
title
- Title of the graphxlabel
- Title of the x-axisylabel
- Title of the y-axisMethod Detail |
---|
public void readInData(java.io.File dataSource)
dataSource
- A file containing data to be plottedpublic void addSeries(java.util.ArrayList<Tuple<java.lang.Double,java.lang.Double>> list, java.lang.String title)
list
- A list of numerical pairs/tuplestitle
- The title of the listpublic void addData(double x, double y)
x
- The x-axis valuey
- The y-axis valuepublic void addData(double x, java.util.ArrayList<java.lang.Double> y)
x
- A single x-valuey
- A set of corresponding y-valuespublic void addEmptySeries(java.util.ArrayList<java.lang.String> titles)
titles
- A number of titles for the empty seriespublic void addEmptySeries(java.lang.String title)
title
- The title of this seriespublic void generateGraph()
public void saveGraph(java.io.File output)
output
- The output file where it will be savedpublic void savePlotFile(java.io.File output)
public void setPoints(boolean[] points)
points
- An array defining which series will be printed as points (TRUE) and which as lines (FALSE)public java.util.ArrayList<org.jfree.data.xy.XYSeries> getSeries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |