// 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 -----------------------------------------------------------
// updateFromPanel +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ private InventoryItemObject updateFromPanel( int index, JPanel inventoryPanel, InventoryItemObject inventoryItemObject) { InventoryItemObject result = inventoryItemObject; ItemPanel itemPanel; itemPanel = (ItemPanel) inventoryPanel.getComponent(index); if (itemPanel.getItemObject() != null) { result.setItemName(itemPanel.getItemObject().getItemNameSave()); result.setItemId(itemPanel.getItemObject().getItemId()); } // if return result; } // updateFromPanel ---------------------------------------------------------