Example usage for org.apache.poi.xslf.usermodel XMLSlideShow setSlideOrder

List of usage examples for org.apache.poi.xslf.usermodel XMLSlideShow setSlideOrder

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XMLSlideShow setSlideOrder.

Prototype

public void setSlideOrder(XSLFSlide slide, int newIndex) 

Source Link

Usage

From source file:easyoffice.powerpoint.PPTMaker.java

private static XSLFSlide copySlide(XMLSlideShow ppt, XSLFSlide srcSlide) {
    /*/*from   w  w w .  j  av a  2 s  . c om*/
     Create new slide instance copy
    */
    XSLFSlideLayout layout = srcSlide.getSlideLayout();
    XSLFSlide newSlide = ppt.createSlide(layout);
    ppt.setSlideOrder(newSlide, srcSlide.getSlideNumber());

    return newSlide.importContent(srcSlide);
}

From source file:org.joeffice.presentation.actions.NewSlideAction.java

License:Apache License

@Override
public void actionPerformed(ActionEvent e) {
    SlidesTopComponent currentTopComponent = OfficeTopComponent.getSelectedComponent(SlidesTopComponent.class);
    if (currentTopComponent != null) {
        XMLSlideShow presentation = currentTopComponent.getPresentation();
        XSLFSlideLayout slideLayout = getSlideLayout(presentation);
        if (slideLayout != null) {
            XSLFSlide newSlide = presentation.createSlide(slideLayout);
            fillWithText(newSlide);/*from  www .j a v a  2 s .c o m*/
            int selectedSlide = currentTopComponent.getSelectedSlide();
            presentation.setSlideOrder(newSlide, selectedSlide + 1);

            SlideComponent slideComp = new SlideComponent(newSlide, currentTopComponent);
            addSlideToPanel(slideComp, (JPanel) currentTopComponent.getMainComponent(), selectedSlide + 1);
            currentTopComponent.setSelectedSlide(selectedSlide + 1);
            currentTopComponent.getDataObject().setModified(true);
        }
    }
}