Search in sources :

Example 1 with DefaultWindowController

use of delta.common.ui.swing.windows.DefaultWindowController in project lotro-companion by dmorcellet.

the class MainTestReputationSynopsis method doIt.

private void doIt() {
    CharactersManager mgr = CharactersManager.getInstance();
    List<CharacterFile> allToons = mgr.getAllToons();
    ReputationSynopsisTableController table = new ReputationSynopsisTableController(null);
    table.setToons(allToons);
    JTable jtable = table.getTable();
    JScrollPane scroll = GuiFactory.buildScrollPane(jtable);
    DefaultWindowController w = new DefaultWindowController();
    w.getFrame().add(scroll);
    w.getFrame().pack();
    w.show();
}
Also used : CharactersManager(delta.games.lotro.character.CharactersManager) JScrollPane(javax.swing.JScrollPane) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) JTable(javax.swing.JTable) CharacterFile(delta.games.lotro.character.CharacterFile)

Example 2 with DefaultWindowController

use of delta.common.ui.swing.windows.DefaultWindowController 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)

Example 3 with DefaultWindowController

use of delta.common.ui.swing.windows.DefaultWindowController in project lotro-companion by dmorcellet.

the class MainTestStatCurveChart method doIt.

private void doIt(CharacterData data) {
    // Load toon stats
    CharacterGenerationTools tools = new CharacterGenerationTools();
    CharacterGeneratorGiswald generator = new CharacterGeneratorGiswald(tools);
    CharacterData c = generator.buildCharacter();
    List<StatCurvesChartConfiguration> configs = new ArrayList<StatCurvesChartConfiguration>();
    StatCurvesConfigurationFactory factory = new StatCurvesConfigurationFactory(c.getCharacterClass());
    configs.add(factory.buildPhysicalDamageChart());
    configs.add(factory.buildTacticalDamageChart());
    configs.add(factory.buildCriticalsChart());
    configs.add(factory.buildFinesseChart());
    configs.add(factory.buildHealingChart());
    configs.add(factory.buildIncomingHealingChart());
    configs.add(factory.buildBlockChart());
    configs.add(factory.buildParryChart());
    configs.add(factory.buildEvadeChart());
    configs.add(factory.buildResistanceChart());
    configs.add(factory.buildCriticalDefenceChart());
    configs.add(factory.buildPhysicalMitigationChart());
    configs.add(factory.buildTacticalMitigationChart());
    configs.add(factory.buildOrcCraftFellWroughtMitigationChart());
    CharacterStatsComputer statsComputer = new CharacterStatsComputer();
    BasicStatsSet stats = statsComputer.getStats(c);
    c.getStats().setStats(stats);
    int level = c.getLevel();
    for (StatCurvesChartConfiguration config : configs) {
        config.setLevel(level);
        config.setMaxRating(config.getAutoMaxRating());
        StatCurvesPanelController controller = new StatCurvesPanelController(config);
        controller.update(c);
        JPanel statPanel = controller.getPanel();
        DefaultWindowController w = new DefaultWindowController();
        w.getFrame().add(statPanel);
        w.getFrame().pack();
        w.show();
    }
}
Also used : JPanel(javax.swing.JPanel) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) ArrayList(java.util.ArrayList) CharacterGeneratorGiswald(delta.games.lotro.character.stats.CharacterGeneratorGiswald) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet) CharacterData(delta.games.lotro.character.CharacterData) CharacterStatsComputer(delta.games.lotro.character.stats.CharacterStatsComputer) CharacterGenerationTools(delta.games.lotro.character.stats.CharacterGenerationTools)

Aggregations

DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)3 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)2 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)2 JPanel (javax.swing.JPanel)2 CharacterData (delta.games.lotro.character.CharacterData)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterGenerationTools (delta.games.lotro.character.stats.CharacterGenerationTools)1 CharacterGeneratorGiswald (delta.games.lotro.character.stats.CharacterGeneratorGiswald)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 ArrayList (java.util.ArrayList)1 JScrollPane (javax.swing.JScrollPane)1 JTabbedPane (javax.swing.JTabbedPane)1 JTable (javax.swing.JTable)1