Author: kiwiwings
Date: Sat Aug 15 20:43:51 2015
New Revision: 1696095
URL: http://svn.apache.org/r1696095
Log:
Move and rename hslf line because of ambiguity with common sl line
Added:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java
- copied, changed from r1694925,
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
Removed:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
Modified:
poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
poi/trunk/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java
poi/trunk/src/java/org/apache/poi/sl/usermodel/Line.java
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
Modified:
poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
Sat Aug 15 20:43:51 2015
@@ -26,7 +26,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
-import org.apache.poi.hslf.model.Line;
import org.apache.poi.hslf.model.PPGraphics2D;
import org.apache.poi.hslf.record.TextHeaderAtom;
import org.apache.poi.hslf.usermodel.HSLFAutoShape;
@@ -38,6 +37,7 @@ import org.apache.poi.hslf.usermodel.HSL
import org.apache.poi.hslf.usermodel.HSLFTextBox;
import org.apache.poi.hslf.usermodel.HSLFTextParagraph;
import org.apache.poi.hslf.usermodel.HSLFTextRun;
+import org.apache.poi.hslf.usermodel.HSLFLine;
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.sl.usermodel.VerticalAlignment;
@@ -180,12 +180,12 @@ public final class ApacheconEU08 {
}
}
- Line border1 = table1.createBorder();
+ HSLFLine border1 = table1.createBorder();
border1.setLineColor(Color.black);
border1.setLineWidth(1.0);
table1.setAllBorders(border1);
- Line border2 = table1.createBorder();
+ HSLFLine border2 = table1.createBorder();
border2.setLineColor(Color.black);
border2.setLineWidth(2.0);
table1.setOutsideBorders(border2);
Modified: poi/trunk/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
--- poi/trunk/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java
(original)
+++ poi/trunk/src/examples/src/org/apache/poi/hslf/examples/TableDemo.java Sat
Aug 15 20:43:51 2015
@@ -20,12 +20,12 @@ package org.apache.poi.hslf.examples;
import java.awt.Color;
import java.io.FileOutputStream;
-import org.apache.poi.hslf.model.Line;
import org.apache.poi.hslf.usermodel.HSLFSlide;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
import org.apache.poi.hslf.usermodel.HSLFTable;
import org.apache.poi.hslf.usermodel.HSLFTableCell;
import org.apache.poi.hslf.usermodel.HSLFTextRun;
+import org.apache.poi.hslf.usermodel.HSLFLine;
import org.apache.poi.sl.usermodel.TextParagraph.TextAlign;
import org.apache.poi.sl.usermodel.VerticalAlignment;
@@ -71,7 +71,7 @@ public final class TableDemo {
}
}
- Line border1 = table1.createBorder();
+ HSLFLine border1 = table1.createBorder();
border1.setLineColor(Color.black);
border1.setLineWidth(1.0);
table1.setAllBorders(border1);
@@ -119,7 +119,7 @@ public final class TableDemo {
table2.setRowHeight(0, 30);
table2.setRowHeight(1, 70);
- Line border2 = table2.createBorder();
+ HSLFLine border2 = table2.createBorder();
table2.setOutsideBorders(border2);
slide.addShape(table2);
Modified: poi/trunk/src/java/org/apache/poi/sl/usermodel/Line.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/sl/usermodel/Line.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/sl/usermodel/Line.java (original)
+++ poi/trunk/src/java/org/apache/poi/sl/usermodel/Line.java Sat Aug 15
20:43:51 2015
@@ -17,6 +17,14 @@
package org.apache.poi.sl.usermodel;
+import org.apache.poi.util.Internal;
+
+/**
+ * Interface for Lines ... this will be eventually removed,
+ * so don't depend on it in user classes, but use AutoShape instead!
+ */
+
+@Internal
public interface Line<T extends TextParagraph<? extends TextRun>> extends
AutoShape<T> {
}
Copied:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java (from
r1694925, poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java)
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java&r1=1694925&r2=1696095&rev=1696095&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/model/Line.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java
Sat Aug 15 20:43:51 2015
@@ -15,16 +15,13 @@
limitations under the License.
==================================================================== */
-package org.apache.poi.hslf.model;
+package org.apache.poi.hslf.usermodel;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherOptRecord;
import org.apache.poi.ddf.EscherProperties;
import org.apache.poi.ddf.EscherSpRecord;
-import org.apache.poi.hslf.usermodel.HSLFGroupShape;
-import org.apache.poi.hslf.usermodel.HSLFShape;
-import org.apache.poi.hslf.usermodel.HSLFTextParagraph;
-import org.apache.poi.hslf.usermodel.HSLFTextShape;
+import org.apache.poi.sl.usermodel.Line;
import org.apache.poi.sl.usermodel.ShapeContainer;
import org.apache.poi.sl.usermodel.ShapeType;
@@ -33,17 +30,17 @@ import org.apache.poi.sl.usermodel.Shape
*
* @author Yegor Kozlov
*/
-public final class Line extends HSLFTextShape implements
org.apache.poi.sl.usermodel.Line<HSLFTextParagraph> {
- public Line(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape>
parent){
+public final class HSLFLine extends HSLFTextShape implements
Line<HSLFTextParagraph> {
+ public HSLFLine(EscherContainerRecord escherRecord,
ShapeContainer<HSLFShape> parent){
super(escherRecord, parent);
}
- public Line(ShapeContainer<HSLFShape> parent){
+ public HSLFLine(ShapeContainer<HSLFShape> parent){
super(null, parent);
_escherContainer = createSpContainer(parent instanceof HSLFGroupShape);
}
- public Line(){
+ public HSLFLine(){
this(null);
}
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
---
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
(original)
+++
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
Sat Aug 15 20:43:51 2015
@@ -103,7 +103,7 @@ public final class HSLFShapeFactory {
break;
}
case LINE:
- shape = new Line(spContainer, parent);
+ shape = new HSLFLine(spContainer, parent);
break;
case NOT_PRIMITIVE: {
EscherOptRecord opt = HSLFShape.getEscherChild(spContainer,
EscherOptRecord.RECORD_ID);
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
Sat Aug 15 20:43:51 2015
@@ -31,7 +31,6 @@ import org.apache.poi.ddf.EscherProperti
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.EscherSimpleProperty;
import org.apache.poi.ddf.EscherTextboxRecord;
-import org.apache.poi.hslf.model.Line;
import org.apache.poi.sl.usermodel.ShapeContainer;
import org.apache.poi.sl.usermodel.TableShape;
import org.apache.poi.util.LittleEndian;
@@ -144,16 +143,16 @@ public final class HSLFTable extends HSL
HSLFTableCell c = cells[i][j];
addShape(c);
- Line bt = c.getBorderTop();
+ HSLFLine bt = c.getBorderTop();
if(bt != null) addShape(bt);
- Line br = c.getBorderRight();
+ HSLFLine br = c.getBorderRight();
if(br != null) addShape(br);
- Line bb = c.getBorderBottom();
+ HSLFLine bb = c.getBorderBottom();
if(bb != null) addShape(bb);
- Line bl = c.getBorderLeft();
+ HSLFLine bl = c.getBorderLeft();
if(bl != null) addShape(bl);
}
@@ -279,7 +278,7 @@ public final class HSLFTable extends HSL
*
* @param line the border line
*/
- public void setAllBorders(Line line){
+ public void setAllBorders(HSLFLine line){
for (int i = 0; i < cells.length; i++) {
for (int j = 0; j < cells[i].length; j++) {
HSLFTableCell cell = cells[i][j];
@@ -296,7 +295,7 @@ public final class HSLFTable extends HSL
*
* @param line the border line
*/
- public void setOutsideBorders(Line line){
+ public void setOutsideBorders(HSLFLine line){
for (int i = 0; i < cells.length; i++) {
for (int j = 0; j < cells[i].length; j++) {
HSLFTableCell cell = cells[i][j];
@@ -323,7 +322,7 @@ public final class HSLFTable extends HSL
*
* @param line the border line
*/
- public void setInsideBorders(Line line){
+ public void setInsideBorders(HSLFLine line){
for (int i = 0; i < cells.length; i++) {
for (int j = 0; j < cells[i].length; j++) {
HSLFTableCell cell = cells[i][j];
@@ -343,8 +342,8 @@ public final class HSLFTable extends HSL
}
}
- private Line cloneBorder(Line line){
- Line border = createBorder();
+ private HSLFLine cloneBorder(HSLFLine line){
+ HSLFLine border = createBorder();
border.setLineWidth(line.getLineWidth());
border.setLineDashing(line.getLineDashing());
border.setLineColor(line.getLineColor());
@@ -357,8 +356,8 @@ public final class HSLFTable extends HSL
*
* @return the created border
*/
- public Line createBorder(){
- Line line = new Line(this);
+ public HSLFLine createBorder(){
+ HSLFLine line = new HSLFLine(this);
EscherOptRecord opt = getEscherOptRecord();
setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, -1);
Modified:
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
---
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
(original)
+++
poi/trunk/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
Sat Aug 15 20:43:51 2015
@@ -22,7 +22,6 @@ import java.awt.Rectangle;
import org.apache.poi.ddf.EscherContainerRecord;
import org.apache.poi.ddf.EscherOptRecord;
import org.apache.poi.ddf.EscherProperties;
-import org.apache.poi.hslf.model.Line;
import org.apache.poi.sl.usermodel.ShapeContainer;
import org.apache.poi.sl.usermodel.ShapeType;
@@ -35,10 +34,10 @@ public final class HSLFTableCell extends
protected static final int DEFAULT_WIDTH = 100;
protected static final int DEFAULT_HEIGHT = 40;
- private Line borderLeft;
- private Line borderRight;
- private Line borderTop;
- private Line borderBottom;
+ private HSLFLine borderLeft;
+ private HSLFLine borderRight;
+ private HSLFLine borderTop;
+ private HSLFLine borderBottom;
/**
* Create a TableCell object and initialize it from the supplied Record
container.
@@ -76,7 +75,7 @@ public final class HSLFTableCell extends
return _escherContainer;
}
- protected void anchorBorder(int type, Line line){
+ protected void anchorBorder(int type, HSLFLine line){
Rectangle cellAnchor = getAnchor();
Rectangle lineAnchor = new Rectangle();
switch(type){
@@ -110,38 +109,38 @@ public final class HSLFTableCell extends
line.setAnchor(lineAnchor);
}
- public Line getBorderLeft() {
+ public HSLFLine getBorderLeft() {
return borderLeft;
}
- public void setBorderLeft(Line line) {
+ public void setBorderLeft(HSLFLine line) {
if(line != null) anchorBorder(HSLFTable.BORDER_LEFT, line);
this.borderLeft = line;
}
- public Line getBorderRight() {
+ public HSLFLine getBorderRight() {
return borderRight;
}
- public void setBorderRight(Line line) {
+ public void setBorderRight(HSLFLine line) {
if(line != null) anchorBorder(HSLFTable.BORDER_RIGHT, line);
this.borderRight = line;
}
- public Line getBorderTop() {
+ public HSLFLine getBorderTop() {
return borderTop;
}
- public void setBorderTop(Line line) {
+ public void setBorderTop(HSLFLine line) {
if(line != null) anchorBorder(HSLFTable.BORDER_TOP, line);
this.borderTop = line;
}
- public Line getBorderBottom() {
+ public HSLFLine getBorderBottom() {
return borderBottom;
}
- public void setBorderBottom(Line line) {
+ public void setBorderBottom(HSLFLine line) {
if(line != null) anchorBorder(HSLFTable.BORDER_BOTTOM, line);
this.borderBottom = line;
}
Modified:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java
Sat Aug 15 20:43:51 2015
@@ -21,6 +21,7 @@ import java.awt.Color;
import org.apache.poi.hslf.usermodel.HSLFSlide;
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
+import org.apache.poi.hslf.usermodel.HSLFLine;
import org.apache.poi.sl.usermodel.StrokeStyle.LineCompound;
import org.apache.poi.sl.usermodel.StrokeStyle.LineDash;
import org.junit.Test;
@@ -40,36 +41,36 @@ public final class TestLine {
slide.addTitle().setText("Lines tester");
- Line line;
+ HSLFLine line;
/**
* line styles
*/
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 200, 300, 0));
line.setLineCompound(LineCompound.SINGLE);
line.setLineColor(Color.blue);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 230, 300, 0));
line.setLineCompound(LineCompound.DOUBLE);
line.setLineWidth(3.5);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 260, 300, 0));
line.setLineCompound(LineCompound.TRIPLE);
line.setLineWidth(6);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 290, 300, 0));
line.setLineCompound(LineCompound.THICK_THIN);
line.setLineWidth(4.5);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 320, 300, 0));
line.setLineCompound(LineCompound.THIN_THICK);
line.setLineWidth(5.5);
@@ -78,27 +79,27 @@ public final class TestLine {
/**
* line dashing
*/
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(450, 200, 300, 0));
line.setLineDashing(LineDash.SOLID);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(450, 230, 300, 0));
line.setLineDashing(LineDash.DASH);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(450, 260, 300, 0));
line.setLineDashing(LineDash.DOT);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(450, 290, 300, 0));
line.setLineDashing(LineDash.DASH_DOT);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(450, 320, 300, 0));
line.setLineDashing(LineDash.LG_DASH_DOT_DOT);
slide.addShape(line);
@@ -106,21 +107,21 @@ public final class TestLine {
/**
* Combinations
*/
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 400, 300, 0));
line.setLineDashing(LineDash.DASH_DOT);
line.setLineCompound(LineCompound.TRIPLE);
line.setLineWidth(5.0);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 430, 300, 0));
line.setLineDashing(LineDash.DASH);
line.setLineCompound(LineCompound.THICK_THIN);
line.setLineWidth(4.0);
slide.addShape(line);
- line = new Line();
+ line = new HSLFLine();
line.setAnchor(new java.awt.Rectangle(75, 460, 300, 0));
line.setLineDashing(LineDash.DOT);
line.setLineCompound(LineCompound.DOUBLE);
Modified:
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java?rev=1696095&r1=1696094&r2=1696095&view=diff
==============================================================================
---
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
(original)
+++
poi/trunk/src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java
Sat Aug 15 20:43:51 2015
@@ -54,6 +54,7 @@ import org.apache.poi.hslf.usermodel.HSL
import org.apache.poi.hslf.usermodel.HSLFTextParagraph;
import org.apache.poi.hslf.usermodel.HSLFTextRun;
import org.apache.poi.hslf.usermodel.HSLFTextShape;
+import org.apache.poi.hslf.usermodel.HSLFLine;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.poi.sl.usermodel.ShapeType;
import org.apache.poi.sl.usermodel.StrokeStyle.LineDash;
@@ -89,7 +90,7 @@ public final class TestShapes {
public void graphics() throws Exception {
HSLFSlide slide = ppt.createSlide();
- Line line = new Line();
+ HSLFLine line = new HSLFLine();
java.awt.Rectangle lineAnchor = new java.awt.Rectangle(100, 200, 50,
60);
line.setAnchor(lineAnchor);
line.setLineWidth(3);
@@ -119,7 +120,7 @@ public final class TestShapes {
List<HSLFShape> shape = slide.getShapes();
assertEquals(2, shape.size());
- assertTrue(shape.get(0) instanceof Line); //group shape
+ assertTrue(shape.get(0) instanceof HSLFLine); //group shape
assertEquals(lineAnchor, shape.get(0).getAnchor()); //group shape
assertTrue(shape.get(1) instanceof HSLFAutoShape); //group shape
@@ -335,7 +336,7 @@ public final class TestShapes {
pict.setAnchor(new Rectangle(0, 0, 200, 200));
group.addShape(pict);
- Line line = new Line(group);
+ HSLFLine line = new HSLFLine(group);
line.setAnchor(new Rectangle(300, 300, 500, 0));
group.addShape(line);
@@ -358,12 +359,12 @@ public final class TestShapes {
List<HSLFShape> grshape = group.getShapes();
assertEquals(2, grshape.size());
assertTrue(grshape.get(0) instanceof HSLFPictureShape);
- assertTrue(grshape.get(1) instanceof Line);
+ assertTrue(grshape.get(1) instanceof HSLFLine);
pict = (HSLFPictureShape)grshape.get(0);
assertEquals(new Rectangle(0, 0, 200, 200), pict.getAnchor());
- line = (Line)grshape.get(1);
+ line = (HSLFLine)grshape.get(1);
assertEquals(new Rectangle(300, 300, 500, 0), line.getAnchor());
}
@@ -427,7 +428,7 @@ public final class TestShapes {
int dgShapesUsed = dg.getNumShapes(); // number of shapes in
the slide
//insert 3 shapes and make sure the Ids are properly incremented
for (int i = 0; i < 3; i++) {
- shape = new Line();
+ shape = new HSLFLine();
assertEquals(0, shape.getShapeId());
slide.addShape(shape);
assertTrue(shape.getShapeId() > 0);
@@ -454,7 +455,7 @@ public final class TestShapes {
//make sure it is so
int numClusters = dgg.getNumIdClusters();
for (int i = 0; i < 1025; i++) {
- shape = new Line();
+ shape = new HSLFLine();
slide.addShape(shape);
}
assertEquals(numClusters + 1, dgg.getNumIdClusters());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]