Package org.odftoolkit.simple.draw

Examples of org.odftoolkit.simple.draw.Textbox


  public void testNewSlideTitle_left_chart_right_outline() {
    try {
      doc = PresentationDocument.newPresentationDocument();
     
      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_LEFT_CHART_RIGHT_OUTLINE);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the title");

      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");

      doc.save(ResourceUtilities.newTestOutputFile("slidetitlelayout.odp"));
     
View Full Code Here


  @Test
  public void testNewSlideTitle_plus_chart() {
    try {
      doc = PresentationDocument.newPresentationDocument();
      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_PLUS_CHART);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the Presentation title");
        //chart
        String title = "new Chart";
      String[] lables = new String[] { "Anna", "Daisy", "Tony", "MingFei" };
      String[] legends = new String[] { "Day1", "Day2", "Day3" };
      double[][] data = new double[][] { { 1, 6, 3, 8 }, { 9, 1, 0, 5 }, { 3, 7, 8, 1 } };
View Full Code Here

  @Test
  public void testNewSlideTitle_plus_2_chart() {
    try {
      doc = PresentationDocument.newPresentationDocument();
      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_PLUS_2_CHART);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the Presentation title");
        //chart1
        String title = "Chart one";
      String[] lables = new String[] { "AAA", "XXX", "KKK" };
      String[] legends = new String[] { "condition1", "condition2", "condition3" };
      double[][] data = new double[][] { { 3, 3, 2 }, { 2, 1, 5 }, { 1, 4, 0 } };
View Full Code Here

  @Test
  public void testNewSlideTitle_plus_3_object() {
    try {
      doc = PresentationDocument.newPresentationDocument();
      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_PLUS_3_OBJECT);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the Presentation title");
        //chart1
        String title = "Chart one";
      String[] lables = new String[] { "AAA", "XXX", "KKK" };
      String[] legends = new String[] { "condition1", "condition2", "condition3" };
      double[][] data = new double[][] { { 3, 3, 2 }, { 2, 1, 5 }, { 1, 4, 0 } };
      Rectangle rect = new Rectangle();
      rect.x = 2000;
      rect.y = 3300;
      rect.width = 10000;
      rect.height = 8000;
      //char2
      String title1 = "Chart two";
      String[] lables1 = new String[] { "Anna", "Daisy", "Tony", "MingFei" };
      String[] legends1 = new String[] { "Day1", "Day2", "Day3" };
      double[][] data1 = new double[][] { { 1, 5, 3, 2 }, { 2, 1, 0, 5 }, { 3, 3, 4, 1 } };
      Rectangle rect1 = new Rectangle();
      rect1.x = 2000;
      rect1.y = 11300;
      rect1.width = 10000;
      rect1.height = 8000;
      Chart newChart = slidepre.createChart(title, lables, legends, data, rect);
     
      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");
     
      Chart newChart1 = slidepre.createChart(title1, lables1, legends1, data1, rect1);
View Full Code Here

  @Test
  public void testNewSlideTitle_plus_4_object() {
    try {
      doc = PresentationDocument.newPresentationDocument();
      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_PLUS_4_OBJECT);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the Presentation title");
        //chart1
        String title = "Chart one";
      String[] lables = new String[] { "AAA", "XXX", "KKK" };
      String[] legends = new String[] { "condition1", "condition2", "condition3" };
      double[][] data = new double[][] { { 3, 3, 2 }, { 2, 1, 5 }, { 1, 4, 0 } };
      Rectangle rect = new Rectangle();
      rect.x = 2000;
      rect.y = 2300;
      rect.width = 5000;
      rect.height = 6000;
      //char2
      String title1 = "Chart two";
      String[] lables1 = new String[] { "Anna", "Daisy", "Tony", "MingFei" };
      String[] legends1 = new String[] { "Day1", "Day2", "Day3" };
      double[][] data1 = new double[][] { { 1, 5, 3, 2 }, { 2, 1, 0, 5 }, { 3, 3, 4, 1 } };
      Rectangle rect1 = new Rectangle();
      rect1.x = 2000;
      rect1.y = 11300;
      rect1.width = 5000;
      rect1.height = 6000;
      //char3
      String title2 = "Chart three";
      String[] lables2 = new String[] { "Anna", "Daisy", "Tony", "MingFei" };
      String[] legends2 = new String[] { "Day1", "Day2", "Day3" };
      double[][] data2 = new double[][] { { 1, 5, 3, 2 }, { 2, 1, 0, 5 }, { 3, 3, 4, 1 } };
      Rectangle rect2 = new Rectangle();
      rect2.x = 2000;
      rect2.y = 16300;
      rect2.width = 5000;
      rect2.height = 6000;
     
      Chart newChart = slidepre.createChart(title, lables, legends, data, rect);
      Chart newChart1 = slidepre.createChart(title1, lables1, legends1, data1, rect1);
      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");
        Chart newChart2 = slidepre.createChart(title2, lables2, legends2, data2, rect2);
     
      doc.save(ResourceUtilities.newTestOutputFile("slidetitlelayout.odp"));
View Full Code Here

    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      Paragraph p = textDoc.addParagraph("paragraph");
      FrameRectangle frameR = new FrameRectangle(4.21, 1.32, 4.41, 3.92, SupportedLinearMeasure.CM);
     
      Textbox box = p.addTextbox(frameR);
      box.setName("tbox name");
      box.setTextContent(content);
     
      FrameStyleHandler frameStyleHandler = new FrameStyleHandler(box);
      frameStyleHandler.setBackgroundColor(Color.BLUE);
     
      textDoc.changeMode(OdfMediaType.TEXT_TEMPLATE);
View Full Code Here

    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      Paragraph p = textDoc.addParagraph("paragraph");
      FrameRectangle frameR = new FrameRectangle(4.21, 1.32, 4.41, 3.92, SupportedLinearMeasure.IN);
     
      Textbox box = p.addTextbox(frameR);
      box.setName("tbox name");
      box.setTextContent(content);
     
      FrameStyleHandler frameStyleHandler = new FrameStyleHandler(box);
      frameStyleHandler.setBackgroundColor(Color.YELLOW);
      frameStyleHandler.setVerticalRelative(VerticalRelative.PARAGRAPH);
     
View Full Code Here

    try {
      TextDocument textDoc = TextDocument.newTextDocument();
      Paragraph p = textDoc.addParagraph("paragraph");
      FrameRectangle frameR = new FrameRectangle(4.21, 1.32, 4.41, 3.92, SupportedLinearMeasure.IN);
     
      Textbox box = p.addTextbox(frameR);
      box.setName("tbox name");
      box.setTextContent(content);
     
      FrameStyleHandler frameStyleHandler = new FrameStyleHandler(box);
      frameStyleHandler.setBackgroundColor(Color.YELLOW);
      frameStyleHandler.setHorizontalRelative(HorizontalRelative.PARAGRAPH);
     
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.draw.Textbox

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.