annotate artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java @ 8862:5b5bdce5a216

Introduced new number formats for some new data types Also using varargs in msg helper methods
author gernotbelger
date Fri, 19 Jan 2018 18:47:18 +0100
parents 5e38e2924c07
children 322b0e6298ea
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5639
diff changeset
9 package org.dive4elements.river.utils;
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
11 import java.text.DateFormat;
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
12 import java.text.NumberFormat;
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
13 import java.text.SimpleDateFormat;
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
14 import java.text.DecimalFormat;
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
15 import java.util.Locale;
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
16
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5639
diff changeset
17 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5639
diff changeset
18 import org.dive4elements.artifacts.CallMeta;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5639
diff changeset
19 import org.dive4elements.river.artifacts.resources.Resources;
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
20
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
5639
db4e7ff0b987 Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3771
diff changeset
22 /** Helper to access static i18n Formatters. */
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 public final class Formatter {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
25 // KMS IN ERROR REPORTS.
2305
ff558d0332e2 Error report: Format kms in error reports at least with one digit after the decimal separator.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2290
diff changeset
26 public static final int CALCULATION_REPORT_KM_MIN_DIGITS = 1;
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
27 public static final int CALCULATION_REPORT_KM_MAX_DIGITS = 3;
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
28
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 // WATERLEVEL FORMATTER CONSTANTS
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 public static final int WATERLEVEL_KM_MIN_DIGITS = 3;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 public static final int WATERLEVEL_KM_MAX_DIGITS = 3;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 public static final int WATERLEVEL_W_MIN_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 public static final int WATERLEVEL_W_MAX_DIGITS = 2;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 public static final int WATERLEVEL_Q_MIN_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public static final int WATERLEVEL_Q_MAX_DIGITS = 2;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 // COMPUTED DISCHARGE CURVE FORMATTER CONSTANTS
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 public static final int COMPUTED_DISCHARGE_W_MIN_DIGITS = 2;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 public static final int COMPUTED_DISCHARGE_W_MAX_DIGITS = 2;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 public static final int COMPUTED_DISCHARGE_Q_MIN_DIGITS = 0;
1683
acb4d20b130e Changed max number of digits for AT exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 445
diff changeset
42 public static final int COMPUTED_DISCHARGE_Q_MAX_DIGITS = 2;
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
2258
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
45 // HISTORICAL DISCHARGE CURVE FORMATTER CONSTANTS
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
46 public static final int HISTORICAL_DISCHARGE_W_MIN_DIGITS = 0;
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
47 public static final int HISTORICAL_DISCHARGE_W_MAX_DIGITS = 2;
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
48 public static final int HISTORICAL_DISCHARGE_Q_MIN_DIGITS = 0;
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
49 public static final int HISTORICAL_DISCHARGE_Q_MAX_DIGITS = 2;
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
50
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
51
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 // DURATION CURVE FORMATTER CONSTANTS
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 public static final int DURATION_W_MIN_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 public static final int DURATION_W_MAX_DIGITS = 2;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 public static final int DURATION_Q_MIN_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 public static final int DURATION_Q_MAX_DIGITS = 1;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 public static final int DURATION_D_MIN_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 public static final int DURATION_D_MAX_DIGITS = 0;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
61 // FLOW VELOCITY FORMATTER CONSTANTS
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
62 public static final int FLOW_VELOCITY_KM_MIN_DIGITS = 3;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
63 public static final int FLOW_VELOCITY_KM_MAX_DIGITS = 3;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
64 public static final int FLOW_VELOCITY_VALUES_MIN_DIGITS = 2;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
65 public static final int FLOW_VELOCITY_VALUES_MAX_DIGITS = 2;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
66 public static final int FLOW_VELOCITY_Q_MIN_DIGITS = 0;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
67 public static final int FLOW_VELOCITY_Q_MAX_DIGITS = 2;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
68
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
69
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
70 // MIDDLE BED HEIGHT FORMATTER CONSTANTS
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
71 public static final int MIDDLE_BED_HEIGHT_KM_MIN_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
72 public static final int MIDDLE_BED_HEIGHT_KM_MAX_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
73 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
74 public static final int MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
75 public static final int MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
76 public static final int MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
77 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS = 2;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
78 public static final int MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS = 2;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
79 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS = 0;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
80 public static final int MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS = 0;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
81 public static final int MIDDLE_BED_HEIGHT_WIDTH_MIN_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
82 public static final int MIDDLE_BED_HEIGHT_WIDTH_MAX_DIGITS = 3;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
83
2787
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
84 public static final int FIX_DELTA_W_KM_MIN_DIGITS = 3;
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
85 public static final int FIX_DELTA_W_KM_MAX_DIGITS = 3;
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
86 public static final int FIX_DELTA_W_DELTA_W_MIN_DIGITS = 3;
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
87 public static final int FIX_DELTA_W_DELTA_W_MAX_DIGITS = 3;
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
88 public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS = 0;
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
89 public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2;
2787
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
90
6207
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
91 public static final int VARIANCE_MIN_DIGITS = 3;
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
92 public static final int VARIANCE_MAX_DIGITS = 3;
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
93
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
94 // SQ Relation
6322
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
95 public static final int SQ_RELATION_KM_MIN_DIGITS = 2;
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
96 public static final int SQ_RELATION_KM_MAX_DIGITS = 2;
7020
5eb8b9ae4484 (issue1071) Change format for paramter a again
Andre Heinecke <aheinecke@intevation.de>
parents: 6683
diff changeset
97 public static final int SQ_RELATION_A_MAX_DIGITS = 2;
5eb8b9ae4484 (issue1071) Change format for paramter a again
Andre Heinecke <aheinecke@intevation.de>
parents: 6683
diff changeset
98 public static final int SQ_RELATION_A_MIN_DIGITS = 2;
6322
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
99 public static final int SQ_RELATION_B_MAX_DIGITS = 3;
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
100 public static final int SQ_RELATION_B_MIN_DIGITS = 3;
5639
db4e7ff0b987 Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3771
diff changeset
101
7047
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
102 // OTHER
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
103 public static final int CSV_DIAGRAM_DATA_MAX_DIGITS = 3;
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
104 public static final int CSV_DIAGRAM_DATA_MIN_DIGITS = 3;
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
105
3017
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
106 /**
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
107 * Creates a localized NumberFormatter with given range of decimal digits.
3017
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
108 * @param m CallMeta to find the locale.
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
109 * @param min minimum number of decimal ("fraction") digits.
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
110 * @param max maximum number of decimal ("fraction") digits.
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
111 * @return A NumberFormat. Use #format(NUMBER) to get String representation
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
112 * of NUMBER.
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
113 */
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
114 public static NumberFormat getFormatter(CallMeta m, int min, int max){
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
115 Locale locale = Resources.getLocale(m);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 NumberFormat nf = NumberFormat.getInstance(locale);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 nf.setMaximumFractionDigits(max);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 nf.setMinimumFractionDigits(min);
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 return nf;
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
124 public static NumberFormat getFormatter(CallContext c, int min, int max){
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
125 return getFormatter(c.getMeta(), min, max);
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
126 }
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
127
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 /**
2087
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
130 * Returns a number formatter with no max or min digits set.
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
131 *
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
132 * @param c The CallContext.
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
133 *
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
134 * @return a number formatter.
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
135 */
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
136 public static NumberFormat getRawFormatter(CallContext c) {
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
137 Locale locale = Resources.getLocale(c.getMeta());
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
138 return NumberFormat.getInstance(locale);
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
139 }
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
140
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
141 /**
6683
c6c3a2a26a33 Use full stop in doc. This fixes my syntax highlight :) .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6322
diff changeset
142 * Returns a formatter in engineering notation.
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
143 */
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
144 public static NumberFormat getEngFormatter(CallContext c) {
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
145 NumberFormat nf = getRawFormatter(c);
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
146 if (nf instanceof DecimalFormat) {
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
147 DecimalFormat df = (DecimalFormat)nf;
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
148 df.applyPattern("##0.#####E0");
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
149 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
150 return nf;
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
151 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
152
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
153 /**
6683
c6c3a2a26a33 Use full stop in doc. This fixes my syntax highlight :) .
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6322
diff changeset
154 * Returns a number formatter that uses an exponent after max digits.
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
155 */
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
156 public static NumberFormat getScientificFormater(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
157 CallContext c,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
158 int min,
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
159 int max
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
160 ) {
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
161 NumberFormat nf = getRawFormatter(c);
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
162 if (nf instanceof DecimalFormat) {
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
163 DecimalFormat df = (DecimalFormat)nf;
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
164 df.applyPattern("0.0E0");
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
165 df.setMaximumFractionDigits(max);
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
166 df.setMinimumFractionDigits(min);
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
167 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
168 return nf;
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
169 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
170
2087
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
171
bda04ae1154f #196 Localized the WQ labels in CSV exports.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1683
diff changeset
172 /**
2258
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
173 * Returns a date formatter with SHORT style.
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
174 */
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
175 public static DateFormat getShortDateFormat(CallContext cc) {
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
176 Locale locale = Resources.getLocale(cc.getMeta());
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
177 return DateFormat.getDateInstance(DateFormat.SHORT, locale);
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
178 }
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
179
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
180
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
181 /**
2588
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
182 * Returns a date formatter with MEDIUM style.
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
183 */
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
184 public static DateFormat getMediumDateFormat(CallContext cc) {
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
185 Locale locale = Resources.getLocale(cc.getMeta());
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
186 return DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
187 }
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
188
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
189
7dd45896e941 Issue 459.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 2305
diff changeset
190 /**
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
191 * Returns the number formatter for kilometer values in waterlevel exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
192 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
193 * @return the number formatter for kilometer values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
194 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
195 public static NumberFormat getWaterlevelKM(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
196 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
197 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
198 WATERLEVEL_KM_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
199 WATERLEVEL_KM_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
200 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
201
7047
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
202 /**
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
203 * Returns the number formatter for data exported from diagram (not from
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
204 * calculation.
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
205 *
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
206 * @return the number formatter for csv data from diagra.
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
207 */
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
208 public static NumberFormat getCSVFormatter(CallContext context) {
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
209 return getFormatter(
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
210 context,
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
211 CSV_DIAGRAM_DATA_MIN_DIGITS,
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
212 CSV_DIAGRAM_DATA_MAX_DIGITS);
b5e9b8b5c8d6 issue1493: Use other numberformat for csv data from diagram.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 7020
diff changeset
213 }
5639
db4e7ff0b987 Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3771
diff changeset
214
3162
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
215 public static NumberFormat getWaterlevelW(CallMeta meta) {
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
216 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
217 meta,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
218 WATERLEVEL_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
219 WATERLEVEL_W_MAX_DIGITS);
3162
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
220 }
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
221
5639
db4e7ff0b987 Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3771
diff changeset
222
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
223 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
224 * Returns the number formatter for W values in waterlevel exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
225 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
226 * @return the number formatter for W values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
227 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
228 public static NumberFormat getWaterlevelW(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
229 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
230 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
231 WATERLEVEL_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
232 WATERLEVEL_W_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
233 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
234
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
235
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
236 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
237 * Returns the number formatter for Q values in waterlevel exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
238 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
239 * @return the number formatter for Q values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
240 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
241 public static NumberFormat getWaterlevelQ(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
242 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
243 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
244 WATERLEVEL_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
245 WATERLEVEL_Q_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
246 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
247
5639
db4e7ff0b987 Doc and whitespaces.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3771
diff changeset
248
3162
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
249 public static NumberFormat getWaterlevelQ(CallMeta meta) {
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
250 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
251 meta,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
252 WATERLEVEL_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
253 WATERLEVEL_Q_MAX_DIGITS);
3162
0d8146989012 Added labeling for Q/W points FixingsKMChartService.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3076
diff changeset
254 }
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
255
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
256 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
257 * Returns the number formatter for W values in exports of computed
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
258 * discharge curves.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
259 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
260 * @return the number formatter for W values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
261 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
262 public static NumberFormat getComputedDischargeW(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
263 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
264 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
265 COMPUTED_DISCHARGE_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
266 COMPUTED_DISCHARGE_W_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
267 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
268
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
269
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
270 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
271 * Returns the number formatter for Q values in exports of computed
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
272 * discharge curves.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
273 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
274 * @return the number formatter for Q values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
275 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
276 public static NumberFormat getComputedDischargeQ(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
277 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
278 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
279 COMPUTED_DISCHARGE_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
280 COMPUTED_DISCHARGE_Q_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
281 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
282
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
283
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
284 /**
2258
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
285 * Returns the number formatter for W values in exports of historical
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
286 * discharge curves.
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
287 *
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
288 * @return the number formatter for W values.
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
289 */
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
290 public static NumberFormat getHistoricalDischargeW(CallContext context) {
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
291 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
292 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
293 HISTORICAL_DISCHARGE_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
294 HISTORICAL_DISCHARGE_W_MAX_DIGITS);
2258
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
295 }
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
296
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
297
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
298 /**
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
299 * Returns the number formatter for Q values in exports of historical
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
300 * discharge curves.
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
301 *
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
302 * @return the number formatter for Q values.
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
303 */
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
304 public static NumberFormat getHistoricalDischargeQ(CallContext context) {
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
305 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
306 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
307 HISTORICAL_DISCHARGE_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
308 HISTORICAL_DISCHARGE_Q_MAX_DIGITS);
2258
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
309 }
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
310
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
311
ea173e4c07c7 Added a CSV export for historical discharge curves.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2087
diff changeset
312 /**
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
313 * Returns the number formatter for W values in duration curve exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
314 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
315 * @return the number formatter for W values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
316 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
317 public static NumberFormat getDurationW(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
318 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
319 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
320 DURATION_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
321 DURATION_W_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
322 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
323
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
324
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
325 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
326 * Returns the number formatter for Q values in duration curve exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
327 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
328 * @return the number formatter for W values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
329 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
330 public static NumberFormat getDurationQ(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
331 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
332 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
333 DURATION_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
334 DURATION_Q_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
335 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
336
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
337
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
338 /**
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
339 * Returns the number formatter for D values in duration curve exports.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
340 *
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
341 * @return the number formatter for W values.
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
342 */
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
343 public static NumberFormat getDurationD(CallContext context) {
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
344 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
345 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
346 DURATION_D_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
347 DURATION_D_MAX_DIGITS);
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
348 }
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
349
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
350 public static NumberFormat getCalculationKm(CallMeta meta) {
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
351 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
352 meta,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
353 CALCULATION_REPORT_KM_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
354 CALCULATION_REPORT_KM_MAX_DIGITS);
2290
6f4a1f513e89 Calculation error report: i18n the km of the error report.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2258
diff changeset
355 }
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
356
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
357
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
358 public static NumberFormat getFlowVelocityKM(CallContext context) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
359 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
360 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
361 FLOW_VELOCITY_KM_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
362 FLOW_VELOCITY_KM_MAX_DIGITS);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
363 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
364
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
365
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
366 public static NumberFormat getFlowVelocityValues(CallContext context) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
367 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
368 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
369 FLOW_VELOCITY_VALUES_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
370 FLOW_VELOCITY_VALUES_MAX_DIGITS);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
371 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
372
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
373
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
374 public static NumberFormat getFlowVelocityQ(CallContext context) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
375 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
376 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
377 FLOW_VELOCITY_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
378 FLOW_VELOCITY_Q_MAX_DIGITS);
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2588
diff changeset
379 }
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
380
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
381
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
382 public static NumberFormat getMiddleBedHeightKM(CallContext context) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
383 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
384 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
385 MIDDLE_BED_HEIGHT_KM_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
386 MIDDLE_BED_HEIGHT_KM_MAX_DIGITS);
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
387 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
388
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
389
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
390 public static NumberFormat getMiddleBedHeightHeight(CallContext context) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
391 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
392 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
393 MIDDLE_BED_HEIGHT_HEIGHT_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
394 MIDDLE_BED_HEIGHT_HEIGHT_MAX_DIGITS);
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
395 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
396
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
397
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
398 public static NumberFormat getMiddleBedHeightUncert(CallContext context) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
399 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
400 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
401 MIDDLE_BED_HEIGHT_UNCERT_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
402 MIDDLE_BED_HEIGHT_UNCERT_MAX_DIGITS);
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
403 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
404
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
405
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
406 public static NumberFormat getMiddleBedHeightDataGap(CallContext context) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
407 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
408 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
409 MIDDLE_BED_HEIGHT_DATAGAP_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
410 MIDDLE_BED_HEIGHT_DATAGAP_MAX_DIGITS);
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
411 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
412
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
413
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
414 public static NumberFormat getMiddleBedHeightSounding(
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
415 CallContext context
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8554
diff changeset
416 ) {
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
417 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
418 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
419 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
420 MIDDLE_BED_HEIGHT_SOUNDING_WIDTH_MAX_DIGITS);
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
421 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
422
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
423
2787
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
424 public static NumberFormat getFixDeltaWKM(CallContext context) {
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
425 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
426 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
427 FIX_DELTA_W_KM_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
428 FIX_DELTA_W_KM_MAX_DIGITS);
2787
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
429 }
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
430
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
431 public static NumberFormat getFixDeltaWDeltaW(CallContext context) {
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
432 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
433 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
434 FIX_DELTA_W_DELTA_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
435 FIX_DELTA_W_DELTA_W_MAX_DIGITS);
2787
e63969c173e9 FixA: Added CSV export for Delta W/t values.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
436 }
3017
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
437
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
438 public static NumberFormat getFixDeltaWQ(CallContext context) {
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
439 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
440 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
441 FIX_DELTA_W_DELTA_Q_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
442 FIX_DELTA_W_DELTA_Q_MAX_DIGITS);
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
443 }
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
444
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
445 public static NumberFormat getFixDeltaWW(CallContext context) {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
446 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
447 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
448 FIX_DELTA_W_DELTA_W_MIN_DIGITS,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
449 FIX_DELTA_W_DELTA_W_MAX_DIGITS);
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
450 }
3397
6d1740533810 FixA: Added discharge column to DeltaW(t) CSV export.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3162
diff changeset
451
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
452 public static NumberFormat getVariance(CallContext context) {
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
453 return getFormatter(
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
454 context,
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
455 VARIANCE_MIN_DIGITS,
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
456 VARIANCE_MAX_DIGITS);
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
457 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
458
6207
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
459 public static NumberFormat getSQRelationA(CallContext context) {
7020
5eb8b9ae4484 (issue1071) Change format for paramter a again
Andre Heinecke <aheinecke@intevation.de>
parents: 6683
diff changeset
460 return getScientificFormater(
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
461 context,
6207
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
462 SQ_RELATION_A_MIN_DIGITS,
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
463 SQ_RELATION_A_MAX_DIGITS);
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
464 }
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
465
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
466 public static NumberFormat getSQRelationB(CallContext context) {
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
467 return getFormatter(
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
468 context,
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
469 SQ_RELATION_B_MIN_DIGITS,
a82a724356f0 Updade sq relation pdf export as specified in issue1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6172
diff changeset
470 SQ_RELATION_B_MAX_DIGITS);
6172
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
471 }
58a613798386 Implement PDF export for SQ Relation
Andre Heinecke <aheinecke@intevation.de>
parents: 5994
diff changeset
472
6322
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
473 public static NumberFormat getSQRelationKM(CallContext context) {
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
474 return getFormatter(
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
475 context,
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
476 SQ_RELATION_KM_MIN_DIGITS,
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
477 SQ_RELATION_KM_MAX_DIGITS);
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
478 }
8c976bb0362f Add SQ Relation KM formatter and use it fopr issue 1071
Andre Heinecke <aheinecke@intevation.de>
parents: 6207
diff changeset
479
3017
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
480 public static NumberFormat getMeterFormat(CallContext context) {
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
481 return getFormatter(
3771
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
482 context,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
483 0,
04309ca24614 Locales fix
Christian Lins <christian.lins@intevation.de>
parents: 3402
diff changeset
484 2);
3076
5642a83420f2 FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3017
diff changeset
485
3017
296b067e17e6 i18n and format for line labels.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2787
diff changeset
486 }
3402
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
487
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
488 public static DateFormat getDateFormatter(CallMeta m, String pattern) {
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
489 Locale locale = Resources.getLocale(m);
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
490 return new SimpleDateFormat(pattern, locale);
0336132ec9db Adjusted Delta W(t) CSV exporter to customers wishes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3397
diff changeset
491 }
8862
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
492
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
493 public static NumberFormat getMeanBedHeight(CallContext context) {
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
494 return Formatter.getFormatter(context, 2, 2);
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
495 }
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
496
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
497 public static NumberFormat getTkh(CallContext context) {
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
498 return Formatter.getFormatter(context, 1, 1);
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
499 }
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
500
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
501 public static NumberFormat getFlowDepth(CallContext context) {
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
502 return Formatter.getFormatter(context, 2, 2);
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
503 }
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
504
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
505 public static NumberFormat getW(CallContext context) {
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
506 return Formatter.getFormatter(context, 2, 2);
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
507 }
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
508
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
509 /**
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
510 * Another waterlevel formatter with fixed digits (always 2)
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
511 */
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
512 public static NumberFormat getWaterlevelW2(CallMeta meta) {
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
513 return getFormatter( meta, 2, 2);
5b5bdce5a216 Introduced new number formats for some new data types
gernotbelger
parents: 8856
diff changeset
514 }
445
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
515 }
a7947972fdeb Added a new class that supports formatters for different types of data.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
516 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org