// @Override
  public void alertItemAdded(InventoryItem item) {

    if (item instanceof Hat) {
      PartyHatItemViewObject = new InventoryItemViewObject(item);
      manager.addInventoryItemViewObject(PartyHatItemViewObject);
      // ???Can't we just do..
      // manager.addInventoryItemViewObject(new InventoryItemViewObject(item));
    } else if (item instanceof Sword) {
      GodSwordItemViewObject = new InventoryItemViewObject(item);
      manager.addInventoryItemViewObject(GodSwordItemViewObject);
    }
  }
 private void selectFirst() {
   Iterator<ItemViewObject> iter = manager.iterator();
   if (iter.hasNext()) {
     InventoryItemViewObject current = (InventoryItemViewObject) iter.next();
     setSelected(current);
   }
 }
  public ListInventoryView(Inventory inventory) {

    // pass in Inventory
    // pass in self
    this.setBackgroundImageFileName(backgroundImageFileName);
    generateTitle(title);
    // Create a proxy for the observer, regester the proxy w/ entity, add proxy to manager
    ProxyObserver pio = new ProxyInventoryObserver(this, inventory);
    ObserverManager.instance().addProxyObserver(pio);

    // this.setPreferredSize(new Dimension(viewWidth, viewHeight));
    manager = new ListInventoryViewObjectManager();
    manager.initWithInventory(inventory);

    selectFirst();
    /* edit the next two lines/maybe delete them */

  }
  /// *
  public void paintComponent(Graphics g) { // change to render(Graphics g, int x, int y) ?
    super.paintComponent(g);
    Graphics2D g2d = (Graphics2D) g;
    Iterator<ItemViewObject> iter = manager.iterator();
    offset =
        Config.instance().INVENTORY_IMAGE_HEIGHT
            + this.titleLabel.getHeight(); // going to need to find a better way to get an offset
    while (iter.hasNext()) {
      InventoryItemViewObject current = (InventoryItemViewObject) iter.next();
      if (current.isSelected) {
        // Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.ORANGE,
        // Color.ORANGE);
        // b.paintBorder(current, g2d, 0, offset, viewWidth,
        // Config.instance().INVENTORY_IMAGE_HEIGHT);
        g2d.setColor(new Color(255, 255, 255, 80));
        g2d.fillRect(0, offset, viewWidth, Config.instance().INVENTORY_IMAGE_HEIGHT);
        // current.paintComponent(g2d, 20, offset, viewWidth, viewHeight); //this paintComponent
        // method is in the InventoryItemViewObject class
        current.paintComponent(
            g2d,
            (viewWidth / 4) - Config.instance().INVENTORY_IMAGE_WIDTH - (viewWidth / 12),
            offset,
            viewWidth,
            viewHeight); // this paintComponent method is in the InventoryItemViewObject class

      } else {
        // current.paintComponent(g2d, 20, offset, viewWidth, viewHeight); //this paintComponent
        // method is in the InventoryItemViewObject class
        current.paintComponent(
            g2d,
            (viewWidth / 4) - Config.instance().INVENTORY_IMAGE_WIDTH - (viewWidth / 12),
            offset,
            viewWidth,
            viewHeight); // this paintComponent method is in the InventoryItemViewObject class
      }
      offset = offset + Config.instance().INVENTORY_IMAGE_HEIGHT + 2;
    }
    Toolkit.getDefaultToolkit().sync(); // purpose?
  }
 // @Override
 public void alertItemDropped(InventoryItem item) {
   //// System.out.Println("LISTINVENTORYVIEW!!!!");
   //// System.out.Println("Item: " + item.getItemName() + " DROPPED!");
   manager.removeInventoryItemViewObject(item);
 }