PageRenderTime 59ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/excelgen/src/main/java/by/q64/promo/excelgen/service/marketing/MarketingReportLastSlideGeneratorImpl.java

https://bitbucket.org/quadrate/promo
Java | 50 lines | 36 code | 11 blank | 3 comment | 0 complexity | 5be983c2131ccc4b9249d5247f69c1e9 MD5 | raw file
  1. package by.q64.promo.excelgen.service.marketing;
  2. import by.q64.promo.excelgen.service.marketing.source.MarketingReportDataOneCity;
  3. import by.q64.promo.excelgen.service.marketing.source.settings.MarketingReportSettings;
  4. import org.apache.poi.xslf.usermodel.*;
  5. import org.springframework.stereotype.Service;
  6. import java.awt.*;
  7. import java.util.function.Function;
  8. /**
  9. * Created by Pavel.Sirotkin on 25.12.2014.
  10. */
  11. @Service("marketingReportLastSlideGenerator")
  12. public class MarketingReportLastSlideGeneratorImpl implements MarketingReportPartGenerator {
  13. @Override
  14. public XMLSlideShow generate(XMLSlideShow ppt, MarketingReportSettings reportSettings,
  15. MarketingReportDataOneCity marketingReportDataOneCity,
  16. Function<String, byte[]> pictureGetter) {
  17. XSLFSlide slide1 = ppt.createSlide();
  18. XSLFTextBox txt1 = slide1.createTextBox();
  19. txt1.setAnchor(new java.awt.Rectangle(20, 250, 600, 50));
  20. XSLFTextParagraph p1 = txt1.addNewTextParagraph();
  21. XSLFTextRun r1 = p1.addNewTextRun();
  22. r1.setText("Thank you for your attention!");
  23. r1.setFontFamily("Verdana");
  24. r1.setFontColor(new Color(255, 0, 102));
  25. r1.setFontSize(32);
  26. r1.setBold(true);
  27. XSLFTextBox txt2 = slide1.createTextBox();
  28. txt2.setAnchor(new java.awt.Rectangle(20, 410, 600, 50));
  29. XSLFTextParagraph p2 = txt2.addNewTextParagraph();
  30. XSLFTextRun r2 = p2.addNewTextRun();
  31. r2.setText("Group of companies «Trast Group BTL»\n" +
  32. "tel. +7 (495) 223-45-96 \n" +
  33. "www.trast-group.ru\n");
  34. r2.setFontColor(Color.black);
  35. r2.setFontSize(19);
  36. r2.setFontFamily("Verdana");
  37. return ppt;
  38. }
  39. }