Examples of ChsRectangle


Examples of org.gvt.util.ChsRectangle

  /*
   * Main method for testing purposes.
   */
  public static void main(String [] args)
  {
    ChsRectangle rect = new ChsRectangle();
    PrecisionPoint p1;
    PrecisionPoint p2;
    Random rand = new Random();
    double x;
    double y;
    double width;
    double height;
    double p1x;
    double p1y;
    double p2x;
    double p2y;

    int counter = 0;
    int i,j=0;
   
    for(i=0; i<10; i++)
    {
      System.out.println("------------------------------------");
      System.out.println("Test " + i + ":");
     
      x = 1000 * rand.nextDouble();
      y = 1000 * rand.nextDouble();
      width = 1000 * rand.nextDouble();
      height = 1000 * rand.nextDouble();
      System.out.println("X: " + x + "  Y: " + y + "  Width: " + width + "  Height: " + height);
      rect.setX(x);
      rect.setY(y);
      rect.setWidth(width);
      rect.setHeight(height);
     
      p1x = rect.getCenterX();
      p1y = rect.getCenterY();
     
      p2x = 1000 * rand.nextDouble();
      p2y = 1000 * rand.nextDouble();
     
      System.out.println("Input Point:  X - " + p2x + " Y - " + p2y);
View Full Code Here

Examples of org.gvt.util.ChsRectangle

   */
  public LNode()
  {
    this.initialize();
    this.graphManager = null;
    rect = new ChsRectangle();
  }
View Full Code Here

Examples of org.gvt.util.ChsRectangle

   */
  public LNode(LGraphManager gm)
  {
    this.initialize();
    this.graphManager = gm;
    rect = new ChsRectangle();
  }
View Full Code Here

Examples of org.gvt.util.ChsRectangle

  public LNode(LGraphManager gm, Point loc, Dimension size)
  {
    this.initialize();

    this.graphManager = gm;
    rect = new ChsRectangle(loc.x, loc.y, size.height, size.width);
  }
View Full Code Here

Examples of org.gvt.util.ChsRectangle

    return result;
  }

  private static void testClippingPoints()
  {
    ChsRectangle rectA = new ChsRectangle(5, 6, 2, 4);
    ChsRectangle rectB;
   
    rectB = new ChsRectangle(0, 4, 1, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(1, 4, 1, 2);
    findAndPrintClipPoints(rectA, rectB);
 
    rectB = new ChsRectangle(1, 3, 3, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------   
    rectB = new ChsRectangle(2, 3, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(3, 3, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(3, 2, 4, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------   
    rectB = new ChsRectangle(6, 3, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------   
    rectB = new ChsRectangle(9, 2, 4, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(9, 3, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(8, 3, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(11, 3, 3, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(11, 4, 1, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(10, 4, 1, 4);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(10, 5, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(9, 4.5, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(10, 5.8, 0.4, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------   
    rectB = new ChsRectangle(11, 6, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(10, 7.8, 0.4, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(9, 7.5, 1, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(10, 7, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(10, 9, 2, 6);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(11, 9, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(12, 8, 4, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(7, 9, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(8, 9, 4, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(10, 9, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(6, 10, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(3, 8, 4, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(3, 9, 2, 2);
    findAndPrintClipPoints(rectA, rectB);

    rectB = new ChsRectangle(2, 8, 4, 4);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(2, 8, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(1, 8, 2, 4);
    findAndPrintClipPoints(rectA, rectB);
 
    rectB = new ChsRectangle(1, 8.5, 1, 4);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(3, 7, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(1, 7.5, 1, 4);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(3, 7.8, 0.4, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(1, 6, 2, 2);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------   
    rectB = new ChsRectangle(3, 5.8, 0.4, 2);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(1, 5, 1, 3);
    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(1, 4, 3, 3);
    findAndPrintClipPoints(rectA, rectB);
//----------------------------------------------
    rectB = new ChsRectangle(4, 4, 3, 3);
//    findAndPrintClipPoints(rectA, rectB);
   
    rectB = new ChsRectangle(5, 6, 2, 4);
//    findAndPrintClipPoints(rectA, rectB);
  }
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.