public java.util.List<Figure> findFigures(Rectangle2D.Double r) {
   LinkedList<Figure> c = new LinkedList<Figure>(quadTree.findIntersects(r));
   switch (c.size()) {
     case 0:
       // fall through
     case 1:
       return c;
     default:
       return sort(c);
   }
 }
  public void end() {
    final int[] selected = table.getSelectedRows();

    model.clear(rows.size());
    Iterator i = rows.iterator();
    while (i.hasNext()) {
      model.addEntry((Map) i.next());
    }
    rows.clear();

    if (SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              model.fireListeners();
              fixSelection(selected);
            }
          });
    } else {
      model.fireListeners();
      fixSelection(selected);
    }
  }