// setItemPanel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ private void setItemPanel(ItemPanel itemPanel, ItemObject itemObject) { if (itemObject != null && !itemObject.equals(ItemObjectDAO.getEmptyItem())) { itemPanel.setItem(itemObject); } // if else { itemPanel.setItem(ItemObjectDAO.getEmptyItem()); } // if } // setItemPanel ------------------------------------------------------------
// setItemPanels +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ private void setItemPanels( JPanel panel, int slots, Iterator<InventoryItemObject> inventoryItemListObjectsIter) { InventoryItemObject inventoryItemObject; int position; ItemObject itemObject; ItemPanel itemPanel; position = 0; while (position < slots) { itemPanel = (ItemPanel) panel.getComponent(position); setItemPanel(itemPanel, null); if (inventoryItemListObjectsIter.hasNext()) { inventoryItemObject = inventoryItemListObjectsIter.next(); if (inventoryItemObject != null) { itemObject = ItemObjectDAO.getItemObjectByName(inventoryItemObject.getItemName()); setItemPanel(itemPanel, itemObject); } // if } // if position++; Splash.updateSplashProgress(1); } // while } // setItemPanels -----------------------------------------------------------