Search in sources :

Example 1 with ContribsByStat

use of delta.games.lotro.character.stats.contribs.ContribsByStat in project lotro-companion by dmorcellet.

the class StatContribsPanelController method updateStatCombo.

private void updateStatCombo() {
    STAT currentStat = _statChooser.getSelectedItem();
    _statChooser.removeAllItems();
    boolean found = false;
    for (STAT stat : STAT.values()) {
        ContribsByStat contribs = _contribs.getContribs(stat);
        if (contribs != null) {
            _statChooser.addItem(stat, stat.getName());
            if (stat == currentStat) {
                found = true;
            }
        }
    }
    if (found) {
        _statChooser.selectItem(currentStat);
    }
}
Also used : STAT(delta.games.lotro.character.stats.STAT) ContribsByStat(delta.games.lotro.character.stats.contribs.ContribsByStat)

Example 2 with ContribsByStat

use of delta.games.lotro.character.stats.contribs.ContribsByStat in project lotro-companion by dmorcellet.

the class StatContribsPanelController method updateStat.

private void updateStat(STAT stat) {
    if (stat == null) {
        return;
    }
    ContribsByStat contribs = _contribs.getContribs(stat);
    if (contribs == null) {
        contribs = new ContribsByStat(stat);
    }
    _chartPanel.setContributions(contribs);
    _table.setContributions(contribs);
    FixedDecimalsInteger statValue = _toon.getStats().getStat(stat);
    updateTotals(contribs, statValue);
}
Also used : ContribsByStat(delta.games.lotro.character.stats.contribs.ContribsByStat) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger)

Example 3 with ContribsByStat

use of delta.games.lotro.character.stats.contribs.ContribsByStat in project lotro-companion by dmorcellet.

the class MainTestStatContribsChart method doIt.

private void doIt(CharacterData data) {
    StatsContributionsManager contribs = new StatsContributionsManager(data.getCharacterClass());
    CharacterStatsComputer statsComputer = new CharacterStatsComputer(contribs);
    BasicStatsSet stats = statsComputer.getStats(data);
    System.out.println(stats);
    contribs.setResolveIndirectContributions(true);
    contribs.compute();
    JPanel panel = GuiFactory.buildBackgroundPanel(new BorderLayout());
    JTabbedPane tabs = GuiFactory.buildTabbedPane();
    panel.add(tabs, BorderLayout.CENTER);
    for (STAT stat : STAT.values()) {
        ContribsByStat contribsForStat = contribs.getContribs(stat);
        if (contribsForStat != null) {
            StatContribsChartPanelController chartController = new StatContribsChartPanelController();
            chartController.setContributions(contribsForStat);
            JPanel statPanel = chartController.getPanel();
            tabs.add(stat.getName(), statPanel);
        }
    }
    DefaultWindowController w = new DefaultWindowController();
    w.getFrame().add(panel);
    w.getFrame().pack();
    w.show();
}
Also used : JPanel(javax.swing.JPanel) STAT(delta.games.lotro.character.stats.STAT) ContribsByStat(delta.games.lotro.character.stats.contribs.ContribsByStat) BorderLayout(java.awt.BorderLayout) StatsContributionsManager(delta.games.lotro.character.stats.contribs.StatsContributionsManager) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) JTabbedPane(javax.swing.JTabbedPane) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Aggregations

ContribsByStat (delta.games.lotro.character.stats.contribs.ContribsByStat)3 STAT (delta.games.lotro.character.stats.STAT)2 DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)1 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 StatsContributionsManager (delta.games.lotro.character.stats.contribs.StatsContributionsManager)1 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)1 BorderLayout (java.awt.BorderLayout)1 JPanel (javax.swing.JPanel)1 JTabbedPane (javax.swing.JTabbedPane)1