当前位置: 首页>>代码示例>>Java>>正文


Java PathConsumer2D.lineTo方法代码示例

本文整理汇总了Java中sun.awt.geom.PathConsumer2D.lineTo方法的典型用法代码示例。如果您正苦于以下问题:Java PathConsumer2D.lineTo方法的具体用法?Java PathConsumer2D.lineTo怎么用?Java PathConsumer2D.lineTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.geom.PathConsumer2D的用法示例。


在下文中一共展示了PathConsumer2D.lineTo方法的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]);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:Stroker.java

示例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();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:RenderingEngine.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:Stroker.java

示例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;
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:39,代码来源:Stroker.java

示例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;
}
 
开发者ID:bourgesl,项目名称:marlin-renderer,代码行数:37,代码来源:MarlinRenderingEngine.java


注:本文中的sun.awt.geom.PathConsumer2D.lineTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。