Search in sources :

Example 1 with ItemFilterController

use of delta.games.lotro.gui.items.ItemFilterController 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 ItemFilterController

use of delta.games.lotro.gui.items.ItemFilterController 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 ItemFilterController

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

the class StashWindowController method buildContents.

@Override
protected JComponent buildContents() {
    // Whole panel
    JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
    // Build table
    JPanel tablePanel = buildTablePanel();
    // Filter
    ItemFilterController filterController = new ItemFilterController();
    Filter<Item> filter = filterController.getFilter();
    filterController.setFilterUpdateListener(this);
    JPanel filterPanel = filterController.getPanel();
    TitledBorder filterBorder = GuiFactory.buildTitledBorder("Filter");
    filterPanel.setBorder(filterBorder);
    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);
    // Items table
    c.gridy = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    panel.add(tablePanel, c);
    tablePanel.setBorder(GuiFactory.buildTitledBorder("Items"));
    _itemsTable.getTableController().setFilter(filter);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) ToolbarIconItem(delta.common.ui.swing.toolbar.ToolbarIconItem) Item(delta.games.lotro.lore.items.Item) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ItemFilterController(delta.games.lotro.gui.items.ItemFilterController) TitledBorder(javax.swing.border.TitledBorder)

Aggregations

ItemFilterController (delta.games.lotro.gui.items.ItemFilterController)3 Item (delta.games.lotro.lore.items.Item)3 ItemChoiceWindowController (delta.games.lotro.gui.items.ItemChoiceWindowController)2 ToolbarIconItem (delta.common.ui.swing.toolbar.ToolbarIconItem)1 TypedProperties (delta.common.utils.misc.TypedProperties)1 StoredItem (delta.games.lotro.character.storage.StoredItem)1 ItemFilterConfiguration (delta.games.lotro.gui.items.ItemFilterConfiguration)1 ItemsManager (delta.games.lotro.lore.items.ItemsManager)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 JMenuItem (javax.swing.JMenuItem)1 JPanel (javax.swing.JPanel)1 TitledBorder (javax.swing.border.TitledBorder)1