Package org.odftoolkit.simple.presentation

Examples of org.odftoolkit.simple.presentation.Slide


        navigation.nextSelection();
        count++;
      }
      Assert.assertEquals(3, count);

      Slide slide = document.getSlideByIndex(0);
      navigation = new TextNavigation("RANDOM COLORED TEXTBOX", slide.getOdfElement());
      count = 0;
      while (navigation.hasNext()) {
        navigation.nextSelection();
        count++;
      }
View Full Code Here


  @Test
  public void testPresentation() {
    try {
      PresentationDocument odpdoc = (PresentationDocument) odfdoc;

      Slide page = odpdoc.getSlideByName("slide-name-1");
      Assert.assertTrue((page != null) && page.getSlideName().equals("slide-name-1"));
      Assert.assertEquals(page, odpdoc.getSlideByIndex(0));

      page = odpdoc.getSlideByName("slide-name-2");
      Assert.assertTrue((page != null) && page.getSlideName().equals("slide-name-2"));
      Assert.assertEquals(page, odpdoc.getSlideByIndex(1));

      page = odpdoc.getSlideByName("slide-name-3");
      Assert.assertTrue((page != null) && page.getSlideName().equals("slide-name-3"));
      Assert.assertEquals(page, odpdoc.getSlideByIndex(2));

    } catch (Exception e) {
      Logger.getLogger(PresentationTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
      Assert.fail(e.getMessage());
View Full Code Here

        Assert.assertEquals(image, aImage);
      }

      // new image in presentation
      PresentationDocument pDoc = PresentationDocument.newPresentationDocument();
      Slide slide = pDoc.newSlide(0, "test", SlideLayout.TITLE_OUTLINE);
      Textbox box = slide.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      box.setImage(ResourceUtilities.getURI("image_list_item.png"));
      pDoc.save(ResourceUtilities.newTestOutputFile("imagep.odp"));

      // new image in a table
      TextDocument sDoc = TextDocument.newTextDocument();
View Full Code Here

  @Test
  public void testRemoveTextbox() {
    try {
      // new image in presentation
      PresentationDocument pDoc = PresentationDocument.newPresentationDocument();
      Slide slide = pDoc.newSlide(0, "slide name ", SlideLayout.TITLE_OUTLINE);
      java.util.List<Textbox> listTbox = slide.getTextboxByUsage(PresentationClass.TITLE);
      Textbox titleBox = listTbox.get(0);
      titleBox.setBackgroundColor(Color.BLUE);
      //titleBox.setImage(ResourceUtilities.getURI("image_list_item.png"));
      titleBox.setName("title");
      titleBox.setTextContent("this is title");
     
      //validate
      Textbox tbox = slide.getTextboxByName("title");
      Assert.assertEquals(titleBox, tbox);
     
      slide.removeTextbox(titleBox);
     
      Textbox tbox1 = slide.getTextboxByName("title");
      Assert.assertNull(tbox1);

      //save
      pDoc.save(ResourceUtilities.newTestOutputFile("imagep.odp"));
    } catch (Exception e) {
View Full Code Here

      Assert.assertNotNull(aBox);
      String textContent = aBox.getTextContent();
      Assert.assertEquals(content, textContent);

      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("My Title1");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

 
  @Test
  public void testaddListListDecorator() {
    try {
      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      //title
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

 
  @Test
  public void testClearList() {
    try {
      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      //title
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

 
  @Test
  public void testGetListContainerElement() {
    try {
      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      //title
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

 
  @Test
  public void testGetListIterator() {
    try {
      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      //title
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

 
  @Test
  public void testRemoveList() {
    try {
      PresentationDocument presentDoc = PresentationDocument.newPresentationDocument();
      Slide slide1 = presentDoc.newSlide(1, "slide1", SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      //title
      Textbox titleTextbox = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.TITLE).get(0);
      Assert.assertNotNull(titleTextbox);
      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.presentation.Slide

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.