Search in sources :

Example 1 with XSLFAutoShape

use of org.apache.poi.xslf.usermodel.XSLFAutoShape in project poi by apache.

the class TestXSLFSlideShow method testMasterBackground.

@Test
public void testMasterBackground() throws IOException {
    XMLSlideShow ppt = new XMLSlideShow();
    XSLFBackground b = ppt.getSlideMasters().get(0).getBackground();
    b.setFillColor(Color.RED);
    XSLFSlide sl = ppt.createSlide();
    XSLFAutoShape as = sl.createAutoShape();
    as.setAnchor(new Rectangle2D.Double(100, 100, 100, 100));
    as.setShapeType(ShapeType.CLOUD);
    XMLSlideShow ppt2 = XSLFTestDataSamples.writeOutAndReadBack(ppt);
    ppt.close();
    XSLFBackground b2 = ppt2.getSlideMasters().get(0).getBackground();
    assertEquals(Color.RED, b2.getFillColor());
    ppt2.close();
}
Also used : XSLFSlide(org.apache.poi.xslf.usermodel.XSLFSlide) XMLSlideShow(org.apache.poi.xslf.usermodel.XMLSlideShow) XSLFAutoShape(org.apache.poi.xslf.usermodel.XSLFAutoShape) Rectangle2D(java.awt.geom.Rectangle2D) XSLFBackground(org.apache.poi.xslf.usermodel.XSLFBackground) Test(org.junit.Test)

Aggregations

Rectangle2D (java.awt.geom.Rectangle2D)1 XMLSlideShow (org.apache.poi.xslf.usermodel.XMLSlideShow)1 XSLFAutoShape (org.apache.poi.xslf.usermodel.XSLFAutoShape)1 XSLFBackground (org.apache.poi.xslf.usermodel.XSLFBackground)1 XSLFSlide (org.apache.poi.xslf.usermodel.XSLFSlide)1 Test (org.junit.Test)1