Example usage for org.apache.poi.xslf.usermodel XSLFSimpleShape setLineWidth

List of usage examples for org.apache.poi.xslf.usermodel XSLFSimpleShape setLineWidth

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XSLFSimpleShape setLineWidth.

Prototype

@SuppressWarnings("WeakerAccess")
public void setLineWidth(double width) 

Source Link

Usage

From source file:de.kiwiwings.jasperreports.exporter.PptxShapeExporter.java

License:Open Source License

protected void exportElementAttributes(XSLFSimpleShape xsShape // the target shape
        , JRCommonElement jrShape // the source shape
        , JRPen jrPen // the outline of the shape
        , JRBoxContainer jrBox // box around the shape, if applicable
        , XSLFShape hyperlinkTarget // a shape or group of shape as hyperlink object
) {/*  w w  w.j ava2 s.co m*/
    assert (xsShape != null && jrShape != null);

    if (jrShape.getKey() != null) {
        XSLFSimpleShapeHelper.setShapeName(xsShape, jrShape.getKey());
    }

    if ((jrShape.getModeValue() == null || jrShape.getModeValue() == ModeEnum.OPAQUE)
            && jrShape.getBackcolor() != null) {
        xsShape.setFillColor(jrShape.getBackcolor());
    }

    if (jrPen != null && jrPen.getLineWidth() > 0) {
        xsShape.setLineWidth(jrPen.getLineWidth());
        xsShape.setLineColor(jrPen.getLineColor());
        switch (jrPen.getLineStyleValue()) {
        case DASHED:
            xsShape.setLineDash(LineDash.DASH);
            break;
        case DOTTED:
            xsShape.setLineDash(LineDash.DOT);
            break;
        default:
            xsShape.setLineDash(LineDash.SOLID);
            break;
        }
    }

    // TODO: set border to box around the shape

    setHyperlinkURL(jrShape, hyperlinkTarget);
}