Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FixingsOverview.java @ 5805:11bcace6f2fe
Doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 24 Apr 2013 11:32:04 +0200 |
parents | 948d07aa988a |
children |
rev | line source |
---|---|
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
4 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
5 import java.text.SimpleDateFormat; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import java.util.ArrayList; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 import java.util.Collections; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 import java.util.Comparator; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 import java.util.Date; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
12 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import org.apache.log4j.Logger; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 import org.hibernate.SQLQuery; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import org.hibernate.Session; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 import org.hibernate.type.StandardBasicTypes; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 import org.w3c.dom.Document; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.Element; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 |
5343
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
23 |
61f4d4164a30
Doc, cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5335
diff
changeset
|
24 /** Generate Fixings Table chart. */ |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 public class FixingsOverview |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 implements Serializable |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 private static Logger log = Logger.getLogger(FixingsOverview.class); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 |
3430
278b5508567e
FixA: fixed aggregation bug in calculation of range spreads.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3421
diff
changeset
|
30 public static final double EPSILON = 1e-2; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
2632
7d163c2c6e6d
Improve XSL transformation for fixings overview output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2613
diff
changeset
|
32 public static final String DATE_FORMAT = "dd.MM.yyyy"; |
2564
3f038d54bc87
FixingsOverviewService: Made the filter mechanisms available via the incoming XML document.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
33 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 public static final String SQL_RIVER_ID = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 " id AS river_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 " km_up " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 "FROM rivers " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 " name = :name"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 |
5725 | 42 /** All kind-2 wsts from given river. */ |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 public static final String SQL_FIXINGS = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 " id AS wst_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 " description " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 "FROM wsts " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 " river_id = :river_id AND kind = 2"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 |
5725 | 51 /** All columns from given wst. */ |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 public static final String SQL_FIXING_COLUMNS = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 " wc.id AS wst_column_id," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 " ti.start_time AS start_time," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 " wc.name AS name " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 "FROM wst_columns wc" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 " JOIN time_intervals ti ON wc.time_interval_id = ti.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 " wc.wst_id = :wst_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 "ORDER BY position"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 public static final String SQL_FIXING_COLUMN_Q_RANGES = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 " wqr.q AS q," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 " r.a AS start_km," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 " r.b AS stop_km " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 "FROM wst_column_q_ranges wcqr" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 " JOIN wst_q_ranges wqr ON wcqr.wst_q_range_id = wqr.id" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 " JOIN ranges r ON wqr.range_id = r.id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 "WHERE" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 " wcqr.wst_column_id = :column_id " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 "ORDER BY r.a"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 public static final String SQL_FIXING_COLUMN_KM_RANGE = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 "SELECT" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 " MIN(position) AS start_km," + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 " MAX(position) AS stop_km " + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 "FROM" + |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 " wst_column_values " + |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
81 "WHERE" + |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 " wst_column_id = :column_id"; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 public static class QRange extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 protected double q; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 public QRange() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 public QRange(double start, double end, double q) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 super(start, end); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 this.q = q; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 } // class QRange |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 public static class SectorRange extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 protected int sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 public SectorRange() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
103 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
104 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
105 public SectorRange(SectorRange other) { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
106 start = other.start; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
107 end = other.end; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
108 sector = other.sector; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
109 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
110 |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
111 public SectorRange(Range range) { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
112 super(range); |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
113 } |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
114 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 public SectorRange(double start, double end, int sector) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
116 super(start, end); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
117 this.sector = sector; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
120 public int getSector() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
121 return sector; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
122 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
123 |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
124 public void setSector(int sector) { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
125 this.sector = sector; |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
126 } |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
127 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 public boolean enlarge(SectorRange other) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 if (sector == other.sector |
3430
278b5508567e
FixA: fixed aggregation bug in calculation of range spreads.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3421
diff
changeset
|
130 && Math.abs(end-other.start) < FixingsOverview.EPSILON) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 end = other.end; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 } // class SectorRange |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
138 public static class Fixing implements Serializable { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
139 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
140 public static final Comparator<Column> DATE_CMP = |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 new Comparator<Column>() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 @Override |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 public int compare(Column a, Column b) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 return a.startTime.compareTo(b.startTime); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 }; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
148 public interface Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
149 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
150 boolean accept(Column column); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
151 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
152 } // interface Filter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
153 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 public class Column extends Range { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
155 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 protected int columnId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
157 protected Date startTime; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
158 protected String name; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
159 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
160 protected List<SectorRange> sectors; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
161 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
162 public Column() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
163 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
164 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
165 public Column(int columnId, Date startTime, String name) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 this.columnId = columnId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
167 this.startTime = startTime; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
168 this.name = name; |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3008
diff
changeset
|
169 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
170 sectors = new ArrayList<SectorRange>(); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
171 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
172 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
173 public int getId() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
174 return columnId; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
175 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
176 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
177 public Fixing getFixing() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 return Fixing.this; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
181 public Date getStartTime() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
182 return startTime; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
183 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
184 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
185 public String getName() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
186 return name; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
187 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
188 |
2707
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
189 public String getDescription() { |
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
190 return Fixing.this.description + "/" + name; |
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
191 } |
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
192 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
193 public List<SectorRange> getSectors() { |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
194 return sectors; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
195 } |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 |
5804
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
197 public boolean hasSectorsInRange(Range range) { |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
198 for (SectorRange sector: sectors) { |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
199 if (sector.intersects(range)) { |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
200 return true; |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
201 } |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
202 } |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
203 return false; |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
204 } |
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
205 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
206 public List<SectorRange> getSectors(Range range) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
207 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
208 List<SectorRange> result = |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
209 new ArrayList<SectorRange>(sectors.size()); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
210 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
211 for (SectorRange src: sectors) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
212 SectorRange dst = new SectorRange(src); |
2613
2e129754d450
Fixed NPE bug in filter builder for fixings overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2608
diff
changeset
|
213 if (range == null || dst.clip(range)) { |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
214 result.add(dst); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
215 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
216 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
217 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
218 return result; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
219 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
220 |
3002
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
221 public int findQSector(double km) { |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
222 for (SectorRange sector: sectors) { |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
223 if (sector.inside(km)) { |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
224 return sector.getSector(); |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
225 } |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
226 } |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
227 return -1; |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
228 } |
e54dd69d306f
FixA: Added method to classify fixing events for certain kms.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2744
diff
changeset
|
229 |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
230 public void buildSectors( |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
231 GaugeFinder gaugeFinder, |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
232 List<QRange> qRanges |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
233 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
234 for (QRange qRange: qRanges) { |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
235 for (GaugeRange gRange: gaugeFinder.getGauges()) { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
236 SectorRange sector = new SectorRange(qRange); |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
237 if (!sector.clip(gRange)) { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
238 continue; |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
239 } |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
240 sector.setSector(gRange.classify(qRange.q)); |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
241 |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
242 if (sectors.isEmpty() |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
243 || !sectors.get(sectors.size()-1).enlarge(sector)) { |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
244 sectors.add(sector); |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
245 } |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
246 } // for all gauges |
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
247 } // for all Q ranges |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
248 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
249 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
250 public void loadKmRange(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
251 query.setInteger("column_id", columnId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
252 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
253 List<Object []> kms = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
254 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
255 if (kms.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
256 log.warn("No km range for column " + columnId + "."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
257 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
258 else { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
259 Object [] obj = kms.get(0); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
260 start = (Double)obj[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
261 end = (Double)obj[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
262 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
263 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
264 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
265 public void loadQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
266 SQLQuery query, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
267 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
268 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
269 query.setInteger("column_id", columnId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
270 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
271 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
272 List<QRange> qRanges = new ArrayList<QRange>(list.size()); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
273 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
274 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
275 double q = (Double)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
276 double start = (Double)row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
277 double end = (Double)row[2]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
278 QRange qRange = new QRange(start, end, q); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
279 if (qRange.clip(this)) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
280 qRanges.add(qRange); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
281 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
282 } |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
283 |
3401
086326be721c
FixA: Overview: classify Q ranges by intersecting gauges.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3143
diff
changeset
|
284 buildSectors(gaugeFinder, qRanges); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
285 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
286 } // class Column |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
287 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
288 protected int wstId; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
289 protected String description; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
290 protected List<Column> columns; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
291 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
292 public Fixing() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
293 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
294 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
295 public int getId() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
296 return wstId; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
297 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
298 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
299 public String getDescription() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
300 return description; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
301 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
302 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
303 public Fixing(int wstId, String description) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
304 this.wstId = wstId; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
305 this.description = description; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
306 columns = new ArrayList<Column>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
307 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
308 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
309 public void loadColumns(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
310 query.setInteger("wst_id", wstId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
311 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
312 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
313 int columnId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
314 Date startTime = (Date) row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
315 String name = (String) row[2]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
316 columns.add(new Column(columnId, startTime, name)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
317 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
318 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
319 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
320 public void loadColumnsKmRange(SQLQuery query) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
321 for (Column column: columns) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
322 column.loadKmRange(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
323 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
324 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
325 |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
326 public void adjustExtent(Range extent) { |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
327 for (Column column: columns) { |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
328 extent.extend(column); |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
329 } |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
330 } |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
331 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
332 public void loadColumnsQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
333 SQLQuery query, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
334 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
335 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
336 for (Column column: columns) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
337 column.loadQRanges(query, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
338 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
339 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
340 |
5725 | 341 /** |
342 * @param allColumns[out] Columns will be put here. | |
343 * @param range can be null. | |
344 * @param filter filter to apply. | |
345 */ | |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
346 public void addAllColumns( |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
347 List<Column> allColumns, |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
348 Range range, |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
349 Filter filter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
350 ) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
351 for (Column column: columns) { |
5804
948d07aa988a
FixA: Fixes flys/issue1138 (Ausgel. WSPL: Streckenintelligenz bei Generierung Balkendiagramm)
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5725
diff
changeset
|
352 if ((range == null || column.hasSectorsInRange(range)) |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3008
diff
changeset
|
353 && (filter == null || filter.accept(column))) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
354 allColumns.add(column); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
355 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
356 } |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
357 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
358 } // class Fixing |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
359 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
360 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
361 protected String riverName; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
362 protected int riverId; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
363 protected boolean isKmUp; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
364 protected List<Fixing> fixings; |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
365 protected Range extent; |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
366 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
367 public FixingsOverview() { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
368 fixings = new ArrayList<Fixing>(); |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
369 extent = new Range(Double.MAX_VALUE, -Double.MAX_VALUE); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
370 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
371 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
372 public FixingsOverview(String riverName) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
373 this(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
374 this.riverName = riverName; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
375 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
376 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
377 protected boolean loadRiver(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
378 SQLQuery query = session.createSQLQuery(SQL_RIVER_ID) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
379 .addScalar("river_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
380 .addScalar("km_up", StandardBasicTypes.BOOLEAN); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
381 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
382 query.setString("name", riverName); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
383 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
384 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
385 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
386 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
387 log.warn("No river '" + riverName + "' found."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
388 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
389 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
390 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
391 Object [] row = list.get(0); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
392 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
393 riverId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
394 isKmUp = (Boolean)row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
395 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
396 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
397 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
398 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
399 protected void loadFixings(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
400 SQLQuery query = session.createSQLQuery(SQL_FIXINGS) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
401 .addScalar("wst_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
402 .addScalar("description", StandardBasicTypes.STRING); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
403 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
404 query.setInteger("river_id", riverId); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
405 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
406 List<Object []> list = query.list(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
407 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
408 if (list.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
409 log.warn("River " + riverId + " has no fixings."); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
410 // Its pretty fine to have no fixings. |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
411 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
412 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
413 for (Object [] row: list) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
414 int wstId = (Integer)row[0]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
415 String description = (String) row[1]; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
416 Fixing fixing = new Fixing(wstId, description); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
417 fixings.add(fixing); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
418 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
419 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
420 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
421 protected void loadFixingsColumns(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
422 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMNS) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
423 .addScalar("wst_column_id", StandardBasicTypes.INTEGER) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
424 .addScalar("start_time", StandardBasicTypes.DATE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
425 .addScalar("name", StandardBasicTypes.STRING); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
426 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
427 for (Fixing fixing: fixings) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
428 fixing.loadColumns(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
429 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
430 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
431 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
432 protected void loadFixingsColumnsKmRange(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
433 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMN_KM_RANGE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
434 .addScalar("start_km", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
435 .addScalar("stop_km", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
436 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
437 for (Fixing fixing: fixings) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
438 fixing.loadColumnsKmRange(query); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
439 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
440 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
441 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
442 protected void loadFixingsColumnsQRanges( |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
443 Session session, |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
444 GaugeFinder gaugeFinder |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
445 ) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
446 SQLQuery query = session.createSQLQuery(SQL_FIXING_COLUMN_Q_RANGES) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
447 .addScalar("q", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
448 .addScalar("start_km", StandardBasicTypes.DOUBLE) |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
449 .addScalar("stop_km", StandardBasicTypes.DOUBLE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
450 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
451 for (Fixing fixing: fixings) { |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
452 fixing.loadColumnsQRanges(query, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
453 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
454 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
455 |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
456 protected void adjustExtent() { |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
457 for (Fixing fixing: fixings) { |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
458 fixing.adjustExtent(extent); |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
459 } |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
460 } |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
461 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
462 public boolean load(Session session) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
463 |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
464 if (!loadRiver(session)) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
465 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
466 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
467 |
3143
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
468 GaugeFinderFactory gff = GaugeFinderFactory.getInstance(); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
469 |
3143
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
470 GaugeFinder gaugeFinder = gff.getGaugeFinder(riverId, isKmUp); |
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
471 |
29022c93027d
FixA: Create a cached GaugeFinderFactory to access the gauge along a river
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3142
diff
changeset
|
472 if (gaugeFinder == null) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
473 return false; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
474 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
475 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
476 loadFixings(session); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
477 loadFixingsColumns(session); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
478 loadFixingsColumnsKmRange(session); |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
479 |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
480 adjustExtent(); |
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
481 |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
482 loadFixingsColumnsQRanges(session, gaugeFinder); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
483 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
484 return true; |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
485 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
486 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
487 public static final Range FULL_EXTENT = |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
488 new Range(-Double.MAX_VALUE, Double.MAX_VALUE); |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
489 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
490 public static final Fixing.Filter ACCEPT = new Fixing.Filter() { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
491 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
492 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
493 return true; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
494 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
495 }; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
496 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
497 public static class NotFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
498 protected Fixing.Filter child; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
499 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
500 public NotFilter(Fixing.Filter child) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
501 this.child = child; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
502 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
503 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
504 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
505 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
506 return !child.accept(column); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
507 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
508 } // class NotFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
509 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
510 public static abstract class ComponentFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
511 protected List<Fixing.Filter> children; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
512 |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
513 public ComponentFilter() { |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
514 children = new ArrayList<Fixing.Filter>(); |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
515 } |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
516 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
517 public ComponentFilter(List<Fixing.Filter> children) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
518 this.children = children; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
519 } |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
520 |
3121
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
521 public ComponentFilter add(Fixing.Filter filter) { |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
522 children.add(filter); |
3121
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
523 return this; |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
524 } |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
525 } // class ComponentFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
526 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
527 public static class OrFilter extends ComponentFilter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
528 |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
529 public OrFilter() { |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
530 } |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
531 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
532 public OrFilter(List<Fixing.Filter> children) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
533 super(children); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
534 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
535 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
536 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
537 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
538 for (Fixing.Filter child: children) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
539 if (child.accept(column)) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
540 return true; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
541 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
542 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
543 return false; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
544 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
545 } // class OrFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
546 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
547 public static class AndFilter extends ComponentFilter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
548 |
2744
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
549 public AndFilter() { |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
550 } |
c1f2e792704a
FixA: Calculate Delta W/t, too.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2707
diff
changeset
|
551 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
552 public AndFilter(List<Fixing.Filter> children) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
553 super(children); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
554 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
555 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
556 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
557 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
558 for (Fixing.Filter child: children) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
559 if (!child.accept(column)) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
560 return false; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
561 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
562 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
563 return true; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
564 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
565 } // class AndFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
566 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
567 public static class IdFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
568 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
569 protected int columnId; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
570 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
571 public IdFilter(int columnId) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
572 this.columnId = columnId; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
573 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
574 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
575 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
576 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
577 return column.getId() == columnId; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
578 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
579 } // class IdFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
580 |
5725 | 581 /** Accept Fixing columns whose id is in id list. */ |
3121
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
582 public static class IdsFilter implements Fixing.Filter { |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
583 |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
584 protected int [] columnIds; |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
585 |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
586 public IdsFilter(int [] columnIds) { |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
587 this.columnIds = columnIds; |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
588 } |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
589 |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
590 @Override |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
591 public boolean accept(Fixing.Column column) { |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
592 int cid = column.getId(); |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
593 for (int i = columnIds.length-1; i >= 0; --i) { |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
594 if (columnIds[i] == cid) { |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
595 return true; |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
596 } |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
597 } |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
598 return false; |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
599 } |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
600 } // class IdFilter |
0b86b005bb9a
FixA: Respect the selected events and reference period correctly.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3076
diff
changeset
|
601 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
602 public static class DateFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
603 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
604 protected Date date; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
605 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
606 public DateFilter(Date date) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
607 this.date = date; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
608 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
609 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
610 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
611 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
612 return date.equals(column.getStartTime()); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
613 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
614 } // class DateFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
615 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
616 public static class DateRangeFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
617 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
618 protected Date start; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
619 protected Date end; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
620 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
621 public DateRangeFilter(Date start, Date end) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
622 this.start = start; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
623 this.end = end; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
624 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
625 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
626 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
627 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
628 Date date = column.getStartTime(); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
629 return start.compareTo(date) <= 0 && end.compareTo(date) >= 0; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
630 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
631 } // class DateRangeFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
632 |
3008
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
633 public static class SectorFilter implements Fixing.Filter { |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
634 |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
635 protected int sector; |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
636 |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
637 public SectorFilter(int sector) { |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
638 this.sector = sector; |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
639 } |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
640 |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
641 @Override |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
642 public boolean accept(Fixing.Column column) { |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
643 for (SectorRange s: column.getSectors()) { |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
644 if (s.getSector() == sector) { |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
645 return true; |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
646 } |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
647 } |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
648 return false; |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
649 } |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
650 } // class SectorFilter |
9e0500d64524
FixA: Calculate the Delta W/ts + the average Delta W/ts per Q sector per analysis period.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3006
diff
changeset
|
651 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
652 public static class SectorRangeFilter implements Fixing.Filter { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
653 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
654 protected int min; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
655 protected int max; |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
656 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
657 public SectorRangeFilter(int min, int max) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
658 this.min = Math.min(min, max); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
659 this.max = Math.max(min, max); |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
660 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
661 |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
662 @Override |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
663 public boolean accept(Fixing.Column column) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
664 for (SectorRange s: column.getSectors()) { |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
665 int v = s.getSector(); |
5153
658dc517fd7b
workaround for flys/issue1139: filter columns by all sectors.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3430
diff
changeset
|
666 if (v < min || v > max) { |
658dc517fd7b
workaround for flys/issue1139: filter columns by all sectors.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3430
diff
changeset
|
667 return false; |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
668 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
669 } |
5153
658dc517fd7b
workaround for flys/issue1139: filter columns by all sectors.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3430
diff
changeset
|
670 return true; |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
671 } |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
672 } // class SectorRangeFilter |
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
673 |
3006
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
674 public static class KmFilter implements Fixing.Filter { |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
675 |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
676 protected double km; |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
677 |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
678 public KmFilter(double km) { |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
679 this.km = km; |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
680 } |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
681 |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
682 @Override |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
683 public boolean accept(Fixing.Column column) { |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
684 for (SectorRange s: column.getSectors()) { |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
685 if (s.inside(km)) { |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
686 return true; |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
687 } |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
688 } |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
689 return false; |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
690 } |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
691 } // class KmFilter |
1b1af1597401
FixA: Added new km filter
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3002
diff
changeset
|
692 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
693 public void generateOverview(Document document) { |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
694 generateOverview(document, FULL_EXTENT, ACCEPT); |
2562
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
695 } |
ba35dfb7c09a
FixingsOverview: Construct the Q sectors once.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2561
diff
changeset
|
696 |
2608
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
697 public List<Fixing.Column> filter(Range range, Fixing.Filter filter) { |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
698 List<Fixing.Column> allColumns = new ArrayList<Fixing.Column>(); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
699 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
700 for (Fixing fixing: fixings) { |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
701 fixing.addAllColumns(allColumns, range, filter); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
702 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
703 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
704 Collections.sort(allColumns, Fixing.DATE_CMP); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
705 |
2608
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
706 return allColumns; |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
707 } |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
708 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
709 protected static Range realRange(List<Fixing.Column> columns) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
710 Range range = null; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
711 for (Fixing.Column column: columns) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
712 if (range == null) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
713 range = new Range(column); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
714 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
715 else { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
716 range.extend(column); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
717 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
718 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
719 return range; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
720 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
721 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
722 protected Element intersectingGauges(Document document, Range range) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
723 Element gauges = document.createElement("gauges"); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
724 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
725 if (range == null) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
726 return gauges; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
727 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
728 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
729 GaugeFinderFactory gff = GaugeFinderFactory.getInstance(); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
730 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
731 GaugeFinder gf = gff.getGaugeFinder(riverId, isKmUp); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
732 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
733 if (gf == null) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
734 return gauges; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
735 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
736 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
737 for (GaugeRange gr: gf.getGauges()) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
738 if (gr.intersects(range)) { |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
739 Element gauge = document.createElement("gauge"); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
740 gauge.setAttribute("from", String.valueOf(gr.getStart())); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
741 gauge.setAttribute("to", String.valueOf(gr.getEnd())); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
742 gauge.setAttribute("name", gr.getName()); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
743 gauges.appendChild(gauge); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
744 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
745 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
746 |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
747 return gauges; |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
748 } |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
749 |
5335
05eeedc5b156
Doc, cosmetic and TODO fixes, renamed field in WQTimeRange.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5153
diff
changeset
|
750 /** Populate document with fixings, filtered by range and filter. */ |
2608
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
751 public void generateOverview( |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
752 Document document, |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
753 Range range, |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
754 Fixing.Filter filter |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
755 ) { |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
756 List<Fixing.Column> allColumns = filter(range, filter); |
938e2f6c0c9a
Refactored the code of the fixings filter building to be useful in more cases.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2565
diff
changeset
|
757 |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
758 Element fixingsElement = document.createElement("fixings"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
759 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
760 Element riverElement = document.createElement("river"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
761 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
762 riverElement.setAttribute("from", String.valueOf(extent.start)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
763 riverElement.setAttribute("to", String.valueOf(extent.end)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
764 riverElement.setAttribute("rid", String.valueOf(riverId)); |
2565
72f77b2210c2
FixingsOverview: Added XSL transformation which directly converts the output of the fixings overview service into an HTML representation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2564
diff
changeset
|
765 riverElement.setAttribute("name", riverName); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
766 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
767 fixingsElement.appendChild(riverElement); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
768 |
3421
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
769 fixingsElement.appendChild( |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
770 intersectingGauges( |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
771 document, |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
772 realRange(allColumns))); |
c44ff50f4970
FixA: Added a list of gauges to the output of the fixings overview service which intersect the selected fixings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3401
diff
changeset
|
773 |
2564
3f038d54bc87
FixingsOverviewService: Made the filter mechanisms available via the incoming XML document.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2563
diff
changeset
|
774 SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
775 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
776 Element esE = document.createElement("events"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
777 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
778 for (Fixing.Column column: allColumns) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
779 |
2563
59c920e73d8a
FixingsOverview: Added a filter mechanism for generating output.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2562
diff
changeset
|
780 List<SectorRange> sectors = column.getSectors(range); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
781 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
782 if (!sectors.isEmpty()) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
783 Element eE = document.createElement("event"); |
2707
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
784 eE.setAttribute("description", |
d6e32ae72da6
Deliver description on events instead of names in fixing overview.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2632
diff
changeset
|
785 String.valueOf(column.getDescription())); |
2561
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
786 eE.setAttribute("cid", String.valueOf(column.columnId)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
787 eE.setAttribute("date", df.format(column.startTime)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
788 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
789 for (SectorRange sector: sectors) { |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
790 Element sE = document.createElement("sector"); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
791 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
792 sE.setAttribute("from", String.valueOf(sector.start)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
793 sE.setAttribute("to", String.valueOf(sector.end)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
794 sE.setAttribute("class", String.valueOf(sector.sector)); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
795 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
796 eE.appendChild(sE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
797 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
798 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
799 esE.appendChild(eE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
800 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
801 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
802 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
803 fixingsElement.appendChild(esE); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
804 |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
805 document.appendChild(fixingsElement); |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
806 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
807 } |
b3f6d49cdc80
Service to generate the data needed to build the "Fixerungen pro Fluss Uebersicht"
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
808 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |