public void addItem(Item item, Rect4f rect) { items.put(rect, item); itemRects.put(item, rect); // cause bounding box to be recomputed _bounding_box = null; }
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(); } }; }
public Rect4f getItemRect(Item item) { Rect4f rect = itemRects.get(item); if (rect != null) return rect; else throw new NoSuchElementException(item.toString()); }
public void clear() { items.clear(); itemRects.clear(); _bounding_box = null; }