Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/ReferenceCurveGenerator.java @ 3409:97ad960f5579
Add subtitle to Fix W/Q chart and refactor addSubtitle() method(s)
flys-artifacts/trunk@5062 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 19 Jul 2012 12:59:56 +0000 |
parents | 5642a83420f2 |
children | 572384206fe0 |
comparison
equal
deleted
inserted
replaced
3408:50d61a2494cb | 3409:97ad960f5579 |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.awt.geom.Point2D; | |
4 | |
5 import org.w3c.dom.Document; | |
6 | |
7 import org.apache.log4j.Logger; | |
8 | |
9 import org.jfree.chart.JFreeChart; | |
10 | |
11 import org.jfree.chart.title.TextTitle; | |
12 | |
13 import org.jfree.data.xy.XYSeries; | |
14 | |
15 import org.jfree.chart.axis.ValueAxis; | |
16 import org.jfree.chart.axis.NumberAxis; | |
17 import org.jfree.chart.axis.NumberTickUnit; | |
18 import org.jfree.chart.axis.TickUnits; | |
19 | |
20 import de.intevation.artifactdatabase.state.ArtifactAndFacet; | 3 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
21 | |
22 import de.intevation.flys.artifacts.model.FacetTypes; | 4 import de.intevation.flys.artifacts.model.FacetTypes; |
23 import de.intevation.flys.artifacts.model.WW; | 5 import de.intevation.flys.artifacts.model.WW; |
24 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator; | 6 import de.intevation.flys.artifacts.model.WW.ApplyFunctionIterator; |
25 import de.intevation.flys.artifacts.model.WWAxisTypes; | 7 import de.intevation.flys.artifacts.model.WWAxisTypes; |
26 | 8 import de.intevation.flys.jfree.FLYSAnnotation; |
27 import de.intevation.flys.jfree.StyledXYSeries; | 9 import de.intevation.flys.jfree.StyledXYSeries; |
28 import de.intevation.flys.jfree.FLYSAnnotation; | |
29 | |
30 import de.intevation.flys.utils.Formatter; | 10 import de.intevation.flys.utils.Formatter; |
11 | |
12 import java.awt.geom.Point2D; | |
13 | |
14 import org.apache.log4j.Logger; | |
15 import org.jfree.chart.axis.NumberAxis; | |
16 import org.jfree.chart.axis.NumberTickUnit; | |
17 import org.jfree.chart.axis.TickUnits; | |
18 import org.jfree.chart.axis.ValueAxis; | |
19 import org.jfree.data.xy.XYSeries; | |
20 import org.w3c.dom.Document; | |
31 | 21 |
32 /** | 22 /** |
33 * An OutGenerator that generates reference curves. | 23 * An OutGenerator that generates reference curves. |
34 */ | 24 */ |
35 public class ReferenceCurveGenerator | 25 public class ReferenceCurveGenerator |
100 | 90 |
101 return msg(I18N_CHART_SUBTITLE, "", args); | 91 return msg(I18N_CHART_SUBTITLE, "", args); |
102 } | 92 } |
103 | 93 |
104 | 94 |
105 @Override | |
106 protected void addSubtitles(JFreeChart chart) { | |
107 String subtitle = getChartSubtitle(); | |
108 | |
109 if (subtitle != null && subtitle.length() > 0) { | |
110 chart.addSubtitle(new TextTitle(subtitle)); | |
111 } | |
112 } | |
113 | |
114 protected boolean getInCm(int index) { | 95 protected boolean getInCm(int index) { |
115 Object obj = context.getContextValue("reference.curve.axis.scale"); | 96 Object obj = context.getContextValue("reference.curve.axis.scale"); |
116 return obj instanceof WWAxisTypes && ((WWAxisTypes)obj).getInCm(index); | 97 return obj instanceof WWAxisTypes && ((WWAxisTypes)obj).getInCm(index); |
117 } | 98 } |
118 | 99 |