Package java.awt.geom

Examples of java.awt.geom.Line2D.intersects()


    harness.check(line3.intersects(new Rectangle2D.Double(0.0, 1.0, 1.0, 1.0)));
   
    Line2D line4 = new Line2D.Double(1.0, 0.0, 1.0, 1.0);
    harness.check(!line4.intersects(-1.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(0.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(1.0, 0.0, 1.0, 1.0));
    harness.check(!line4.intersects(new Rectangle2D.Double(-1.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(0.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(1.0, 0.0, 1.0, 1.0)));

    boolean pass = false;
View Full Code Here


   
    Line2D line4 = new Line2D.Double(1.0, 0.0, 1.0, 1.0);
    harness.check(!line4.intersects(-1.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(0.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(1.0, 0.0, 1.0, 1.0));
    harness.check(!line4.intersects(new Rectangle2D.Double(-1.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(0.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(1.0, 0.0, 1.0, 1.0)));

    boolean pass = false;
    try {
View Full Code Here

    Line2D line4 = new Line2D.Double(1.0, 0.0, 1.0, 1.0);
    harness.check(!line4.intersects(-1.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(0.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(1.0, 0.0, 1.0, 1.0));
    harness.check(!line4.intersects(new Rectangle2D.Double(-1.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(0.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(1.0, 0.0, 1.0, 1.0)));

    boolean pass = false;
    try {
        line4.intersects(null);
View Full Code Here

    harness.check(!line4.intersects(-1.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(0.0, 0.0, 1.0, 1.0));
    harness.check(line4.intersects(1.0, 0.0, 1.0, 1.0));
    harness.check(!line4.intersects(new Rectangle2D.Double(-1.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(0.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(1.0, 0.0, 1.0, 1.0)));

    boolean pass = false;
    try {
        line4.intersects(null);
    }
View Full Code Here

    harness.check(line4.intersects(new Rectangle2D.Double(0.0, 0.0, 1.0, 1.0)));
    harness.check(line4.intersects(new Rectangle2D.Double(1.0, 0.0, 1.0, 1.0)));

    boolean pass = false;
    try {
        line4.intersects(null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    harness.check(pass)
View Full Code Here

  public boolean intersects(Rectangle2D r) {
    if(np==0)return false;
    Line2D line = new Line2D.Double(x[0],y[0],x[0],y[0]);
    for (int i = 1; i < np; i++) {
      line.setLine(x[i-1], y[i-1], x[i], y[i]);
      if(line.intersects(r))return true;
    }
    return false;
  }

  /**
 
View Full Code Here

  public boolean intersects(Rectangle2D r) {
    if(np==0)return false;
    Line2D line = new Line2D.Double(x[0],y[0],x[0],y[0]);
    for (int i = 1; i < np; i++) {
      line.setLine(x[i-1], y[i-1], x[i], y[i]);
      if(line.intersects(r))return true;
    }
    return false;
  }

  /**
 
View Full Code Here

        }
        else if (PlotOrientation.VERTICAL == l_orientation) {
            l_line = new Line2D.Double(l_x1, l_y1, l_x2, l_y2);
        }

        if ((null != l_line) && l_line.intersects(x_dataArea)) {
            x_graphics.setPaint(getItemPaint(x_series, x_item));
            x_graphics.setStroke(getItemStroke(x_series, x_item));
            x_graphics.draw(l_line);
        }
    }
View Full Code Here

  public boolean intersects(Rectangle2D r) {
    if(np==0)return false;
    Line2D line = new Line2D.Double(x[0],y[0],x[0],y[0]);
    for (int i = 1; i < np; i++) {
      line.setLine(x[i-1], y[i-1], x[i], y[i]);
      if(line.intersects(r))return true;
    }
    return false;
  }

  /**
 
View Full Code Here

  public boolean intersects(Rectangle2D r) {
    if(np==0)return false;
    Line2D line = new Line2D.Double(x[0],y[0],x[0],y[0]);
    for (int i = 1; i < np; i++) {
      line.setLine(x[i-1], y[i-1], x[i], y[i]);
      if(line.intersects(r))return true;
    }
    return false;
  }

  /**
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.