Package org.odftoolkit.odfdom.dom.element.style

Examples of org.odftoolkit.odfdom.dom.element.style.StylePageLayoutPropertiesElement


            }
          }
          autoStyles.appendChild(pageLayoutNew);
        }
        NodeList vListStlePageLprop = pageLayout.getElementsByTagName("style:page-layout-properties");
        StylePageLayoutPropertiesElement vStlePageLprop = (StylePageLayoutPropertiesElement) vListStlePageLprop.item(0);
        StyleColumnsElement vStyleColumnsElement = vStlePageLprop.newStyleColumnsElement(columnsNumber);
        vStyleColumnsElement.setFoColumnGapAttribute(vSpacingColumn);
      }
    } catch (Exception e) {
      Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE, null, e);
      throw new RuntimeException("Page column sets failed.", e);
View Full Code Here


    OdfStylePageLayout pageLayout = master.getAutomaticStyles()
        .getPageLayout(pageLayoutName);
    Assert.assertNotNull(pageLayout);

    // check page layout properties
    StylePageLayoutPropertiesElement properties = (StylePageLayoutPropertiesElement) pageLayout
        .getPropertiesElement(OdfStylePropertiesSet.PageLayoutProperties);
    Assert.assertNotNull(properties);
    // page width
    checkDoubleValue(masterPage.getPageWidth(), properties
        .getFoPageWidthAttribute());
    // page height
    checkDoubleValue(masterPage.getPageHeight(), properties
        .getFoPageHeightAttribute());
    // footnote max height
    checkDoubleValue(masterPage.getFootnoteMaxHeight(), properties
        .getStyleFootnoteMaxHeightAttribute());
    // margins
    checkDoubleValue(masterPage.getMarginTop(), properties
        .getFoMarginTopAttribute());
    checkDoubleValue(masterPage.getMarginBottom(), properties
        .getFoMarginBottomAttribute());
    checkDoubleValue(masterPage.getMarginLeft(), properties
        .getFoMarginLeftAttribute());
    checkDoubleValue(masterPage.getMarginRight(), properties
        .getFoMarginRightAttribute());
    // writing mode
    checkStringValue(masterPage.getWritingMode(), properties
        .getStyleWritingModeAttribute());
    // number format
    checkStringValue(masterPage.getNumberFormat(), properties
        .getStyleNumFormatAttribute());
    // print orientation
    checkStringValue(masterPage.getPrintOrientation(), properties
        .getStylePrintOrientationAttribute());

    // check footnote separator line
    StyleFootnoteSepElement footnoteSep = (StyleFootnoteSepElement) properties
        .getElementsByTagName("style:footnote-sep").item(0);
    Assert.assertNotNull(footnoteSep);
    checkStringValue(masterPage.getFootnoteSepAdjustment(), footnoteSep
        .getStyleAdjustmentAttribute());
    checkStringValue(masterPage.getFootnoteSepColor(), footnoteSep
View Full Code Here

  // Method To be moved on StyleMasterPageElement
  private HashMap<String, String> getPageStyleProps(OdfDocument odfDoc, StyleMasterPageElement masterPage) throws Exception {
    StylePageLayoutElement pageLayout = getMasterPageLayout(odfDoc, masterPage);

    // ToDo: Access methods for MasterPage children NOT available!! & drop prefix/suffix
    StylePageLayoutPropertiesElement pagePropsElement = OdfElement.findFirstChildNode(StylePageLayoutPropertiesElement.class, pageLayout);
    Assert.assertNotNull(pagePropsElement);

    // fill map with header attributes name/values
    HashMap<String, String> pageProps = new HashMap<String, String>();
    NamedNodeMap pageAttrs = pagePropsElement.getAttributes();
    for (int i = 0; i < pageAttrs.getLength(); i++) {
      pageProps.put(pageAttrs.item(i).getNamespaceURI() + pageAttrs.item(i).getLocalName(), pageAttrs.item(i).getNodeValue());
    }
    return pageProps;
  }
View Full Code Here

            }
          }
          autoStyles.appendChild(pageLayoutNew);
        }
        NodeList vListStlePageLprop = pageLayout.getElementsByTagName("style:page-layout-properties");
        StylePageLayoutPropertiesElement vStlePageLprop = (StylePageLayoutPropertiesElement) vListStlePageLprop.item(0);
        StyleColumnsElement vStyleColumnsElement = vStlePageLprop.newStyleColumnsElement(columnsNumber);
        vStyleColumnsElement.setFoColumnGapAttribute(vSpacingColumn);
      }
    } catch (Exception e) {
      Logger.getLogger(TextDocument.class.getName()).log(Level.SEVERE, null, e);
      throw new RuntimeException("Page column sets failed.", e);
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.style.StylePageLayoutPropertiesElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.