Key Features of Pages

The Page superclass provides for features common to all pages, including:

Placeholders

PowerPoint uses placeholders to guide where text and other elements are placed on a page. The most common types of placeholders are the title placeholder (where text for the title of a page is placed) and the body placeholder (where the body text for the page is placed). There are also placeholders for headers, footers and other elements that can be placed on a slide (e.g. pictures, charts).

A placeholder only allows a specific type of content to be placed within it. All pages (slides, master slides, notes, handouts etc) have layouts that specify where placeholders are positioned and what type of content they contain. Placeholders provide a guide only and can be manually deleted from a page.

Unlike other shapes, placeholders cannot be grouped and therefore are always direct children of the page on which they appear

If a placeholder is empty, it displays instructional text to prompt the user to add specific content, e.g. 'Click to add title'. Additionally, the text within title and body placeholders is displayed in the presentation's Outline View.

Given the specific position and role of placeholders on a page (as opposed to the more general text shapes, which we will cover later), you need to use specific methods when working with placeholders.

General Methods for Working with Placeholders

To add a placeholder of a specific type (e.g. title or body) onto a page use:

Placeholder addPlaceholder(int placeholderType)

The placeholder will be placed in its preset position on the page, depending on the type of placeholder you specified and the type of page (master slide, title slide, standard slide etc) on which it is placed. You may only add valid placeholders to the page. The set of valid placeholders for each type of page is as follows:

Page Type

Placeholders

Slide Master

Placeholder.MASTER_TITLE, Placeholder.MASTER_BODY, Placeholder.MASTER_DATE, Placeholder.MASTER_FOOTER, Placeholder.MASTER_SLIDE_NUMBER

Title Master

Placeholder.MASTER_CENTERED_TITLE, Placeholder.MASTER_SUBTITLE, Placeholder.MASTER_DATE, Placeholder.MASTER_FOOTER, Placeholder.MASTER_SLIDE_NUMBER

Notes Master

Placeholder.MASTER_HEADER, Placeholder.MASTER_DATE, Placeholder.MASTER_NOTES_SLIDE_IMAGE, Placeholder.MASTER_NOTES_BODY, Placeholder.MASTER_FOOTER, Placeholder.MASTER_SLIDE_NUMBER

Handout Master

Placeholder.MASTER_HEADER, Placeholder.MASTER_DATE, Placeholder.MASTER_FOOTER, Placeholder.MASTER_SLIDE_NUMBER

Notes

Placeholder.NOTES_SLIDE_IMAGE, Placeholder.NOTES_BODY.

Slide

[none - the placeholders are defined by the slide layout]

To get a reference to a placeholder (e.g. title or body) on a specific page use:

Placeholder getPlaceholder(int placeholderType)

Note that placeholders have different types depending on the type of page they appear on. To get a placeholder from a specific page, you need to know what type of placeholder it is. The different types of placeholders on specific types of pages are generally listed in the table above. The placeholders on a slide depend on the layout selected for the slide. Alternatively, you can use the convenience methods below to quickly access body and title placeholders.

Convenience Methods for Working with Placeholders

Title and body placeholders are the most common types of placeholders. Given this, there are two convenience methods for working with these elements.

These methods are particularly handy because you are able to get the correct title or body placeholder for a particular page regardless of whether that placeholder is on a master slide, title slide or a standard slide (and therefore actually has different placeholder types).

To get a body placeholder use:

Placeholder getBody()

To get a title placeholder use:

Placeholder getTitle()

Backgrounds

All pages have backgrounds. The background of a page is a shape of a specific size (which corresponds with the dimensions of the slide). To ensure the continuity of the background, the background shape cannot be resized, copied or moved but can otherwise be changed or customised for a specific page.

To get the background of a page use:

Background getBackground()

See Background Shape (Background class) in the Working with Shapes chapter later in this Guide for more about the background shape.

Color Schemes

In PowerPoint, colors can be specified directly or as part of a color scheme. When a color is specified as part of a color scheme, the actual color used is defined by the corresponding color in the color scheme palette. For instance, we may set the color of a line to be the 'fill color'. We can then set the color scheme fill color to be yellow, and the line will appear yellow. If the color scheme is changed, all elements using that scheme color will change accordingly.

To change the color scheme used on a page, you need to change its various color scheme settings.

To get the color scheme in order to edit its settings use:

ColorScheme getColorScheme()

Once you have got the color scheme, you can use the following methods in the ColorScheme class to access and change the color settings.

To get a specific color use:

PPColor getColor(int index) [ColorScheme]

To set a new color in the color scheme use:

void setColor(int index, java.awt.Color color) [ColorScheme]

The index used defines the element of interest in the color scheme. The constants to be used for the indexes (e.g. FILLS, SHADOWS, BACKGROUND, etc) are listed in the ColorScheme class of the API documentation. In addition, see the Working with Colors chapter later in this Guide for more about the PPColor class.

Names

Every page has a name. However, the page name is only relevant when working with Visual Basic. Names are not used or accessed in the actual PowerPoint product.

To get the page name use:

java.lang.String getName()

To set a page name use:

void setName(java.lang.String name)

Page generated: 2008-01-18 02:53:28 GMT TonicPoint Builder Developer's Guide -- Version 2.3