Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 414:0385bcc4229a
Added subtitles to the available charts.
flys-artifacts/trunk@1878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 10 May 2011 12:19:17 +0000 |
parents | fc3ac59c3c8b |
children | a0afdda4d4b9 |
comparison
equal
deleted
inserted
replaced
413:8a4c219fd0ee | 414:0385bcc4229a |
---|---|
3 import org.apache.log4j.Logger; | 3 import org.apache.log4j.Logger; |
4 | 4 |
5 import org.jfree.chart.JFreeChart; | 5 import org.jfree.chart.JFreeChart; |
6 import org.jfree.chart.axis.NumberAxis; | 6 import org.jfree.chart.axis.NumberAxis; |
7 import org.jfree.chart.plot.XYPlot; | 7 import org.jfree.chart.plot.XYPlot; |
8 import org.jfree.chart.title.TextTitle; | |
8 import org.jfree.data.xy.XYSeries; | 9 import org.jfree.data.xy.XYSeries; |
9 import org.jfree.data.xy.XYSeriesCollection; | 10 import org.jfree.data.xy.XYSeriesCollection; |
10 | 11 |
11 import org.w3c.dom.Document; | 12 import org.w3c.dom.Document; |
12 | 13 |
35 "longitudinal_section.q"; | 36 "longitudinal_section.q"; |
36 | 37 |
37 public static final String I18N_CHART_TITLE = | 38 public static final String I18N_CHART_TITLE = |
38 "chart.longitudinal.section.title"; | 39 "chart.longitudinal.section.title"; |
39 | 40 |
41 public static final String I18N_CHART_SUBTITLE = | |
42 "chart.longitudinal.section.subtitle"; | |
43 | |
40 public static final String I18N_XAXIS_LABEL = | 44 public static final String I18N_XAXIS_LABEL = |
41 "chart.longitudinal.section.xaxis.label"; | 45 "chart.longitudinal.section.xaxis.label"; |
42 | 46 |
43 public static final String I18N_YAXIS_LABEL = | 47 public static final String I18N_YAXIS_LABEL = |
44 "chart.longitudinal.section.yaxis.label"; | 48 "chart.longitudinal.section.yaxis.label"; |
66 } | 70 } |
67 | 71 |
68 | 72 |
69 protected String getChartTitle() { | 73 protected String getChartTitle() { |
70 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); | 74 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
75 } | |
76 | |
77 | |
78 @Override | |
79 protected void addSubtitles(JFreeChart chart) { | |
80 double[] dist = getRange(); | |
81 | |
82 Object[] args = new Object[] { | |
83 getRiverName(), | |
84 dist[0], | |
85 dist[1] | |
86 }; | |
87 | |
88 String subtitle = msg(I18N_CHART_SUBTITLE, "", args); | |
89 chart.addSubtitle(new TextTitle(subtitle)); | |
71 } | 90 } |
72 | 91 |
73 | 92 |
74 protected String getXAxisLabel() { | 93 protected String getXAxisLabel() { |
75 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); | 94 return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); |