Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java @ 335:e964a3d8f7bc
Some Refactoring work done.
Moved Transition to State
gnv-artifacts/trunk@401 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 08 Dec 2009 08:39:03 +0000 |
parents | |
children | 2e43542e6a11 |
comparison
equal
deleted
inserted
replaced
334:e37930705daa | 335:e964a3d8f7bc |
---|---|
1 /** | |
2 * | |
3 */ | |
4 package de.intevation.gnv.state.profile.vertical; | |
5 | |
6 import java.util.Collection; | |
7 import java.util.Locale; | |
8 | |
9 import org.apache.log4j.Logger; | |
10 | |
11 import de.intevation.gnv.chart.Chart; | |
12 import de.intevation.gnv.chart.ChartLabels; | |
13 import de.intevation.gnv.chart.VerticalProfileChart; | |
14 import de.intevation.gnv.state.timeseries.TimeSeriesOutputState; | |
15 import de.intevation.gnv.statistics.Statistics; | |
16 import de.intevation.gnv.statistics.VerticalProfileStatistics; | |
17 | |
18 /** | |
19 * @author Tim Englich <tim.englich@intevation.de> | |
20 * | |
21 */ | |
22 public class VerticalProfileOutputState extends TimeSeriesOutputState { | |
23 /** | |
24 * The UID of this class | |
25 */ | |
26 private static final long serialVersionUID = 4401516087492028840L; | |
27 | |
28 private static Logger log = Logger | |
29 .getLogger(TimeSeriesOutputState.class); | |
30 | |
31 /** | |
32 * Constructor | |
33 */ | |
34 public VerticalProfileOutputState() { | |
35 super(); | |
36 super.domainLable = "Depth [m]"; | |
37 } | |
38 | |
39 | |
40 @Override | |
41 protected Chart getChart( | |
42 ChartLabels chartLables, | |
43 Collection parameters, | |
44 Collection measurements, | |
45 Collection dates, | |
46 Collection result, | |
47 Locale locale, | |
48 String uuid, | |
49 boolean linesVisible, | |
50 boolean shapesVisible | |
51 ) { | |
52 Chart chart = null; | |
53 | |
54 if (CACHE_CHART) { | |
55 log.info("Try to get verticalprofile chart from cache."); | |
56 chart = (Chart) getChartFromCache(uuid); | |
57 } | |
58 | |
59 if (chart != null) | |
60 return chart; | |
61 | |
62 log.info("Chart not in cache yet."); | |
63 chart = new VerticalProfileChart( | |
64 chartLables, | |
65 this.createStyle(), | |
66 parameters, | |
67 measurements, | |
68 dates, | |
69 result, | |
70 null, | |
71 locale, | |
72 linesVisible, | |
73 shapesVisible | |
74 ); | |
75 chart.generateChart(); | |
76 | |
77 if (CACHE_CHART) { | |
78 log.info("Put chart into cache."); | |
79 purifyChart(chart, uuid); | |
80 } | |
81 | |
82 return chart; | |
83 } | |
84 | |
85 | |
86 protected String createChartSubtitle(Locale locale, String uuid) { | |
87 return getSelectedFeatureName(uuid); | |
88 } | |
89 | |
90 | |
91 | |
92 /** | |
93 * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#getStatisticsGenerator() | |
94 */ | |
95 @Override | |
96 protected Statistics getStatisticsGenerator() { | |
97 return new VerticalProfileStatistics(); | |
98 } | |
99 | |
100 } |