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();
}
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();
}
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);
}
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;
}
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;
}
Aggregations