Search in sources :

Example 6 with STAT

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();
}
Also used : STAT(delta.games.lotro.character.stats.STAT)

Example 7 with STAT

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++;
            }
        }
    }
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) STAT(delta.games.lotro.character.stats.STAT) Insets(java.awt.Insets) FixedDecimalsInteger(delta.games.lotro.utils.FixedDecimalsInteger) JLabel(javax.swing.JLabel) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 8 with STAT

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;
}
Also used : STAT(delta.games.lotro.character.stats.STAT) Buff(delta.games.lotro.character.stats.buffs.Buff) BasicStatsSet(delta.games.lotro.character.stats.BasicStatsSet)

Example 9 with STAT

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;
}
Also used : JPanel(javax.swing.JPanel) STAT(delta.games.lotro.character.stats.STAT) GridBagLayout(java.awt.GridBagLayout) TitledBorder(javax.swing.border.TitledBorder)

Example 10 with STAT

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;
}
Also used : JPanel(javax.swing.JPanel) STAT(delta.games.lotro.character.stats.STAT) GridBagLayout(java.awt.GridBagLayout) TitledBorder(javax.swing.border.TitledBorder)

Aggregations

STAT (delta.games.lotro.character.stats.STAT)30 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)12 FixedDecimalsInteger (delta.games.lotro.utils.FixedDecimalsInteger)11 JPanel (javax.swing.JPanel)7 GridBagLayout (java.awt.GridBagLayout)6 TitledBorder (javax.swing.border.TitledBorder)5 GridBagConstraints (java.awt.GridBagConstraints)4 Insets (java.awt.Insets)4 CharacterClass (delta.games.lotro.common.CharacterClass)3 Armour (delta.games.lotro.lore.items.Armour)3 ArmourType (delta.games.lotro.lore.items.ArmourType)3 EquipmentLocation (delta.games.lotro.lore.items.EquipmentLocation)3 ItemQuality (delta.games.lotro.lore.items.ItemQuality)3 ItemStatSliceData (delta.games.lotro.lore.items.stats.ItemStatSliceData)3 JLabel (javax.swing.JLabel)3 ContribsByStat (delta.games.lotro.character.stats.contribs.ContribsByStat)2 TomesSet (delta.games.lotro.character.stats.tomes.TomesSet)2 DamageType (delta.games.lotro.lore.items.DamageType)2 Item (delta.games.lotro.lore.items.Item)2 Weapon (delta.games.lotro.lore.items.Weapon)2