本文整理汇总了Java中sun.awt.geom.PathConsumer2D.quadTo方法的典型用法代码示例。如果您正苦于以下问题:Java PathConsumer2D.quadTo方法的具体用法?Java PathConsumer2D.quadTo怎么用?Java PathConsumer2D.quadTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.geom.PathConsumer2D
的用法示例。
在下文中一共展示了PathConsumer2D.quadTo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pop
import sun.awt.geom.PathConsumer2D; //导入方法依赖的package包/类
public void pop(PathConsumer2D io) {
numCurves--;
int type = curveTypes[numCurves];
end -= (type - 2);
switch(type) {
case 8:
io.curveTo(curves[end+0], curves[end+1],
curves[end+2], curves[end+3],
curves[end+4], curves[end+5]);
break;
case 6:
io.quadTo(curves[end+0], curves[end+1],
curves[end+2], curves[end+3]);
break;
case 4:
io.lineTo(curves[end], curves[end+1]);
}
}
示例2: feedConsumer
import sun.awt.geom.PathConsumer2D; //导入方法依赖的package包/类
/**
* Utility method to feed a {@link PathConsumer2D} object from a
* given {@link PathIterator}.
* This method deals with the details of running the iterator and
* feeding the consumer a segment at a time.
*/
public static void feedConsumer(PathIterator pi, PathConsumer2D consumer) {
float coords[] = new float[6];
while (!pi.isDone()) {
switch (pi.currentSegment(coords)) {
case PathIterator.SEG_MOVETO:
consumer.moveTo(coords[0], coords[1]);
break;
case PathIterator.SEG_LINETO:
consumer.lineTo(coords[0], coords[1]);
break;
case PathIterator.SEG_QUADTO:
consumer.quadTo(coords[0], coords[1],
coords[2], coords[3]);
break;
case PathIterator.SEG_CUBICTO:
consumer.curveTo(coords[0], coords[1],
coords[2], coords[3],
coords[4], coords[5]);
break;
case PathIterator.SEG_CLOSE:
consumer.closePath();
break;
}
pi.next();
}
}
示例3: popAll
import sun.awt.geom.PathConsumer2D; //导入方法依赖的package包/类
void popAll(PathConsumer2D io) {
if (DO_STATS) {
// update used marks:
if (numCurves > curveTypesUseMark) {
curveTypesUseMark = numCurves;
}
if (end > curvesUseMark) {
curvesUseMark = end;
}
}
final byte[] _curveTypes = curveTypes;
final float[] _curves = curves;
int nc = numCurves;
int e = end;
while (nc != 0) {
switch(_curveTypes[--nc]) {
case TYPE_LINETO:
e -= 2;
io.lineTo(_curves[e], _curves[e+1]);
continue;
case TYPE_QUADTO:
e -= 4;
io.quadTo(_curves[e+0], _curves[e+1],
_curves[e+2], _curves[e+3]);
continue;
case TYPE_CUBICTO:
e -= 6;
io.curveTo(_curves[e+0], _curves[e+1],
_curves[e+2], _curves[e+3],
_curves[e+4], _curves[e+5]);
continue;
default:
}
}
numCurves = 0;
end = 0;
}
示例4: popAll
import sun.awt.geom.PathConsumer2D; //导入方法依赖的package包/类
void popAll(PathConsumer2D io) {
if (doStats) {
// update used marks:
if (numCurves > curveTypesUseMark) {
curveTypesUseMark = numCurves;
}
if (end > curvesUseMark) {
curvesUseMark = end;
}
}
final byte[] _curveTypes = curveTypes;
final float[] _curves = curves;
int nc = numCurves;
int e = end;
while (nc != 0) {
switch(_curveTypes[--nc]) {
case TYPE_LINETO:
e -= 2;
io.lineTo(_curves[e], _curves[e+1]);
continue;
case TYPE_QUADTO:
e -= 4;
io.quadTo(_curves[e+0], _curves[e+1],
_curves[e+2], _curves[e+3]);
continue;
case TYPE_CUBICTO:
e -= 6;
io.curveTo(_curves[e+0], _curves[e+1],
_curves[e+2], _curves[e+3],
_curves[e+4], _curves[e+5]);
continue;
default:
}
}
numCurves = 0;
end = 0;
}
示例5: pathTo
import sun.awt.geom.PathConsumer2D; //导入方法依赖的package包/类
private static void pathTo(final RendererContext rdrCtx, final PathIterator pi,
final PathConsumer2D pc2d)
{
// mark context as DIRTY:
rdrCtx.dirty = true;
final float[] coords = rdrCtx.float6;
for (; !pi.isDone(); pi.next()) {
switch (pi.currentSegment(coords)) {
case PathIterator.SEG_MOVETO:
pc2d.moveTo(coords[0], coords[1]);
continue;
case PathIterator.SEG_LINETO:
pc2d.lineTo(coords[0], coords[1]);
continue;
case PathIterator.SEG_QUADTO:
pc2d.quadTo(coords[0], coords[1],
coords[2], coords[3]);
continue;
case PathIterator.SEG_CUBICTO:
pc2d.curveTo(coords[0], coords[1],
coords[2], coords[3],
coords[4], coords[5]);
continue;
case PathIterator.SEG_CLOSE:
pc2d.closePath();
continue;
default:
}
}
pc2d.pathDone();
// mark context as CLEAN:
rdrCtx.dirty = false;
}