FileDocCategorySizeDatePackage
TestLine.javaAPI DocApache Poi 3.0.14257Sun Mar 11 12:59:30 GMT 2007org.apache.poi.hslf.model

TestLine

public class TestLine extends TestCase
Test Line shape.
author
Yegor Kozlov

Fields Summary
Constructors Summary
Methods Summary
public voidsetUp()


    
public voidtestCreateLines()

        SlideShow ppt = new SlideShow();

        Slide slide = ppt.createSlide();

        slide.addTitle().setText("Lines tester");

        Line line;

        /**
         * line styles
         */
        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 200, 300, 0));
        line.setLineStyle(Line.LINE_SIMPLE);
        line.setLineColor(Color.blue);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 230, 300, 0));
        line.setLineStyle(Line.LINE_DOUBLE);
        line.setLineWidth(3.5);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 260, 300, 0));
        line.setLineStyle(Line.LINE_TRIPLE);
        line.setLineWidth(6);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 290, 300, 0));
        line.setLineStyle(Line.LINE_THICKTHIN);
        line.setLineWidth(4.5);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 320, 300, 0));
        line.setLineStyle(Line.LINE_THINTHICK);
        line.setLineWidth(5.5);
        slide.addShape(line);

        /**
         * line dashing
         */
        line = new Line();
        line.setAnchor(new java.awt.Rectangle(450, 200, 300, 0));
        line.setLineDashing(Line.PEN_SOLID);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(450, 230, 300, 0));
        line.setLineDashing(Line.PEN_PS_DASH);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(450, 260, 300, 0));
        line.setLineDashing(Line.PEN_DOT);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(450, 290, 300, 0));
        line.setLineDashing(Line.PEN_DOTGEL);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(450, 320, 300, 0));
        line.setLineDashing(Line.PEN_LONGDASHDOTDOTGEL);
        slide.addShape(line);

        /**
         * Combinations
         */
        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 400, 300, 0));
        line.setLineDashing(Line.PEN_DASHDOT);
        line.setLineStyle(Line.LINE_TRIPLE);
        line.setLineWidth(5.0);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 430, 300, 0));
        line.setLineDashing(Line.PEN_DASH);
        line.setLineStyle(Line.LINE_THICKTHIN);
        line.setLineWidth(4.0);
        slide.addShape(line);

        line = new Line();
        line.setAnchor(new java.awt.Rectangle(75, 460, 300, 0));
        line.setLineDashing(Line.PEN_DOT);
        line.setLineStyle(Line.LINE_DOUBLE);
        line.setLineWidth(8.0);
        slide.addShape(line);