* PathConsumer.
*/
public static PathConsumer createStroker(PathConsumer consumer,
BasicStroke bs, boolean thin,
AffineTransform transform) {
PathStroker stroker = new PathStroker(consumer);
consumer = stroker;
float matrix[] = null;
if (!thin) {
stroker.setPenDiameter(bs.getLineWidth());
if (transform != null) {
matrix = new float[4];
double dmatrix[] = new double[6];
transform.getMatrix(dmatrix);
for (int i = 0; i < 4; i++) {
matrix[i] = (float) dmatrix[i];
}
}
stroker.setPenT4(matrix);
stroker.setPenFitting(PenUnits, MinPenUnits);
}
stroker.setCaps(RasterizerCaps[bs.getEndCap()]);
stroker.setCorners(RasterizerCorners[bs.getLineJoin()],
bs.getMiterLimit());
float[] dashes = bs.getDashArray();
if (dashes != null) {
PathDasher dasher = new PathDasher(stroker);
dasher.setDash(dashes, bs.getDashPhase());