示例#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;
 }