1 package org.catacomb.dataview.model;
2
3 import org.catacomb.interlish.structure.AddableTo;
4 import org.catacomb.report.E;
5
6 import java.util.ArrayList;
7
8
9 public class LineGraph implements AddableTo {
10
11 public int width;
12 public int height;
13
14
15 public XAxis xaxis;
16 public YAxis yaxis;
17
18 public ArrayList<Line> lines = new ArrayList<Line>();
19
20 public ArrayList<LineSet> lineSets = new ArrayList<LineSet>();
21
22 public ArrayList<View> views = new ArrayList<View>();
23
24
25 public void add(Object obj) {
26 if (obj instanceof XAxis) {
27 xaxis = (XAxis)obj;
28 } else if (obj instanceof YAxis) {
29 yaxis = (YAxis)obj;
30 } else if (obj instanceof Line) {
31 lines.add((Line)obj);
32 } else if (obj instanceof LineSet) {
33 lineSets.add((LineSet)obj);
34 } else if (obj instanceof View) {
35 views.add((View)obj);
36
37 } else {
38 E.error("cant add " + obj);
39 }
40 }
41
42
43
44 public XAxis getXAxis() {
45 return xaxis;
46 }
47
48 public YAxis getYAxis() {
49 return yaxis;
50 }
51
52
53 public ArrayList<View> getViews() {
54 return views;
55 }
56
57
58 public ArrayList<Plottable> getPlottables() {
59 ArrayList<Plottable> ret = new ArrayList<Plottable>();
60 ret.addAll(lines);
61 ret.addAll(lineSets);
62 return ret;
63 }
64
65
66
67 public int getWidth() {
68 return width;
69 }
70
71 public int getHeight() {
72 return height;
73 }
74
75
76
77
78 }