Search in sources :

Example 1 with StatsContributionsManager

use of delta.games.lotro.character.stats.contribs.StatsContributionsManager 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

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