use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class StashItemsTableController method buildDataProvider.
private DataProvider<Item> buildDataProvider() {
DataProvider<Item> ret = new DataProvider<Item>() {
@Override
public Item getAt(int index) {
ItemsStash stash = _toon.getStash();
List<Item> items = stash.getItemsList();
return items.get(index);
}
@Override
public int getCount() {
ItemsStash stash = _toon.getStash();
List<Item> items = stash.getItemsList();
return items.size();
}
};
return ret;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class DeedUiUtils method buildItemsCombo.
/**
* Build a combo-box controller to choose an item name.
* @return A new combo-box controller.
*/
public static ComboBoxController<Integer> buildItemsCombo() {
ComboBoxController<Integer> ctrl = new ComboBoxController<Integer>();
ctrl.addEmptyItem("");
List<Item> items = DeedUtils.getItems();
for (Item item : items) {
ctrl.addItem(Integer.valueOf(item.getIdentifier()), item.getName());
}
ctrl.selectItem(null);
return ctrl;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EssencesEditionPanelController method getEssences.
/**
* Get the selected essences.
* @return a list of essences (with <code>null</code> items possible).
*/
public List<Item> getEssences() {
List<Item> essences = new ArrayList<Item>();
for (SingleEssenceEditionController ctrl : _essenceControllers) {
Item essence = ctrl.getEssence();
essences.add(essence);
}
return essences;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EssencesEditionPanelController method initFromItem.
/**
* Initialize the managed panel with the given item.
* @param item Item to set.
*/
public void initFromItem(Item item) {
_essenceControllers.clear();
int nbSlots = item.getEssencesCount();
for (int i = 0; i < nbSlots; i++) {
Item essence = item.getEssenceAt(i);
SingleEssenceEditionController ctrl = new SingleEssenceEditionController(_parent, 1);
ctrl.setEssence(essence);
_essenceControllers.add(ctrl);
}
updateUi();
}
use of delta.games.lotro.lore.items.Item in project lotro-tools by dmorcellet.
the class QuestsItemsLoader method handleItem.
private void handleItem(ObjectItem itemReference) {
// Use name
String name = itemReference.getName();
Item item = _resolver.getItem(name);
if (item == null) {
// Use item 'key' (Wiki key)
String url = itemReference.getObjectURL();
if ((url != null) && (url.startsWith(WIKI_SEED))) {
String itemKey = url.substring(WIKI_SEED.length());
item = _resolver.getItem(itemKey);
}
}
if (item == null) {
// Use icon path
String iconUrl = itemReference.getIconURL();
if (iconUrl != null) {
iconUrl = ItemsResolver.normalizeIconUrl(iconUrl);
item = _resolver.getItem(iconUrl);
}
}
if (item != null) {
// Found!
itemReference.setItemId(item.getIdentifier());
itemReference.setIconURL(null);
itemReference.setObjectURL(null);
_resolved++;
} else {
// Not found!
System.out.println("Not found: " + itemReference);
_missed++;
}
}
Aggregations