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);
}
Aggregations