Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/TkhCalculationResult.java @ 9318:7b2b086e45f0
collision pdf details, ResultType refactoring, bezugswst result
author | gernotbelger |
---|---|
date | Fri, 27 Jul 2018 10:11:23 +0200 |
parents | 740d65e4aa14 |
children |
comparison
equal
deleted
inserted
replaced
9317:61b5de0b673b | 9318:7b2b086e45f0 |
---|---|
57 final TkhCalculationResults results = exportContext.getResults(); | 57 final TkhCalculationResults results = exportContext.getResults(); |
58 final String descriptionHeader = results.getDescriptionHeader(); | 58 final String descriptionHeader = results.getDescriptionHeader(); |
59 if (descriptionHeader != null) | 59 if (descriptionHeader != null) |
60 header.add(descriptionHeader); | 60 header.add(descriptionHeader); |
61 | 61 |
62 header.add(exportContext.formatCsvHeader(SInfoResultType.gaugeLabel)); | 62 header.add(exportContext.formatCsvHeader(GeneralResultType.gaugeLabel)); |
63 header.add(exportContext.formatCsvHeader(GeneralResultType.location)); | 63 header.add(exportContext.formatCsvHeader(GeneralResultType.location)); |
64 | 64 |
65 exportContext.writeCSVLine(header.toArray(new String[header.size()])); | 65 exportContext.writeCSVLine(header.toArray(new String[header.size()])); |
66 | 66 |
67 } | 67 } |
103 // writes an empty column into the pdf in that case (most probably to avoid the need for two jasper templates). | 103 // writes an empty column into the pdf in that case (most probably to avoid the need for two jasper templates). |
104 | 104 |
105 final TkhCalculationResults results = exportContext.getResults(); | 105 final TkhCalculationResults results = exportContext.getResults(); |
106 final String descriptionHeader = results.getDescriptionHeader(); | 106 final String descriptionHeader = results.getDescriptionHeader(); |
107 | 107 |
108 final String waterlevelNameHeader = descriptionHeader == null ? exportContext.msgPdf(SInfoResultType.waterlevelLabel) : descriptionHeader; | 108 final String waterlevelNameHeader = descriptionHeader == null ? exportContext.msgPdf(GeneralResultType.waterlevelLabel) : descriptionHeader; |
109 exportContext.addJRMetadata(source, "waterlevel_name_header", waterlevelNameHeader); | 109 exportContext.addJRMetadata(source, "waterlevel_name_header", waterlevelNameHeader); |
110 | 110 |
111 exportContext.addJRMetadata(source, "gauge_header", SInfoResultType.gaugeLabel); | 111 exportContext.addJRMetadata(source, "gauge_header", GeneralResultType.gaugeLabel); |
112 exportContext.addJRMetadata(source, "location_header", GeneralResultType.location); | 112 exportContext.addJRMetadata(source, "location_header", GeneralResultType.location); |
113 | 113 |
114 } | 114 } |
115 | 115 |
116 private String[] formatRow(final IExportContext exportContext, final ResultRow row, final ExportMode mode) { | 116 private String[] formatRow(final IExportContext exportContext, final ResultRow row, final ExportMode mode) { |
126 | 126 |
127 // REMARK: always export this column in pdf-mode, because WInfo also does it (no need for two jasper-templates). | 127 // REMARK: always export this column in pdf-mode, because WInfo also does it (no need for two jasper-templates). |
128 final TkhCalculationResults results = exportContext.getResults(); | 128 final TkhCalculationResults results = exportContext.getResults(); |
129 final String descriptionHeader = results.getDescriptionHeader(); | 129 final String descriptionHeader = results.getDescriptionHeader(); |
130 if (descriptionHeader != null || mode == ExportMode.pdf) | 130 if (descriptionHeader != null || mode == ExportMode.pdf) |
131 lines.add(exportContext.formatRowValue(row, SInfoResultType.waterlevelLabel)); | 131 lines.add(exportContext.formatRowValue(row, GeneralResultType.waterlevelLabel)); |
132 | 132 |
133 lines.add(exportContext.formatRowValue(row, SInfoResultType.gaugeLabel)); | 133 lines.add(exportContext.formatRowValue(row, GeneralResultType.gaugeLabel)); |
134 lines.add(exportContext.formatRowValue(row, GeneralResultType.location)); | 134 lines.add(exportContext.formatRowValue(row, GeneralResultType.location)); |
135 | 135 |
136 return lines.toArray(new String[lines.size()]); | 136 return lines.toArray(new String[lines.size()]); |
137 } | 137 } |
138 } | 138 } |