Update git submodules
[LibreOffice.git] / reportbuilder / java / org / libreoffice / report / pentaho / model / OfficeMasterStyles.java
blobbe42e98620e4eb192d2635505f9ce2c3e1e94f09
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 package org.libreoffice.report.pentaho.model;
20 import java.util.HashMap;
21 import java.util.Map;
23 import org.jfree.report.structure.Element;
24 import org.jfree.report.structure.Section;
27 /**
28 * The master-styles section can have either a master-page, handout-master
29 * or draw-layer-set. (The latter ones are ignored for the reporting purposes,
30 * they are PowerPoint related.)
32 * There is no documentation how the system selects a master-page if there is
33 * no master-page assigned to the paragraph. However, it seems as if the
34 * master-page called 'Standard' is used as initial default.
36 * @since 13.03.2007
38 public class OfficeMasterStyles extends Element
41 private final Map<String,OfficeMasterPage> masterPages;
42 private final Section otherNodes;
44 public OfficeMasterStyles()
46 masterPages = new HashMap<String,OfficeMasterPage>();
47 otherNodes = new Section();
50 public void addMasterPage(final OfficeMasterPage masterPage)
52 if (masterPage == null)
54 throw new NullPointerException();
56 this.masterPages.put(masterPage.getStyleName(), masterPage);
59 public OfficeMasterPage getMasterPage(final String name)
61 return masterPages.get(name);
64 public OfficeMasterPage[] getAllMasterPages()
66 return masterPages.values().toArray(new OfficeMasterPage[masterPages.size()]);
69 public Section getOtherNodes()
71 return otherNodes;