Search in sources :

Example 1 with ProfessionStatus

use of delta.games.lotro.character.crafting.ProfessionStatus 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);
        }
    }
}
Also used : ProfessionStatus(delta.games.lotro.character.crafting.ProfessionStatus) Profession(delta.games.lotro.lore.crafting.Profession) GuildStatus(delta.games.lotro.character.crafting.GuildStatus) CraftingStatus(delta.games.lotro.character.crafting.CraftingStatus) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 2 with ProfessionStatus

use of delta.games.lotro.character.crafting.ProfessionStatus in project lotro-companion by dmorcellet.

the class VocationEditionPanelController method updateProfessionsUi.

/**
 * Update the UI for professions.
 */
private void updateProfessionsUi() {
    Vocation vocation = _status.getVocation();
    _vocationPanel.removeAll();
    JComponent centerComponent = null;
    List<Profession> professions = (vocation != null) ? vocation.getProfessions() : null;
    if ((professions != null) && (professions.size() > 0)) {
        _tabbedPane = GuiFactory.buildTabbedPane();
        // Professions
        for (Profession profession : professions) {
            ProfessionStatus stats = _status.getProfessionStatus(profession, true);
            ProfessionStatusPanelController craftingPanelController = _panels.get(profession);
            if (craftingPanelController == null) {
                craftingPanelController = new ProfessionStatusPanelController(stats);
                _panels.put(profession, craftingPanelController);
            }
            JPanel craftingPanel = craftingPanelController.getPanel();
            _tabbedPane.add(profession.getLabel(), craftingPanel);
        }
        // Clean other professions
        for (Profession profession : Profession.getAll()) {
            if (!professions.contains(profession)) {
                _panels.remove(profession);
            }
        }
        centerComponent = _tabbedPane;
    } else {
        JLabel centerLabel = new JLabel("No vocation!");
        centerComponent = centerLabel;
        _tabbedPane = null;
    }
    _vocationPanel.add(centerComponent, BorderLayout.CENTER);
    _vocationPanel.revalidate();
    _vocationPanel.repaint();
}
Also used : ProfessionStatus(delta.games.lotro.character.crafting.ProfessionStatus) JPanel(javax.swing.JPanel) Profession(delta.games.lotro.lore.crafting.Profession) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) Vocation(delta.games.lotro.lore.crafting.Vocation)

Example 3 with ProfessionStatus

use of delta.games.lotro.character.crafting.ProfessionStatus in project lotro-companion by dmorcellet.

the class MainTestCraftingHistoryChart method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    Locale.setDefault(Locale.US);
    LotroTestUtils utils = new LotroTestUtils();
    // for(CharacterFile toon : utils.getAllFiles())
    {
        CharacterFile toon = utils.getMainToon();
        CraftingStatus stats = toon.getCraftingStatus();
        stats.dump(System.out);
        List<Profession> professions = stats.getProfessions();
        for (Profession profession : professions) {
            ProfessionStatus stat = stats.getProfessionStatus(profession);
            JFrame f = new JFrame();
            ProfessionStatusPanelController controller = new ProfessionStatusPanelController(stat);
            JPanel panel = controller.getPanel();
            f.getContentPane().add(panel);
            f.pack();
            f.setVisible(true);
            f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        }
    }
}
Also used : ProfessionStatus(delta.games.lotro.character.crafting.ProfessionStatus) JPanel(javax.swing.JPanel) Profession(delta.games.lotro.lore.crafting.Profession) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) JFrame(javax.swing.JFrame) CraftingStatus(delta.games.lotro.character.crafting.CraftingStatus) List(java.util.List) CharacterFile(delta.games.lotro.character.CharacterFile)

Aggregations

ProfessionStatus (delta.games.lotro.character.crafting.ProfessionStatus)3 Profession (delta.games.lotro.lore.crafting.Profession)3 CharacterFile (delta.games.lotro.character.CharacterFile)2 CraftingStatus (delta.games.lotro.character.crafting.CraftingStatus)2 JPanel (javax.swing.JPanel)2 GuildStatus (delta.games.lotro.character.crafting.GuildStatus)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 Vocation (delta.games.lotro.lore.crafting.Vocation)1 List (java.util.List)1 JComponent (javax.swing.JComponent)1 JFrame (javax.swing.JFrame)1 JLabel (javax.swing.JLabel)1