Exemplo n.º 1
0
  public void addItem(Item item, Rect4f rect) {
    items.put(rect, item);
    itemRects.put(item, rect);

    // cause bounding box to be recomputed
    _bounding_box = null;
  }
Exemplo n.º 2
0
  public Iterator<Item> iterator() {
    final Iterator<Item> myItr = itemRects.keySet().iterator();

    return new Iterator<Item>() {

      public boolean hasNext() {
        return myItr.hasNext();
      }

      public Item next() {
        return myItr.next();
      }

      public void remove() {
        throw new UnsupportedOperationException();
      }
    };
  }
Exemplo n.º 3
0
 public Rect4f getItemRect(Item item) {
   Rect4f rect = itemRects.get(item);
   if (rect != null) return rect;
   else throw new NoSuchElementException(item.toString());
 }
Exemplo n.º 4
0
 public void clear() {
   items.clear();
   itemRects.clear();
   _bounding_box = null;
 }