use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class StashWindowController method cloneItem.
private void cloneItem() {
GenericTableController<Item> controller = _itemsTable.getTableController();
Item item = controller.getSelectedItem();
if (item != null) {
Item clone = ItemFactory.clone(item);
clone.setStashIdentifier(null);
ItemsStash stash = _toon.getStash();
stash.addItem(clone);
_toon.saveStash();
_itemsTable.getTableController().refresh();
}
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class ItemChoiceWindowController method buildFormPanel.
@Override
protected JPanel buildFormPanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
// Table
_panelController = new ItemChoicePanelController(this, _tableController);
_filterController.setFilterUpdateListener(_panelController);
JPanel tablePanel = _panelController.getPanel();
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ok();
}
};
GenericTableController<Item> controller = _tableController.getTableController();
controller.addActionListener(al);
// Filter
JPanel filterPanel = _filterController.getPanel();
TitledBorder filterBorder = GuiFactory.buildTitledBorder("Filter");
filterPanel.setBorder(filterBorder);
// Whole panel
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
panel.add(filterPanel, c);
c.gridy = 1;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
panel.add(tablePanel, c);
return panel;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class EssenceChoice method chooseEssence.
/**
* Choose an essence.
* @param parent Parent controller.
* @return An essence item or <code>null</code>.
*/
public static Item chooseEssence(WindowController parent) {
List<Item> essences = ItemsManager.getInstance().getEssences();
EssenceFilterController filterController = new EssenceFilterController(_filter);
TypedProperties prefs = null;
if (parent != null) {
prefs = parent.getUserProperties(ItemChoiceWindowController.ESSENCE_CHOOSER_PROPERTIES_ID);
}
ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(parent, prefs, essences, _filter, filterController);
Item ret = choiceCtrl.editModal();
return ret;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class MainTestShowCharacterStorage method getItems.
private List<Item> getItems(List<StoredItem> storedItems) {
ItemsManager itemsMgr = ItemsManager.getInstance();
List<Item> allItems = itemsMgr.getAllItems();
List<Item> selection = new ArrayList<Item>();
for (StoredItem storedItem : storedItems) {
Item selectedItem = null;
for (Item item : allItems) {
Item match = match(item, storedItem);
if (match != null) {
selectedItem = item;
break;
}
}
if (selectedItem != null) {
selection.add(selectedItem);
} else {
LOGGER.warn("Could not find item: " + storedItem.getName());
}
}
return selection;
}
use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.
the class MainTestItemEditionWindowController method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
ItemsManager itemsMgr = ItemsManager.getInstance();
List<Item> items = itemsMgr.getAllItems();
int nbWindows = 0;
int index = 0;
int nbItems = items.size();
while ((index < nbItems) && (nbWindows < 1)) {
// Item item=itemsMgr.getItem(1879313783); // Light Nadhin Hood (level 192)
// Item item=itemsMgr.getItem(1879323547); // Bridge-warden's Shield (level 201)
// Item item=itemsMgr.getItem(1879134849); // Javelin of Ire
// Item item=itemsMgr.getItem(1879311750); // Reshaped Minstrel's Club of the First Age
// Lesser Valourous Helm of Fate
Item item = itemsMgr.getItem(1879279194);
// Item item=items.get(index);
// if ((item.getQuality()==ItemQuality.LEGENDARY) && (Integer.valueOf(192).equals(item.getItemLevel())))
// if (item instanceof Armour)
// if (item instanceof Weapon)
{
ItemEditionWindowController ctrl = new ItemEditionWindowController(null, item);
ctrl.show(true);
nbWindows++;
}
index++;
}
}
Aggregations