use of delta.games.lotro.character.stats.STAT in project lotro-companion by dmorcellet.
the class StatCurveChartPanelController method update.
/**
* Update this panel with new stats.
* @param stats Stats to display.
*/
public void update(BasicStatsSet stats) {
STAT baseStat = _config.getBaseStat();
_statValue = stats.getStat(baseStat);
updateStatSeries();
}
use of delta.games.lotro.character.stats.STAT in project lotro-companion by dmorcellet.
the class EssencesSummaryPanelController method updateStatsPanel.
private void updateStatsPanel(JPanel panel, BasicStatsSet stats) {
panel.removeAll();
int rowIndex = 0;
GridBagConstraints strutConstraints = new GridBagConstraints(0, rowIndex, 3, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0);
panel.add(Box.createHorizontalStrut(100), strutConstraints);
rowIndex++;
int statsCount = stats.getStatsCount();
if (statsCount > 0) {
// Grab toon stats
BasicStatsSet toonStats = _toon.getStats();
// Build display
for (STAT stat : STAT.values()) {
FixedDecimalsInteger value = stats.getStat(stat);
if (value != null) {
// Value label
JLabel valueLabel = GuiFactory.buildLabel(value.toString());
GridBagConstraints c = new GridBagConstraints(0, rowIndex, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0);
panel.add(valueLabel, c);
// Name label
String name = StatLabels.getStatLabel(stat);
JLabel statLabel = GuiFactory.buildLabel(name);
c = new GridBagConstraints(1, rowIndex, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 0), 0, 0);
panel.add(statLabel, c);
// Percentage
FixedDecimalsInteger toonStat = toonStats.getStat(stat);
String percentageStr = "";
if (toonStat != null) {
float percentage = 100 * (value.floatValue() / toonStat.floatValue());
percentageStr = String.format("%.1f%%", Float.valueOf(percentage));
}
JLabel percentageLabel = GuiFactory.buildLabel(percentageStr);
c = new GridBagConstraints(2, rowIndex, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0);
panel.add(percentageLabel, c);
rowIndex++;
}
}
}
}
use of delta.games.lotro.character.stats.STAT in project lotro-companion by dmorcellet.
the class BuffIconController method buildToolTip.
private String buildToolTip() {
Buff buff = _buff.getBuff();
StringBuilder sb = new StringBuilder();
sb.append(buff.getLabel()).append(EndOfLine.NATIVE_EOL);
BasicStatsSet stats = _buff.getStats(_toon);
if (stats != null) {
for (STAT stat : stats.getStats()) {
String name = stat.getName();
String value = stats.getStat(stat).toString();
sb.append(name).append(": ").append(value).append(EndOfLine.NATIVE_EOL);
}
}
String text = sb.toString().trim();
String html = "<html>" + text.replace(EndOfLine.NATIVE_EOL, "<br>") + "</html>";
return html;
}
use of delta.games.lotro.character.stats.STAT in project lotro-companion by dmorcellet.
the class DetailedCharacterStatsPanelController method buildMainStatsPanel.
private JPanel buildMainStatsPanel() {
JPanel panel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
STAT[] stats = { STAT.MORALE, STAT.POWER, STAT.ARMOUR, STAT.MIGHT, STAT.AGILITY, STAT.VITALITY, STAT.WILL, STAT.FATE, STAT.OCMR, STAT.ICMR, STAT.OCPR, STAT.ICPR };
int x = 0;
int y = 0;
for (STAT stat : stats) {
addStatWidgets(panel, stat, x, y, true);
y++;
}
TitledBorder border = GuiFactory.buildTitledBorder("Main");
panel.setBorder(border);
return panel;
}
use of delta.games.lotro.character.stats.STAT in project lotro-companion by dmorcellet.
the class DetailedCharacterStatsPanelController method buildOffencePercentagePanel.
private JPanel buildOffencePercentagePanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
String[] labelsV = new String[] { "Melee", "Ranged", "Tactical" };
STAT[] stats = { STAT.PHYSICAL_MASTERY, STAT.PHYSICAL_MASTERY, STAT.TACTICAL_MASTERY };
addHeaders(panel, 0, 1, labelsV, stats, false, 1);
int x = 1;
String[] labelsH = new String[] { "Damage %", "Critical %", "Devastate %", "Magnitude %" };
addHeaders(panel, x, 0, labelsH, null, true, 2);
int y = 1;
addStatWidgets(panel, STAT.MELEE_DAMAGE_PERCENTAGE, x, y, false);
addStatWidgets(panel, STAT.CRITICAL_MELEE_PERCENTAGE, x + 2, y, false);
addStatWidgets(panel, STAT.DEVASTATE_MELEE_PERCENTAGE, x + 4, y, false);
addStatWidgets(panel, STAT.CRIT_DEVASTATE_MAGNITUDE_MELEE_PERCENTAGE, x + 6, y, false);
y++;
addStatWidgets(panel, STAT.RANGED_DAMAGE_PERCENTAGE, x, y, false);
addStatWidgets(panel, STAT.CRITICAL_RANGED_PERCENTAGE, x + 2, y, false);
addStatWidgets(panel, STAT.DEVASTATE_RANGED_PERCENTAGE, x + 4, y, false);
addStatWidgets(panel, STAT.CRIT_DEVASTATE_MAGNITUDE_RANGED_PERCENTAGE, x + 6, y, false);
y++;
addStatWidgets(panel, STAT.TACTICAL_DAMAGE_PERCENTAGE, x, y, false);
addStatWidgets(panel, STAT.CRITICAL_TACTICAL_PERCENTAGE, x + 2, y, false);
addStatWidgets(panel, STAT.DEVASTATE_TACTICAL_PERCENTAGE, x + 4, y, false);
addStatWidgets(panel, STAT.CRIT_DEVASTATE_MAGNITUDE_TACTICAL_PERCENTAGE, x + 6, y, false);
TitledBorder border = GuiFactory.buildTitledBorder("Damage");
panel.setBorder(border);
return panel;
}
Aggregations