Search in sources :

Example 1 with Item

use of delta.games.lotro.lore.items.Item 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 Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class MainTestStashWindow method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getMainToon();
    // Copy gear to stash
    ItemsStash stash = toon.getStash();
    CharacterData data = toon.getInfosManager().getLastCharacterDescription();
    CharacterEquipment gear = data.getEquipment();
    for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
        Item item = gear.getItemForSlot(slot);
        if (item != null) {
            Item clone = ItemFactory.clone(item);
            stash.addItem(clone);
        }
    }
    StashWindowController controller = new StashWindowController(toon);
    controller.show();
}
Also used : Item(delta.games.lotro.lore.items.Item) CharacterEquipment(delta.games.lotro.character.CharacterEquipment) ItemsStash(delta.games.lotro.character.storage.ItemsStash) CharacterData(delta.games.lotro.character.CharacterData) EQUIMENT_SLOT(delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 3 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class MainTestEssenceChoice method doIt.

private void doIt() {
    Item ret = EssenceChoice.chooseEssence(null);
    System.out.println(ret);
}
Also used : Item(delta.games.lotro.lore.items.Item)

Example 4 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class ItemChoicePanelController method build.

private JPanel build() {
    JPanel panel = GuiFactory.buildPanel(new BorderLayout());
    TitledBorder itemsFrameBorder = GuiFactory.buildTitledBorder("Items");
    panel.setBorder(itemsFrameBorder);
    // Table
    JTable table = _tableController.getTable();
    JScrollPane scroll = GuiFactory.buildScrollPane(table);
    panel.add(scroll, BorderLayout.CENTER);
    // Stats
    JPanel statsPanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
    _statsLabel = GuiFactory.buildLabel("-");
    statsPanel.add(_statsLabel);
    JButton choose = GuiFactory.buildButton("Choose columns...");
    ActionListener al = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            TableColumnsChooserController<Item> chooser = new TableColumnsChooserController<Item>(_parent, _tableController.getTableController());
            chooser.editModal();
        }
    };
    choose.addActionListener(al);
    statsPanel.add(choose);
    panel.add(statsPanel, BorderLayout.NORTH);
    return panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) Item(delta.games.lotro.lore.items.Item) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JTable(javax.swing.JTable) JButton(javax.swing.JButton) TableColumnsChooserController(delta.common.ui.swing.tables.TableColumnsChooserController) TitledBorder(javax.swing.border.TitledBorder)

Example 5 with Item

use of delta.games.lotro.lore.items.Item in project lotro-companion by dmorcellet.

the class ItemChoiceTableController method buildStatColumn.

private TableColumnController<Item, FixedDecimalsInteger> buildStatColumn(final STAT stat) {
    CellDataProvider<Item, FixedDecimalsInteger> statCell = new CellDataProvider<Item, FixedDecimalsInteger>() {

        @Override
        public FixedDecimalsInteger getData(Item item) {
            BasicStatsSet stats = item.getStats();
            FixedDecimalsInteger value = stats.getStat(stat);
            return value;
        }
    };
    TableColumnController<Item, FixedDecimalsInteger> statColumn = new TableColumnController<Item, FixedDecimalsInteger>(stat.name(), stat.getName(), FixedDecimalsInteger.class, statCell);
    statColumn.setWidthSpecs(55, 55, 50);
    return statColumn;
}
Also used : Item(delta.games.lotro.lore.items.Item) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) TableColumnController(delta.common.ui.swing.tables.TableColumnController) CellDataProvider(delta.common.ui.swing.tables.CellDataProvider) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Aggregations

Item (delta.games.lotro.lore.items.Item)105 ArrayList (java.util.ArrayList)29 HashMap (java.util.HashMap)19 File (java.io.File)17 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)16 Armour (delta.games.lotro.lore.items.Armour)15 LegendaryItem (delta.games.lotro.lore.items.legendary.LegendaryItem)12 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)11 ArmourType (delta.games.lotro.lore.items.ArmourType)8 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)8 Weapon (delta.games.lotro.lore.items.Weapon)8 JMenuItem (javax.swing.JMenuItem)8 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)7 CharacterClass (delta.games.lotro.common.CharacterClass)7 ItemsManager (delta.games.lotro.lore.items.ItemsManager)7 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)6 ItemsStash (delta.games.lotro.character.storage.ItemsStash)6 WeaponType (delta.games.lotro.lore.items.WeaponType)6 ItemQuality (delta.games.lotro.lore.items.ItemQuality)5 List (java.util.List)5