|
||
In PowerPoint, presentations contain slides (including master slides, master notes, and individual content slides and notes). In turn, each slide contains various elements that make up the content of that slide (including shapes and groups of shapes).

You access a slide from within its presentation, just as you access a text shape, picture or group on a particular slide. In this way, a slide is a child of a presentation and a parent of a shape or element. The following diagram represents this hierarchy of elements:
The Hierarchy of Elements in a Presentation
This hierarchy of elements is also reflected in the way you work with the library.
Each PowerPoint object has methods to access its parent object and its children objects,
usually by name. For example the Slide class has these methods:
Presentation getPresentation() List getShapes() Notes getNotes()
The main way to work with an element (e.g. a slide, shape or group) is to access it step-by-step through its hierarchy within the presentation. In addition if you are adding new objects, they need to be pasted into their parent.
PowerPoint elements also have associated elements. For example a slide has an associated slide master. There are usually convenience methods provided in each class to access associated elements.
As you work with elements and traverse from one element to another, it is important to keep in mind each element's place in the hierarchy, particularly when creating new elements.
In the library, PowerPoint objects are created, removed or copied using a 'clipboard' paradigm. This concept is used throughout the library.
First, an object is cut or copied onto a clipboard and then it is pasted from the clipboard into its desired location. Objects are always pasted via the clipboard.
An object can only be pasted into valid places within the presentation hierarchy - that is, child objects can only be pasted into their parent objects. When an object is cut, copied or pasted it will always include all of its children.
For example, a slide can only be pasted into a presentation (its parent) and when pasted will include all the shapes (the children) on it.
In instances where an object has only one child (e.g. a presentation only ever has one title master) then pasting a new child object will replace the existing one. For example, pasting a new title master into a slide master will replace the existing title master.
Where an object has more than one child, then pasting a new child will add it to the end of the current children. For example, when pasting a new slide into a presentation, it will become the new last slide.
You may paste an object from a clipboard more than once.
If an object has been cut or copied, it is in a detached state and cannot be edited until it has been pasted.
For example, if you cut a slide onto the clipboard, then that slide is in a detached state and cannot be used. But when the slide is pasted from the clipboard it becomes a new slide object, and represents a new slide within the presentation.
Once pasted within the presentation, the slide can now be edited.
The Clipboard class only contains a single method, which can be used to determine the type of object that is stored on the clipboard:
java.lang.Class getType()
|
||
| Page generated: 2008-01-18 02:53:28 GMT | TonicPoint Builder Developer's Guide -- Version 2.3 |