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);
}
}
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);
}
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();
}
Aggregations