Package java.awt.geom

Examples of java.awt.geom.Rectangle2D.outcode()


               
                Rectangle2D b=ss.element.getBounds2D();
                b.setFrame(b.getX()+5.,b.getY()+5.,b.getWidth()-10.,b.getHeight()-10.);

                // look for the closest corner
                int oc=b.outcode(x,y);
                switch(oc){
                case Rectangle2D.OUT_TOP:
                    res = 1;
                    break;
                case Rectangle2D.OUT_TOP|Rectangle2D.OUT_RIGHT:
View Full Code Here


    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
   
    boolean pass = false;
    try
View Full Code Here

    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
   
    boolean pass = false;
    try
    {
View Full Code Here

    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
   
    boolean pass = false;
    try
    {
      r.outcode(null);
View Full Code Here

    harness.check(r.outcode(1.0, 1.0) == outside);
   
    boolean pass = false;
    try
    {
      r.outcode(null);
    }
    catch (NullPointerException e)
    {
      pass = true;
    }
View Full Code Here

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness
  {
    Rectangle2D r = new Rectangle2D.Double(0.0, 0.0, 10.0, 10.0);
    harness.check(r.outcode(5.0, 5.0) == 0);
    harness.check(r.outcode(0.0, 0.0) == 0);
    harness.check(r.outcode(0.0, 10.0) == 0);
    harness.check(r.outcode(10.0, 0.0) == 0);
    harness.check(r.outcode(10.0, 10.0) == 0);
    harness.check(r.outcode(-5.0, 5.0) == Rectangle2D.OUT_LEFT);   
View Full Code Here

   */
  public void test(TestHarness harness
  {
    Rectangle2D r = new Rectangle2D.Double(0.0, 0.0, 10.0, 10.0);
    harness.check(r.outcode(5.0, 5.0) == 0);
    harness.check(r.outcode(0.0, 0.0) == 0);
    harness.check(r.outcode(0.0, 10.0) == 0);
    harness.check(r.outcode(10.0, 0.0) == 0);
    harness.check(r.outcode(10.0, 10.0) == 0);
    harness.check(r.outcode(-5.0, 5.0) == Rectangle2D.OUT_LEFT);   
    harness.check(r.outcode(15.0, 5.0) == Rectangle2D.OUT_RIGHT);   
View Full Code Here

  public void test(TestHarness harness
  {
    Rectangle2D r = new Rectangle2D.Double(0.0, 0.0, 10.0, 10.0);
    harness.check(r.outcode(5.0, 5.0) == 0);
    harness.check(r.outcode(0.0, 0.0) == 0);
    harness.check(r.outcode(0.0, 10.0) == 0);
    harness.check(r.outcode(10.0, 0.0) == 0);
    harness.check(r.outcode(10.0, 10.0) == 0);
    harness.check(r.outcode(-5.0, 5.0) == Rectangle2D.OUT_LEFT);   
    harness.check(r.outcode(15.0, 5.0) == Rectangle2D.OUT_RIGHT);   
    harness.check(r.outcode(5.0, -5.0) == Rectangle2D.OUT_TOP);   
View Full Code Here

  {
    Rectangle2D r = new Rectangle2D.Double(0.0, 0.0, 10.0, 10.0);
    harness.check(r.outcode(5.0, 5.0) == 0);
    harness.check(r.outcode(0.0, 0.0) == 0);
    harness.check(r.outcode(0.0, 10.0) == 0);
    harness.check(r.outcode(10.0, 0.0) == 0);
    harness.check(r.outcode(10.0, 10.0) == 0);
    harness.check(r.outcode(-5.0, 5.0) == Rectangle2D.OUT_LEFT);   
    harness.check(r.outcode(15.0, 5.0) == Rectangle2D.OUT_RIGHT);   
    harness.check(r.outcode(5.0, -5.0) == Rectangle2D.OUT_TOP);   
    harness.check(r.outcode(5.0, 15.0) == Rectangle2D.OUT_BOTTOM);   
View Full Code Here

    Rectangle2D r = new Rectangle2D.Double(0.0, 0.0, 10.0, 10.0);
    harness.check(r.outcode(5.0, 5.0) == 0);
    harness.check(r.outcode(0.0, 0.0) == 0);
    harness.check(r.outcode(0.0, 10.0) == 0);
    harness.check(r.outcode(10.0, 0.0) == 0);
    harness.check(r.outcode(10.0, 10.0) == 0);
    harness.check(r.outcode(-5.0, 5.0) == Rectangle2D.OUT_LEFT);   
    harness.check(r.outcode(15.0, 5.0) == Rectangle2D.OUT_RIGHT);   
    harness.check(r.outcode(5.0, -5.0) == Rectangle2D.OUT_TOP);   
    harness.check(r.outcode(5.0, 15.0) == Rectangle2D.OUT_BOTTOM);   
    harness.check(r.outcode(-5.0, -5.0) == (Rectangle2D.OUT_LEFT
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.