Search in sources :

Example 1 with ItemChoiceWindowController

use of delta.games.lotro.gui.items.ItemChoiceWindowController in project lotro-companion by dmorcellet.

the class MainTestShowCharacterStorage method show.

private void show(List<StoredItem> storedItems) {
    List<Item> items = getItems(storedItems);
    ItemFilterController filterController = new ItemFilterController();
    Filter<Item> filter = filterController.getFilter();
    ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(null, null, items, filter, filterController);
    choiceCtrl.show();
}
Also used : StoredItem(delta.games.lotro.character.storage.StoredItem) Item(delta.games.lotro.lore.items.Item) ItemChoiceWindowController(delta.games.lotro.gui.items.ItemChoiceWindowController) ItemFilterController(delta.games.lotro.gui.items.ItemFilterController)

Example 2 with ItemChoiceWindowController

use of delta.games.lotro.gui.items.ItemChoiceWindowController in project lotro-companion by dmorcellet.

the class EquipmentPanelController method chooseItem.

private Item chooseItem(EQUIMENT_SLOT slot, List<Item> items) {
    ItemsManager itemsManager = new ItemsManager(items);
    List<Item> selectedItems = itemsManager.getItems(_toonData, slot);
    ItemFilterConfiguration cfg = new ItemFilterConfiguration();
    cfg.initFromItems(selectedItems);
    ItemFilterController filterController = new ItemFilterController(cfg);
    Filter<Item> filter = filterController.getFilter();
    String id = ItemChoiceWindowController.ITEM_CHOOSER_PROPERTIES_ID + "#" + slot.name();
    TypedProperties props = _parentWindow.getUserProperties(id);
    ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(_parentWindow, props, selectedItems, filter, filterController);
    Item ret = choiceCtrl.editModal();
    return ret;
}
Also used : JMenuItem(javax.swing.JMenuItem) Item(delta.games.lotro.lore.items.Item) ItemsManager(delta.games.lotro.lore.items.ItemsManager) ItemChoiceWindowController(delta.games.lotro.gui.items.ItemChoiceWindowController) ItemFilterController(delta.games.lotro.gui.items.ItemFilterController) TypedProperties(delta.common.utils.misc.TypedProperties) ItemFilterConfiguration(delta.games.lotro.gui.items.ItemFilterConfiguration)

Example 3 with ItemChoiceWindowController

use of delta.games.lotro.gui.items.ItemChoiceWindowController 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;
}
Also used : Item(delta.games.lotro.lore.items.Item) ItemChoiceWindowController(delta.games.lotro.gui.items.ItemChoiceWindowController) TypedProperties(delta.common.utils.misc.TypedProperties)

Aggregations

ItemChoiceWindowController (delta.games.lotro.gui.items.ItemChoiceWindowController)3 Item (delta.games.lotro.lore.items.Item)3 TypedProperties (delta.common.utils.misc.TypedProperties)2 ItemFilterController (delta.games.lotro.gui.items.ItemFilterController)2 StoredItem (delta.games.lotro.character.storage.StoredItem)1 ItemFilterConfiguration (delta.games.lotro.gui.items.ItemFilterConfiguration)1 ItemsManager (delta.games.lotro.lore.items.ItemsManager)1 JMenuItem (javax.swing.JMenuItem)1