Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/process/KMIndexProcessor.java @ 4573:b87073a05f9d
flys-client: Patch to render combobox options as clickable links.
The way of passing data arguments to the links and further to
the Artifact feeding service is somewhat hacked and should be
refactored (later...).
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Tue, 27 Nov 2012 12:50:10 +0100 |
parents | 05a54b4d579d |
children | f59fbc9bd04a |
rev | line source |
---|---|
4446
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports.process; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
2 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
3 import org.apache.log4j.Logger; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
4 import org.jfree.data.xy.XYSeries; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
5 import org.jfree.data.xy.XYSeriesCollection; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
6 import org.w3c.dom.Document; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
7 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
8 import de.intevation.artifactdatabase.state.ArtifactAndFacet; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.artifacts.CallContext; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
10 import de.intevation.flys.artifacts.model.FacetTypes; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.flys.artifacts.model.fixings.AnalysisPeriod; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.flys.artifacts.model.fixings.QWD; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.flys.exports.XYChartGenerator; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.flys.jfree.StyledXYSeries; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.flys.utils.KMIndex; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
16 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
17 public class KMIndexProcessor implements Processor { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
18 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
19 private static final Logger logger = Logger.getLogger(KMIndexProcessor.class); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
20 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
21 @Override |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
22 public void doOut(XYChartGenerator generator, ArtifactAndFacet aandf, |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
23 Document theme, boolean visible, int index) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
24 String facettype = aandf.getFacetName(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
25 if (facettype.contains(FacetTypes.FIX_SECTOR_AVERAGE_LS)) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
26 doSectorAverageOut(generator, aandf, theme, visible, index); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
27 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
28 else if (facettype.equals(FacetTypes.FIX_REFERENCE_EVENTS_LS)) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
29 doReferenceEventsOut(generator, aandf, theme, visible, index); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
30 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
31 else if (facettype.equals(FacetTypes.FIX_ANALYSIS_EVENTS_LS)) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
32 doAnalysisEventsOut(generator, aandf, theme, visible, index); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
33 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
34 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
35 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
36 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
37 @Override |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
38 public boolean canHandle(String facettype) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
39 if (facettype == null) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
40 return false; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
41 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
42 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
43 if (facettype.equals(FacetTypes.FIX_SECTOR_AVERAGE_LS) |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
44 || facettype.equals(FacetTypes.FIX_REFERENCE_EVENTS_LS) |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
45 || facettype.equals(FacetTypes.FIX_ANALYSIS_EVENTS_LS)) |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
46 { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
47 return true; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
48 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
49 return false; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
50 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
51 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
52 private void doSectorAverageOut(XYChartGenerator generator, ArtifactAndFacet aaf, |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
53 Document doc, boolean visible, int idx) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
54 logger.debug("doSectorAverageOut" + aaf.getFacet().getIndex()); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
55 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
56 CallContext context = generator.getCallContext(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
57 int index = aaf.getFacet().getIndex(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
58 int sectorNdx = index & 3; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
59 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
60 @SuppressWarnings("unchecked") |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
61 KMIndex<AnalysisPeriod> kms = |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
62 (KMIndex<AnalysisPeriod>)aaf.getData(context); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
63 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
64 if(kms == null) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
65 return; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
66 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
67 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
68 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), doc); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
69 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
70 for (KMIndex.Entry<AnalysisPeriod> entry: kms) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
71 double km = entry.getKm(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
72 AnalysisPeriod ap = entry.getValue(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
73 QWD qwd = ap.getQSectorAverages()[sectorNdx]; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
74 if (qwd == null) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
75 continue; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
76 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
77 double deltaW = qwd.getDeltaW(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
78 series.add(km, deltaW); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
79 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
80 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
81 generator.addAxisSeries(series, idx, visible); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
82 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
83 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
84 private void doReferenceEventsOut(XYChartGenerator generator, |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
85 ArtifactAndFacet aaf, Document doc, boolean visible, int idx) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
86 logger.debug("doReferenceEventOut"); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
87 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
88 CallContext context = generator.getCallContext(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
89 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
90 @SuppressWarnings("unchecked") |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
91 KMIndex<QWD> kms = |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
92 (KMIndex<QWD>)aaf.getData(context); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
93 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
94 if(kms == null) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
95 return; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
96 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
97 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
98 XYSeriesCollection col = new XYSeriesCollection(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
99 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
100 StyledXYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
101 doc); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
102 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
103 for (KMIndex.Entry<QWD> entry: kms) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
104 double km = entry.getKm(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
105 QWD qwd = entry.getValue(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
106 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
107 series.add(km, qwd.getDeltaW()); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
108 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
109 col.addSeries(series); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
110 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
111 generator.addAxisDataset(col, idx, visible); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
112 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
113 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
114 private void doAnalysisEventsOut(XYChartGenerator generator, |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
115 ArtifactAndFacet aaf, Document doc, boolean visible, int idx) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
116 logger.debug("doAnalysisEventsOut"); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
117 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
118 CallContext context = generator.getCallContext(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
119 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
120 @SuppressWarnings("unchecked") |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
121 KMIndex<QWD> kms = |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
122 (KMIndex<QWD>)aaf.getData(context); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
123 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
124 if(kms == null) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
125 return; |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
126 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
127 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
128 XYSeriesCollection col = new XYSeriesCollection(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
129 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
130 StyledXYSeries series = new StyledXYSeries(aaf.getFacetDescription(), false, doc); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
131 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
132 for (KMIndex.Entry<QWD> entry: kms) { |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
133 double km = entry.getKm(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
134 QWD qwd = entry.getValue(); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
135 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
136 series.add(km, qwd.getDeltaW()); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
137 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
138 col.addSeries(series); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
139 |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
140 generator.addAxisDataset(col, idx, visible); |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
141 } |
05a54b4d579d
Remove AbstractFixGenerator and use new KMIndexProcessor instead
Björn Ricks <bjoern.ricks@intevation.de>
parents:
diff
changeset
|
142 } |