java类java.awt.geom.Path2D的实例源码

GeneralRenderer.java 文件源码 项目:OpenJSharp 阅读 23 收藏 0 点赞 0 评论 0
public void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
                     int transx, int transy,
                     Path2D.Float p2df)
{
    PixelWriter pw = GeneralRenderer.createSolidPixelWriter(sg2d, sData);
    ProcessPath.drawPath(
        new PixelWriterDrawHandler(sData, pw, sg2d.getCompClip(),
                                   sg2d.strokeHint),
        p2df, transx, transy
    );
}
GeneralRenderer.java 文件源码 项目:OpenJSharp 阅读 28 收藏 0 点赞 0 评论 0
public void FillPath(SunGraphics2D sg2d, SurfaceData sData,
                     int transx, int transy,
                     Path2D.Float p2df)
{
    PixelWriter pw = GeneralRenderer.createXorPixelWriter(sg2d, sData);
    ProcessPath.fillPath(
        new PixelWriterDrawHandler(sData, pw, sg2d.getCompClip(),
                                   sg2d.strokeHint),
        p2df, transx, transy);
}
GeneralRenderer.java 文件源码 项目:OpenJSharp 阅读 25 收藏 0 点赞 0 评论 0
public void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
                     int transx, int transy, Path2D.Float p2df)
{
    PixelWriter pw = GeneralRenderer.createXorPixelWriter(sg2d, sData);
    ProcessPath.drawPath(
        new PixelWriterDrawHandler(sData, pw, sg2d.getCompClip(),
                                   sg2d.strokeHint),
        p2df, transx, transy
    );
}
ProcessPath.java 文件源码 项目:OpenJSharp 阅读 24 收藏 0 点赞 0 评论 0
public static boolean fillPath(DrawHandler dhnd, Path2D.Float p2df,
                               int transX, int transY)
{
    FillProcessHandler fhnd = new FillProcessHandler(dhnd);
    if (!doProcessPath(fhnd, p2df, transX, transY)) {
        return false;
    }
    FillPolygon(fhnd, p2df.getWindingRule());
    return true;
}
ProcessPath.java 文件源码 项目:openjdk-jdk10 阅读 25 收藏 0 点赞 0 评论 0
public static boolean fillPath(DrawHandler dhnd, Path2D.Float p2df,
                               int transX, int transY)
{
    FillProcessHandler fhnd = new FillProcessHandler(dhnd);
    if (!doProcessPath(fhnd, p2df, transX, transY)) {
        return false;
    }
    FillPolygon(fhnd, p2df.getWindingRule());
    return true;
}
EmptyCapacity.java 文件源码 项目:openjdk-jdk10 阅读 24 收藏 0 点赞 0 评论 0
public static void main(final String[] args) {
    final Path2D path1 = new Path2D.Double(Path2D.WIND_EVEN_ODD, 0);
    path1.moveTo(10, 10);
    path1.lineTo(20, 20);
    final Path2D path2 = new Path2D.Float(Path2D.WIND_EVEN_ODD, 0);
    path2.moveTo(10, 10);
    path2.lineTo(20, 20);
}
Path2DCopyConstructor.java 文件源码 项目:openjdk-jdk10 阅读 27 收藏 0 点赞 0 评论 0
static void testIterator(Path2D pathA, Path2D pathB) {
    final PathIterator itA = pathA.getPathIterator(at);
    final PathIterator itB = pathB.getPathIterator(at);

    float[] coordsA = new float[6];
    float[] coordsB = new float[6];

    int n = 0;
    for (; !itA.isDone() && !itB.isDone(); itA.next(), itB.next(), n++) {
        int typeA = itA.currentSegment(coordsA);
        int typeB = itB.currentSegment(coordsB);

        if (typeA != typeB) {
            throw new IllegalStateException("Path-segment[" + n + "] "
                + "type are not equals [" + typeA + "|" + typeB + "] !");
        }
        // Take care of floating-point precision:
        if (!equalsArrayEps(coordsA, coordsB, getLength(typeA))) {
            throw new IllegalStateException("Path-segment[" + n + "] coords"
                + " are not equals [" + Arrays.toString(coordsA) + "|"
                + Arrays.toString(coordsB) + "] !");
        }
    }
    if (!itA.isDone() || !itB.isDone()) {
        throw new IllegalStateException("Paths do not have same lengths !");
    }
    log("testIterator: " + n + " segments.");
}
BufferedRenderPipe.java 文件源码 项目:OpenJSharp 阅读 24 收藏 0 点赞 0 评论 0
protected void fillPath(SunGraphics2D sg2d,
                        Path2D.Float p2df, int transx, int transy)
{
    rq.lock();
    try {
        validateContext(sg2d);
        drawHandler.validate(sg2d);
        drawHandler.startFillPath();
        ProcessPath.fillPath(drawHandler, p2df, transx, transy);
        drawHandler.endFillPath();
    } finally {
        rq.unlock();
    }
}
BufferedRenderPipe.java 文件源码 项目:openjdk-jdk10 阅读 31 收藏 0 点赞 0 评论 0
protected void drawPath(SunGraphics2D sg2d,
                        Path2D.Float p2df, int transx, int transy)
{
    rq.lock();
    try {
        validateContext(sg2d);
        drawHandler.validate(sg2d);
        ProcessPath.drawPath(drawHandler, p2df, transx, transy);
    } finally {
        rq.unlock();
    }
}
Path2DCopyConstructor.java 文件源码 项目:jdk8u-jdk 阅读 34 收藏 0 点赞 0 评论 0
static void testFlattening(Path2D pathA, Path2D pathB) {
    final PathIterator itA = pathA.getPathIterator(at, FLATNESS);
    final PathIterator itB = pathB.getPathIterator(at, FLATNESS);

    float[] coordsA = new float[6];
    float[] coordsB = new float[6];

    int n = 0;
    for (; !itA.isDone() && !itB.isDone(); itA.next(), itB.next(), n++) {
        int typeA = itA.currentSegment(coordsA);
        int typeB = itB.currentSegment(coordsB);

        if (typeA != typeB) {
            throw new IllegalStateException("Path-segment[" + n + "] "
                + "type are not equals [" + typeA + "|" + typeB + "] !");
        }
        // Take care of floating-point precision:
        if (!equalsArrayEps(coordsA, coordsB, getLength(typeA))) {
            throw new IllegalStateException("Path-segment[" + n + "] coords"
                + " are not equals [" + Arrays.toString(coordsA) + "|"
                + Arrays.toString(coordsB) + "] !");
        }
    }
    if (!itA.isDone() || !itB.isDone()) {
        throw new IllegalStateException("Paths do not have same lengths !");
    }
    log("testFlattening: " + n + " segments.");
}


问题


面经


文章

微信
公众号

扫码关注公众号