diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
130 files changed, 11486 insertions, 0 deletions
diff --git a/src/AbstractGraph.java b/src/AbstractGraph.java new file mode 100644 index 0000000..cb36558 --- /dev/null +++ b/src/AbstractGraph.java @@ -0,0 +1,114 @@ +/* */ import java.awt.Color; +/* */ import java.util.ArrayList; +/* */ import java.util.List; +/* */ +/* */ public abstract class AbstractGraph extends GraphWorld +/* */ { +/* */ private static final long serialVersionUID = -4806217320367527179L; +/* 15 */ public static final Color[] colors = { +/* 16 */ Color.red, +/* 17 */ Color.blue, +/* 18 */ Color.green, +/* 19 */ Color.yellow.darker(), +/* 20 */ Color.magenta, +/* 21 */ Color.pink, +/* 22 */ Color.orange, +/* 23 */ Color.black, +/* 24 */ new Color(100, 100, 0), +/* 25 */ Color.gray }; +/* */ private ArrayList<Point2D>[] points; +/* */ private static ExtendablePointInvoker invoker; +/* */ private double lastY; +/* */ private double lastX; +/* */ private WindowRange winRange; +/* */ private int xskip; +/* */ +/* */ public AbstractGraph(int w, int h) +/* */ { +/* 38 */ super(w, h); +/* 39 */ this.points = new ArrayList[10]; +/* 40 */ for (int i = 0; i < this.points.length; i++) this.points[i] = new ArrayList(); +/* 41 */ this.winRange = new WindowRange(); +/* */ } +/* */ public void setWindowRange(WindowRange winRange) { +/* 44 */ this.winRange = winRange; +/* 45 */ repaint(); +/* */ } +/* */ public WindowRange getWindowRange() { +/* 48 */ return this.winRange; +/* */ } +/* */ public void addPoint(Point2D point, int index) { +/* 51 */ this.points[index].add(point); +/* */ } +/* */ public void pushPoint(Point2D point, int index) { +/* 54 */ this.points[index].add(0, point); +/* */ } +/* */ public void removePoint(Point2D point, int index) { +/* 57 */ this.points[index].remove(point); +/* */ } +/* */ +/* */ public ArrayList<Point2D>[] getPoints() { +/* 61 */ return this.points; +/* */ } +/* */ public String[] getEquations() { +/* 64 */ return GraphTypeHolder.getInstance().getEquations(); +/* */ } +/* */ public void setEquations(String[] equations) { +/* 67 */ GraphTypeHolder.getInstance().setEquations(equations); +/* 68 */ clearEvents(); +/* 69 */ repaint(); +/* */ } +/* */ +/* */ protected void setLastY(double last) { +/* 73 */ this.lastY = last; +/* */ } +/* */ protected void setLastX(double last) { +/* 76 */ this.lastX = last; +/* */ } +/* */ public double getLastY() { +/* 79 */ return this.lastY; +/* */ } +/* */ public double getLastX() { +/* 82 */ return this.lastX; +/* */ } +/* */ |