コード例 #1
0
 public MasterPage getMasterPage(String sName) {
   return (MasterPage) masterPage.getStyle(sName);
 }
コード例 #2
0
 private void loadStylesFromDOM(Node node, boolean bAllParagraphsAreSoft) {
   // node should be office:master-styles, office:styles or office:automatic-styles
   boolean bAutomatic = XMLString.OFFICE_AUTOMATIC_STYLES.equals(node.getNodeName());
   if (node.hasChildNodes()) {
     NodeList nl = node.getChildNodes();
     int nLen = nl.getLength();
     for (int i = 0; i < nLen; i++) {
       Node child = nl.item(i);
       if (child.getNodeType() == Node.ELEMENT_NODE) {
         if (child.getNodeName().equals(XMLString.STYLE_STYLE)) {
           String sFamily = Misc.getAttribute(child, XMLString.STYLE_FAMILY);
           if ("text".equals(sFamily)) {
             text.loadStyleFromDOM(child, bAutomatic);
           } else if ("paragraph".equals(sFamily)) {
             par.loadStyleFromDOM(child, bAutomatic && !bAllParagraphsAreSoft);
           } else if ("section".equals(sFamily)) {
             section.loadStyleFromDOM(child, bAutomatic);
           } else if ("table".equals(sFamily)) {
             table.loadStyleFromDOM(child, bAutomatic);
           } else if ("table-column".equals(sFamily)) {
             column.loadStyleFromDOM(child, bAutomatic);
           } else if ("table-row".equals(sFamily)) {
             row.loadStyleFromDOM(child, bAutomatic);
           } else if ("table-cell".equals(sFamily)) {
             cell.loadStyleFromDOM(child, bAutomatic);
           } else if ("graphics".equals(sFamily)) {
             frame.loadStyleFromDOM(child, bAutomatic);
           } else if ("graphic".equals(sFamily)) { // oasis
             frame.loadStyleFromDOM(child, bAutomatic);
           } else if ("presentation".equals(sFamily)) {
             presentation.loadStyleFromDOM(child, bAutomatic);
           } else if ("drawing-page".equals(sFamily)) {
             // Bug in OOo 1.x: The same name may be used for a real and an automatic style...
             if (drawingPage.getStyle(Misc.getAttribute(child, XMLString.STYLE_NAME)) == null) {
               drawingPage.loadStyleFromDOM(child, bAutomatic);
             }
           }
         } else if (child.getNodeName().equals(XMLString.STYLE_PAGE_MASTER)) { // old
           pageLayout.loadStyleFromDOM(child, bAutomatic);
         } else if (child.getNodeName().equals(XMLString.STYLE_PAGE_LAYOUT)) { // oasis
           pageLayout.loadStyleFromDOM(child, bAutomatic);
         } else if (child.getNodeName().equals(XMLString.STYLE_MASTER_PAGE)) {
           masterPage.loadStyleFromDOM(child, bAutomatic);
           if (firstMasterPage == null) {
             firstMasterPage =
                 (MasterPage) masterPage.getStyle(Misc.getAttribute(child, XMLString.STYLE_NAME));
           }
         } else if (child.getNodeName().equals(XMLString.TEXT_LIST_STYLE)) {
           list.loadStyleFromDOM(child, bAutomatic);
         } else if (child.getNodeName().equals(XMLString.TEXT_OUTLINE_STYLE)) {
           outline.loadStyleFromDOM(child);
         } else if (child.getNodeName().equals(XMLString.STYLE_DEFAULT_STYLE)) {
           String sFamily = Misc.getAttribute(child, XMLString.STYLE_FAMILY);
           if ("paragraph".equals(sFamily)) {
             StyleWithProperties defaultPar = new StyleWithProperties();
             defaultPar.loadStyleFromDOM(child);
             par.setDefaultStyle(defaultPar);
           } else if ("graphics".equals(sFamily) || "graphic".equals(sFamily)) { // oasis: no s
             StyleWithProperties defaultFrame = new StyleWithProperties();
             defaultFrame.loadStyleFromDOM(child);
             frame.setDefaultStyle(defaultFrame);
           } else if ("table-cell".equals(sFamily)) {
             StyleWithProperties defaultCell = new StyleWithProperties();
             defaultCell.loadStyleFromDOM(child);
             cell.setDefaultStyle(defaultCell);
           }
         }
       }
     }
   }
 }
コード例 #3
0
 public ListStyle getListStyle(String sName) {
   return (ListStyle) list.getStyle(sName);
 }
コード例 #4
0
 public PageLayout getPageLayout(String sName) {
   return (PageLayout) pageLayout.getStyle(sName);
 }
コード例 #5
0
 public StyleWithProperties getPresentationStyle(String sName) {
   return (StyleWithProperties) presentation.getStyle(sName);
 }
コード例 #6
0
 public StyleWithProperties getDrawingPageStyle(String sName) {
   return (StyleWithProperties) drawingPage.getStyle(sName);
 }
コード例 #7
0
 public StyleWithProperties getCellStyle(String sName) {
   return (StyleWithProperties) cell.getStyle(sName);
 }
コード例 #8
0
 public StyleWithProperties getFrameStyle(String sName) {
   return (StyleWithProperties) frame.getStyle(sName);
 }
コード例 #9
0
 public StyleWithProperties getColumnStyle(String sName) {
   return (StyleWithProperties) column.getStyle(sName);
 }
コード例 #10
0
 public StyleWithProperties getRowStyle(String sName) {
   return (StyleWithProperties) row.getStyle(sName);
 }
コード例 #11
0
 public StyleWithProperties getTableStyle(String sName) {
   return (StyleWithProperties) table.getStyle(sName);
 }
コード例 #12
0
 public StyleWithProperties getSectionStyle(String sName) {
   return (StyleWithProperties) section.getStyle(sName);
 }
コード例 #13
0
 public StyleWithProperties getParStyle(String sName) {
   return (StyleWithProperties) par.getStyle(sName);
 }
コード例 #14
0
 public StyleWithProperties getTextStyle(String sName) {
   return (StyleWithProperties) text.getStyle(sName);
 }
コード例 #15
0
 /**
  * Get a specific font declaration
  *
  * @param sName the name of the font declaration
  * @return a <code>FontDeclaration</code> representing the font
  */
 public FontDeclaration getFontDeclaration(String sName) {
   return (FontDeclaration) font.getStyle(sName);
 }