org.apache.poi.hslf.model
Class Slide

java.lang.Object
  extended by org.apache.poi.hslf.model.Sheet
      extended by org.apache.poi.hslf.model.Slide

public class Slide
extends Sheet

This class represents a slide in a PowerPoint Document. It allows access to the text within, and the layout. For now, it only does the text side of things though

Author:
Nick Burch, Yegor Kozlov

Constructor Summary
Slide(int sheetNumber, int sheetRefId, int slideNumber)
          Create a new Slide instance
Slide(Slide slide, Notes notes, SlideListWithText.SlideAtomsSet atomSet, int slideIdentifier, int slideNumber)
          Constructs a Slide from the Slide record, and the SlideAtomsSet containing the text.
 
Method Summary
 TextBox addTitle()
          Create a TextBox object that represents the slide's title.
 Background getBackground()
          Returns the background shape for this sheet.
 boolean getFollowMasterBackground()
          Whether this slide follows master sheet background
 MasterSheet getMasterSheet()
          Returns master sheet associated with this slide.
 Notes getNotesSheet()
          Returns the Notes Sheet for this slide, or null if there isn't one
protected  SlideListWithText.SlideAtomsSet getSlideAtomsSet()
           
 int getSlideNumber()
          Returns the (public facing) page number of this slide
 Slide getSlideRecord()
          Returns the underlying slide record
 TextRun[] getTextRuns()
          Returns an array of all the TextRuns found
 java.lang.String getTitle()
          Return title of this slide or null if the slide does not have title.
 void setFollowMasterBackground(boolean flag)
          Sets whether this slide follows master background
 void setMasterSheet(MasterSheet master)
          Change Master of this slide.
 void setNotes(Notes notes)
          Sets the Notes that are associated with this.
 void setSlideNumber(int newSlideNumber)
          Changes the Slide's (external facing) page number.
 
Methods inherited from class org.apache.poi.hslf.model.Sheet
_getSheetNumber, _getSheetRefId, addShape, findTextRuns, findTextRuns, getColorScheme, getPPDrawing, getShapes, getSheetContainer, getSlideShow, setSlideShow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Slide

public Slide(Slide slide,
             Notes notes,
             SlideListWithText.SlideAtomsSet atomSet,
             int slideIdentifier,
             int slideNumber)
Constructs a Slide from the Slide record, and the SlideAtomsSet containing the text. Initialises TextRuns, to provide easier access to the text

Parameters:
slide - the Slide record we're based on
notes - the Notes sheet attached to us
atomSet - the SlideAtomsSet to get the text from

Slide

public Slide(int sheetNumber,
             int sheetRefId,
             int slideNumber)
Create a new Slide instance

Parameters:
sheetNumber - The internal number of the sheet, as used by PersistPtrHolder
slideNumber - The user facing number of the sheet
Method Detail

setNotes

public void setNotes(Notes notes)
Sets the Notes that are associated with this. Updates the references in the records to point to the new ID


setSlideNumber

public void setSlideNumber(int newSlideNumber)
Changes the Slide's (external facing) page number.

See Also:
SlideShow.reorderSlide(int, int)

addTitle

public TextBox addTitle()
Create a TextBox object that represents the slide's title.

Returns:
TextBox object that represents the slide's title.

getTitle

public java.lang.String getTitle()
Return title of this slide or null if the slide does not have title.

The title is a run of text of type TextHeaderAtom.CENTER_TITLE_TYPE or TextHeaderAtom.TITLE_TYPE

Returns:
title of this slide
See Also:
TextHeaderAtom

getTextRuns

public TextRun[] getTextRuns()
Returns an array of all the TextRuns found

Specified by:
getTextRuns in class Sheet

getSlideNumber

public int getSlideNumber()
Returns the (public facing) page number of this slide


getSlideRecord

public Slide getSlideRecord()
Returns the underlying slide record


getNotesSheet

public Notes getNotesSheet()
Returns the Notes Sheet for this slide, or null if there isn't one


getSlideAtomsSet

protected SlideListWithText.SlideAtomsSet getSlideAtomsSet()
Returns:
set of records inside SlideListWithtext container which hold text data for this slide (typically for placeholders).

getMasterSheet

public MasterSheet getMasterSheet()
Returns master sheet associated with this slide. It can be either SlideMaster or TitleMaster objects.

Specified by:
getMasterSheet in class Sheet
Returns:
the master sheet associated with this slide.

setMasterSheet

public void setMasterSheet(MasterSheet master)
Change Master of this slide.


setFollowMasterBackground

public void setFollowMasterBackground(boolean flag)
Sets whether this slide follows master background

Parameters:
flag - true if the slide follows master, false otherwise

getFollowMasterBackground

public boolean getFollowMasterBackground()
Whether this slide follows master sheet background

Returns:
true if the slide follows master background, false otherwise

getBackground

public Background getBackground()
Description copied from class: Sheet
Returns the background shape for this sheet.

Overrides:
getBackground in class Sheet
Returns:
the background shape for this sheet.


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.