Search in sources :

Example 1 with HwmfPenStyle

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

the class HwmfGraphics method getStroke.

protected BasicStroke getStroke() {
    // TODO: fix line width calculation
    float width = (float) prop.getPenWidth();
    if (width == 0) {
        width = 1;
    }
    HwmfPenStyle ps = prop.getPenStyle();
    int cap = ps.getLineCap().awtFlag;
    int join = ps.getLineJoin().awtFlag;
    float miterLimit = (float) prop.getPenMiterLimit();
    float[] dashes = ps.getLineDash().dashes;
    boolean dashAlt = ps.isAlternateDash();
    // This value is not an integer index into the dash pattern array.
    // Instead, it is a floating-point value that specifies a linear distance.
    float dashStart = (dashAlt && dashes != null && dashes.length > 1) ? dashes[0] : 0;
    return new BasicStroke(width, cap, join, miterLimit, dashes, dashStart);
}
Also used : BasicStroke(java.awt.BasicStroke) TexturePaint(java.awt.TexturePaint) Paint(java.awt.Paint) HwmfPenStyle(org.apache.poi.hwmf.record.HwmfPenStyle)

Aggregations

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