]> source.dussan.org Git - poi.git/commitdiff
Move and rename hslf line because of ambiguity with common sl line
authorAndreas Beeker <kiwiwings@apache.org>
Sat, 15 Aug 2015 20:43:51 +0000 (20:43 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sat, 15 Aug 2015 20:43:51 +0000 (20:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1696095 13f79535-47bb-0310-9956-ffa450edef68

src/examples/src/org/apache/poi/hslf/examples/ApacheconEU08.java
src/examples/src/org/apache/poi/hslf/examples/TableDemo.java
src/java/org/apache/poi/sl/usermodel/Line.java
src/scratchpad/src/org/apache/poi/hslf/model/Line.java [deleted file]
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java [new file with mode: 0644]
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFShapeFactory.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTable.java
src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTableCell.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestLine.java
src/scratchpad/testcases/org/apache/poi/hslf/model/TestShapes.java

index 8ed05d71143eeff13bd92772019db0be35740f4b..c9114247263b0e9b342f295851b11afd9f8fbec6 100644 (file)
@@ -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.HSLFTableCell;
 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);
index 12f66e3c178e37393c16376f9f8135dd825c58fc..d50855e6194be3e800187b9bdd6928d2f2dd1760 100644 (file)
@@ -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);
index b06764e54d1f02a41f645303feaf32e5e9ad849f..aa42eeab63b4fcab8d6768ecb6e4853a18cce0c4 100644 (file)
 
 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> {
 
 }
diff --git a/src/scratchpad/src/org/apache/poi/hslf/model/Line.java b/src/scratchpad/src/org/apache/poi/hslf/model/Line.java
deleted file mode 100644 (file)
index c713959..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-
-package org.apache.poi.hslf.model;
-
-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.ShapeContainer;
-import org.apache.poi.sl.usermodel.ShapeType;
-
-/**
- * Represents a line in a PowerPoint drawing
- *
- *  @author Yegor Kozlov
- */
-public final class Line extends HSLFTextShape implements org.apache.poi.sl.usermodel.Line<HSLFTextParagraph> {
-    public Line(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape> parent){
-        super(escherRecord, parent);
-    }
-
-    public Line(ShapeContainer<HSLFShape> parent){
-        super(null, parent);
-        _escherContainer = createSpContainer(parent instanceof HSLFGroupShape);
-    }
-
-    public Line(){
-        this(null);
-    }
-
-    protected EscherContainerRecord createSpContainer(boolean isChild){
-        _escherContainer = super.createSpContainer(isChild);
-        
-        setShapeType(ShapeType.LINE);
-
-        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
-        short type = (short)((ShapeType.LINE.nativeId << 4) | 0x2);
-        spRecord.setOptions(type);
-
-        //set default properties for a line
-        EscherOptRecord opt = getEscherOptRecord();
-
-        //default line properties
-        setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);
-        setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000);
-        setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000);
-        setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001);
-        setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
-        setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
-
-        return _escherContainer;
-    }
-    
-//    /**
-//     * Sets the orientation of the line, if inverse is false, then line goes
-//     * from top-left to bottom-right, otherwise use inverse equals true 
-//     *
-//     * @param inverse the orientation of the line
-//     */
-//    public void setInverse(boolean inverse) {
-//        setShapeType(inverse ? ShapeType.LINE_INV : ShapeType.LINE);
-//    }
-//    
-//    /**
-//     * Gets the orientation of the line, if inverse is false, then line goes
-//     * from top-left to bottom-right, otherwise inverse equals true 
-//     *
-//     * @return inverse the orientation of the line
-//     */
-//    public boolean isInverse() {
-//        return (getShapeType() == ShapeType.LINE_INV);
-//    }
-}
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFLine.java
new file mode 100644 (file)
index 0000000..10b2bd0
--- /dev/null
@@ -0,0 +1,89 @@
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+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.sl.usermodel.Line;
+import org.apache.poi.sl.usermodel.ShapeContainer;
+import org.apache.poi.sl.usermodel.ShapeType;
+
+/**
+ * Represents a line in a PowerPoint drawing
+ *
+ *  @author Yegor Kozlov
+ */
+public final class HSLFLine extends HSLFTextShape implements Line<HSLFTextParagraph> {
+    public HSLFLine(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape> parent){
+        super(escherRecord, parent);
+    }
+
+    public HSLFLine(ShapeContainer<HSLFShape> parent){
+        super(null, parent);
+        _escherContainer = createSpContainer(parent instanceof HSLFGroupShape);
+    }
+
+    public HSLFLine(){
+        this(null);
+    }
+
+    protected EscherContainerRecord createSpContainer(boolean isChild){
+        _escherContainer = super.createSpContainer(isChild);
+        
+        setShapeType(ShapeType.LINE);
+
+        EscherSpRecord spRecord = _escherContainer.getChildById(EscherSpRecord.RECORD_ID);
+        short type = (short)((ShapeType.LINE.nativeId << 4) | 0x2);
+        spRecord.setOptions(type);
+
+        //set default properties for a line
+        EscherOptRecord opt = getEscherOptRecord();
+
+        //default line properties
+        setEscherProperty(opt, EscherProperties.GEOMETRY__SHAPEPATH, 4);
+        setEscherProperty(opt, EscherProperties.GEOMETRY__FILLOK, 0x10000);
+        setEscherProperty(opt, EscherProperties.FILL__NOFILLHITTEST, 0x100000);
+        setEscherProperty(opt, EscherProperties.LINESTYLE__COLOR, 0x8000001);
+        setEscherProperty(opt, EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0xA0008);
+        setEscherProperty(opt, EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
+
+        return _escherContainer;
+    }
+    
+//    /**
+//     * Sets the orientation of the line, if inverse is false, then line goes
+//     * from top-left to bottom-right, otherwise use inverse equals true 
+//     *
+//     * @param inverse the orientation of the line
+//     */
+//    public void setInverse(boolean inverse) {
+//        setShapeType(inverse ? ShapeType.LINE_INV : ShapeType.LINE);
+//    }
+//    
+//    /**
+//     * Gets the orientation of the line, if inverse is false, then line goes
+//     * from top-left to bottom-right, otherwise inverse equals true 
+//     *
+//     * @return inverse the orientation of the line
+//     */
+//    public boolean isInverse() {
+//        return (getShapeType() == ShapeType.LINE_INV);
+//    }
+}
index 5948b4013278f5984eef4f3f752d7f7bf81865a5..08db124d4c1e800408605228eabf0da1f5ad9590 100644 (file)
@@ -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);
index 5cb5698a4f195bd41c422967a63a178dcfbfb6e9..9e7ff158e72b1d37fefea884300b7a3bcd5ca055 100644 (file)
@@ -31,7 +31,6 @@ import org.apache.poi.ddf.EscherProperties;
 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 HSLFGroupShape implements TableShape {
                 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 HSLFGroupShape implements TableShape {
      *
      * @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 HSLFGroupShape implements TableShape {
      *
      * @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 HSLFGroupShape implements TableShape {
      *
      * @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 HSLFGroupShape implements TableShape {
         }
     }
 
-    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 HSLFGroupShape implements TableShape {
      *
      * @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);
index 74abd190386fe6cb4ec9eaa42cd15a128d534b53..e22db21baf2a3be713b78c2f4a27ba33a564e0a6 100644 (file)
@@ -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 HSLFTextBox {
     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 HSLFTextBox {
         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 HSLFTextBox {
         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;
     }
index 5d58b2538325c9c7061ae814e974c05382cfa066..b26e10215f420c45c1ea37627e4c32c48bda1320 100644 (file)
@@ -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);
index 8141650fe75bc745988c377c532c6fc7a8a261cd..3fca4c2571815c88f489fadad4859a3c691b0414 100644 (file)
@@ -54,6 +54,7 @@ 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.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());