• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SlideShow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.poi.hslf.usermodel.SlideShow的典型用法代码示例。如果您正苦于以下问题:Java SlideShow类的具体用法?Java SlideShow怎么用?Java SlideShow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SlideShow类属于org.apache.poi.hslf.usermodel包,在下文中一共展示了SlideShow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithslides/addbackground/data/";
	
	SlideShow ppt = new SlideShow();
	
	//add first slide
    Slide s1 = ppt.createSlide();
    
    SlideMaster master = ppt.getSlidesMasters()[0];

    Fill fill = master.getBackground().getFill();
    int idx = ppt.addPicture(new File(dataPath + "background.jpg"), Picture.JPEG);
    fill.setFillType(Fill.FILL_PICTURE);
    fill.setPictureData(idx);
    
    //save changes in a file
    FileOutputStream out = new FileOutputStream(dataPath + "AddBG_Apache_Out.ppt");
    ppt.write(out);
    out.close();
    
    System.out.println("Background Added.");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:24,代码来源:ApacheAddBackground.java


示例2: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithslides/setslidetitle/data/";
	
	SlideShow ppt = new SlideShow();
	Slide slide = ppt.createSlide();
	TextBox title = slide.addTitle();
	title.setText("Hello, World!");
    
    //save changes 
    FileOutputStream out = new FileOutputStream(dataPath + "Apache_SlideTitle_Out.ppt");
    ppt.write(out);
    out.close();
    
	System.out.println("Presentation with Title Saved.");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:17,代码来源:ApacheSlideTitle.java


示例3: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithpresentation/addslides/data/";

	//create a new empty slide show
    SlideShow ppt = new SlideShow();

    //add first slide
    Slide s1 = ppt.createSlide();

    //add second slide
    Slide s2 = ppt.createSlide();
    
    //save changes in a file
    FileOutputStream out = new FileOutputStream(dataPath + "AddSlides_Apache_Out.ppt");
    ppt.write(out);
    out.close();
    
    System.out.println("Slide Added and Saved.");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:21,代码来源:ApacheAddSlides.java


示例4: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithpresentation/createheaderfooter/data/";
	
	SlideShow ppt = new SlideShow();

	ppt.createSlide();

	//presentation-scope headers / footers
       HeadersFooters hf = ppt.getSlideHeadersFooters();
       hf.setSlideNumberVisible(true);
       hf.setFootersText("Created by POI-HSLF");
       
       FileOutputStream out = new FileOutputStream(dataPath + "ApacheHeaderFooter.ppt");
       ppt.write(out);
       out.close();
  
       System.out.println("Done...");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:20,代码来源:ApacheCreateHeaderFooter.java


示例5: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithpresentation/createnewpresentation/data/";
	
	//create a new empty slide show
	SlideShow ppt = new SlideShow();
	//add first slide
	Slide s1 = ppt.createSlide();
	//save changes in a file
	FileOutputStream out = new FileOutputStream(dataPath + "NewPPT_Apache_Out.ppt");
	ppt.write(out);
	out.close();

	//Printing the status
       System.out.println("Presentation Created successfully!");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:17,代码来源:ApacheCreatePresentation.java


示例6: getPictureData

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Returns the picture data for this picture.
 *
 * @return the picture data for this picture.
 */
public PictureData getPictureData(){
    SlideShow ppt = getSheet().getSlideShow();
    PictureData[] pict = ppt.getPictureData();

    EscherBSERecord bse = getEscherBSERecord();
    if (bse == null){
        logger.log(POILogger.ERROR, "no reference to picture data found ");
    } else {
        for ( int i = 0; i < pict.length; i++ ) {
            if (pict[i].getOffset() ==  bse.getOffset()){
                return pict[i];
            }
        }
        logger.log(POILogger.ERROR, "no picture found for our BSE offset " + bse.getOffset());
    }
    return null;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:23,代码来源:Picture.java


示例7: getEscherBSERecord

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
protected EscherBSERecord getEscherBSERecord(){
    SlideShow ppt = getSheet().getSlideShow();
    Document doc = ppt.getDocumentRecord();
    EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
    EscherContainerRecord bstore = (EscherContainerRecord)Shape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
    if(bstore == null) {
        logger.log(POILogger.DEBUG, "EscherContainerRecord.BSTORE_CONTAINER was not found ");
        return null;
    }
    List lst = bstore.getChildRecords();
    int idx = getPictureIndex();
    if (idx == 0){
        logger.log(POILogger.DEBUG, "picture index was not found, returning ");
        return null;
    }
    return (EscherBSERecord)lst.get(idx-1);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:Picture.java


示例8: getEscherBSERecord

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
protected EscherBSERecord getEscherBSERecord(int idx){
    Sheet sheet = shape.getSheet();
    if(sheet == null) {
        logger.log(POILogger.DEBUG, "Fill has not yet been assigned to a sheet");
        return null;
    }
    SlideShow ppt = sheet.getSlideShow();
    Document doc = ppt.getDocumentRecord();
    EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
    EscherContainerRecord bstore = (EscherContainerRecord)Shape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
    if(bstore == null) {
        logger.log(POILogger.DEBUG, "EscherContainerRecord.BSTORE_CONTAINER was not found ");
        return null;
    }
    List lst = bstore.getChildRecords();
    return (EscherBSERecord)lst.get(idx-1);
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:18,代码来源:Fill.java


示例9: find

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Find hyperlinks in a text run
 *
 * @param run  <code>TextRun</code> to lookup hyperlinks in
 * @return found hyperlinks or <code>null</code> if not found
 */
protected static Hyperlink[] find(TextRun run){
    ArrayList lst = new ArrayList();
    SlideShow ppt = run.getSheet().getSlideShow();
    //document-level container which stores info about all links in a presentation
    ExObjList exobj = ppt.getDocumentRecord().getExObjList();
    if (exobj == null) {
        return null;
    }
    Record[] records = run._records;
    if(records != null) find(records, exobj, lst);

    Hyperlink[] links = null;
    if (lst.size() > 0){
        links = new Hyperlink[lst.size()];
        lst.toArray(links);
    }
    return links;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:25,代码来源:Hyperlink.java


示例10: getObjectData

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Returns unique identifier for the OLE object.
 *
 * @return the unique identifier for the OLE object
 */
public ObjectData getObjectData(){
    SlideShow ppt = getSheet().getSlideShow();
    ObjectData[] ole = ppt.getEmbeddedObjects();

    //persist reference
    ExEmbed exEmbed = getExEmbed();
    ObjectData data = null;
    if(exEmbed != null) {
        int ref = exEmbed.getExOleObjAtom().getObjStgDataRef();

        for (int i = 0; i < ole.length; i++) {
            if(ole[i].getExOleObjStg().getPersistId() == ref) {
                data=ole[i];
            }
        }
    }
    if (data==null) {
        logger.log(POILogger.WARN, "OLE data not found");
    }

    return data;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:28,代码来源:OLEShape.java


示例11: getExEmbed

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Return the record container for this embedded object.
 *
 * <p>
 * It contains:
 * 1. ExEmbedAtom.(4045)
 * 2. ExOleObjAtom (4035)
 * 3. CString (4026), Instance MenuName (1) used for menus and the Links dialog box.
 * 4. CString (4026), Instance ProgID (2) that stores the OLE Programmatic Identifier.
 *     A ProgID is a string that uniquely identifies a given object.
 * 5. CString (4026), Instance ClipboardName (3) that appears in the paste special dialog.
 * 6. MetaFile( 4033), optional
 * </p>
 */
public ExEmbed getExEmbed(){
    if(_exEmbed == null){
        SlideShow ppt = getSheet().getSlideShow();

        ExObjList lst = ppt.getDocumentRecord().getExObjList();
        if(lst == null){
            logger.log(POILogger.WARN, "ExObjList not found");
            return null;
        }

        int id = getObjectID();
        Record[] ch = lst.getChildRecords();
        for (int i = 0; i < ch.length; i++) {
            if(ch[i] instanceof ExEmbed){
                ExEmbed embd = (ExEmbed)ch[i];
                if( embd.getExOleObjAtom().getObjID() == id) _exEmbed = embd;
            }
        }
    }
    return _exEmbed;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:36,代码来源:OLEShape.java


示例12: setSlideShow

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Assign SlideShow for this slide master.
 * (Used interanlly)
 */
public void setSlideShow(SlideShow ss) {
    super.setSlideShow(ss);

    //after the slide show is assigned collect all available style records
    if (_txmaster == null) {
        _txmaster = new TxMasterStyleAtom[9];

        TxMasterStyleAtom txdoc = getSlideShow().getDocumentRecord().getEnvironment().getTxMasterStyleAtom();
        _txmaster[txdoc.getTextType()] = txdoc;

        TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).getTxMasterStyleAtoms();
        for (int i = 0; i < txrec.length; i++) {
            int txType = txrec[i].getTextType();
            if(_txmaster[txType] == null) _txmaster[txType] = txrec[i];
        }
    }
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:22,代码来源:SlideMaster.java


示例13: getPath

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * @return UNC or local path to a video file
 */
public String getPath(){
    OEShapeAtom oe = (OEShapeAtom)getClientDataRecord(RecordTypes.OEShapeAtom.typeID);
    int idx = oe.getOptions();

    SlideShow ppt = getSheet().getSlideShow();
    ExObjList lst = (ExObjList)ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID);
    if(lst == null) return null;

    Record[]  r = lst.getChildRecords();
    for (int i = 0; i < r.length; i++) {
        if(r[i] instanceof ExMCIMovie){
            ExMCIMovie mci = (ExMCIMovie)r[i];
            ExVideoContainer exVideo = mci.getExVideo();
            int objectId = exVideo.getExMediaAtom().getObjectId();
            if(objectId == idx){
                return exVideo.getPathAtom().getText();
            }
        }

    }
    return null;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:26,代码来源:MovieShape.java


示例14: exportAsImages

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
private static void exportAsImages(final SlideShow ppt, final File... files) throws IOException {
	if (log.isTraceEnabled()) log.trace(HelperLog.methodStart(ppt, files));

	final Dimension size = ppt.getPageSize();
	final Slide[] slides = ppt.getSlides();

	for (int ii = 0; ii < slides.length; ii++) {

		final BufferedImage image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
		final Graphics2D g2d = image.createGraphics();

		// clear the drawing area
		g2d.setPaint(Color.WHITE);
		g2d.fill(new Rectangle2D.Float(0, 0, size.width, size.height));

		// render
		slides[ii].draw(g2d);

		HelperImage.writeImage(files[ii], IMAGE_TYPE, image);
	}

	if (log.isTraceEnabled()) log.trace(HelperLog.methodExit());
}
 
开发者ID:slaubenberger,项目名称:wichtel,代码行数:24,代码来源:HelperPdf.java


示例15: handleSlideEmbeddedPictures

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
private void handleSlideEmbeddedPictures(SlideShow slideshow,
    XHTMLContentHandler xhtml) throws TikaException, SAXException,
    IOException {
  for (PictureData pic : slideshow.getPictureData()) {
    String mediaType = null;

    switch (pic.getType()) {
    case Picture.EMF:
      mediaType = "application/x-emf";
      break;
    case Picture.JPEG:
      mediaType = "image/jpeg";
      break;
    case Picture.PNG:
      mediaType = "image/png";
      break;
    case Picture.WMF:
      mediaType = "application/x-msmetafile";
      break;
    case Picture.DIB:
      mediaType = "image/bmp";
      break;
    }

    try {
      handleEmbeddedResource(TikaInputStream.get(pic.getData()), null, null,
          mediaType, xhtml, false);
    } catch (Exception e) {
      // log as info
    }
  }
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:33,代码来源:HSLFExtractor.java


示例16: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithslides/createbulletedlists/data/";
	
	SlideShow ppt = new SlideShow();

	  Slide slide = ppt.createSlide();

	  TextBox shape = new TextBox();
	  RichTextRun rt = shape.getTextRun().getRichTextRuns()[0];
	  shape.setText(
	          "January\r" +
	          "February\r" +
	          "March\r" +
	          "April");
	  rt.setFontSize(42);
	  rt.setBullet(true);
	  rt.setBulletOffset(0);  //bullet offset
	  rt.setTextOffset(50);   //text offset (should be greater than bullet offset)
	  rt.setBulletChar('\u263A'); //bullet character
	  slide.addShape(shape);

	  shape.setAnchor(new java.awt.Rectangle(50, 50, 500, 300));  //position of the text box in the slide
	  slide.addShape(shape);

	  FileOutputStream out = new FileOutputStream(dataPath + "ApacheBullets.ppt");
	  ppt.write(out);
	  out.close();
	  
	  System.out.println("Done...");
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:32,代码来源:ApacheCreateBulletList.java


示例17: main

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
	String dataPath = "src/featurescomparison/workingwithpresentation/countslides/data/";
	
	SlideShow ppt = new SlideShow(new FileInputStream(dataPath + "presentation.ppt"));
	System.out.println("Total Slides in Count: " + ppt.getSlides().length);
}
 
开发者ID:asposemarketplace,项目名称:Aspose_for_Apache_POI,代码行数:8,代码来源:ApacheCountSlides.java


示例18: PowerPointExtractor

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Creates a PowerPointExtractor, from a HSLFSlideShow
 *
 * @param ss the HSLFSlideShow to extract text from
 */
public PowerPointExtractor(HSLFSlideShow ss) {
	super(ss);
	_hslfshow = ss;
	_show = new SlideShow(_hslfshow);
	_slides = _show.getSlides();
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:12,代码来源:PowerPointExtractor.java


示例19: getPictureData

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * <code>PictureData</code> object used in a texture, pattern of picture fill.
 */
public PictureData getPictureData(){
    EscherOptRecord opt = (EscherOptRecord)Shape.getEscherChild(shape.getSpContainer(), EscherOptRecord.RECORD_ID);
    EscherSimpleProperty p = (EscherSimpleProperty)Shape.getEscherProperty(opt, EscherProperties.FILL__PATTERNTEXTURE);
    if (p == null) return null;

    SlideShow ppt = shape.getSheet().getSlideShow();
    PictureData[] pict = ppt.getPictureData();
    Document doc = ppt.getDocumentRecord();

    EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
    EscherContainerRecord bstore = (EscherContainerRecord)Shape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);

    java.util.List<EscherRecord> lst = bstore.getChildRecords();
    int idx = p.getPropertyValue();
    if (idx == 0){
        logger.log(POILogger.WARN, "no reference to picture data found ");
    } else {
        EscherBSERecord bse = (EscherBSERecord)lst.get(idx - 1);
        for ( int i = 0; i < pict.length; i++ ) {
            if (pict[i].getOffset() ==  bse.getOffset()){
                return pict[i];
            }
        }
    }

    return null;
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:31,代码来源:Fill.java


示例20: supplySlideShow

import org.apache.poi.hslf.usermodel.SlideShow; //导入依赖的package包/类
/**
 * Supply the SlideShow we belong to.
 * Also passes it on to our child RichTextRuns
 */
public void supplySlideShow(SlideShow ss) {
	slideShow = ss;
	if(_rtRuns != null) {
		for(int i=0; i<_rtRuns.length; i++) {
			_rtRuns[i].supplySlideShow(slideShow);
		}
	}
}
 
开发者ID:rmage,项目名称:gnvc-ims,代码行数:13,代码来源:TextRun.java



注:本文中的org.apache.poi.hslf.usermodel.SlideShow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OrientBaseGraph类代码示例发布时间:2022-05-22
下一篇:
Java EncryptableProperties类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap