|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuserinterface.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, 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(Tupel<java.lang.Double,? extends java.lang.Number>[] 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 |
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 |
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
- xlabel
- ylabel
- Method Detail |
---|
public void readInData(java.io.File dataSource)
dataSource
- A file containing data to be plottedpublic void addSeries(Tupel<java.lang.Double,? extends java.lang.Number>[] 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
- y
- public 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 saved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |