java.awt.geom.Path2D#intersects ( )源码实例Demo

下面列出了java.awt.geom.Path2D#intersects ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码2 项目: TencentKona-8   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码3 项目: jdk8u60   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码4 项目: openjdk-jdk8u   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码6 项目: openjdk-jdk9   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码7 项目: jdk8u-jdk   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码8 项目: hottub   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码9 项目: jdk8u_jdk   文件: Path2DCopyConstructor.java
static void testIntersect(Path2D pathA, Path2D pathB) {
    boolean resA = pathA.intersects(rect2d);
    boolean resB = pathB.intersects(rect2d);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(rect2d) are not equals ["
            + resA + "|" + resB + "] !");
    }
    resA = pathA.intersects(1.0, 2.0, 13.0, 17.0);
    resB = pathB.intersects(1.0, 2.0, 13.0, 17.0);
    if (resA != resB) {
        throw new IllegalStateException("Intersects(doubles) are not equals ["
            + resA + "|" + resB + "] !");
    }
    log("testIntersect: passed.");
}
 
源代码10 项目: FastAsyncWorldedit   文件: ShapeInterpolator.java
public boolean intersects(double x, double y, double w, double h) {
    return Path2D.intersects(getPathIterator(null), x, y, w, h);
}
 
源代码11 项目: FastAsyncWorldedit   文件: ShapeInterpolator.java
public boolean intersects(Rectangle2D r) {
    return Path2D.intersects(getPathIterator(null), r);
}
 
源代码12 项目: mil-sym-java   文件: SinglePointRenderer.java
private ShapeInfo CreateFeintDummyIndicator(String symbolID, Rectangle2D symbolBounds, Rectangle2D echelonBounds )
{
    Path2D sFeint = new Path2D.Double();
    ShapeInfo siFeint = null;
    //float dash[] = {5.0f};
    float dash[] = {6.0f, 4.0f};
    //Shape sFeint = null;
    //dashed stroke
    float width = 2.0f;

    try
    {
        if(symbolBounds != null && symbolBounds.getWidth()<20)
        {
            width = 1.0f;
            dash[0] = 5.0f;
            dash[1] = 3.0f;
        }
        
        Stroke stroke = new BasicStroke(width,BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);

        Point2D left = new Point2D.Double(symbolBounds.getX(), symbolBounds.getY());

        Point2D top = null;//new Point2D.Double(symbolBounds.getCenterX(), symbolBounds.getY() - (symbolBounds.getHeight() * .75));

        Point2D right = new Point2D.Double(symbolBounds.getX() + symbolBounds.getWidth(), symbolBounds.getY());

        String affiliation = symbolID.substring(1, 2);
                    if(affiliation.equals("F") ||
                            affiliation.equals("A") ||
                            affiliation.equals("D") ||
                            affiliation.equals("M") ||
                            affiliation.equals("J") ||
                            affiliation.equals("K"))
                    {
                        top = new Point2D.Double(symbolBounds.getCenterX(), symbolBounds.getY() - (symbolBounds.getHeight() * .75));
                    }
                    else
                    {
                        top = new Point2D.Double(symbolBounds.getCenterX(), symbolBounds.getY() - (symbolBounds.getHeight() * .54));

                    }

        Line2D leftLine = new Line2D.Double(left, top);
        Line2D rightLine = new Line2D.Double(top, right);
        sFeint.append(leftLine, false);
        sFeint.append(rightLine, false);

        if(echelonBounds != null && sFeint.intersects(echelonBounds))
        {
            //move it above echelon and add some breathing room
            sFeint.transform(AffineTransform.getTranslateInstance(0, -echelonBounds.getHeight()-2));
        }

        siFeint = new ShapeInfo(sFeint);
        siFeint.setLineColor(Color.BLACK);
        siFeint.setStroke(stroke);
        siFeint.setShapeType(ShapeInfo.SHAPE_TYPE_UNIT_DISPLAY_MODIFIER);
    }
    catch(Exception exc)
    {
        ErrorLogger.LogException(_className, "CreateFeintDummyIndicator()", exc);
    }
    return siFeint;
}