summaryrefslogtreecommitdiff
path: root/altosui/AltosGraph.java
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2012-09-12 20:01:22 -0600
committerBdale Garbee <bdale@gag.com>2012-09-12 20:01:22 -0600
commit3b612efcd1dddc6a3d59012f7ed57754b1f798c2 (patch)
tree18d50713491ef96c5c127a309f870efb6c33f98d /altosui/AltosGraph.java
parente076773c1693e2a62bb828dee71c04c20dbab0a5 (diff)
parent01eb36408d7e0e826b431fcc1d3b2deb23607e0b (diff)
Merge branch 'new-debian' into debian
Conflicts: ChangeLog debian/altos.install debian/changelog debian/control debian/copyright debian/dirs debian/docs debian/menu debian/rules src/Makefile
Diffstat (limited to 'altosui/AltosGraph.java')
-rw-r--r--altosui/AltosGraph.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/altosui/AltosGraph.java b/altosui/AltosGraph.java
new file mode 100644
index 00000000..54d2bb0b
--- /dev/null
+++ b/altosui/AltosGraph.java
@@ -0,0 +1,27 @@
+
+// Copyright (c) 2010 Anthony Towns
+// GPL v2 or later
+
+package altosui;
+
+import java.io.*;
+
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.ChartUtilities;
+import org.altusmetrum.AltosLib.*;
+
+abstract class AltosGraph {
+ public String filename;
+ public abstract void addData(AltosDataPoint d);
+ public abstract JFreeChart createChart();
+ public String title;
+ public void toPNG() throws java.io.IOException { toPNG(300, 500); }
+ public void toPNG(int width, int height)
+ throws java.io.IOException
+ {
+ File pngout = new File(filename);
+ JFreeChart chart = createChart();
+ ChartUtilities.saveChartAsPNG(pngout, chart, width, height);
+ System.out.println("Created " + filename);
+ }
+}