public void draw(Graphics2D graphics){ MasterSheet master = getMasterSheet(); Background bg = getBackground(); if(bg != null)bg.draw(graphics); if(getFollowMasterObjects()){ Shape[] sh = master.getShapes(); for (int i = 0; i < sh.length; i++) { if(MasterSheet.isPlaceholder(sh[i])) continue; sh[i].draw(graphics); } } Shape[] sh = getShapes(); for (int i = 0; i < sh.length; i++) { sh[i].draw(graphics); } }
protected String extractPPTContent(InputStream in) throws Exception{ SlideShow ppt = new SlideShow(in); Slide[] slide = ppt.getSlides(); StringBuffer content = new StringBuffer(); for(int i=0;i<slide.length;i++){ TextRun[] tr = slide[i].getTextRuns(); for(int j = 0; j<tr.length; j++){ content.append(" "); content.append(slide[i].getTextRuns()[j].getText()); } } return content.toString(); } }
@Override protected void drawOntoThisGraphic(int index, Graphics2D graphics){ slides[index].draw(graphics); }
/** * Background for this slide. */ public Background getBackground() { if(getFollowMasterBackground()) { return getMasterSheet().getBackground(); } return super.getBackground(); }
HeadersFooters hf = slide.getHeadersFooters(); if (hf != null && hf.isHeaderVisible() && hf.getHeaderText() != null) { ret.append(hf.getHeaderText() + "\n"); textRunsToText(ret, slide.getTextRuns()); Comment[] comments = slide.getComments(); for (int j = 0; j < comments.length; j++) { ret.append(comments[j].getAuthor() + " - " + comments[j].getText() + "\n"); Notes notes = _slides[i].getNotesSheet(); if (notes == null) { continue;
Slide slide = new Slide(sp.getSlideIdentifier(), sp.getRefID(), _slides.length + 1); slide.setSlideShow(this); slide.onCreate(); org.apache.poi.hslf.record.Slide slideRecord = slide.getSlideRecord(); int slideRecordPos = _hslfSlideShow.appendRootLevelRecord(slideRecord); _records = _hslfSlideShow.getRecords(); logger.log(POILogger.INFO, "New slide ended up at " + slideOffset); slide.setMasterSheet(_masters[0]);
EscherDggRecord dgg = getSlideShow().getDocumentRecord().getPPDrawingGroup().getEscherDggRecord(); EscherContainerRecord dgContainer = (EscherContainerRecord)getSheetContainer().getPPDrawing().getEscherRecords()[0]; EscherDgRecord dg = (EscherDgRecord) Shape.getEscherChild(dgContainer, EscherDgRecord.RECORD_ID); int dgId = dgg.getMaxDrawingGroupId() + 1; break; if(spr != null) spr.setShapeId(allocateShapeId());
@Override protected Color getSlideBGColor(int index){ return slides[index].getBackground().getFill().getForegroundColor(); }
TextRun[] _otherRuns = findTextRuns(getPPDrawing()); findTextRuns(_atomSet.getSlideRecords(),textRuns); } else {
_slides[i] = new Slide(slidesRecords[i], notes, sas, slideIdentifier, (i + 1)); _slides[i].setSlideShow(this);
/** * Create a <code>TextBox</code> object that represents the slide's title. * * @return <code>TextBox</code> object that represents the slide's title. */ public TextBox addTitle() { Placeholder pl = new Placeholder(); pl.setShapeType(ShapeTypes.Rectangle); pl.getTextRun().setRunType(TextHeaderAtom.TITLE_TYPE); pl.setText("Click to edit title"); pl.setAnchor(new java.awt.Rectangle(54, 48, 612, 90)); addShape(pl); return pl; }
/** * Return title of this slide or <code>null</code> if the slide does not have title. * <p> * The title is a run of text of type <code>TextHeaderAtom.CENTER_TITLE_TYPE</code> or * <code>TextHeaderAtom.TITLE_TYPE</code> * </p> * * @see TextHeaderAtom * * @return title of this slide */ public String getTitle(){ TextRun[] txt = getTextRuns(); for (int i = 0; i < txt.length; i++) { int type = txt[i].getRunType(); if (type == TextHeaderAtom.CENTER_TITLE_TYPE || type == TextHeaderAtom.TITLE_TYPE ){ String title = txt[i].getText(); return title; } } return null; }