1 | public class CombinedCategoryPlot extends CombinedDomainCategoryPlot {↵ | | 1 | public class CombinedXYPlot extends CombinedDomainXYPlot {↵
|
|
2 | /**↵ | | 2 | /**↵
|
3 | * Creates a new instance with the specified axes.↵ | | 3 | * Creates a new instance with the specified axes.↵
|
4 | *↵ | | 4 | *↵
|
5 | * @param domainAxis the x-axis.↵ | | 5 | * @param domainAxis the x-axis.↵
|
6 | * @param rangeAxis the y-axis.↵ | | 6 | * @param rangeAxis the y-axis.↵
|
7 | */↵ | | 7 | */↵
|
8 | public CombinedCategoryPlot (CategoryAxis domainAxis, ValueAxis rangeAxis) {↵ | | 8 | public CombinedXYPlot(ValueAxis domainAxis, ValueAxis rangeAxis) {↵
|
9 | super(domainAxis);↵ | | 9 | super(domainAxis);↵
|
10 | super.setGap(10.0);↵ | | 10 | super.setGap(10.0);↵
|
11 | super.setRangeAxis(rangeAxis);↵ | | 11 | super.setRangeAxis(rangeAxis);↵
|
12 | }↵ | | 12 | }↵
|
|
13 | /**↵ | | 13 | /**↵
|
14 | * Adds a new subplot with weight <code>1</code>.↵ | | 14 | * Adds a new subplot with weight <code>1</code>.↵
|
15 | *↵ | | 15 | *↵
|
16 | * @param subplot the subplot.↵ | | 16 | * @param subplot the subplot.↵
|
17 | */↵ | | 17 | */↵
|
18 | public void add(CategoryPlot subplot) {↵ | | 18 | public void add(XYPlot subplot) {↵
|
19 | this.add(subplot, 1);↵ | | 19 | this.add(subplot, 1);↵
|
20 | }↵ | | 20 | }↵
|
|
21 | /**↵ | | 21 | /**↵
|
22 | * Adds a new subplot with the specified weight.↵ | | 22 | * Adds a new subplot with the specified weight.↵
|
23 | *↵ | | 23 | *↵
|
24 | * @param subplot the subplot.↵ | | 24 | * @param subplot the subplot.↵
|
25 | * @param weight the weight for the subplot.↵ | | 25 | * @param weight the weight for the subplot.↵
|
26 | */↵ | | 26 | */↵
|
27 | public void add(CategoryPlot subplot, int weight) {↵ | | 27 | public void add(XYPlot subplot, int weight) {↵
|
28 | super.add(subplot, weight);↵ | | 28 | super.add(subplot, weight);↵
|
|
29 | ValueAxis l_range = super.getRangeAxis();↵ | | 29 | ValueAxis l_range = super.getRangeAxis();↵
|
30 | subplot.setRangeAxis(0, l_range, false);↵ | | 30 | subplot.setRangeAxis(0, l_range, false);↵
|
|
31 | super.setRangeAxis(l_range);↵ | | 31 | super.setRangeAxis(l_range);↵
|
32 | if (null == l_range) {↵ | | 32 | if (null == l_range) {↵
|
33 | return;↵ | | 33 | return;↵
|
34 | }↵ | | 34 | }↵
|
|
35 | l_range.configure();↵ | | 35 | l_range.configure();↵
|
36 | }↵ | | 36 | }↵
|
|
37 | /**↵ | | 37 | /**↵
|
38 | * Returns the bounds of the data values that will be plotted against↵ | | 38 | * Returns the bounds of the data values that will be plotted against↵
|
39 | * the specified axis.↵ | | 39 | * the specified axis.↵
|
40 | *↵ | | 40 | *↵
|
41 | * @param axis the axis.↵ | | 41 | * @param axis the axis.↵
|
42 | */↵ | | 42 | */↵
|
43 | public Range getDataRange(ValueAxis axis) {↵ | | 43 | public Range getDataRange(ValueAxis axis) {↵
|
44 | Range l_result = null;↵ | | 44 | Range l_result = null;↵
|
45 | Iterator l_itr = getSubplots().iterator();↵ | | 45 | Iterator l_itr = getSubplots().iterator();↵
|
46 | while (l_itr.hasNext()) {↵ | | 46 | while (l_itr.hasNext()) {↵
|
47 | CategoryPlot l_subplot = (CategoryPlot) l_itr.next();↵ | | 47 | XYPlot l_subplot = (XYPlot) l_itr.next();↵
|
|
48 | l_result = Range.combine(l_result, l_subplot.getDataRange(axis));↵ | | 48 | l_result = Range.combine(l_result, l_subplot.getDataRange(axis));↵
|
49 | }↵ | | 49 | }↵
|
50 | return l_result;↵ | | 50 | return l_result;↵
|
51 | }↵ | | 51 | }↵
|
|
52 | /**↵ | | 52 | /**↵
|
53 | * Sets the range axis that is shared by all the subplots.↵ | | 53 | * Sets the range axis that is shared by all the subplots.↵
|
54 | *↵ | | 54 | *↵
|
55 | * @param axis the axis.↵ | | 55 | * @param axis the axis.↵
|
56 | */↵ | | 56 | */↵
|
57 | public void setRangeAxis(ValueAxis axis) {↵ | | 57 | public void setRangeAxis(ValueAxis axis) {↵
|
58 | Iterator l_itr = getSubplots().iterator();↵ | | 58 | Iterator l_itr = getSubplots().iterator();↵
|
59 | while (l_itr.hasNext()) {↵ | | 59 | while (l_itr.hasNext()) {↵
|
60 | CategoryPlot l_subplot = (CategoryPlot) l_itr.next();↵ | | 60 | XYPlot l_subplot = (XYPlot) l_itr.next();↵
|
61 | l_subplot.setRangeAxis(0, axis, false);↵ | | 61 | l_subplot.setRangeAxis(0, axis, false);↵
|
62 | }↵ | | 62 | }↵
|
|
63 | super.setRangeAxis(axis);↵ | | 63 | super.setRangeAxis(axis);↵
|
64 | if (null == axis) {↵ | | 64 | if (null == axis) {↵
|
65 | return;↵ | | 65 | return;↵
|
66 | }↵ | | 66 | }↵
|
|
67 | axis.configure() | | 67 | axis.configure()
|