예제 #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;
  }
예제 #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();
      }
    };
  }
예제 #3
0
 public Rect4f getItemRect(Item item) {
   Rect4f rect = itemRects.get(item);
   if (rect != null) return rect;
   else throw new NoSuchElementException(item.toString());
 }
예제 #4
0
 public void clear() {
   items.clear();
   itemRects.clear();
   _bounding_box = null;
 }