diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2015-07-15 00:30:21 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2015-07-15 00:30:21 +0000 |
commit | f7b8e88bda206d65bd03617bbff18c75af618111 (patch) | |
tree | e66ca9da2b585403ea5e2392d42c1f41e1c335d0 /src/examples | |
parent | 72ce8545dd62955427b12e11eaec646749391c8d (diff) | |
download | poi-f7b8e88bda206d65bd03617bbff18c75af618111.tar.gz poi-f7b8e88bda206d65bd03617bbff18c75af618111.zip |
junit fixes
set font size via Double
color handling via HSL calculation
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/common_sl@1691117 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
4 files changed, 22 insertions, 22 deletions
diff --git a/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java b/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java index c27e8e4e8e..ce6bf5db03 100644 --- a/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java +++ b/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java @@ -74,7 +74,7 @@ public final class ApacheconEU08 { slide.addShape(box2); HSLFTextBox box3 = new HSLFTextBox(); - box3.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(32); + box3.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(32d); box3.setText( "Yegor Kozlov\r" + "yegor - apache - org"); @@ -129,10 +129,10 @@ public final class ApacheconEU08 { List<HSLFTextParagraph> tp = box2.getTextParagraphs(); for (int i : new byte[]{0,1,2,8}) { - tp.get(i).getTextRuns().get(0).setFontSize(28); + tp.get(i).getTextRuns().get(0).setFontSize(28d); } for (int i : new byte[]{3,4,5,6,7}) { - tp.get(i).getTextRuns().get(0).setFontSize(24); + tp.get(i).getTextRuns().get(0).setFontSize(24d); tp.get(i).setIndentLevel(1); } box2.setAnchor(new Rectangle(36, 80, 648, 400)); @@ -152,15 +152,15 @@ public final class ApacheconEU08 { HSLFTableCell cell = table1.getCell(i, j); cell.setText(txt1[i][j]); HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0); - rt.setFontSize(10); + rt.setFontSize(10d); rt.setFontFamily("Arial"); rt.setBold(true); if(i == 0){ - rt.setFontSize(32); + rt.setFontSize(32d); rt.setFontColor(Color.white); cell.getFill().setForegroundColor(new Color(0, 153, 204)); } else { - rt.setFontSize(28); + rt.setFontSize(28d); cell.getFill().setForegroundColor(new Color(235, 239, 241)); } cell.setVerticalAlignment(VerticalAlignment.MIDDLE); @@ -186,7 +186,7 @@ public final class ApacheconEU08 { HSLFTextBox box1 = new HSLFTextBox(); box1.setHorizontalCentered(true); - box1.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(24); + box1.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(24d); box1.setText("The source code is available at\r" + "http://people.apache.org/~yegor/apachecon_eu08/"); box1.setAnchor(new Rectangle(80, 356, 553, 65)); @@ -225,7 +225,7 @@ public final class ApacheconEU08 { slide.addShape(box1); HSLFTextBox box2 = new HSLFTextBox(); - box2.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(18); + box2.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(18d); box2.setText("Creating a simple presentation from scratch"); box2.setAnchor(new Rectangle(170, 100, 364, 30)); slide.addShape(box2); @@ -233,7 +233,7 @@ public final class ApacheconEU08 { HSLFTextBox box3 = new HSLFTextBox(); HSLFTextRun rt3 = box3.getTextParagraphs().get(0).getTextRuns().get(0); rt3.setFontFamily("Courier New"); - rt3.setFontSize(8); + rt3.setFontSize(8d); box3.setText( "SlideShow ppt = new SlideShow();\u000b" + "Slide slide = ppt.createSlide();\u000b" + @@ -334,7 +334,7 @@ public final class ApacheconEU08 { slide.addShape(box1); HSLFTextBox box2 = new HSLFTextBox(); - box2.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(18); + box2.getTextParagraphs().get(0).getTextRuns().get(0).setFontSize(18d); box2.setText("PPGraphics2D: PowerPoint Graphics2D driver"); box2.setAnchor(new Rectangle(178, 70, 387, 30)); slide.addShape(box2); @@ -342,7 +342,7 @@ public final class ApacheconEU08 { HSLFTextBox box3 = new HSLFTextBox(); HSLFTextRun rt3 = box3.getTextParagraphs().get(0).getTextRuns().get(0); rt3.setFontFamily("Courier New"); - rt3.setFontSize(8); + rt3.setFontSize(8d); box3.setText( "//bar chart data. The first value is the bar color, the second is the width\u000b" + "Object[] def = new Object[]{\u000b" + @@ -446,10 +446,10 @@ public final class ApacheconEU08 { List<HSLFTextParagraph> tp = box2.getTextParagraphs(); for (int i : new byte[]{0,1,3}) { - tp.get(i).getTextRuns().get(0).setFontSize(28); + tp.get(i).getTextRuns().get(0).setFontSize(28d); } for (int i : new byte[]{2,4,5}) { - tp.get(i).getTextRuns().get(0).setFontSize(24); + tp.get(i).getTextRuns().get(0).setFontSize(24d); tp.get(i).setIndentLevel(1); } diff --git a/src/examples/src/org/apache/poi/hslf/examples/BulletsDemo.java b/src/examples/src/org/apache/poi/hslf/examples/BulletsDemo.java index 0032bc8097..a047d8b80a 100644 --- a/src/examples/src/org/apache/poi/hslf/examples/BulletsDemo.java +++ b/src/examples/src/org/apache/poi/hslf/examples/BulletsDemo.java @@ -37,7 +37,7 @@ public final class BulletsDemo { HSLFTextBox shape = new HSLFTextBox(); HSLFTextParagraph rt = shape.getTextParagraphs().get(0); - rt.getTextRuns().get(0).setFontSize(42); + rt.getTextRuns().get(0).setFontSize(42d); rt.setBullet(true); rt.setIndent(0d); //bullet offset rt.setLeftMargin(50d); //text offset (should be greater than bullet offset) diff --git a/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java b/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java index b931ba1b57..93463aaa91 100644 --- a/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java +++ b/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java @@ -55,7 +55,7 @@ public final class TableDemo { HSLFTableCell cell = table1.getCell(i, j); HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0); rt.setFontFamily("Arial"); - rt.setFontSize(10); + rt.setFontSize(10d); if(i == 0){ cell.getFill().setForegroundColor(new Color(227, 227, 227)); } else { @@ -93,17 +93,17 @@ public final class TableDemo { for (int j = 0; j < txt2[i].length; j++) { HSLFTableCell cell = table2.getCell(i, j); HSLFTextRun rt = cell.getTextParagraphs().get(0).getTextRuns().get(0); - rt.setFontSize(10); + rt.setFontSize(10d); rt.setFontFamily("Arial"); if(i == 0){ cell.getFill().setForegroundColor(new Color(0, 51, 102)); rt.setFontColor(Color.white); rt.setBold(true); - rt.setFontSize(14); + rt.setFontSize(14d); cell.setHorizontalCentered(true); } else { rt.getTextParagraph().setBullet(true); - rt.setFontSize(12); + rt.setFontSize(12d); rt.getTextParagraph().setAlignment(TextAlign.LEFT); cell.setHorizontalCentered(false); } diff --git a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial2.java b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial2.java index 91366b9d06..dcd0dea77c 100644 --- a/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial2.java +++ b/src/examples/src/org/apache/poi/xslf/usermodel/Tutorial2.java @@ -42,7 +42,7 @@ public class Tutorial2 { XSLFTextParagraph p1 = shape1.addNewTextParagraph();
XSLFTextRun r1 = p1.addNewTextRun();
r1.setText("Paragraph Formatting");
- r1.setFontSize(24);
+ r1.setFontSize(24d);
r1.setFontColor(new Color(85, 142, 213));
XSLFTextParagraph p2 = shape1.addNewTextParagraph();
@@ -52,20 +52,20 @@ public class Tutorial2 { p2.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r2 = p2.addNewTextRun();
r2.setText("Paragraph properties apply to all text residing within the corresponding paragraph.");
- r2.setFontSize(16);
+ r2.setFontSize(16d);
XSLFTextParagraph p3 = shape1.addNewTextParagraph();
XSLFTextRun r3 = p3.addNewTextRun();
r3.setText("Run Formatting");
- r3.setFontSize(24);
+ r3.setFontSize(24d);
r3.setFontColor(new Color(85, 142, 213));
XSLFTextParagraph p4 = shape1.addNewTextParagraph();
p4.setSpaceBefore(-20d); // 20 pt from the previous paragraph
p4.setSpaceAfter(300d); // 3 lines after the paragraph
XSLFTextRun r4 = p4.addNewTextRun();
- r4.setFontSize(16);
+ r4.setFontSize(16d);
r4.setText(
"Run level formatting is the most granular property level and allows " +
"for the specifying of all low level text properties. The text run is " +
|