Package org.apache.poi.hslf.usermodel

Examples of org.apache.poi.hslf.usermodel.SlideShow.createSlide()


     * Picture#getEscherBSERecord threw NullPointerException if EscherContainerRecord.BSTORE_CONTAINER
     * was not found. The correct behaviour is to return null.
     */
    public void test46122() throws IOException {
        SlideShow ppt = new SlideShow();
        Slide slide = ppt.createSlide();

        Picture pict = new Picture(-1); //index to non-existing picture data
        pict.setSheet(slide);
        PictureData data = pict.getPictureData();
        assertNull(data);
View Full Code Here


     */
    public void testShapeGroup() throws Exception {
        String cwd = System.getProperty("HSLF.testdata.path");
        SlideShow ppt = new SlideShow();

        Slide slide = ppt.createSlide();
        Dimension pgsize = ppt.getPageSize();

        ShapeGroup group = new ShapeGroup();

        group.setAnchor(new Rectangle(0, 0, (int)pgsize.getWidth(), (int)pgsize.getHeight()));
View Full Code Here

  /**
   * Test creation of TextRun objects.
   */
  public void testAddTextRun() {
    SlideShow ppt = new SlideShow();
    Slide slide = ppt.createSlide();

    assertNull(slide.getTextRuns());

    TextBox shape1 = new TextBox();
    TextRun run1 = shape1.getTextRun();
View Full Code Here

    assertSame(run1, box1.getTextRun());
    TextBox box2 = (TextBox)sh[1];
    assertSame(run2, box2.getTextRun());

    //test Table - a complex group of shapes containing text objects
    Slide slide2 = ppt.createSlide();
    assertNull(slide2.getTextRuns());
    Table table = new Table(2, 2);
    slide2.addShape(table);
    runs = slide2.getTextRuns();
    assertNotNull(runs);
View Full Code Here

    }

    public void testCreateLines() throws Exception {
        SlideShow ppt = new SlideShow();

        Slide slide = ppt.createSlide();

        slide.addTitle().setText("Lines tester");

        Line line;
View Full Code Here

    public void testDefaults() throws Exception {
        SlideShow ppt = new SlideShow();

        assertEquals(Fill.FILL_SOLID, ppt.getSlidesMasters()[0].getBackground().getFill().getFillType());

        Slide slide = ppt.createSlide();
        assertTrue(slide.getFollowMasterBackground());
        assertEquals(Fill.FILL_SOLID, slide.getBackground().getFill().getFillType());

        Shape shape = new AutoShape(ShapeTypes.Rectangle);
        assertEquals(Fill.FILL_SOLID, shape.getFill().getFillType());
View Full Code Here

        Fill fill;
        Shape shape;
        int idx;

        //slide 1
        slide = ppt.createSlide();
        slide.setFollowMasterBackground(false);
        fill = slide.getBackground().getFill();
        idx = ppt.addPicture(new File(System.getProperty("HSLF.testdata.path") + "/tomcat.png"), Picture.PNG);
        fill.setFillType(Fill.FILL_PICTURE);
        fill.setPictureData(idx);
View Full Code Here

        fill = shape.getFill();
        fill.setFillType(Fill.FILL_SOLID);
        slide.addShape(shape);

        //slide 2
        slide = ppt.createSlide();
        slide.setFollowMasterBackground(false);
        fill = slide.getBackground().getFill();
        idx = ppt.addPicture(new File(System.getProperty("HSLF.testdata.path") + "/tomcat.png"), Picture.PNG);
        fill.setFillType(Fill.FILL_PATTERN);
        fill.setPictureData(idx);
View Full Code Here

        fill = shape.getFill();
        fill.setFillType(Fill.FILL_BACKGROUND);
        slide.addShape(shape);

        //slide 3
        slide = ppt.createSlide();
        slide.setFollowMasterBackground(false);
        fill = slide.getBackground().getFill();
        idx = ppt.addPicture(new File(System.getProperty("HSLF.testdata.path") + "/tomcat.png"), Picture.PNG);
        fill.setFillType(Fill.FILL_TEXTURE);
        fill.setPictureData(idx);
View Full Code Here

        idx = ppt.addPicture(new File(System.getProperty("HSLF.testdata.path") + "/clock.jpg"), Picture.JPEG);
        fill.setPictureData(idx);
        slide.addShape(shape);

        // slide 4
        slide = ppt.createSlide();
        slide.setFollowMasterBackground(false);
        fill = slide.getBackground().getFill();
        fill.setFillType(Fill.FILL_SHADE_CENTER);
        fill.setBackgroundColor(Color.white);
        fill.setForegroundColor(Color.darkGray);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.