FileDocCategorySizeDatePackage
SlideMaster.javaAPI DocApache Poi 3.0.14383Thu May 31 18:45:28 BST 2007org.apache.poi.hslf.model

SlideMaster

public class SlideMaster extends MasterSheet
SlideMaster determines the graphics, layout, and formatting for all the slides in a given presentation. It stores information about default font styles, placeholder sizes and positions, background design, and color schemes.
author
Yegor Kozlov

Fields Summary
private TextRun[]
_runs
private TxMasterStyleAtom[]
_txmaster
all TxMasterStyleAtoms available in this master
Constructors Summary
public SlideMaster(MainMaster record, int sheetNo)
Constructs a SlideMaster from the MainMaster record,

        super(record, sheetNo);

        _runs = findTextRuns(getPPDrawing());
        for (int i = 0; i < _runs.length; i++) _runs[i].setSheet(this);
    
Methods Summary
public org.apache.poi.hslf.model.MasterSheetgetMasterSheet()
Returns null since SlideMasters doen't have master sheet.

        return null;
    
public org.apache.poi.hslf.model.textproperties.TextPropgetStyleAttribute(int txtype, int level, java.lang.String name, boolean isCharacter)
Pickup a style attribute from the master. This is the "workhorse" which returns the default style attrubutes.


        TextProp prop = null;
        for (int i = level; i >= 0; i--) {
            TextPropCollection[] styles =
                    isCharacter ? _txmaster[txtype].getCharacterStyles() : _txmaster[txtype].getParagraphStyles();
            if (i < styles.length) prop = styles[i].findByName(name);
            if (prop != null) break;
        }
        if (prop == null) {
            switch (txtype) {
                case TextHeaderAtom.CENTRE_BODY_TYPE:
                case TextHeaderAtom.HALF_BODY_TYPE:
                case TextHeaderAtom.QUARTER_BODY_TYPE:
                    txtype = TextHeaderAtom.BODY_TYPE;
                    break;
                case TextHeaderAtom.CENTER_TITLE_TYPE:
                    txtype = TextHeaderAtom.TITLE_TYPE;
                    break;
                default:
                    return null;
            }
            prop = getStyleAttribute(txtype, level, name, isCharacter);
        }
        return prop;
    
public org.apache.poi.hslf.model.TextRun[]getTextRuns()
Returns an array of all the TextRuns found

        return _runs;
    
public voidsetSlideShow(org.apache.poi.hslf.usermodel.SlideShow ss)
Assign SlideShow for this slide master. (Used interanlly)

        super.setSlideShow(ss);

        //after the slide show is assigned collect all available style records
        if (_txmaster == null) {
            _txmaster = new TxMasterStyleAtom[9];

            TxMasterStyleAtom txdoc = getSlideShow().getDocumentRecord().getEnvironment().getTxMasterStyleAtom();
            _txmaster[txdoc.getTextType()] = txdoc;

            TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).getTxMasterStyleAtoms();
            for (int i = 0; i < txrec.length; i++) {
                _txmaster[txrec[i].getTextType()] = txrec[i];
            }
        }