Package java.awt

Examples of java.awt.Rectangle.union()


                int minRow = Math.min(ankor.row, lead.row);
                int maxRow = Math.max(ankor.row, lead.row);

                rc = getRowRect(minCol, maxCol, ankor.row);
                if(lead.row != ankor.row) {
                    rc = rc.union(getRowRect(minCol, maxCol, lead.row));
                }
                rc = rc.union(getColRect(minRow, maxRow, ankor.col));
                if(ankor.col != lead.col) {
                    rc = rc.union(getColRect(minRow, maxRow, lead.col));
                }
View Full Code Here


                rc = getRowRect(minCol, maxCol, ankor.row);
                if(lead.row != ankor.row) {
                    rc = rc.union(getRowRect(minCol, maxCol, lead.row));
                }
                rc = rc.union(getColRect(minRow, maxRow, ankor.col));
                if(ankor.col != lead.col) {
                    rc = rc.union(getColRect(minRow, maxRow, lead.col));
                }
            }
            return rc;
View Full Code Here

                if(lead.row != ankor.row) {
                    rc = rc.union(getRowRect(minCol, maxCol, lead.row));
                }
                rc = rc.union(getColRect(minRow, maxRow, ankor.col));
                if(ankor.col != lead.col) {
                    rc = rc.union(getColRect(minRow, maxRow, lead.col));
                }
            }
            return rc;
        }
View Full Code Here

        }

        private Rectangle getRowRect(int a, int b, int row) {
            Rectangle rc = new Rectangle();
            for(int i=a; i<=b; i++) {
                rc = rc.union(getCellRect(new CellPosition(row, i)));
            }
            return rc;
        }

        private Rectangle getColRect(int a, int b, int col) {
View Full Code Here

        }

        private Rectangle getColRect(int a, int b, int col) {
            Rectangle rc = new Rectangle();
            for(int i=a; i<=b; i++) {
                rc = rc.union(getCellRect(new CellPosition(i, col)));
            }
            return rc;
        }
    }
}
View Full Code Here

        for (int j = i + 1; j < blobs.size(); j++) {
          Rectangle a, b;
          a = blobs.get(i).bounds;
          b = blobs.get(j).bounds;
          if (a.intersects(b)) {
            a = a.union(b);
            blobs.get(i).bounds = a;
            blobs.remove(j);
            j--;
          }
        }
View Full Code Here

        for (int j = i + 1; j < blobs.size(); j++) {
          Rectangle a, b;
          a = blobs.get(i).bounds;
          b = blobs.get(j).bounds;
          if (a.intersects(b)) {
            a = a.union(b);
            blobs.get(i).bounds = a;
            blobs.remove(j);
            j--;
          }
        }
View Full Code Here

      } else {
        clip = new Rectangle(rectangles[0]);
        if(rectangles.length > 1) {
          System.err.println("Non-rectangular clip detected on a system that does not support this feature.");
          for(int i=1; i<rectangles.length; i++) {
            clip = clip.union(rectangles[i]);
          }
        }
      }
      if(Utils.equals(this.clip, clip)) {
        return;
View Full Code Here

    // Include the display boxes of our composite children
    try
    {
      for (Iterator it = fFigures.iterator(); it.hasNext();)
      {
        box = box.union(((Figure) it.next()).displayBox());
      }
    }
    catch (ConcurrentModificationException e)
    {
      // Ignore
View Full Code Here

    Rectangle r = new Rectangle(pointAt(0));

    for (Iterator it = segments.iterator(); it.hasNext();)
    {
      r = r.union(((CubicCurve2D) it.next()).getBounds());
    }

    return r;
  }
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.