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
-
-
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.void
addShape(HSLFShape shape)
Add a new Shape to this Slideint
allocateShapeId()
Allocates new shape id for the new drawing group id.HSLFAutoShape
createAutoShape()
HSLFConnectorShape
createConnector()
HSLFFreeformShape
createFreeform()
HSLFGroupShape
createGroup()
HSLFObjectShape
createOleShape(PictureData pictureData)
HSLFPictureShape
createPicture(PictureData pictureData)
HSLFTable
createTable(int numRows, int numCols)
HSLFTextBox
createTextBox()
void
draw(Graphics2D graphics)
HSLFBackground
getBackground()
Returns the background shape for this sheet.ColorSchemeAtom
getColorScheme()
Color scheme for this sheet.boolean
getFollowMasterGraphics()
HeadersFooters
getHeadersFooters()
Header / Footer settings for this slide.abstract HSLFMasterSheet
getMasterSheet()
Return the master sheet .HSLFSimpleShape
getPlaceholder(Placeholder type)
Search placeholder by its typeHSLFTextShape
getPlaceholderByTextType(int type)
Return placeholder by text typeHSLFPlaceholderDetails
getPlaceholderDetails(Placeholder placeholder)
PPDrawing
getPPDrawing()
Fetch the PPDrawing from the underlying recordString
getProgrammableTag()
Return programmable tag associated with this sheet, e.g.List<HSLFShape>
getShapes()
Returns all shapes contained in this SheetSheetContainer
getSheetContainer()
Return record container for this sheetHSLFSlideShow
getSlideShow()
Fetch the SlideShow we're attached toabstract List<List<HSLFTextParagraph>>
getTextParagraphs()
Returns an array of all the TextRuns in the sheet.Iterator<HSLFShape>
iterator()
protected void
onAddTextShape(HSLFTextShape shape)
Subclasses should call this method and update the array of text runs when a text shape is addedvoid
onCreate()
Called by SlideShow ater a new sheet is createdboolean
removeShape(HSLFShape shape)
Removes the specified shape from this sheet.protected void
setSlideShow(HSLFSlideShow ss)
Set the SlideShow we're attached to.Spliterator<HSLFShape>
spliterator()
-
-
-
Constructor Detail
-
HSLFSheet
public HSLFSheet(SheetContainer container, int sheetNo)
-
-
Method Detail
-
getTextParagraphs
public abstract List<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:
getSlideShow
in interfaceSheet<HSLFShape,HSLFTextParagraph>
-
getSheetContainer
public SheetContainer getSheetContainer()
Return record container for this sheet
-
setSlideShow
@Internal protected void setSlideShow(HSLFSlideShow ss)
Set the SlideShow we're attached to. Also passes it on to our child text paragraphs
-
getShapes
public List<HSLFShape> getShapes()
Returns all shapes contained in this Sheet- Specified by:
getShapes
in 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:
addShape
in 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:
removeShape
in 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:
getMasterSheet
in 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:
getBackground
in interfaceSheet<HSLFShape,HSLFTextParagraph>
- Returns:
- the background shape for this sheet.
-
draw
public void draw(Graphics2D graphics)
- Specified by:
draw
in interfaceSheet<HSLFShape,HSLFTextParagraph>
-
onAddTextShape
protected void onAddTextShape(HSLFTextShape shape)
Subclasses should call this method and update the array of text runs when a text shape is added
-
getPlaceholderByTextType
public HSLFTextShape getPlaceholderByTextType(int type)
Return placeholder by text type- Parameters:
type
- type of text, SeeTextHeaderAtom
- Returns:
TextShape
ornull
-
getPlaceholder
public HSLFSimpleShape getPlaceholder(Placeholder type)
Search placeholder by its type- Parameters:
type
- type of placeholder to search. SeeOEPlaceholderAtom
- Returns:
SimpleShape
ornull
-
getProgrammableTag
public String getProgrammableTag()
Return programmable tag associated with this sheet, e.g.___PPT12
.- Returns:
- programmable tag associated with this sheet.
-
spliterator
public Spliterator<HSLFShape> spliterator()
- Specified by:
spliterator
in interfaceIterable<HSLFShape>
- Since:
- POI 5.2.0
-
getFollowMasterGraphics
public boolean getFollowMasterGraphics()
- Specified by:
getFollowMasterGraphics
in 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()
- Specified by:
createTextBox
in interfaceHSLFShapeContainer
- Specified by:
createTextBox
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
public HSLFAutoShape createAutoShape()
- Specified by:
createAutoShape
in interfaceHSLFShapeContainer
- Specified by:
createAutoShape
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createFreeform
public HSLFFreeformShape createFreeform()
- Specified by:
createFreeform
in interfaceHSLFShapeContainer
- Specified by:
createFreeform
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
public HSLFConnectorShape createConnector()
- Specified by:
createConnector
in interfaceHSLFShapeContainer
- Specified by:
createConnector
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
public HSLFGroupShape createGroup()
- Specified by:
createGroup
in interfaceHSLFShapeContainer
- Specified by:
createGroup
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createPicture
public HSLFPictureShape createPicture(PictureData pictureData)
- Specified by:
createPicture
in interfaceHSLFShapeContainer
- Specified by:
createPicture
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
public HSLFTable createTable(int numRows, int numCols)
- Specified by:
createTable
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createOleShape
public HSLFObjectShape createOleShape(PictureData pictureData)
- Specified by:
createOleShape
in interfaceHSLFShapeContainer
- Specified by:
createOleShape
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
getHeadersFooters
public HeadersFooters getHeadersFooters()
Header / Footer settings for this slide.- Returns:
- Header / Footer settings for this slide
-
getPlaceholderDetails
public HSLFPlaceholderDetails getPlaceholderDetails(Placeholder placeholder)
- Specified by:
getPlaceholderDetails
in interfaceSheet<HSLFShape,HSLFTextParagraph>
-
-