Search in sources :

Example 1 with HwmfLineDash

use of org.apache.poi.hwmf.record.HwmfPenStyle.HwmfLineDash in project poi by apache.

the class HwmfGraphics method draw.

public void draw(Shape shape) {
    HwmfLineDash lineDash = prop.getPenStyle().getLineDash();
    if (lineDash == HwmfLineDash.NULL) {
        // line is not drawn
        return;
    }
    BasicStroke stroke = getStroke();
    // only makes sense if the line is not solid
    if (prop.getBkMode() == HwmfBkMode.OPAQUE && (lineDash != HwmfLineDash.SOLID && lineDash != HwmfLineDash.INSIDEFRAME)) {
        graphicsCtx.setStroke(new BasicStroke(stroke.getLineWidth()));
        graphicsCtx.setColor(prop.getBackgroundColor().getColor());
        graphicsCtx.draw(shape);
    }
    // then draw the (dashed) line
    graphicsCtx.setStroke(stroke);
    graphicsCtx.setColor(prop.getPenColor().getColor());
    graphicsCtx.draw(shape);
}
Also used : BasicStroke(java.awt.BasicStroke) HwmfLineDash(org.apache.poi.hwmf.record.HwmfPenStyle.HwmfLineDash)

Aggregations

BasicStroke (java.awt.BasicStroke)1 HwmfLineDash (org.apache.poi.hwmf.record.HwmfPenStyle.HwmfLineDash)1