Search in sources :

Example 6 with CharacterSummary

use of delta.games.lotro.character.CharacterSummary in project lotro-companion by dmorcellet.

the class CharactersSelectorPanelController method buildToonCheckbox.

private JCheckBox buildToonCheckbox(CharacterFile toon) {
    JCheckBox ret = null;
    CharacterSummary summary = toon.getSummary();
    if (summary != null) {
        String name = summary.getName();
        ret = GuiFactory.buildCheckbox(name);
        String id = toon.getIdentifier();
        _checkboxes.put(id, ret);
        boolean selected = isSelected(toon);
        ret.setSelected(selected);
        boolean enabled = _enabledToons.contains(toon);
        ret.setEnabled(enabled);
        ret.addItemListener(this);
    }
    return ret;
}
Also used : JCheckBox(javax.swing.JCheckBox) CharacterSummary(delta.games.lotro.character.CharacterSummary)

Example 7 with CharacterSummary

use of delta.games.lotro.character.CharacterSummary in project lotro-companion by dmorcellet.

the class ReputationSynopsisTableController method buildToonHeaderPanel.

private JPanel buildToonHeaderPanel(CharacterFile toon) {
    JPanel panel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
    // Class icon
    GridBagConstraints c = new GridBagConstraints(0, 0, 1, 2, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    ImageIcon classIcon = null;
    CharacterSummary summary = toon.getSummary();
    if (summary != null) {
        CharacterClass cClass = summary.getCharacterClass();
        classIcon = LotroIconsManager.getClassIcon(cClass, LotroIconsManager.COMPACT_SIZE);
    }
    JLabel classLabel;
    if (classIcon != null) {
        classLabel = new JLabel(classIcon);
    } else {
        classLabel = new JLabel("(class)");
    }
    panel.add(classLabel, c);
    // Toon name
    String name = toon.getName();
    JLabel nameLabel = GuiFactory.buildLabel(name, 16.0f);
    c = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 2, 2, 2), 0, 0);
    panel.add(nameLabel, c);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) GridBagConstraints(java.awt.GridBagConstraints) CharacterSummary(delta.games.lotro.character.CharacterSummary) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 8 with CharacterSummary

use of delta.games.lotro.character.CharacterSummary in project lotro-companion by dmorcellet.

the class WarbandsTableController method buildToonHeaderPanel.

private JPanel buildToonHeaderPanel(CharacterFile toon) {
    JPanel panel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
    // Class icon
    GridBagConstraints c = new GridBagConstraints(0, 0, 1, 2, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    ImageIcon classIcon = null;
    CharacterSummary summary = toon.getSummary();
    if (summary != null) {
        CharacterClass cClass = summary.getCharacterClass();
        classIcon = LotroIconsManager.getClassIcon(cClass, LotroIconsManager.COMPACT_SIZE);
    }
    JLabel classLabel;
    if (classIcon != null) {
        classLabel = new JLabel(classIcon);
    } else {
        classLabel = new JLabel("(class)");
    }
    panel.add(classLabel, c);
    // Toon name
    String name = toon.getName();
    JLabel nameLabel = GuiFactory.buildLabel(name, 16.0f);
    c = new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 2, 2, 2), 0, 0);
    panel.add(nameLabel, c);
    // Log update
    Date logDate = toon.getLastLogUpdate();
    String logDateStr = "";
    if (logDate != null) {
        logDateStr = Formats.getDateString(logDate);
    }
    JLabel logDateLabel = GuiFactory.buildLabel(logDateStr);
    c = new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(2, 2, 5, 2), 0, 0);
    panel.add(logDateLabel, c);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) GridBagConstraints(java.awt.GridBagConstraints) CharacterSummary(delta.games.lotro.character.CharacterSummary) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) CharacterClass(delta.games.lotro.common.CharacterClass) Date(java.util.Date)

Aggregations

CharacterSummary (delta.games.lotro.character.CharacterSummary)8 CharacterFile (delta.games.lotro.character.CharacterFile)2 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)2 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)2 CharacterClass (delta.games.lotro.common.CharacterClass)2 TraitPointsStatus (delta.games.lotro.stats.traitPoints.TraitPointsStatus)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 ImageIcon (javax.swing.ImageIcon)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 CharacterData (delta.games.lotro.character.CharacterData)1 CharacterInfosManager (delta.games.lotro.character.CharacterInfosManager)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 CharacterSummaryDialogController (delta.games.lotro.gui.character.summary.CharacterSummaryDialogController)1 TraitPointsEditionWindowController (delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController)1 QuestsManager (delta.games.lotro.lore.quests.QuestsManager)1 QuestsIndex (delta.games.lotro.lore.quests.index.QuestsIndex)1