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

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

Introduction

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

Prototype

public void setLineColor(Color color) 

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
) {//from  w w  w. java  2s . c o 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);
}