Package org.odftoolkit.odfdom.dom.element.draw

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement


      super(doc);
      this.slide = slide.getOdfElement();
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      DrawFrameElement element = OdfElement.findFirstChildNode(DrawFrameElement.class, slide);
      while (element != null) {
        if ("chart".equals(element.getPresentationClassAttribute())) {
          DrawObjectElement chartEle= OdfElement.findFirstChildNode(DrawObjectElement.class, element);
          if(chartEle == null){
            return element;
          }else{
            String href = chartEle.getXlinkHrefAttribute();
View Full Code Here


      sdoc = (TextDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TextPElement lastPara = sdoc.getContentRoot().newTextPElement();
      lastPara.appendChild(drawFrame);
      drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PARAGRAPH.toString());
      return drawFrame;
    }
View Full Code Here

   *            the text that need to insert in the notes page
   */
  public void addText(String text) {
    NodeList frameList = maNoteElement.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "frame");
    if (frameList.getLength() > 0) {
      DrawFrameElement frame = (DrawFrameElement) frameList.item(0);
      NodeList textBoxList = frame.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "text-box");
      if (textBoxList.getLength() > 0) {
        DrawTextBoxElement textBox = (DrawTextBoxElement) textBoxList.item(0);
        TextPElement newPara = textBox.newTextPElement();
        newPara.setTextContent(text);
      }
View Full Code Here

  }

  private class ListContainerImpl extends AbstractListContainer {

    public OdfElement getListContainerElement() {
      DrawFrameElement frame = null;
      DrawTextBoxElement textBox = null;
      NodeList frameList = maNoteElement.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "frame");
      if (frameList.getLength() <= 0) {
        frame = maNoteElement.newDrawFrameElement();
      } else {
        frame = (DrawFrameElement) frameList.item(frameList.getLength() - 1);
      }
      NodeList textBoxList = frame.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "text-box");
      if (textBoxList.getLength() <= 0) {
        textBox = frame.newDrawTextBoxElement();
      } else {
        textBox = (DrawTextBoxElement) textBoxList.item(textBoxList.getLength() - 1);
      }
      return textBox;
    }
View Full Code Here

  public void testNotCompressImages() throws Exception {
    // create test presentation
    OdfPresentationDocument odp = OdfPresentationDocument.newPresentationDocument();
    OfficePresentationElement officePresentation = odp.getContentRoot();
    DrawPageElement page = officePresentation.newDrawPageElement(null);
    DrawFrameElement frame = page.newDrawFrameElement();
    OdfDrawImage image = (OdfDrawImage) frame.newDrawImageElement();
    image.newImage(ResourceUtilities.getURI(IMAGE_TEST_FILE));
    odp.save(ResourceUtilities.newTestOutputFile(IMAGE_PRESENTATION));
   
    // test if the image is not compressed
    ZipInputStream zinput = new ZipInputStream(ResourceUtilities.getTestResourceAsStream(IMAGE_PRESENTATION));
View Full Code Here

   * Create child element {@odf.element draw:frame}.
   *
   * @return the element {@odf.element draw:frame}
   */
  public DrawFrameElement newDrawFrameElement() {
    DrawFrameElement drawFrame = ((OdfFileDom) this.ownerDocument).newOdfElement(DrawFrameElement.class);
    this.appendChild(drawFrame);
    return drawFrame;
  }
View Full Code Here

      sdoc = (PresentationDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      DrawPageElement lastPage = (DrawPageElement) contentDom2.getXPath().evaluate("//draw:page[last()]",
          contentDom2, XPathConstants.NODE);
      lastPage.appendChild(drawFrame);
      drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PAGE.toString());
      return drawFrame;
    }
View Full Code Here

   * Create child element {@odf.element draw:frame}.
   *
   * @return the element {@odf.element draw:frame}
   */
  public DrawFrameElement newDrawFrameElement() {
    DrawFrameElement drawFrame = ((OdfFileDom) this.ownerDocument).newOdfElement(DrawFrameElement.class);
    this.appendChild(drawFrame);
    return drawFrame;
  }
View Full Code Here

      sdoc = (SpreadsheetDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TableTableCellElement lastCell = (TableTableCellElement) contentDom2.getXPath().evaluate(
          "//table:table-cell[last()]", contentDom2, XPathConstants.NODE);
      lastCell.appendChild(drawFrame);
      drawFrame.removeAttribute("text:anchor-type");
      this.drawFrame = drawFrame;
      return drawFrame;
    }
View Full Code Here

   * Child element is new in Odf 1.2
   *
   * @return the element {@odf.element draw:frame}
   */
  public DrawFrameElement newDrawFrameElement() {
    DrawFrameElement drawFrame = ((OdfFileDom) this.ownerDocument).newOdfElement(DrawFrameElement.class);
    this.appendChild(drawFrame);
    return drawFrame;
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement

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.