예제 #1
0
파일: LiteGroup.java 프로젝트: URMC/i2b2
  /**
   * Compute the bounds of the <code>Lite</code> objets.
   *
   * @return The bounding rectangle.
   */
  public Rectangle getBounds() {
    if (lites.isEmpty()) return new Rectangle();

    Enumeration e = elements();
    Lite l = (Lite) e.nextElement();
    Rectangle r = l.getBounds();
    while (e.hasMoreElements()) {
      l = (Lite) e.nextElement();
      r.add(l.getBounds());
    }
    return r;
  }
예제 #2
0
파일: LiteGroup.java 프로젝트: URMC/i2b2
 /**
  * Retrieve the <code>Lite</code> object visible under a point. This object should actually be
  * searched in reverse order in the <code>Lite</code> object list.
  */
 public Lite itemUnder(int x, int y) {
   for (int i = lites.size() - 1; i >= 0; i--) {
     Lite l = elementAt(i);
     if (l.getBounds().contains(x, y)) return l;
   }
   return null;
 }