org.odftoolkit.simple.presentation
Class Slide

java.lang.Object
  extended by org.odftoolkit.simple.presentation.Slide
All Implemented Interfaces:
ListContainer

public class Slide
extends Object
implements ListContainer

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.


Nested Class Summary
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 placeholder.
 
Method Summary
 List addList()
          Add a new List to this container.
 List addList(ListDecorator decorator)
          Add a List with specified ListDecorator to this container.
 void clearList()
          Remove all Lists from this container.
static Slide getInstance(DrawPageElement pageElement)
          Get a presentation slide instance by an instance of DrawPageElement.
 OdfElement getListContainerElement()
          Get the ODF element which can have as child element directly according to ODF specification.
 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.
 boolean removeList(List list)
          Remove the existing List from this container.
 void setSlideName(String name)
          Set the current slide name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Slide getInstance(DrawPageElement pageElement)
Get a presentation slide instance by an instance of DrawPageElement.

Parameters:
pageElement - an instance of DrawPageElement
Returns:
an instance of Slide that can represent pageElement

getOdfElement

public DrawPageElement getOdfElement()
Return an instance of DrawPageElement which represents presentation slide feature.

Returns:
an instance of DrawPageElement

getSlideIndex

public int getSlideIndex()
Get the current slide index in the owner document.

Returns:
the slide index in the owner document

-1, if the odf element which can represent this slide is not in the document DOM tree


getSlideName

public String getSlideName()
Get the current slide name.

If the "draw:name" attribute is not present there, create an unique name for this slide

Returns:
the name of the current slide

setSlideName

public void setSlideName(String name)
Set the current slide 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.

Parameters:
name - the new name of the current slide
Throws:
IllegalArgumentException - if the given name is null or it is not unique in the current presentation.

getNotesPage

public Notes getNotesPage()
Get the Notes page of this slide

Returns:
the instance of Notes which represent the notes page of the current slide

getListContainerElement

public OdfElement getListContainerElement()
Description copied from interface: ListContainer
Get the ODF element which can have as child element directly according to ODF specification. This Element will help to find the position to insert a new List. For example, element is usable with element, so TextDocument will return OfficeTextElement. While Presentation Notes is an indirectly ListContainer, which holds List with the help of its grand-child element , so for Notes, DrawTextBoxElement should be return.

Specified by:
getListContainerElement in interface ListContainer
Returns:
container element which can hold .

addList

public List addList()
Description copied from interface: ListContainer
Add a new List to this container.

Specified by:
addList in interface ListContainer
Returns:
added list.

addList

public List addList(ListDecorator decorator)
Description copied from interface: ListContainer
Add a List with specified ListDecorator to this container.

Specified by:
addList in interface ListContainer
Parameters:
decorator - the specified ListDecorator
Returns:
added list.

clearList

public void clearList()
Description copied from interface: ListContainer
Remove all Lists from this container.

Specified by:
clearList in interface ListContainer

getListIterator

public Iterator<List> getListIterator()
Description copied from interface: ListContainer
Return an Iterator of the Lists in this ListContainer. The Lists are iterated in the same order that they occur in the ListContainer.

Specified by:
getListIterator in interface ListContainer
Returns:
an Iterator of the Lists in this ListContainer
See Also:
Iterator

removeList

public boolean removeList(List list)
Description copied from interface: ListContainer
Remove the existing List from this container.

Specified by:
removeList in interface ListContainer
Returns:
true, if the container contains this List.


Copyright © 2010-2011 ODF Toolkit Project. All Rights Reserved.