diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-07-08 00:09:34 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-07-08 00:09:34 +0000 |
commit | 3cab0825131d36705c058c2e011c9918c8addfdf (patch) | |
tree | b6046120a0ee025c2d1661e23fae2b0b0f8511f3 /src/examples | |
parent | 40aae2250bdbb93fa2ebbe50961b01211ea5c61a (diff) | |
download | poi-3cab0825131d36705c058c2e011c9918c8addfdf.tar.gz poi-3cab0825131d36705c058c2e011c9918c8addfdf.zip |
downgraded xjc params to jdk6 and regenerated geometry binding classes
added rendering for auto numbers
fixed various bugs on failing tests
changed xslf paragraph indent to indentLevel to align with hslf
added escher record factory subclass to hslf, to eventually make hslf wrapper classes obsolete
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/common_sl@1689777 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
3 files changed, 14 insertions, 12 deletions
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java index 458b987320..f552ea88fc 100644 --- a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java +++ b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial1.java @@ -56,13 +56,13 @@ public class Tutorial1 { // we are going to add text by paragraphs. Clear the default placehoder text before that
bodyPlaceholder.clearText();
XSLFTextParagraph p1 = bodyPlaceholder.addNewTextParagraph();
- p1.setLevel(0);
+ p1.setIndentLevel(0);
p1.addNewTextRun().setText("Level1 text");
XSLFTextParagraph p2 = bodyPlaceholder.addNewTextParagraph();
- p2.setLevel(1);
+ p2.setIndentLevel(1);
p2.addNewTextRun().setText("Level2 text");
XSLFTextParagraph p3 = bodyPlaceholder.addNewTextParagraph();
- p3.setLevel(3);
+ p3.setIndentLevel(3);
p3.addNewTextRun().setText("Level3 text");
FileOutputStream out = new FileOutputStream("slides.pptx");
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java index 95252d72f5..443d5684d6 100644 --- a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java +++ b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial7.java @@ -23,6 +23,8 @@ import java.awt.*; import java.io.FileOutputStream;
import java.io.IOException;
+import org.apache.poi.sl.usermodel.AutoNumberingScheme;
+
/**
* Bullets and numbering
*
@@ -38,7 +40,7 @@ public class Tutorial7 { shape.setAnchor(new Rectangle(50, 50, 400, 200));
XSLFTextParagraph p1 = shape.addNewTextParagraph();
- p1.setLevel(0);
+ p1.setIndentLevel(0);
p1.setBullet(true);
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Bullet1");
@@ -53,26 +55,26 @@ public class Tutorial7 { p2.setBulletFontColor(Color.red);
p2.setBulletFont("Wingdings");
p2.setBulletCharacter("\u0075");
- p2.setLevel(1);
+ p2.setIndentLevel(1);
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Bullet2");
// the next three paragraphs form an auto-numbered list
XSLFTextParagraph p3 = shape.addNewTextParagraph();
- p3.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 1);
- p3.setLevel(2);
+ p3.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 1);
+ p3.setIndentLevel(2);
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Numbered List Item - 1");
XSLFTextParagraph p4 = shape.addNewTextParagraph();
- p4.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 2);
- p4.setLevel(2);
+ p4.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 2);
+ p4.setIndentLevel(2);
XSLFTextRun r4 = p4.addNewTextRun();
r4.setText("Numbered List Item - 2");
XSLFTextParagraph p5 = shape.addNewTextParagraph();
- p5.setBulletAutoNumber(ListAutoNumber.ALPHA_LC_PARENT_R, 3);
- p5.setLevel(2);
+ p5.setBulletAutoNumber(AutoNumberingScheme.alphaLcParenRight, 3);
+ p5.setIndentLevel(2);
XSLFTextRun r5 = p5.addNewTextRun();
r5.setText("Numbered List Item - 3");
diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java b/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java index 2f0e7e7515..41c6cc2da2 100644 --- a/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java +++ b/src/examples/src/org/apache/poi/xslf/usermodel/tutorial/Step1.java @@ -50,7 +50,7 @@ public class Step1 { if(shape instanceof XSLFTextShape) { XSLFTextShape tsh = (XSLFTextShape)shape; for(XSLFTextParagraph p : tsh){ - System.out.println("Paragraph level: " + p.getLevel()); + System.out.println("Paragraph level: " + p.getIndentLevel()); for(XSLFTextRun r : p){ System.out.println(r.getRawText()); System.out.println(" bold: " + r.isBold()); |