comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculationResult.java @ 9523:d421c2bf0195

Allow to edit colors in vegetation zones
author gernotbelger
date Mon, 01 Oct 2018 17:08:50 +0200
parents e2da9c8a7c57
children c3ed5dcd5e08
comparison
equal deleted inserted replaced
9522:23d97d60b889 9523:d421c2bf0195
23 23
24 /** 24 /**
25 * @author Domenico Nardi Tironi 25 * @author Domenico Nardi Tironi
26 */ 26 */
27 final class VegetationZonesCalculationResult extends AbstractCalculationExportableResult { 27 final class VegetationZonesCalculationResult extends AbstractCalculationExportableResult {
28
28 private static final long serialVersionUID = 1L; 29 private static final long serialVersionUID = 1L;
29 30
30 private static final String JASPER_FILE = "/jasper/templates/uinfo.vegetationzones.jrxml"; 31 private static final String JASPER_FILE = "/jasper/templates/uinfo.vegetationzones.jrxml";
31 32
32 public VegetationZonesCalculationResult(final String label, final Collection<ResultRow> rows) { 33 public VegetationZonesCalculationResult(final String label, final Collection<ResultRow> rows) {
39 final Collection<String> header = new ArrayList<>(11); 40 final Collection<String> header = new ArrayList<>(11);
40 41
41 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegname)); 42 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegname));
42 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauervon)); 43 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauervon));
43 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauerbis)); 44 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauerbis));
44 if (VegetationZoneServerClientXChange.HAS_COLORS_EDITABLE) 45 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegzone_color));
45 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegzone_color));
46 exportContextCSV.writeCSVLine(header.toArray(new String[header.size()])); 46 exportContextCSV.writeCSVLine(header.toArray(new String[header.size()]));
47 } 47 }
48 48
49 @Override 49 @Override
50 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) { 50 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) {
83 final Collection<String> lines = new ArrayList<>(11); 83 final Collection<String> lines = new ArrayList<>(11);
84 84
85 lines.add(context.formatRowValue(row, UInfoResultType.vegname)); 85 lines.add(context.formatRowValue(row, UInfoResultType.vegname));
86 lines.add(context.formatRowValue(row, UInfoResultType.vegdauervon)); 86 lines.add(context.formatRowValue(row, UInfoResultType.vegdauervon));
87 lines.add(context.formatRowValue(row, UInfoResultType.vegdauerbis)); 87 lines.add(context.formatRowValue(row, UInfoResultType.vegdauerbis));
88 if (VegetationZoneServerClientXChange.HAS_COLORS_EDITABLE) 88 lines.add(context.formatRowValue(row, UInfoResultType.vegzone_color));
89 lines.add(context.formatRowValue(row, UInfoResultType.vegzone_color)); 89
90 return lines.toArray(new String[lines.size()]); 90 return lines.toArray(new String[lines.size()]);
91 } 91 }
92
93 } 92 }

http://dive4elements.wald.intevation.org