本文整理汇总了Java中sun.dc.pr.PathStroker.setCorners方法的典型用法代码示例。如果您正苦于以下问题:Java PathStroker.setCorners方法的具体用法?Java PathStroker.setCorners怎么用?Java PathStroker.setCorners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.dc.pr.PathStroker
的用法示例。
在下文中一共展示了PathStroker.setCorners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: strokeTo
import sun.dc.pr.PathStroker; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void strokeTo(Shape src,
AffineTransform transform,
BasicStroke bs,
boolean thin,
boolean normalize,
boolean antialias,
PathConsumer2D sr)
{
PathStroker stroker = new PathStroker(sr);
PathConsumer consumer = stroker;
float matrix[] = null;
if (!thin) {
stroker.setPenDiameter(bs.getLineWidth());
if (transform != null) {
matrix = getTransformMatrix(transform);
}
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());
if (transform != null && matrix == null) {
matrix = getTransformMatrix(transform);
}
dasher.setDashT4(matrix);
consumer = dasher;
}
try {
PathIterator pi = src.getPathIterator(transform);
feedConsumer(pi, consumer, normalize, 0.25f);
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")", e);
} finally {
while (consumer != null && consumer != sr) {
PathConsumer next = consumer.getConsumer();
consumer.dispose();
consumer = next;
}
}
}
示例2: strokeTo
import sun.dc.pr.PathStroker; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void strokeTo(Shape src,
AffineTransform transform,
BasicStroke bs,
boolean thin,
boolean normalize,
boolean antialias,
PathConsumer2D sr)
{
PathStroker stroker = new PathStroker(sr);
PathConsumer consumer = stroker;
float matrix[] = null;
if (!thin) {
stroker.setPenDiameter(bs.getLineWidth());
if (transform != null) {
matrix = getTransformMatrix(transform);
}
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());
if (transform != null && matrix == null) {
matrix = getTransformMatrix(transform);
}
dasher.setDashT4(matrix);
consumer = dasher;
}
try {
PathIterator pi = src.getPathIterator(transform);
feedConsumer(pi, consumer, normalize, 0.25f);
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
e.getMessage()+")");
} finally {
while (consumer != null && consumer != sr) {
PathConsumer next = consumer.getConsumer();
consumer.dispose();
consumer = next;
}
}
}