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
 int _getSheetNumber()
          Returns the (internal, SlideIdentifier based) sheet number
 int _getSheetRefId()
          Returns the (internal, RefID based) sheet number, as used to in PersistPtr stuff.
 TextBox addTitle()
          Create a TextBox object that represents the slide's title.
 Background getBackground()
          Returns the background shape for this sheet.
 ColorSchemeAtom getColorScheme()
          Color scheme for this sheet.
 boolean getFollowMasterBackground()
          Whether this slide follows master sheet background
 MasterSheet getMasterSheet()
          Returns the slide master associated with this slide.
 Notes getNotesSheet()
          Returns the Notes Sheet for this slide, or null if there isn't one
protected  PPDrawing getPPDrawing()
          Returns the PPDrawing associated with 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
addShape, findTextRuns, findTextRuns, getShapes, 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()

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

_getSheetRefId

public int _getSheetRefId()
Returns the (internal, RefID based) sheet number, as used to in PersistPtr stuff.

Specified by:
_getSheetRefId in class Sheet

_getSheetNumber

public int _getSheetNumber()
Returns the (internal, SlideIdentifier based) sheet number

Specified by:
_getSheetNumber in class Sheet
See Also:
getSlideNumber()

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


getPPDrawing

protected PPDrawing getPPDrawing()
Returns the PPDrawing associated with this slide, or null if there isn't one

Specified by:
getPPDrawing in class Sheet

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 the slide master associated with this slide.

Overrides:
getMasterSheet in class Sheet
Returns:
the slide master associated with this slide.

setMasterSheet

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


getColorScheme

public ColorSchemeAtom getColorScheme()
Description copied from class: Sheet
Color scheme for this sheet.

Overrides:
getColorScheme in class Sheet

getBackground

public Background getBackground()
Returns the background shape for this sheet.

Returns:
the background shape for this sheet.

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


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