org.odftoolkit.simple.presentation
public class Slide extends Component implements ListContainer, TableContainer, TextboxContainer, ChartContainer
Slide
represents the presentation slide feature of the ODF
document. Slide
provides methods to get the slide index,get the
content of the current slide, etc.Modifier and Type | Class and Description |
---|---|
static class |
Slide.SlideBuilder
This is a tool class which supplies all of the slide creation detail.
|
static class |
Slide.SlideLayout
A slide layout is a slide with some predefine place holder.
|
Modifier and Type | Method and Description |
---|---|
List |
addList()
Add a new List to this container.
|
List |
addList(ListDecorator decorator)
Add a List with specified ListDecorator to this container.
|
Table |
addTable()
Add a new Table to this container.
|
Table |
addTable(int numRows,
int numCols)
Add a new Table to this container with a specified row number and column
number.
|
Textbox |
addTextbox()
Add a text box
|
Textbox |
addTextbox(FrameRectangle position)
Add a text box with a specific size at a specific position
|
void |
clearList()
Remove all Lists from this container.
|
Chart |
createChart(String title,
DataSet dataset,
Rectangle rect)
Creates a new Chart for this container.
|
Chart |
createChart(String title,
SpreadsheetDocument document,
CellRangeAddressList cellRangeAddr,
boolean firstRowAsLabel,
boolean firstColumnAsLabel,
boolean rowAsDataSeries,
Rectangle rect)
Creates a new Chart for this container.
|
Chart |
createChart(String title,
String[] labels,
String[] legends,
double[][] data,
Rectangle rect)
Creates a new Chart for this container.
|
void |
deleteChartById(String chartId)
Deletes chart by chart id.
|
void |
deleteChartByTitle(String title)
Deletes chart(s) by chart title.
|
Chart |
getChartById(String chartId)
Gets chart with specified id.
|
List<Chart> |
getChartByTitle(String title)
Gets chart list with specified title.
|
int |
getChartCount()
Returns the chart count of this container
|
OdfElement |
getFrameContainerElement()
Get the ODF element which can have
|
static Slide |
getInstance(DrawPageElement pageElement)
Get a presentation slide instance by an instance of
DrawPageElement . |
OdfElement |
getListContainerElement()
Get the ODF element which can have
|
Iterator<List> |
getListIterator()
Return an Iterator of the Lists in this ListContainer.
|
Notes |
getNotesPage()
Get the Notes page of this slide
|
DrawPageElement |
getOdfElement()
Return an instance of
DrawPageElement which represents
presentation slide feature. |
int |
getSlideIndex()
Get the current slide index in the owner document.
|
String |
getSlideName()
Get the current slide name.
|
Table.TableBuilder |
getTableBuilder()
Return the table builder of this document.
|
Table |
getTableByName(String name)
Return an instance of table feature with the specific table name.
|
OdfElement |
getTableContainerElement()
Get the ODF element which can have
|
protected TableContainer |
getTableContainerImpl() |
List<Table> |
getTableList()
Return a list of table features in this document.
|
Textbox |
getTextboxByName(String name)
Return a text box whose name is a given value.
|
List<Textbox> |
getTextboxByUsage(PresentationDocument.PresentationClass usage)
This method is only useful in presentation slide.
|
Iterator<Textbox> |
getTextboxIterator()
Return an Iterator of the text objects in this container.
|
boolean |
removeList(List list)
Remove the existing List from this container.
|
boolean |
removeTextbox(Textbox box)
Remove the text box
|
void |
setSlideName(String name)
Set the current slide name.
|
getComponentByElement, getOwnerDocument, registerComponent, unregisterComponent
public static Slide getInstance(DrawPageElement pageElement)
DrawPageElement
.pageElement
- an instance of DrawPageElement
Slide
that can represent
pageElement
public DrawPageElement getOdfElement()
DrawPageElement
which represents
presentation slide feature.getOdfElement
in class Component
DrawPageElement
public int getSlideIndex()
-1, if the odf element which can represent this slide is not in the document DOM tree
public String getSlideName()
If the "draw:name" attribute is not present there, create an unique name for this slide
public void setSlideName(String name)
It must be unique slide name in the current presentation. If not, an IllegalArgumentException will be thrown. If the given name is null, an IllegalArgumentException will also be thrown.
name
- the new name of the current slideIllegalArgumentException
- if the given name is null or it is not unique in the current
presentation.public Notes getNotesPage()
Notes
which represent the notes page
of the current slidepublic OdfElement getListContainerElement()
ListContainer
getListContainerElement
in interface ListContainer
public List addList()
ListContainer
addList
in interface ListContainer
public List addList(ListDecorator decorator)
ListContainer
addList
in interface ListContainer
decorator
- the specified ListDecoratorpublic void clearList()
ListContainer
clearList
in interface ListContainer
public Iterator<List> getListIterator()
ListContainer
getListIterator
in interface ListContainer
Iterator
public boolean removeList(List list)
ListContainer
removeList
in interface ListContainer
public Table addTable()
TableContainer
addTable
in interface TableContainer
public Table addTable(int numRows, int numCols)
TableContainer
The table will be inserted at the end of the tableContainer. An unique
table name will be given, you may set a custom table name using the
setTableName
method.
addTable
in interface TableContainer
numRows
- the row numbernumCols
- the column numberTable
public Table getTableByName(String name)
TableContainer
getTableByName
in interface TableContainer
name
- of the table being searched for.public List<Table> getTableList()
TableContainer
getTableList
in interface TableContainer
public Table.TableBuilder getTableBuilder()
TableContainer
getTableBuilder
in interface TableContainer
public OdfElement getTableContainerElement()
TableContainer
getTableContainerElement
in interface TableContainer
protected TableContainer getTableContainerImpl()
public Textbox addTextbox()
TextboxContainer
addTextbox
in interface TextboxContainer
public Iterator<Textbox> getTextboxIterator()
TextboxContainer
getTextboxIterator
in interface TextboxContainer
public boolean removeTextbox(Textbox box)
TextboxContainer
removeTextbox
in interface TextboxContainer
box
- - the instance of text boxpublic OdfElement getFrameContainerElement()
FrameContainer
getFrameContainerElement
in interface FrameContainer
public Textbox addTextbox(FrameRectangle position)
TextboxContainer
addTextbox
in interface TextboxContainer
position
- - the rectangle (position and size) of this text boxpublic Textbox getTextboxByName(String name)
TextboxContainer
getTextboxByName
in interface TextboxContainer
name
- - the name of the text boxpublic List<Textbox> getTextboxByUsage(PresentationDocument.PresentationClass usage)
TextboxContainer
This method will return a list of text boxs by the usage in presentation slides.
getTextboxByUsage
in interface TextboxContainer
usage
- - the usage descriptionpublic Chart createChart(String title, DataSet dataset, Rectangle rect)
ChartContainer
createChart
in interface ChartContainer
title
- chart title.dataset
- chart data set.rect
- chart rectangle.public Chart createChart(String title, SpreadsheetDocument document, CellRangeAddressList cellRangeAddr, boolean firstRowAsLabel, boolean firstColumnAsLabel, boolean rowAsDataSeries, Rectangle rect)
ChartContainer
createChart
in interface ChartContainer
title
- chart title.document
- the data source spreadsheet document.cellRangeAddr
- the cell range address list which is used as chart data set.firstRowAsLabel
- whether uses first row as label.firstColumnAsLabel
- whether uses first column as label.rowAsDataSeries
- whether uses data as series.rect
- chart rectangle.public Chart createChart(String title, String[] labels, String[] legends, double[][] data, Rectangle rect)
ChartContainer
createChart
in interface ChartContainer
title
- chart rectangle.labels
- label stringslegends
- legend stringsdata
- chart data set.rect
- chart rectangle.public void deleteChartById(String chartId)
ChartContainer
deleteChartById
in interface ChartContainer
chartId
- the id of specified chart.public void deleteChartByTitle(String title)
ChartContainer
deleteChartByTitle
in interface ChartContainer
title
- the title of specified chart(s).public Chart getChartById(String chartId)
ChartContainer
getChartById
in interface ChartContainer
chartId
- the id of this chart.public List<Chart> getChartByTitle(String title)
ChartContainer
getChartByTitle
in interface ChartContainer
title
- the title of specified chart(s).public int getChartCount()
ChartContainer
getChartCount
in interface ChartContainer
Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.