Examples of newDrawImageElement()


Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    fcell.removeContent();
    Assert.assertEquals(0, fcell.mCellElement.getChildNodes().getLength());

    fcell.setDisplayText("hello");
    DrawFrameElement drawEle = new DrawFrameElement(odsdoc.getContentDom());
    drawEle.newDrawImageElement();
    fcell.mCellElement.appendChild(drawEle);

    Assert.assertEquals(2, fcell.mCellElement.getChildNodes().getLength());

    fcell.removeTextContent();
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    try {
      OdfElement parent = container.getFrameContainerElement();
      OdfFileDom ownerDom = (OdfFileDom) parent.getOwnerDocument();
      DrawFrameElement fElement = ownerDom.newOdfElement(DrawFrameElement.class);
      parent.appendChild(fElement);
      DrawImageElement imageElement = fElement.newDrawImageElement();
      // set uri and copy resource
      String packagePath = insertImageResourceIntoPackage((OdfSchemaDocument) ownerDom.getDocument(), uri);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      URI newURI = configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement, packagePath,
          false);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    Image mImage;

    try {
      DrawFrameElement fElement = (DrawFrameElement) frame.getDrawFrameElement();
      OdfFileDom ownerDom = (OdfFileDom) fElement.getOwnerDocument();
      DrawImageElement imageElement = fElement.newDrawImageElement();
      // set uri and copy resource
      String packagePath = insertImageResourceIntoPackage((OdfSchemaDocument) ownerDom.getDocument(), uri);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      URI newURI = configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement, packagePath,
          true);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    //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

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    fcell.removeContent();
    Assert.assertEquals(0, fcell.mCellElement.getChildNodes().getLength());

    fcell.setDisplayText("hello");
    DrawFrameElement drawEle = new DrawFrameElement(odsdoc.getContentDom());
    DrawImageElement imageEle = drawEle.newDrawImageElement();
    fcell.mCellElement.appendChild(drawEle);

    Assert.assertEquals(2, fcell.mCellElement.getChildNodes().getLength());

    fcell.removeTextContent();
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    fcell.removeContent();
    Assert.assertEquals(0, fcell.mCellElement.getChildNodes().getLength());

    fcell.setDisplayText("hello");
    DrawFrameElement drawEle = new DrawFrameElement(odsdoc.getContentDom());
    drawEle.newDrawImageElement();
    fcell.mCellElement.appendChild(drawEle);

    Assert.assertEquals(2, fcell.mCellElement.getChildNodes().getLength());

    fcell.removeTextContent();
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    fcell.removeContent();
    Assert.assertEquals(0, fcell.mCellElement.getChildNodes().getLength());

    fcell.setDisplayText("hello");
    DrawFrameElement drawEle = new DrawFrameElement(odsdoc.getContentDom());
    drawEle.newDrawImageElement();
    fcell.mCellElement.appendChild(drawEle);

    Assert.assertEquals(2, fcell.mCellElement.getChildNodes().getLength());

    fcell.removeTextContent();
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    // insert a frame
    DrawFrameElement frame = firstParagraph.newDrawFrameElement();

    // insert an image: This is a class from the Document API
    OdfDrawImage image = (OdfDrawImage) frame.newDrawImageElement();
    image.newImage(new URI("./MySampleImage.png"));

    // Save file
    odt.save("ImageOut.odt");
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    try {
      OdfElement parent = container.getFrameContainerElement();
      OdfFileDom ownerDom = (OdfFileDom) parent.getOwnerDocument();
      DrawFrameElement fElement = ownerDom.newOdfElement(DrawFrameElement.class);
      parent.appendChild(fElement);
      DrawImageElement imageElement = fElement.newDrawImageElement();
      // set uri and copy resource
      String packagePath = insertImageResourceIntoPackage((OdfSchemaDocument) ownerDom.getDocument(), uri);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      URI newURI = configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement, packagePath,
          false);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement.newDrawImageElement()

    Image mImage;

    try {
      DrawFrameElement fElement = (DrawFrameElement) frame.getDrawFrameElement();
      OdfFileDom ownerDom = (OdfFileDom) fElement.getOwnerDocument();
      DrawImageElement imageElement = fElement.newDrawImageElement();
      // set uri and copy resource
      String packagePath = insertImageResourceIntoPackage((OdfSchemaDocument) ownerDom.getDocument(), uri);
      packagePath = packagePath.replaceFirst(ownerDom.getDocument().getDocumentPath(), "");
      URI newURI = configureInsertedImage((OdfSchemaDocument) ownerDom.getDocument(), imageElement, packagePath,
          true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.