类sun.awt.geom.AreaOp源码实例Demo

下面列出了怎么用sun.awt.geom.AreaOp的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: jdk1.8-source-analysis   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码2 项目: TencentKona-8   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码3 项目: jdk8u60   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码4 项目: JDKSourceCode1.8   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码5 项目: openjdk-jdk8u   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码6 项目: jdk8u-jdk   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码7 项目: jdk8u-dev-jdk   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码8 项目: openjdk-jdk8u-backup   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码9 项目: Bytecoder   文件: Area.java
/**
 * Tests whether the geometries of the two {@code Area} objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the {@code Area} to be compared to this
 *          {@code Area}
 * @return  {@code true} if the two geometries are equal;
 *          {@code false} otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector<Curve> c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码10 项目: openjdk-jdk9   文件: Area.java
/**
 * Tests whether the geometries of the two {@code Area} objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the {@code Area} to be compared to this
 *          {@code Area}
 * @return  {@code true} if the two geometries are equal;
 *          {@code false} otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector<Curve> c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码11 项目: jdk-1.7-annotated   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码12 项目: jdk8u-jdk   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码13 项目: openjdk-8   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码14 项目: openjdk-8-source   文件: Area.java
/**
 * Tests whether the geometries of the two <code>Area</code> objects
 * are equal.
 * This method will return false if the argument is null.
 * @param   other  the <code>Area</code> to be compared to this
 *          <code>Area</code>
 * @return  <code>true</code> if the two geometries are equal;
 *          <code>false</code> otherwise.
 * @since 1.2
 */
public boolean equals(Area other) {
    // REMIND: A *much* simpler operation should be possible...
    // Should be able to do a curve-wise comparison since all Areas
    // should evaluate their curves in the same top-down order.
    if (other == this) {
        return true;
    }
    if (other == null) {
        return false;
    }
    Vector c = new AreaOp.XorOp().calculate(this.curves, other.curves);
    return c.isEmpty();
}
 
源代码15 项目: jdk1.8-source-analysis   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码16 项目: dragonwell8_jdk   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码17 项目: jdk8u-jdk   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码18 项目: jdk8u_jdk   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码19 项目: jdk8u60   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码20 项目: JDKSourceCode1.8   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码21 项目: openjdk-jdk8u   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码23 项目: Bytecoder   文件: Area.java
private static Vector<Curve> pathToCurves(PathIterator pi) {
    Vector<Curve> curves = new Vector<>();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double[] coords = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码24 项目: openjdk-jdk9   文件: Area.java
private static Vector<Curve> pathToCurves(PathIterator pi) {
    Vector<Curve> curves = new Vector<>();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码25 项目: jdk8u-jdk   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码26 项目: jdk-1.7-annotated   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码27 项目: Java8CN   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码28 项目: hottub   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码29 项目: openjdk-8-source   文件: Area.java
private static Vector pathToCurves(PathIterator pi) {
    Vector curves = new Vector();
    int windingRule = pi.getWindingRule();
    // coords array is big enough for holding:
    //     coordinates returned from currentSegment (6)
    //     OR
    //         two subdivided quadratic curves (2+4+4=10)
    //         AND
    //             0-1 horizontal splitting parameters
    //             OR
    //             2 parametric equation derivative coefficients
    //     OR
    //         three subdivided cubic curves (2+6+6+6=20)
    //         AND
    //             0-2 horizontal splitting parameters
    //             OR
    //             3 parametric equation derivative coefficients
    double coords[] = new double[23];
    double movx = 0, movy = 0;
    double curx = 0, cury = 0;
    double newx, newy;
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case PathIterator.SEG_MOVETO:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx = coords[0];
            cury = movy = coords[1];
            Curve.insertMove(curves, movx, movy);
            break;
        case PathIterator.SEG_LINETO:
            newx = coords[0];
            newy = coords[1];
            Curve.insertLine(curves, curx, cury, newx, newy);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_QUADTO:
            newx = coords[2];
            newy = coords[3];
            Curve.insertQuad(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CUBICTO:
            newx = coords[4];
            newy = coords[5];
            Curve.insertCubic(curves, curx, cury, coords);
            curx = newx;
            cury = newy;
            break;
        case PathIterator.SEG_CLOSE:
            Curve.insertLine(curves, curx, cury, movx, movy);
            curx = movx;
            cury = movy;
            break;
        }
        pi.next();
    }
    Curve.insertLine(curves, curx, cury, movx, movy);
    AreaOp operator;
    if (windingRule == PathIterator.WIND_EVEN_ODD) {
        operator = new AreaOp.EOWindOp();
    } else {
        operator = new AreaOp.NZWindOp();
    }
    return operator.calculate(curves, EmptyCurves);
}
 
源代码30 项目: jdk1.8-source-analysis   文件: Area.java
/**
 * Adds the shape of the specified <code>Area</code> to the
 * shape of this <code>Area</code>.
 * The resulting shape of this <code>Area</code> will include
 * the union of both shapes, or all areas that were contained
 * in either this or the specified <code>Area</code>.
 * <pre>
 *     // Example:
 *     Area a1 = new Area([triangle 0,0 =&gt; 8,0 =&gt; 0,8]);
 *     Area a2 = new Area([triangle 0,0 =&gt; 8,0 =&gt; 8,8]);
 *     a1.add(a2);
 *
 *        a1(before)     +         a2         =     a1(after)
 *
 *     ################     ################     ################
 *     ##############         ##############     ################
 *     ############             ############     ################
 *     ##########                 ##########     ################
 *     ########                     ########     ################
 *     ######                         ######     ######    ######
 *     ####                             ####     ####        ####
 *     ##                                 ##     ##            ##
 * </pre>
 * @param   rhs  the <code>Area</code> to be added to the
 *          current shape
 * @throws NullPointerException if <code>rhs</code> is null
 * @since 1.2
 */
public void add(Area rhs) {
    curves = new AreaOp.AddOp().calculate(this.curves, rhs.curves);
    invalidateBounds();
}
 
 类所在包
 类方法
 同包方法