Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java @ 815:22c18083225e
Removed compiler warnings while JavaDoc generation.
gnv-artifacts/trunk@900 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 12 Apr 2010 06:59:33 +0000 |
parents | feae2f9d6c6f |
children | 05bf8534a35a |
rev | line source |
---|---|
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.jfreechart; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.awt.AlphaComposite; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 import java.awt.Composite; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.awt.Graphics2D; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import java.awt.Shape; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import java.awt.geom.Point2D; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import java.awt.geom.Rectangle2D; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.util.HashMap; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 import java.util.Iterator; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import java.util.Map; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.jfree.chart.axis.Axis; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import org.jfree.chart.axis.AxisCollection; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 import org.jfree.chart.axis.AxisLocation; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 import org.jfree.chart.axis.AxisSpace; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 import org.jfree.chart.axis.AxisState; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.jfree.chart.axis.ValueAxis; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 import org.jfree.chart.plot.Plot; |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
23 import org.jfree.chart.plot.PlotOrientation; |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 import org.jfree.chart.plot.PlotRenderingInfo; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 import org.jfree.chart.plot.PlotState; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 import org.jfree.data.Range; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 import org.jfree.ui.RectangleEdge; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 import org.jfree.ui.RectangleInsets; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 import org.jfree.util.ObjectList; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 /** |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
35 * A class for plotting polygons into a 2D chart. This plot makes use of <code> |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
36 * PolygonRenderer</code>. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
795
diff
changeset
|
37 * |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
38 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 */ |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 // TODO implement cloneable |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 public class PolygonPlot |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 extends Plot |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 public static final String PLOT_TYPE = "PolygonPlot"; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 public static final PlotOrientation DEFAULT_PLOT_ORIENTATION = |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 PlotOrientation.VERTICAL; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 private PolygonDataset dataset; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 private transient PolygonRenderer renderer; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 private PlotOrientation orientation; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 private RectangleInsets axisOffset; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 private ObjectList domainAxisLocation; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 private ObjectList rangeAxisLocation; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 private ObjectList domainAxes; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 private ObjectList rangeAxes; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
62 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
63 * Constructs a new PolygonPlot with a dataset and a renderer. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
64 * |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
65 * @param dataset Dataset containing polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
66 * @param renderer The renderer used to draw polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
67 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 public PolygonPlot(PolygonDataset dataset, PolygonRenderer renderer) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 this(dataset, renderer, null, null, PlotOrientation.HORIZONTAL); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
73 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
74 * @param dataset Dataset containing polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
75 * @param renderer The renderer used to draw polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
76 * @param orientation The orientation used for this plot. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
77 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 public PolygonPlot( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 PolygonDataset dataset, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 PolygonRenderer renderer, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 PlotOrientation orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 this(dataset, renderer, null, null, orientation); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
87 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
88 * @param dataset Dataset containing polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
89 * @param renderer The renderer used to draw polygons. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
90 * @param domainAxis The x axis. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
91 * @param rangeAxis The y axis. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
92 * @param orientation The orientation used for this plot. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
93 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 public PolygonPlot( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 PolygonDataset dataset, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 PolygonRenderer renderer, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 ValueAxis domainAxis, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 ValueAxis rangeAxis, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 PlotOrientation orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 super(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 this.dataset = dataset; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 this.renderer = renderer; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
105 this.domainAxes = new ObjectList(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
106 this.rangeAxes = new ObjectList(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 this.domainAxisLocation = new ObjectList(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 this.rangeAxisLocation = new ObjectList(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 this.axisOffset = RectangleInsets.ZERO_INSETS; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 if (orientation != null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
112 this.orientation = orientation; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
113 else |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 this.orientation = DEFAULT_PLOT_ORIENTATION; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 if (domainAxis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 this.domainAxes.set(0, domainAxis); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 domainAxis.setPlot(this); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 domainAxisLocation.set(0, AxisLocation.BOTTOM_OR_LEFT); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
121 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 if (rangeAxis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 this.rangeAxes.set(0, rangeAxis); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 rangeAxis.setPlot(this); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 rangeAxisLocation.set(0, AxisLocation.BOTTOM_OR_LEFT); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 configureDomainAxis(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 configureRangeAxis(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 public void configureDomainAxis() { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 // we just have 1 dataset |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 Range domainAxisRange = getDataset().getDomainBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 for (int i = 0; i < domainAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
138 ValueAxis axis = (ValueAxis) domainAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
139 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
140 if (axis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 axis.configure(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 axis.setRange(domainAxisRange); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
147 public ValueAxis getDomainAxis() { |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
148 return getDomainAxis(0); |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
149 } |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
150 |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
151 public ValueAxis getDomainAxis(int index) { |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
152 return index < domainAxes.size() |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
153 ? (ValueAxis)domainAxes.get(index) |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
154 : null; |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
155 } |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
156 |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
157 public ValueAxis getRangeAxis() { |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
158 return getRangeAxis(0); |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
159 } |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
160 |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
161 public ValueAxis getRangeAxis(int index) { |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
162 return index < rangeAxes.size() |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
163 ? (ValueAxis)rangeAxes.get(index) |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
164 : null; |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
165 } |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
167 public void configureRangeAxis() { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
168 // we just have 1 dataset |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
169 Range rangeAxisRange = getDataset().getRangeBounds(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
170 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
171 for (int i = 0; i < rangeAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
172 ValueAxis axis = (ValueAxis) rangeAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
173 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
174 if (axis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
175 axis.configure(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
176 axis.setRange(rangeAxisRange); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
177 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
181 public PolygonDataset getDataset(){ |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
182 return this.dataset; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
183 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
184 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
185 public String getPlotType() { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
186 return PLOT_TYPE; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
188 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 public void setDataset(PolygonDataset dataset) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 this.dataset = dataset; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
194 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
195 * This is the major method to draw the into a given Graphic2D object. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
196 * |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
197 * @param g2 Graphics object where the plot is drawn into. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
198 * @param area The bounds for drawing this plot. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
199 * @param anchor An anchor point. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
200 * @param parentState The plot state. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
201 * @param info |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
202 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
203 public void draw( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
204 Graphics2D g2, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
205 Rectangle2D area, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
206 Point2D anchor, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
207 PlotState parentState, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
208 PlotRenderingInfo info |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
209 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
210 Graphics2D savedG2 = g2; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
211 Rectangle2D savedDataArea = area; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
212 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
213 if (info != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
214 info.setPlotArea(area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
215 info.setDataArea(area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
216 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
217 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
218 AxisSpace space = calculateAxisSpace(g2, area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
219 Rectangle2D dataArea = space.shrink(area, null); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
220 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
221 // draw background and outline |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
222 drawBackground(g2, area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
223 drawOutline(g2, area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
224 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
225 Shape savedClip = g2.getClip(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
226 g2.clip(area); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
227 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
228 Composite originalComposite = g2.getComposite(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
229 g2.setComposite(AlphaComposite.getInstance( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
230 AlphaComposite.SRC_OVER, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
231 getForegroundAlpha() |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
232 )); |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
451
diff
changeset
|
233 |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
234 // draw axis |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
235 drawAxes(g2, area, dataArea, info); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
236 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
237 if (!isEmptyOrNull(dataset)) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
238 // draw data |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
239 drawPolygons(savedG2, dataArea, info); |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
240 drawLabels(savedG2, dataArea, info); |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
241 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
242 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
243 g2.setClip(savedClip); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
244 g2.setComposite(originalComposite); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
245 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
246 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
247 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
248 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
249 * Method to draw the axis for this plot. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
795
diff
changeset
|
250 * |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
251 * @param g2 |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
252 * @param plotArea |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
253 * @param dataArea |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
254 * @param plotState |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
255 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
256 private void drawAxes( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
257 Graphics2D g2, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
258 Rectangle2D plotArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
259 Rectangle2D dataArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
260 PlotRenderingInfo plotState |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
261 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
262 AxisCollection axisCollection = new AxisCollection(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
263 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
264 for (int i = 0; i < domainAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
265 ValueAxis axis = (ValueAxis) domainAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
266 if (axis != null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
267 axisCollection.add(axis, getDomainAxisEdge(i)); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
268 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
269 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
270 for (int i = 0; i < rangeAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
271 ValueAxis axis = (ValueAxis) rangeAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
272 if (axis != null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
273 axisCollection.add(axis, getRangeAxisEdge(i)); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
274 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
275 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
276 Map axisStateMap = new HashMap(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
277 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
278 // draw the top axes |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
279 double cursor = dataArea.getMinY() - this.axisOffset.calculateTopOutset( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
280 dataArea.getHeight()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
281 Iterator iterator = axisCollection.getAxesAtTop().iterator(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
282 while (iterator.hasNext()) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
283 ValueAxis axis = (ValueAxis) iterator.next(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
284 AxisState info = axis.draw(g2, cursor, plotArea, dataArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
285 RectangleEdge.TOP, plotState); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
286 cursor = info.getCursor(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
287 axisStateMap.put(axis, info); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
288 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
289 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
290 // draw the bottom axes |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
291 cursor = dataArea.getMaxY() |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
292 + this.axisOffset.calculateBottomOutset(dataArea.getHeight()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
293 iterator = axisCollection.getAxesAtBottom().iterator(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
294 while (iterator.hasNext()) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
295 ValueAxis axis = (ValueAxis) iterator.next(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
296 AxisState info = axis.draw(g2, cursor, plotArea, dataArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
297 RectangleEdge.BOTTOM, plotState); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
298 cursor = info.getCursor(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
299 axisStateMap.put(axis, info); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
300 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
301 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
302 // draw the left axes |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
303 cursor = dataArea.getMinX() |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
304 - this.axisOffset.calculateLeftOutset(dataArea.getWidth()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
305 iterator = axisCollection.getAxesAtLeft().iterator(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
306 while (iterator.hasNext()) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
307 ValueAxis axis = (ValueAxis) iterator.next(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
308 AxisState info = axis.draw(g2, cursor, plotArea, dataArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
309 RectangleEdge.LEFT, plotState); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
310 cursor = info.getCursor(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
311 axisStateMap.put(axis, info); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
312 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
313 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
314 // draw the right axes |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
315 cursor = dataArea.getMaxX() |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
316 + this.axisOffset.calculateRightOutset(dataArea.getWidth()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
317 iterator = axisCollection.getAxesAtRight().iterator(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
318 while (iterator.hasNext()) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
319 ValueAxis axis = (ValueAxis) iterator.next(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
320 AxisState info = axis.draw(g2, cursor, plotArea, dataArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
321 RectangleEdge.RIGHT, plotState); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
322 cursor = info.getCursor(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
323 axisStateMap.put(axis, info); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
324 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
325 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
326 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
327 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
328 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
329 * Put some labels at data items into the plot. Uses PolygonRenderer to do |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
330 * this job. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
331 * |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
332 * @param g2 |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
333 * @param area |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
334 * @param info |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
335 */ |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
336 private void drawLabels( |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
337 Graphics2D g2, |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
338 Rectangle2D area, |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
339 PlotRenderingInfo info |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
340 ) { |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
341 renderer.drawLabels(g2, this, area, dataset); |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
342 } |
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
343 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
344 |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
345 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
346 * Plot the polygons. Uses PolygonRenderer to do this job. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
795
diff
changeset
|
347 * |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
348 * @param g2 |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
349 * @param area |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
350 * @param info |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
351 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
352 private void drawPolygons( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
353 Graphics2D g2, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
354 Rectangle2D area, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
355 PlotRenderingInfo info |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
356 ) { |
451
bc5901bb4525
Use JFreeCharts ValueAxis.valueToJava2D() to transform data values
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
450
diff
changeset
|
357 renderer.drawPolygons(g2, this, area, dataset); |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
358 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
359 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
360 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
361 private AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
362 AxisSpace space = new AxisSpace(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
363 space = calculateRangeAxisSpace(g2, plotArea, space); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
364 Rectangle2D tmpPlotArea = space.shrink(plotArea, null); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
365 space = calculateDomainAxisSpace(g2, plotArea, space); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
366 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
367 return space; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
368 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
369 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
370 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
371 private AxisSpace calculateDomainAxisSpace( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
372 Graphics2D g2, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
373 Rectangle2D plotArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
374 AxisSpace space |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
375 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
376 if (space == null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
377 space = new AxisSpace(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
378 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
379 for (int i = 0; i < domainAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
380 Axis axis = (Axis) domainAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
381 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
382 if (axis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
383 RectangleEdge edge = getDomainAxisEdge(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
384 space = axis.reserveSpace(g2, this, plotArea, edge, space); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
385 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
386 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
387 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
388 return space; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
389 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
390 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
391 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
392 private AxisSpace calculateRangeAxisSpace( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
393 Graphics2D g2, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
394 Rectangle2D plotArea, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
395 AxisSpace space |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
396 ) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
397 if (space == null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
398 space = new AxisSpace(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
399 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
400 for (int i = 0; i < rangeAxes.size(); i++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
401 Axis axis = (Axis) rangeAxes.get(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
402 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
403 if (axis != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
404 RectangleEdge edge = getRangeAxisEdge(i); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
405 space = axis.reserveSpace(g2, this, plotArea, edge, space); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
406 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
407 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
408 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
409 return space; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
410 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
411 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
412 |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
413 public RectangleEdge getDomainAxisEdge() { |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
414 return Plot.resolveDomainAxisLocation( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
415 getDomainAxisLocation(), orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
416 ); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
417 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
418 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
419 |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
420 public RectangleEdge getDomainAxisEdge(int idx) { |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
421 AxisLocation location = getDomainAxisLocation(idx); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
422 RectangleEdge result = Plot.resolveDomainAxisLocation( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
423 location, orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
424 ); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
425 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
426 if (result == null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
427 result = RectangleEdge.opposite(getDomainAxisEdge()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
428 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
429 return result; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
430 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
431 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
432 |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
433 public RectangleEdge getRangeAxisEdge() { |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
434 return Plot.resolveRangeAxisLocation( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
435 getRangeAxisLocation(), orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
436 ); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
437 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
438 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
439 |
450
20a480753ff9
Render labels in vertical cross section charts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
446
diff
changeset
|
440 public RectangleEdge getRangeAxisEdge(int idx) { |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
441 AxisLocation location = getRangeAxisLocation(idx); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
442 RectangleEdge result = Plot.resolveRangeAxisLocation( |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
443 location, |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
444 orientation |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
445 ); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
446 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
447 if (result == null) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
448 result = RectangleEdge.opposite(getRangeAxisEdge()); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
449 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
450 return result; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
451 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
452 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
453 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
454 public AxisLocation getDomainAxisLocation() { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
455 return (AxisLocation) domainAxisLocation.get(0); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
456 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
457 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
458 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
459 public AxisLocation getDomainAxisLocation(int idx) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
460 if (idx < domainAxisLocation.size()) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
461 return (AxisLocation) domainAxisLocation.get(idx); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
462 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
463 return null; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
464 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
465 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
466 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
467 public AxisLocation getRangeAxisLocation() { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
468 return (AxisLocation) rangeAxisLocation.get(0); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
469 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
470 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
471 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
472 public AxisLocation getRangeAxisLocation(int idx) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
473 if (idx < rangeAxisLocation.size()) |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
474 return (AxisLocation) rangeAxisLocation.get(idx); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
475 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
476 return null; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
477 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
478 |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
479 |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
480 /** |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
481 * @return true, if dataset is null or if it does not contain any |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
482 * PolygonSeries, otherwise false. |
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
483 */ |
422
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
484 private boolean isEmptyOrNull(PolygonDataset dataset) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
485 if (dataset != null) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
486 int seriesCount = dataset.getSeriesCount(); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
487 for (int s = 0; s < seriesCount; s++) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
488 PolygonSeries series = dataset.getSeries(s); |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
489 if (series.getItemCount() > 0) { |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
490 return false; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
491 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
492 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
493 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
494 return true; |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
495 } |
f426f55d4f7a
Added Ingo Weinzierl's special JFreeChart classes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
496 } |
795
cdade5005cba
Added javadoc in jfreechart package.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
780
diff
changeset
|
497 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |