/sigmah/src/test/java/org/sigmah/server/report/renderer/ppt/PptAlphaCheck.java

http://sigma-h.googlecode.com/ · Java · 42 lines · 22 code · 13 blank · 7 comment · 1 complexity · b50cd5d333ad06f0d4045ee1d1f67cf3 MD5 · raw file

  1. /*
  2. * All Sigmah code is released under the GNU General Public License v3
  3. * See COPYRIGHT.txt and LICENSE.txt.
  4. */
  5. package org.sigmah.server.report.renderer.ppt;
  6. import org.apache.poi.ddf.EscherProperties;
  7. import org.apache.poi.hslf.HSLFSlideShow;
  8. import org.apache.poi.hslf.model.Shape;
  9. import org.apache.poi.hslf.model.Slide;
  10. import org.apache.poi.hslf.usermodel.SlideShow;
  11. import org.junit.Test;
  12. import java.io.IOException;
  13. import java.io.InputStream;
  14. /*
  15. * @author Alex Bertram
  16. */
  17. public class PptAlphaCheck {
  18. @Test
  19. public void testAlphaValues() throws IOException {
  20. InputStream in = PptAlphaCheck.class.getResourceAsStream("/alpha.ppt");
  21. SlideShow ppt = new SlideShow( new HSLFSlideShow(in) );
  22. Slide[] slides = ppt.getSlides();
  23. Shape[] shapes = slides[0].getShapes();
  24. for(int i=0; i!=shapes.length; ++i) {
  25. System.out.println(String.format("slide %d, opacity = %d", i,
  26. shapes[i].getEscherProperty(EscherProperties.FILL__FILLOPACITY)));
  27. }
  28. }
  29. }