Package org.apache.poi.hslf.usermodel
Class HSLFSheet
java.lang.Object
org.apache.poi.hslf.usermodel.HSLFSheet
- All Implemented Interfaces:
Iterable<HSLFShape>,HSLFShapeContainer,ShapeContainer<HSLFShape,,HSLFTextParagraph> Sheet<HSLFShape,HSLFTextParagraph>
- Direct Known Subclasses:
HSLFMasterSheet,HSLFNotes,HSLFSlide
public abstract class HSLFSheet
extends Object
implements HSLFShapeContainer, Sheet<HSLFShape,HSLFTextParagraph>
This class defines the common format of "Sheets" in a powerpoint
document. Such sheets could be Slides, Notes, Master etc
- Author:
- Nick Burch, Yegor Kozlov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the (internal, SlideIdentifier based) sheet number, as used to reference this sheet from other records.intReturns the (internal, RefID based) sheet number, as used to in PersistPtr stuff.voidAdd a new Shape to this SlideintAllocates new shape id for the new drawing group id.create a new shape with a predefined geometry and add it to this shape containercreate a connectorcreate a new shape with a custom geometrycreate a group of shapes belonging to this containercreateOleShape(PictureData pictureData) Create a new OLE object shape with the given pictureData as preview imagecreatePicture(PictureData pictureData) create a picture belonging to this containercreateTable(int numRows, int numCols) Create a new Table of the given number of rows and columnscreate a text boxvoiddraw(Graphics2D graphics) Convenience method to draw a sheet to a graphics contextReturns the background shape for this sheet.Color scheme for this sheet.booleanHeader / Footer settings for this slide.abstract HSLFMasterSheetReturn the master sheet .getPlaceholder(Placeholder type) Search placeholder by its typegetPlaceholderByTextType(int type) Return placeholder by text typegetPlaceholderDetails(Placeholder placeholder) Get the placeholder details for the given placeholder type.Fetch the PPDrawing from the underlying recordReturn programmable tag associated with this sheet, e.g.Returns all shapes contained in this SheetReturn record container for this sheetFetch the SlideShow we're attached toabstract List<List<HSLFTextParagraph>>Returns an array of all the TextRuns in the sheet.iterator()protected voidonAddTextShape(HSLFTextShape shape) Subclasses should call this method and update the array of text runs when a text shape is addedvoidonCreate()Called by SlideShow ater a new sheet is createdbooleanremoveShape(HSLFShape shape) Removes the specified shape from this sheet.protected voidSet the SlideShow we're attached to.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
HSLFSheet
-
-
Method Details
-
getTextParagraphs
Returns an array of all the TextRuns in the sheet. -
_getSheetRefId
public int _getSheetRefId()Returns the (internal, RefID based) sheet number, as used to in PersistPtr stuff. -
_getSheetNumber
public int _getSheetNumber()Returns the (internal, SlideIdentifier based) sheet number, as used to reference this sheet from other records. -
getPPDrawing
Fetch the PPDrawing from the underlying record -
getSlideShow
Fetch the SlideShow we're attached to- Specified by:
getSlideShowin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getSheetContainer
Return record container for this sheet -
setSlideShow
Set the SlideShow we're attached to. Also passes it on to our child text paragraphs -
getShapes
Returns all shapes contained in this Sheet- Specified by:
getShapesin interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Returns:
- all shapes contained in this Sheet (Slide or Notes)
-
addShape
Add a new Shape to this Slide- Specified by:
addShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
shape- - the Shape to add
-
allocateShapeId
public int allocateShapeId()Allocates new shape id for the new drawing group id.- Returns:
- a new shape id.
-
removeShape
Removes the specified shape from this sheet.- Specified by:
removeShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
shape- shape to be removed from this sheet, if present.- Returns:
- true if the shape was deleted.
-
onCreate
public void onCreate()Called by SlideShow ater a new sheet is created -
getMasterSheet
Return the master sheet .- Specified by:
getMasterSheetin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getColorScheme
Color scheme for this sheet. -
getBackground
Returns the background shape for this sheet.- Specified by:
getBackgroundin interfaceSheet<HSLFShape,HSLFTextParagraph> - Returns:
- the background shape for this sheet.
-
draw
Description copied from interface:SheetConvenience method to draw a sheet to a graphics context- Specified by:
drawin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
onAddTextShape
Subclasses should call this method and update the array of text runs when a text shape is added- Parameters:
shape-
-
getPlaceholderByTextType
Return placeholder by text type- Parameters:
type- type of text, SeeTextHeaderAtom- Returns:
TextShapeornull
-
getPlaceholder
Search placeholder by its type- Parameters:
type- type of placeholder to search. SeeOEPlaceholderAtom- Returns:
SimpleShapeornull
-
getProgrammableTag
Return programmable tag associated with this sheet, e.g.___PPT12.- Returns:
- programmable tag associated with this sheet.
-
iterator
-
getFollowMasterGraphics
public boolean getFollowMasterGraphics()- Specified by:
getFollowMasterGraphicsin interfaceSheet<HSLFShape,HSLFTextParagraph> - Returns:
- whether shapes on the master sheet should be shown. By default master graphics is turned off. Sheets that support the notion of master (slide, slideLayout) should override it and check this setting
-
createTextBox
Description copied from interface:ShapeContainercreate a text box- Specified by:
createTextBoxin interfaceHSLFShapeContainer- Specified by:
createTextBoxin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
Description copied from interface:ShapeContainercreate a new shape with a predefined geometry and add it to this shape container- Specified by:
createAutoShapein interfaceHSLFShapeContainer- Specified by:
createAutoShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createFreeform
Description copied from interface:ShapeContainercreate a new shape with a custom geometry- Specified by:
createFreeformin interfaceHSLFShapeContainer- Specified by:
createFreeformin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
Description copied from interface:ShapeContainercreate a connector- Specified by:
createConnectorin interfaceHSLFShapeContainer- Specified by:
createConnectorin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
Description copied from interface:ShapeContainercreate a group of shapes belonging to this container- Specified by:
createGroupin interfaceHSLFShapeContainer- Specified by:
createGroupin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createPicture
Description copied from interface:ShapeContainercreate a picture belonging to this container- Specified by:
createPicturein interfaceHSLFShapeContainer- Specified by:
createPicturein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
Description copied from interface:ShapeContainerCreate a new Table of the given number of rows and columns- Specified by:
createTablein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
numRows- the number of rowsnumCols- the number of columns
-
createOleShape
Description copied from interface:ShapeContainerCreate a new OLE object shape with the given pictureData as preview image- Specified by:
createOleShapein interfaceHSLFShapeContainer- Specified by:
createOleShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
pictureData- the preview image
-
getPlaceholderDetails
Description copied from interface:SheetGet the placeholder details for the given placeholder type. Not all placeholders are also shapes - this is especially true for old HSLF slideshows, which notes have header/footers elements which aren't shapes.- Specified by:
getPlaceholderDetailsin interfaceSheet<HSLFShape,HSLFTextParagraph> - Parameters:
placeholder- the placeholder type- Returns:
- the placeholder details or
null, if the placeholder isn't contained in the sheet
-