Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 706668b19b04 |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
49 { | 49 { |
50 /** The log used in this class. */ | 50 /** The log used in this class. */ |
51 private static Logger log = Logger.getLogger(DifferencesState.class); | 51 private static Logger log = Logger.getLogger(DifferencesState.class); |
52 public static final String I18N_DIFF_YEAR = "beddifference.year"; | 52 public static final String I18N_DIFF_YEAR = "beddifference.year"; |
53 | 53 |
54 public static final String I18N_FACET_BED_DIFF_YEAR = "facet.bedheight.diff.year"; | 54 public static final String I18N_FACET_BED_DIFF_YEAR = |
55 public static final String I18N_FACET_BED_DIFF_YEAR_RAW = "facet.bedheight.diff.year.raw"; | 55 "facet.bedheight.diff.year"; |
56 public static final String I18N_FACET_BED_DIFF_ABSOLUTE = "facet.bedheight.diff.absolute"; | 56 public static final String I18N_FACET_BED_DIFF_YEAR_RAW = |
57 public static final String I18N_FACET_BED_DIFF_ABSOLUTE_RAW = "facet.bedheight.diff.absolute.raw"; | 57 "facet.bedheight.diff.year.raw"; |
58 public static final String I18N_FACET_BED_DIFF_SOUNDING = "facet.bedheight.diff.sounding"; | 58 public static final String I18N_FACET_BED_DIFF_ABSOLUTE = |
59 public static final String I18N_FACET_BED_DIFF_MORPH1 = "facet.bedheight.diff.morph1"; | 59 "facet.bedheight.diff.absolute"; |
60 public static final String I18N_FACET_BED_DIFF_MORPH2 = "facet.bedheight.diff.morph2"; | 60 public static final String I18N_FACET_BED_DIFF_ABSOLUTE_RAW = |
61 public static final String I18N_FACET_BED_DIFF_HEIGHT1 = "facet.bedheight.diff.height1"; | 61 "facet.bedheight.diff.absolute.raw"; |
62 public static final String I18N_FACET_BED_DIFF_HEIGHT1_RAW = "facet.bedheight.diff.height1.raw"; | 62 public static final String I18N_FACET_BED_DIFF_SOUNDING = |
63 public static final String I18N_FACET_BED_DIFF_HEIGHT2 = "facet.bedheight.diff.height2"; | 63 "facet.bedheight.diff.sounding"; |
64 public static final String I18N_FACET_BED_DIFF_HEIGHT2_RAW = "facet.bedheight.diff.height2.raw"; | 64 public static final String I18N_FACET_BED_DIFF_MORPH1 = |
65 | 65 "facet.bedheight.diff.morph1"; |
66 public static final String I18N_FACET_BED_DIFF_HEIGHT_RAW = "facet.bedheight.diff.height.raw"; | 66 public static final String I18N_FACET_BED_DIFF_MORPH2 = |
67 "facet.bedheight.diff.morph2"; | |
68 public static final String I18N_FACET_BED_DIFF_HEIGHT1 = | |
69 "facet.bedheight.diff.height1"; | |
70 public static final String I18N_FACET_BED_DIFF_HEIGHT1_RAW = | |
71 "facet.bedheight.diff.height1.raw"; | |
72 public static final String I18N_FACET_BED_DIFF_HEIGHT2 = | |
73 "facet.bedheight.diff.height2"; | |
74 public static final String I18N_FACET_BED_DIFF_HEIGHT2_RAW = | |
75 "facet.bedheight.diff.height2.raw"; | |
76 | |
77 public static final String I18N_FACET_BED_DIFF_HEIGHT_RAW = | |
78 "facet.bedheight.diff.height.raw"; | |
67 | 79 |
68 public DifferencesState() { | 80 public DifferencesState() { |
69 } | 81 } |
70 | 82 |
71 @Override | 83 @Override |
83 | 95 |
84 if (facets == null || res == null) { | 96 if (facets == null || res == null) { |
85 return res; | 97 return res; |
86 } | 98 } |
87 | 99 |
88 BedDifferencesResult[] results = (BedDifferencesResult[]) res.getData(); | 100 BedDifferencesResult[] results = |
101 (BedDifferencesResult[])res.getData(); | |
89 | 102 |
90 if (results == null || results.length == 0) { | 103 if (results == null || results.length == 0) { |
91 log.warn("Calculation computed no results!"); | 104 log.warn("Calculation computed no results!"); |
92 return res; | 105 return res; |
93 } | 106 } |
118 ) { | 131 ) { |
119 log.debug("DifferencesState.generateFacets"); | 132 log.debug("DifferencesState.generateFacets"); |
120 | 133 |
121 CallMeta meta = context.getMeta(); | 134 CallMeta meta = context.getMeta(); |
122 | 135 |
123 newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); | 136 newFacets.add( |
124 newFacets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); | 137 new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id)); |
138 newFacets.add( | |
139 new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id)); | |
125 for (int idx = 0; idx < results.length; idx++) { | 140 for (int idx = 0; idx < results.length; idx++) { |
126 if (results[idx] instanceof BedDiffYearResult) { | 141 if (results[idx] instanceof BedDiffYearResult) { |
127 newFacets.add(new BedDiffFacet( | 142 newFacets.add(new BedDiffFacet( |
128 idx, | 143 idx, |
129 BED_DIFFERENCE_YEAR, | 144 BED_DIFFERENCE_YEAR, |
222 BedDiffYearResult result, | 237 BedDiffYearResult result, |
223 int ndx, | 238 int ndx, |
224 boolean raw | 239 boolean raw |
225 ) { | 240 ) { |
226 if (raw && ndx == 0) { | 241 if (raw && ndx == 0) { |
227 return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW, | 242 return Resources.getMsg( |
228 I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameFirst()}); | 243 meta, |
244 I18N_FACET_BED_DIFF_HEIGHT_RAW, | |
245 I18N_FACET_BED_DIFF_HEIGHT_RAW, | |
246 new Object[] {result.getNameFirst()}); | |
229 } | 247 } |
230 if (raw && ndx == 1) { | 248 if (raw && ndx == 1) { |
231 return Resources.getMsg(meta, I18N_FACET_BED_DIFF_HEIGHT_RAW, | 249 return Resources.getMsg( |
232 I18N_FACET_BED_DIFF_HEIGHT_RAW, new Object[] {result.getNameSecond()}); | 250 meta, |
251 I18N_FACET_BED_DIFF_HEIGHT_RAW, | |
252 I18N_FACET_BED_DIFF_HEIGHT_RAW, | |
253 new Object[] {result.getNameSecond()}); | |
233 } | 254 } |
234 if (ndx == 0) { | 255 if (ndx == 0) { |
235 return result.getNameFirst(); | 256 return result.getNameFirst(); |
236 } | 257 } |
237 else { | 258 else { |