示例#1
0
 private void run() {
   List<ProjectVariant> variants = Utils.sortVariants(result.getVariants());
   List<ImpactCategoryDescriptor> impacts = Utils.sortImpacts(result.getImpactDescriptors());
   int row = 1;
   header(sheet, row++, 1, "LCIA Results");
   writeRows(row, variants, impacts);
   Excel.autoSize(sheet, 1, 4);
 }
示例#2
0
 private int writeRows(
     int row, List<ProjectVariant> variants, List<ImpactCategoryDescriptor> impacts) {
   for (int i = 0; i < variants.size(); i++) {
     int col = i + 4;
     header(sheet, row, col, variants.get(i).getName());
   }
   row++;
   writeHeader(row++);
   for (ImpactCategoryDescriptor impact : impacts) {
     writeInfo(row, impact);
     ContributionSet<ProjectVariant> contributions = result.getContributions(impact);
     for (int i = 0; i < variants.size(); i++) {
       int col = i + 4;
       ProjectVariant variant = variants.get(i);
       ContributionItem<?> c = contributions.getContribution(variant);
       if (c == null) continue;
       Excel.cell(sheet, row, col, c.getAmount());
     }
     row++;
   }
   return row;
 }
示例#3
0
 private void header(Sheet sheet, int row, int col, String val) {
   Excel.cell(sheet, row, col, val).setCellStyle(headerStyle);
 }
示例#4
0
 void writeInfo(int row, ImpactCategoryDescriptor impact) {
   int col = 1;
   Excel.cell(sheet, row, col++, impact.getRefId());
   Excel.cell(sheet, row, col++, impact.getName());
   Excel.cell(sheet, row, col++, impact.getReferenceUnit());
 }