SlideMaster Class
A slide master in a presentation.
Declaration
public class SlideMaster extends MasterElement
Remarks
A Slide Master (SlideMaster) is a top-level presentation template that defines common content, formatting, layouts, and placeholder settings for slides. Changes made to a slide master are automatically applied to all slides that use layouts associated with that master.
A presentation can contain multiple slide masters. You can create groups of slides with different themes, backgrounds, placeholder arrangements, and shared content within the same presentation.
The following code snippet creates two slide masters. Since every presentation must contain at least one slide master, a newly created presentation initially contains a default slide master. The resetTo(T) method replaces that default master with a new one.
import com.devexpress.docs.presentation.*;
// Create a presentation.
Presentation presentation = new Presentation();
// Create a slide master and replace the default master.
SlideMaster slideMaster1 = new SlideMaster("master");
presentation.getSlideMasters().resetTo(slideMaster1);
// Create and add another slide master.
SlideMaster slideMaster2 = new SlideMaster();
presentation.getSlideMasters().add(slideMaster2);
Refer to the following help topic for additional information: Configure Slide Masters and Layouts.
Warning
A presentation requires at least one slide master. If you attempt to save a presentation where the slide masters collection is empty, the DevExpress Presentation API throws an exception.
Inherited Members
Inheritance
Constructors
SlideMaster() Constructor
Initializes a new instance of the SlideMaster class.
Declaration
public SlideMaster()
SlideMaster(String name) Constructor
Initializes a new instance of the SlideMaster class with specified name.
Declaration
public SlideMaster(String name)
Parameters
| Name | Type | Description |
|---|---|---|
| name | String | The slide master name. |
Methods
deepClone() Method
Clones the current SlideMaster instance.
Declaration
public SlideMaster deepClone()
Returns
| Type | Description |
|---|---|
SlideMaster |
The cloned |
getBodyTextStyle() Method
Returns the body text style of the slide master.
Declaration
public TextStyle getBodyTextStyle()
Returns
| Type | Description |
|---|---|
| TextStyle | The body text style. |
getLayouts() Method
Returns the collection of slide layouts associated with the slide master.
Declaration
public ISlideLayoutCollection getLayouts()
Returns
| Type | Description |
|---|---|
| ISlideLayoutCollection | The collection of slide layouts associated with the slide master. |
Remarks
Use the getLayouts() method to access layouts:
SlideLayout layout1 = new SlideLayout(SlideLayoutType.TITLE);
slideMaster.getLayouts().add(layout1);
Refer to the following help topics for additional information:
getOtherTextStyle() Method
Returns the text style for text elements except for the body text and title text of the slide master.
Declaration
public TextStyle getOtherTextStyle()
Returns
| Type | Description |
|---|---|
| TextStyle | The text style for text elements except body text and title text. |
getTitleTextStyle() Method
Returns the title text style of the slide master.
Declaration
public TextStyle getTitleTextStyle()
Returns
| Type | Description |
|---|---|
| TextStyle | The title text style. |
setBodyTextStyle(TextStyle value) Method
Sets the body text style for the slide master.
Declaration
public void setBodyTextStyle(TextStyle value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextStyle | The body text style. |
setOtherTextStyle(TextStyle value) Method
Sets the text style for text elements except body text and title text of the slide master.
Declaration
public void setOtherTextStyle(TextStyle value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextStyle | The text style for text elements except body text and title text. |
setTitleTextStyle(TextStyle value) Method
Sets the title text style for the slide master.
Declaration
public void setTitleTextStyle(TextStyle value)
Parameters
| Name | Type | Description |
|---|---|---|
| value | TextStyle | The title text style. |