Package org.apache.poi.hslf.usermodel
Class HSLFSheet
- java.lang.Object
-
- org.apache.poi.hslf.usermodel.HSLFSheet
-
- All Implemented Interfaces:
java.lang.Iterable<HSLFShape>,HSLFShapeContainer,ShapeContainer<HSLFShape,HSLFTextParagraph>,Sheet<HSLFShape,HSLFTextParagraph>
- Direct Known Subclasses:
HSLFMasterSheet,HSLFNotes,HSLFSlide
public abstract class HSLFSheet extends java.lang.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
-
-
Constructor Summary
Constructors Constructor Description HSLFSheet(SheetContainer container, int sheetNo)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int_getSheetNumber()Returns the (internal, SlideIdentifier based) sheet number, as used to reference this sheet from other records.int_getSheetRefId()Returns the (internal, RefID based) sheet number, as used to in PersistPtr stuff.voidaddShape(HSLFShape shape)Add a new Shape to this SlideintallocateShapeId()Allocates new shape id for the new drawing group id.HSLFAutoShapecreateAutoShape()create a new shape with a predefined geometry and add it to this shape containerHSLFConnectorShapecreateConnector()create a connectorHSLFFreeformShapecreateFreeform()create a new shape with a custom geometryHSLFGroupShapecreateGroup()create a group of shapes belonging to this containerHSLFObjectShapecreateOleShape(PictureData pictureData)Create a new OLE object shape with the given pictureData as preview imageHSLFPictureShapecreatePicture(PictureData pictureData)create a picture belonging to this containerHSLFTablecreateTable(int numRows, int numCols)Create a new Table of the given number of rows and columnsHSLFTextBoxcreateTextBox()create a text boxvoiddraw(java.awt.Graphics2D graphics)Convenience method to draw a sheet to a graphics contextHSLFBackgroundgetBackground()Returns the background shape for this sheet.ColorSchemeAtomgetColorScheme()Color scheme for this sheet.booleangetFollowMasterGraphics()HeadersFootersgetHeadersFooters()Header / Footer settings for this slide.abstract HSLFMasterSheetgetMasterSheet()Return the master sheet .HSLFSimpleShapegetPlaceholder(Placeholder type)Search placeholder by its typeHSLFTextShapegetPlaceholderByTextType(int type)Return placeholder by text typeHSLFPlaceholderDetailsgetPlaceholderDetails(Placeholder placeholder)Get the placeholder details for the given placeholder type.PPDrawinggetPPDrawing()Fetch the PPDrawing from the underlying recordjava.lang.StringgetProgrammableTag()Return programmable tag associated with this sheet, e.g.java.util.List<HSLFShape>getShapes()Returns all shapes contained in this SheetSheetContainergetSheetContainer()Return record container for this sheetHSLFSlideShowgetSlideShow()Fetch the SlideShow we're attached toabstract java.util.List<java.util.List<HSLFTextParagraph>>getTextParagraphs()Returns an array of all the TextRuns in the sheet.java.util.Iterator<HSLFShape>iterator()voidonCreate()Called by SlideShow ater a new sheet is createdbooleanremoveShape(HSLFShape shape)Removes the specified shape from this sheet.
-
-
-
Constructor Detail
-
HSLFSheet
public HSLFSheet(SheetContainer container, int sheetNo)
-
-
Method Detail
-
getTextParagraphs
public abstract java.util.List<java.util.List<HSLFTextParagraph>> 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
public PPDrawing getPPDrawing()
Fetch the PPDrawing from the underlying record
-
getSlideShow
public HSLFSlideShow getSlideShow()
Fetch the SlideShow we're attached to- Specified by:
getSlideShowin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getSheetContainer
public SheetContainer getSheetContainer()
Return record container for this sheet
-
getShapes
public java.util.List<HSLFShape> 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
public void addShape(HSLFShape shape)
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
public boolean removeShape(HSLFShape shape)
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
public abstract HSLFMasterSheet getMasterSheet()
Return the master sheet .- Specified by:
getMasterSheetin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getColorScheme
public ColorSchemeAtom getColorScheme()
Color scheme for this sheet.
-
getBackground
public HSLFBackground getBackground()
Returns the background shape for this sheet.- Specified by:
getBackgroundin interfaceSheet<HSLFShape,HSLFTextParagraph>- Returns:
- the background shape for this sheet.
-
draw
public void draw(java.awt.Graphics2D graphics)
Description copied from interface:SheetConvenience method to draw a sheet to a graphics context- Specified by:
drawin interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getPlaceholderByTextType
public HSLFTextShape getPlaceholderByTextType(int type)
Return placeholder by text type- Parameters:
type- type of text, SeeTextHeaderAtom- Returns:
TextShapeornull
-
getPlaceholder
public HSLFSimpleShape getPlaceholder(Placeholder type)
Search placeholder by its type- Parameters:
type- type of placeholder to search. SeeOEPlaceholderAtom- Returns:
SimpleShapeornull
-
getProgrammableTag
public java.lang.String getProgrammableTag()
Return programmable tag associated with this sheet, e.g.___PPT12.- Returns:
- programmable tag associated with this sheet.
-
iterator
public java.util.Iterator<HSLFShape> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<HSLFShape>
-
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
public HSLFTextBox createTextBox()
Description copied from interface:ShapeContainercreate a text box- Specified by:
createTextBoxin interfaceHSLFShapeContainer- Specified by:
createTextBoxin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
public HSLFAutoShape 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
public HSLFFreeformShape createFreeform()
Description copied from interface:ShapeContainercreate a new shape with a custom geometry- Specified by:
createFreeformin interfaceHSLFShapeContainer- Specified by:
createFreeformin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
public HSLFConnectorShape createConnector()
Description copied from interface:ShapeContainercreate a connector- Specified by:
createConnectorin interfaceHSLFShapeContainer- Specified by:
createConnectorin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
public HSLFGroupShape 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
public HSLFPictureShape createPicture(PictureData pictureData)
Description copied from interface:ShapeContainercreate a picture belonging to this container- Specified by:
createPicturein interfaceHSLFShapeContainer- Specified by:
createPicturein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
public HSLFTable createTable(int numRows, int numCols)
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
public HSLFObjectShape createOleShape(PictureData pictureData)
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
-
getHeadersFooters
public HeadersFooters getHeadersFooters()
Header / Footer settings for this slide.- Returns:
- Header / Footer settings for this slide
-
getPlaceholderDetails
public HSLFPlaceholderDetails getPlaceholderDetails(Placeholder placeholder)
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
-
-