use of delta.games.lotro.character.CharacterFile 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.character.CharacterFile in project lotro-companion by dmorcellet.
the class MainTestWarbandStats method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
LotroTestUtils utils = new LotroTestUtils();
CharacterFile toon = utils.getToonByName("Allyriel");
CharacterLog log = toon.getLastCharacterLog();
if (log != null) {
WarbandsStats stats = new WarbandsStats(log);
stats.dump(System.out);
}
}
use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.
the class CraftingSynopsisPanelController method eventOccurred.
/**
* Handle character events.
* @param event Source event.
*/
@Override
public void eventOccurred(CharacterEvent event) {
CharacterEventType type = event.getType();
if (type == CharacterEventType.CHARACTER_CRAFTING_UPDATED) {
CharacterFile toon = event.getToonFile();
List<CharacterFile> currentToons = _tableController.getToons();
if (currentToons.contains(toon)) {
_tableController.updateToon(toon);
}
}
}
use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.
the class CraftingSynopsisTableController method updateRowItems.
private void updateRowItems() {
_rowItems.clear();
for (CharacterFile toon : _toons) {
CraftingStatus craftingStatus = toon.getCraftingStatus();
List<Profession> professions = craftingStatus.getProfessions();
GuildStatus guildStatus = craftingStatus.getGuildStatus();
Profession guild = guildStatus.getProfession();
for (Profession profession : professions) {
ProfessionStatus professionStatus = craftingStatus.getProfessionStatus(profession, true);
GuildStatus displayedStatus = (profession == guild) ? guildStatus : null;
CraftingSynopsisItem item = new CraftingSynopsisItem(toon, professionStatus, displayedStatus);
_rowItems.add(item);
}
}
}
use of delta.games.lotro.character.CharacterFile in project lotro-companion by dmorcellet.
the class CharacterLevelPanelController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildBackgroundPanel(new BorderLayout());
_chartController = new CharacterLevelChartController(_stats);
JPanel chartPanel = _chartController.getPanel();
panel.add(chartPanel, BorderLayout.CENTER);
JPanel toonsControlPanel = GuiFactory.buildPanel(new GridBagLayout());
{
// Toons show/hide
List<CharacterFile> toons = _stats.getToonsList();
_toonSelectionController = new CharactersSelectorPanelController(toons);
for (CharacterFile toon : toons) {
_toonSelectionController.setToonSelected(toon, true);
_toonSelectionController.setToonEnabled(toon, true);
}
_toonSelectionController.setGridConfiguration(1, 10);
JPanel selectionPanel = _toonSelectionController.getPanel();
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
toonsControlPanel.add(selectionPanel, c);
_toonSelectionController.getListenersManager().addListener(this);
// Choose toons button
JButton chooser = GuiFactory.buildButton("Choose characters...");
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doChooseToons();
}
};
chooser.addActionListener(al);
chooser.setAlignmentY(Component.CENTER_ALIGNMENT);
c.gridy++;
toonsControlPanel.add(chooser, c);
}
panel.add(toonsControlPanel, BorderLayout.EAST);
return panel;
}
Aggregations