com.aspose.slides
Class Slide

java.lang.Object
  extended by com.aspose.slides.Slide
All Implemented Interfaces:
ISlide
Direct Known Subclasses:
MainMaster

public class Slide
extends java.lang.Object
implements ISlide

Represents the slide in a presentation.


Field Summary
protected  Background m_background
           
protected  Document m_doc
           
protected  PPDrawing m_drawing
           
protected  Notes m_notes
           
protected  Presentation m_parent
           
protected  Placeholders m_pholders
           
protected  SlideAtom m_satom
           
protected  Shapes m_shapes
           
protected  PPTSlide m_slide
           
protected  SlideShowTransition m_SlideTransition
           
protected  Tags m_tags
           
 
Constructor Summary
protected Slide()
           
protected Slide(Presentation parent)
          Creates new Slide - called by Presentation to create a slide from scratch.
protected Slide(Presentation parent, PPTSlide slide)
          Creates a PPTSlide representing the given Slide object.
 
Method Summary
 Notes addNotes()
          Adds the empty notes to a slide.
protected  void addNotes(Notes notes)
           
protected  int changeIdBase(java.util.TreeMap idList)
           
protected  int changeIdBase(java.util.TreeMap idList, EsSpGrContainer group, int newMaxId)
           
 void changeMaster(Slide newMaster)
          Replaces the master slide for a slide and changes placeholder's style.
 void changeMaster(Slide newMaster, boolean changeStyle)
          Replaces the master slide for a slide and optionally changes placeholder's style.
protected  Slide clone(Presentation pres)
           
protected  void deleteSpContainer(EsRecordArray drw, EsContainer cnt)
           
protected  java.util.ArrayList findRootSpContainers(EsRecordArray drw)
           
 Shape findShape(java.lang.String altText)
          Search and return the shape with defined alternative text.
 Background getBackground()
          Returns the background of a slide.
protected  Document getDoc()
           
 HeaderFooter getHeaderFooter()
          Returns the header and footer settings for a slide.
 int getLayout()
          Returns the slide layout.
 long getMasterId()
          Returns the Id of a master slide.
 java.lang.String getName()
          Returns the name of a slide.
 Notes getNotes()
          Returns the notes of a slide.
 Presentation getParent()
          Returns the parent presentation.
 Placeholders getPlaceholders()
          Returns the placeholders of a slide.
protected  PPDrawing getPPDrawing()
           
protected  PPTSlide getPPTSlide()
           
protected  java.awt.Color getSchemeColor(int index)
          Returns the color from the color scheme for a slide.
 Shapes getShapes()
          Returns the shapes of a slide.
protected  SlideAtom getSlideAtom()
           
 SlideComments getSlideComments()
          Returns the collection of slide comments.
 long getSlideId()
          Returns the Id of a slide.
 int getSlidePosition()
          Returns the position of a slide.
 SlideShowTransition getSlideShowTransition()
          Returns the SlideShowTransition object which contains information about how the specified slide advances during a slide show.
protected  java.util.ArrayList getSubFrames()
           
 Tags getTags()
          Returns the tags of a slide.
 java.awt.image.BufferedImage getThumbnail(java.util.Collection elementsToDraw, java.awt.Dimension imageSize, java.awt.geom.Rectangle2D.Float window)
          Returns a Thumbnail Image of specified elements with specified size.
 java.awt.image.BufferedImage getThumbnail(java.util.Collection elementsToDraw, float scaleX, float scaleY, java.awt.geom.Rectangle2D.Float window)
          Returns a Thumbnail Image of specified elements with specified size.
 java.awt.image.BufferedImage getThumbnail(java.awt.Dimension imageSize)
          Returns the thumbnail image object with specified size.
 java.awt.image.BufferedImage getThumbnail(java.awt.Dimension imageSize, java.awt.geom.Rectangle2D.Float window, IDrawingControl drawingControl)
          Returns the thumbnail image object with specified size.
 java.awt.image.BufferedImage getThumbnail(float scaleX, float scaleY)
          Returns the thumbnail image object with custom scaling.
 java.awt.image.BufferedImage getThumbnail(float scaleX, float scaleY, java.awt.geom.Rectangle2D.Float window, IDrawingControl drawingControl)
          Returns a Thumbnail Image object with custom scaling.
 boolean isFollowMasterBackground()
          Determines whether the slide follows the master slide background.
 boolean isFollowMasterObjects()
          Determines whether the slide objects follow the master slide objects style.
 boolean isFollowMasterScheme()
          Determines whether the slide follows the master slide color scheme.
 boolean isMasterSlide()
          Determines whether the slide is a master slide.
 void saveToSVG(java.io.OutputStream stream)
          Creates image of a slide in SVG (vector graphics) format and writes it to a stream.
protected  void setDoc(Document value)
           
 void setFollowMasterBackground(boolean value)
          Sets whether the slide follows the master slide background.
 void setFollowMasterObjects(boolean value)
          Sets whether the slide objects follow the master slide objects style.
 void setFollowMasterScheme(boolean value)
          Sets whether the slide follows the master slide color scheme.
 void setMasterId(long value)
          Sets the ID of a master slide.
 void setName(java.lang.String value)
          Sets the name of a slide.
protected  void setPPDrawing(PPDrawing value)
           
protected  void setPPTSlide(PPTSlide value)
           
protected  void setSchemeColor(int index, java.awt.Color color)
          Sets the color of a color scheme for a slide.
protected  void setSlideAtom(SlideAtom value)
           
protected  void setSlideId(long val)
           
 void setSlidePosition(int value)
          Sets the position of a slide.
protected  void updateDefaultMasterText(Slide srcSlide)
           
protected  void updateParagraphs(Shapes subShapes, boolean skipEmpty)
           
protected  void updateShapeSizes()
           
protected  void updateTextColors()
           
protected  void zOrder(EsRecordArray drw, Shape shape, int cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_parent

protected Presentation m_parent

m_slide

protected PPTSlide m_slide

m_satom

protected SlideAtom m_satom

m_doc

protected Document m_doc

m_notes

protected Notes m_notes

m_background

protected Background m_background

m_drawing

protected PPDrawing m_drawing

m_pholders

protected Placeholders m_pholders

m_shapes

protected Shapes m_shapes

m_SlideTransition

protected SlideShowTransition m_SlideTransition

m_tags

protected Tags m_tags
Constructor Detail

Slide

protected Slide()

Slide

protected Slide(Presentation parent)
Creates new Slide - called by Presentation to create a slide from scratch. You should not be calling this from application code (its protected anyhow).

Parameters:
parent - Presentation object associated with the slide.

Slide

protected Slide(Presentation parent,
                PPTSlide slide)
         throws PptReadException
Creates a PPTSlide representing the given Slide object. Should only be called by PPTPresentation when reading in an exisiting file.

Parameters:
parent -
slide -
Throws:
PptReadException
Method Detail

updateShapeSizes

protected void updateShapeSizes()

updateTextColors

protected void updateTextColors()

updateDefaultMasterText

protected void updateDefaultMasterText(Slide srcSlide)

updateParagraphs

protected void updateParagraphs(Shapes subShapes,
                                boolean skipEmpty)

deleteSpContainer

protected void deleteSpContainer(EsRecordArray drw,
                                 EsContainer cnt)

findRootSpContainers

protected java.util.ArrayList findRootSpContainers(EsRecordArray drw)

getSubFrames

protected java.util.ArrayList getSubFrames()

changeIdBase

protected int changeIdBase(java.util.TreeMap idList)

changeIdBase

protected int changeIdBase(java.util.TreeMap idList,
                           EsSpGrContainer group,
                           int newMaxId)

clone

protected Slide clone(Presentation pres)
               throws java.io.IOException,
                      PptReadException
Parameters:
pres - the target presentation.
Returns:
The new slide object.
Throws:
java.io.IOException
PptReadException

zOrder

protected void zOrder(EsRecordArray drw,
                      Shape shape,
                      int cmd)

addNotes

protected void addNotes(Notes notes)

addNotes

public Notes addNotes()
               throws PptEditException
Adds the empty notes to a slide.

Specified by:
addNotes in interface ISlide
Throws:
PptEditException - on notes adding errors.

getParent

public Presentation getParent()
Returns the parent presentation.

Specified by:
getParent in interface ISlide
Returns:
The parent presentation.

getNotes

public Notes getNotes()
Returns the notes of a slide.

Specified by:
getNotes in interface ISlide
Returns:
The notes of a slide.

getShapes

public Shapes getShapes()
Returns the shapes of a slide.

Specified by:
getShapes in interface ISlide
Returns:
The shapes of a slide.

getPlaceholders

public Placeholders getPlaceholders()
Returns the placeholders of a slide.

Specified by:
getPlaceholders in interface ISlide
Returns:
The placeholders of a slide.

getBackground

public Background getBackground()
Returns the background of a slide.

Specified by:
getBackground in interface ISlide
Returns:
The background of a slide.

getSlideId

public long getSlideId()
Returns the Id of a slide.

Specified by:
getSlideId in interface ISlide
Returns:
The slide Id.

setSlideId

protected void setSlideId(long val)

getMasterId

public long getMasterId()
Returns the Id of a master slide.

Specified by:
getMasterId in interface ISlide
Returns:
The master slide Id.

setMasterId

public void setMasterId(long value)
Sets the ID of a master slide.

Specified by:
setMasterId in interface ISlide
Parameters:
value - the new Id of a master slide.

isMasterSlide

public boolean isMasterSlide()
Determines whether the slide is a master slide.

Specified by:
isMasterSlide in interface ISlide
Returns:
true if slide is a master slide.

getSlidePosition

public int getSlidePosition()
Returns the position of a slide. Returns 0 for master slides.

Specified by:
getSlidePosition in interface ISlide
Returns:
The slide position.

setSlidePosition

public void setSlidePosition(int value)
Sets the position of a slide. Do nothing for master slides.

Specified by:
setSlidePosition in interface ISlide
Parameters:
value - new slide position.

getLayout

public int getLayout()
Returns the slide layout.

Specified by:
getLayout in interface ISlide
Returns:
The slide layout. See SlideLayout.

isFollowMasterObjects

public boolean isFollowMasterObjects()
Determines whether the slide objects follow the master slide objects style.

Specified by:
isFollowMasterObjects in interface ISlide
Returns:
true if slide objects follow the master slide objects style.

setFollowMasterObjects

public void setFollowMasterObjects(boolean value)
Sets whether the slide objects follow the master slide objects style.

Specified by:
setFollowMasterObjects in interface ISlide
Parameters:
value - true to force slide objects follow the master slide objects style.

isFollowMasterScheme

public boolean isFollowMasterScheme()
Determines whether the slide follows the master slide color scheme.

Specified by:
isFollowMasterScheme in interface ISlide
Returns:
true if slide follows the master slide color scheme.

setFollowMasterScheme

public void setFollowMasterScheme(boolean value)
Sets whether the slide follows the master slide color scheme.

Specified by:
setFollowMasterScheme in interface ISlide
Parameters:
value - true to force slide follow the master slide color scheme.

isFollowMasterBackground

public boolean isFollowMasterBackground()
Determines whether the slide follows the master slide background.

Specified by:
isFollowMasterBackground in interface ISlide
Returns:
true if slide follows the master slide background.

setFollowMasterBackground

public void setFollowMasterBackground(boolean value)
Sets whether the slide follows the master slide background.

Specified by:
setFollowMasterBackground in interface ISlide
Parameters:
value - true to force slide follow the master slide background.

getName

public java.lang.String getName()
Returns the name of a slide.

Specified by:
getName in interface ISlide
Returns:
the name of a slide.

setName

public void setName(java.lang.String value)
Sets the name of a slide.

Specified by:
setName in interface ISlide
Parameters:
value - the name of a slide.

getSchemeColor

protected java.awt.Color getSchemeColor(int index)
Returns the color from the color scheme for a slide.

Parameters:
index - index of the color in a scheme.
Returns:
The Color object.

setSchemeColor

protected void setSchemeColor(int index,
                              java.awt.Color color)
Sets the color of a color scheme for a slide.

Parameters:
index - Index of a color in a scheme.
color - New color

getThumbnail

public java.awt.image.BufferedImage getThumbnail(float scaleX,
                                                 float scaleY)
                                          throws PptException
Returns the thumbnail image object with custom scaling.

Specified by:
getThumbnail in interface ISlide
Parameters:
scaleX - The value by which to scale this Thumbnail in the x-axis direction.
scaleY - The value by which to scale this Thumbnail in the y-axis direction.
Returns:
the thumbnail image of a slide.
Throws:
PptException

getThumbnail

public java.awt.image.BufferedImage getThumbnail(java.util.Collection elementsToDraw,
                                                 java.awt.Dimension imageSize,
                                                 java.awt.geom.Rectangle2D.Float window)
                                          throws PptException
Returns a Thumbnail Image of specified elements with specified size.

Specified by:
getThumbnail in interface ISlide
Parameters:
elementsToDraw - a list of elements to draw.
imageSize - size of a new Image.
window - a part of slide to draw.
Returns:
Thumbnail Image of specified elements with specified size.
Throws:
PptException

getThumbnail

public java.awt.image.BufferedImage getThumbnail(java.util.Collection elementsToDraw,
                                                 float scaleX,
                                                 float scaleY,
                                                 java.awt.geom.Rectangle2D.Float window)
                                          throws PptException
Returns a Thumbnail Image of specified elements with specified size.

Specified by:
getThumbnail in interface ISlide
Parameters:
elementsToDraw - a list of elements to draw.
scaleX - value by which to scale thumbnail in the x-axis direction.
scaleY - value by which to scale thumbnail in the y-axis direction.
window - a part of slide to draw.
Returns:
Thumbnail Image of specified elements with specified size.
Throws:
PptException

getThumbnail

public java.awt.image.BufferedImage getThumbnail(float scaleX,
                                                 float scaleY,
                                                 java.awt.geom.Rectangle2D.Float window,
                                                 IDrawingControl drawingControl)
                                          throws PptException
Returns a Thumbnail Image object with custom scaling.

Specified by:
getThumbnail in interface ISlide
Parameters:
scaleX - value by which to scale thumbnail in the x-axis direction.
scaleY - value by which to scale thumbnail in the y-axis direction.
window - a part of slide to draw.
drawingControl - an object which determines which slide elements to draw or null to draw all.
Returns:
Thumbnail image with custom scaling.
Throws:
PptException

getThumbnail

public java.awt.image.BufferedImage getThumbnail(java.awt.Dimension imageSize)
                                          throws PptException
Returns the thumbnail image object with specified size.

Parameters:
imageSize - Size of new Image.
Returns:
Image of a slide.
Throws:
PptException

getThumbnail

public java.awt.image.BufferedImage getThumbnail(java.awt.Dimension imageSize,
                                                 java.awt.geom.Rectangle2D.Float window,
                                                 IDrawingControl drawingControl)
                                          throws PptException
Returns the thumbnail image object with specified size.

Specified by:
getThumbnail in interface ISlide
Parameters:
imageSize - size of a new Image.
window - a part of slide to draw.
drawingControl - an object which determines which slide elements to draw or null to draw all.
Returns:
Thumbnail image object with specified size.
Throws:
PptException

saveToSVG

public void saveToSVG(java.io.OutputStream stream)
               throws PptException,
                      AsposeLicenseException
Creates image of a slide in SVG (vector graphics) format and writes it to a stream.

Specified by:
saveToSVG in interface ISlide
Parameters:
stream - output stream.
Throws:
PptException
AsposeLicenseException

getSlideShowTransition

public SlideShowTransition getSlideShowTransition()
Returns the SlideShowTransition object which contains information about how the specified slide advances during a slide show.

Specified by:
getSlideShowTransition in interface ISlide
Returns:
The SlideShowTransition object.

changeMaster

public void changeMaster(Slide newMaster)
                  throws PptEditException
Replaces the master slide for a slide and changes placeholder's style.

Specified by:
changeMaster in interface ISlide
Parameters:
newMaster - New master slide.
Throws:
PptEditException

changeMaster

public void changeMaster(Slide newMaster,
                         boolean changeStyle)
                  throws PptEditException
Replaces the master slide for a slide and optionally changes placeholder's style.

Specified by:
changeMaster in interface ISlide
Parameters:
newMaster - New master slide.
changeStyle - true to change style of placeholders.
Throws:
PptEditException

getHeaderFooter

public HeaderFooter getHeaderFooter()
Returns the header and footer settings for a slide.

Specified by:
getHeaderFooter in interface ISlide
Returns:
the header and footer settings. See HeaderFooter.

getTags

public Tags getTags()
Returns the tags of a slide.

Specified by:
getTags in interface ISlide
Returns:
The tags of a slide. See Tags.

getSlideComments

public SlideComments getSlideComments()
Returns the collection of slide comments.

Specified by:
getSlideComments in interface ISlide
Returns:
collection of slide comments. See SlideComments.

getDoc

protected Document getDoc()

setDoc

protected void setDoc(Document value)

getPPTSlide

protected PPTSlide getPPTSlide()

setPPTSlide

protected void setPPTSlide(PPTSlide value)

getPPDrawing

protected PPDrawing getPPDrawing()

setPPDrawing

protected void setPPDrawing(PPDrawing value)

getSlideAtom

protected SlideAtom getSlideAtom()

setSlideAtom

protected void setSlideAtom(SlideAtom value)

findShape

public Shape findShape(java.lang.String altText)
Search and return the shape with defined alternative text.

Specified by:
findShape in interface ISlide
Parameters:
altText - Alternative text to find.
Returns:
Shape object.