aboutsummaryrefslogtreecommitdiff
path: root/src/AbstractGraph.java
blob: cb3655876cc1e12df0ce87c4532c982174eaabbf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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;
/*     */   }
/*     */   public ExtendablePointInvoker getInvoker() {
/*  85 */     return invoker;
/*     */   }
/*     */   public void setInvoker(ExtendablePointInvoker invoker) {
/*  88 */     invoker = invoker;
/*  89 */     repaint();
/*     */   }
/*     */   public int getXSkip() {
/*  92 */     return this.xskip;
/*     */   }
/*     */   public void setXSkip(int xSkip) {
/*  95 */     this.xskip = xSkip;
/*  96 */     repaint();
/*     */   }
/*     */   protected void wipe() {
/*  99 */     this.points = new ArrayList[10];
/* 100 */     for (int i = 0; i < this.points.length; i++) {
/* 101 */       this.points[i] = new ArrayList();
/*     */     }
/* 103 */     repaint();
/*     */   }
/*     */   public void appendEquation(String equation) {
/* 106 */     String[] temp = GraphTypeHolder.getInstance().getEquations();
/* 107 */     String[] nother = new String[temp.length + 1];
/* 108 */     for (int i = 0; i < temp.length; i++) nother[i] = temp[i];
/* 109 */     nother[(nother.length - 1)] = equation;
/* 110 */     GraphTypeHolder.getInstance().setEquations(nother); } 
/*     */   public abstract void makePoints();
/*     */ 
/*     */   public abstract void remakePoints();
/*     */ 
/* 115 */   protected void clearEvents() { int max = super.getEvents().size();
/* 116 */     for (int i = 0; i < max; i++)
/* 117 */       super.removeEvent(0);
/*     */   }
/*     */ }

/* Location:           Modulus.jar
 * Qualified Name:     AbstractGraph
 * JD-Core Version:    0.6.2
 */