comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculationResult.java @ 9260:b570b6fcc052

VegetationZone color added and disabled
author gernotbelger
date Tue, 17 Jul 2018 10:59:27 +0200
parents a4121ec450d6
children b3d3c958a594
comparison
equal deleted inserted replaced
9259:66b003701546 9260:b570b6fcc052
39 final Collection<String> header = new ArrayList<>(11); 39 final Collection<String> header = new ArrayList<>(11);
40 40
41 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegname)); 41 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegname));
42 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauervon)); 42 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauervon));
43 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauerbis)); 43 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegdauerbis));
44 44 if (VegetationZone.HAS_COLORS_EDITABLE)
45 header.add(exportContextCSV.formatCsvHeader(UInfoResultType.vegzone_color));
45 exportContextCSV.writeCSVLine(header.toArray(new String[header.size()])); 46 exportContextCSV.writeCSVLine(header.toArray(new String[header.size()]));
46 } 47 }
47 48
48 @Override 49 @Override
49 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) { 50 protected void writeCSVResultMetadata(final ExportContextCSV exportContextCSV) {
72 protected void addJRTableHeader(final ExportContextPDF exportContextPDF, final MetaAndTableJRDataSource source) { 73 protected void addJRTableHeader(final ExportContextPDF exportContextPDF, final MetaAndTableJRDataSource source) {
73 /* additional column headings */ 74 /* additional column headings */
74 exportContextPDF.addJRMetadata(source, "veg_name", UInfoResultType.vegname); 75 exportContextPDF.addJRMetadata(source, "veg_name", UInfoResultType.vegname);
75 exportContextPDF.addJRMetadata(source, "veg_dauervon", UInfoResultType.vegdauervon); 76 exportContextPDF.addJRMetadata(source, "veg_dauervon", UInfoResultType.vegdauervon);
76 exportContextPDF.addJRMetadata(source, "veg_dauerbis", UInfoResultType.vegdauerbis); 77 exportContextPDF.addJRMetadata(source, "veg_dauerbis", UInfoResultType.vegdauerbis);
77 78 // TODO add color to jasper-template and here
78 } 79 }
79 80
80 protected String[] formatRow(final IExportContext context, final ResultRow row) { 81 protected String[] formatRow(final IExportContext context, final ResultRow row) {
81 82
82 final Collection<String> lines = new ArrayList<>(11); 83 final Collection<String> lines = new ArrayList<>(11);
83 84
84 lines.add(context.formatRowValue(row, UInfoResultType.vegname)); 85 lines.add(context.formatRowValue(row, UInfoResultType.vegname));
85 lines.add(context.formatRowValue(row, UInfoResultType.vegdauervon)); 86 lines.add(context.formatRowValue(row, UInfoResultType.vegdauervon));
86 lines.add(context.formatRowValue(row, UInfoResultType.vegdauerbis)); 87 lines.add(context.formatRowValue(row, UInfoResultType.vegdauerbis));
87 88 if (VegetationZone.HAS_COLORS_EDITABLE)
89 lines.add(context.formatRowValue(row, UInfoResultType.vegzone_color));
88 return lines.toArray(new String[lines.size()]); 90 return lines.toArray(new String[lines.size()]);
89 } 91 }
90 92
91 } 93 }

http://dive4elements.wald.intevation.org