Search in sources :

Example 6 with Race

use of delta.games.lotro.common.Race in project lotro-companion by dmorcellet.

the class DeedFilterController method setFilter.

private void setFilter() {
    // Name
    DeedNameFilter nameFilter = _filter.getNameFilter();
    String contains = nameFilter.getPattern();
    if (contains != null) {
        _contains.setText(contains);
    }
    // Type
    DeedTypeFilter typeFilter = _filter.getTypeFilter();
    DeedType type = typeFilter.getDeedType();
    _type.selectItem(type);
    // Category
    DeedCategoryFilter categoryFilter = _filter.getCategoryFilter();
    String category = categoryFilter.getDeedCategory();
    _category.selectItem(category);
    // Requirements:
    // - class
    DeedClassRequirementFilter classFilter = _filter.getClassFilter();
    CharacterClass requiredClass = classFilter.getCharacterClass();
    _class.selectItem(requiredClass);
    // - race
    DeedRaceRequirementFilter raceFilter = _filter.getRaceFilter();
    Race requiredRace = raceFilter.getRace();
    _race.selectItem(requiredRace);
    // Rewards:
    // Reputation
    ReputationRewardFilter factionFilter = _filter.getReputationFilter();
    Faction faction = factionFilter.getFaction();
    _reputation.selectItem(faction);
    // LOTRO points
    LotroPointsRewardFilter lotroPointsFilter = _filter.getLotroPointsFilter();
    Boolean lotroPoints = lotroPointsFilter.getHasLotroPointsFlag();
    _lotroPoints.selectItem(lotroPoints);
    // Class point
    ClassPointRewardFilter classPointFilter = _filter.getClassPointsFilter();
    Boolean classPoint = classPointFilter.getHasClassPointFlag();
    _classPoints.selectItem(classPoint);
    // Trait
    TraitRewardFilter traitFilter = _filter.getTraitFilter();
    String trait = traitFilter.getTrait();
    _trait.selectItem(trait);
    // Skill
    SkillRewardFilter skillFilter = _filter.getSkillFilter();
    String skill = skillFilter.getSkill();
    _skill.selectItem(skill);
    // Title
    TitleRewardFilter titleFilter = _filter.getTitleFilter();
    String title = titleFilter.getTitle();
    _title.selectItem(title);
    // Virtue
    VirtueRewardFilter virtueFilter = _filter.getVirtueFilter();
    VirtueId virtueId = virtueFilter.getVirtueId();
    _virtue.selectItem(virtueId);
    // Emote
    EmoteRewardFilter emoteFilter = _filter.getEmoteFilter();
    String emote = emoteFilter.getEmote();
    _emote.selectItem(emote);
    // Item
    ItemRewardFilter itemFilter = _filter.getItemFilter();
    Integer itemId = itemFilter.getItemId();
    _item.selectItem(itemId);
}
Also used : DeedRaceRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter) TitleRewardFilter(delta.games.lotro.common.rewards.filters.TitleRewardFilter) DeedTypeFilter(delta.games.lotro.lore.deeds.filters.DeedTypeFilter) CharacterClass(delta.games.lotro.common.CharacterClass) SkillRewardFilter(delta.games.lotro.common.rewards.filters.SkillRewardFilter) EmoteRewardFilter(delta.games.lotro.common.rewards.filters.EmoteRewardFilter) TraitRewardFilter(delta.games.lotro.common.rewards.filters.TraitRewardFilter) VirtueId(delta.games.lotro.common.VirtueId) ReputationRewardFilter(delta.games.lotro.common.rewards.filters.ReputationRewardFilter) Race(delta.games.lotro.common.Race) DeedCategoryFilter(delta.games.lotro.lore.deeds.filters.DeedCategoryFilter) LotroPointsRewardFilter(delta.games.lotro.common.rewards.filters.LotroPointsRewardFilter) DeedClassRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedClassRequirementFilter) DeedNameFilter(delta.games.lotro.lore.deeds.filters.DeedNameFilter) DeedType(delta.games.lotro.lore.deeds.DeedType) ItemRewardFilter(delta.games.lotro.common.rewards.filters.ItemRewardFilter) Faction(delta.games.lotro.lore.reputation.Faction) ClassPointRewardFilter(delta.games.lotro.common.rewards.filters.ClassPointRewardFilter) VirtueRewardFilter(delta.games.lotro.common.rewards.filters.VirtueRewardFilter)

Example 7 with Race

use of delta.games.lotro.common.Race in project lotro-companion by dmorcellet.

the class DeedFilterController method buildRaceCombobox.

private ComboBoxController<Race> buildRaceCombobox() {
    ComboBoxController<Race> combo = CharacterUiUtils.buildRaceCombo(true);
    ItemSelectionListener<Race> listener = new ItemSelectionListener<Race>() {

        @Override
        public void itemSelected(Race requiredRace) {
            DeedRaceRequirementFilter filter = _filter.getRaceFilter();
            filter.setRace(requiredRace);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : DeedRaceRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) Race(delta.games.lotro.common.Race)

Example 8 with Race

use of delta.games.lotro.common.Race in project lotro-companion by dmorcellet.

the class DeedDisplayPanelController method buildRequirementString.

/**
 * Build a requirement string.
 * @return A string, empty if no requirement.
 */
private String buildRequirementString() {
    CharacterClass requiredClass = _deed.getRequiredClass();
    Race requiredRace = _deed.getRequiredRace();
    Integer minLevel = _deed.getMinLevel();
    StringBuilder sb = new StringBuilder();
    if (requiredClass != null) {
        if (sb.length() > 0)
            sb.append(", ");
        sb.append(requiredClass.getLabel());
    }
    if (requiredRace != null) {
        if (sb.length() > 0)
            sb.append(", ");
        sb.append(requiredRace.getLabel());
    }
    if (minLevel != null) {
        if (sb.length() > 0)
            sb.append(", ");
        if (minLevel.intValue() == 1000) {
            sb.append("level cap");
        } else {
            sb.append("level>=").append(minLevel);
        }
    }
    String ret = sb.toString();
    if (ret.isEmpty()) {
        ret = "-";
    }
    return ret;
}
Also used : Race(delta.games.lotro.common.Race) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 9 with Race

use of delta.games.lotro.common.Race in project lotro-companion by dmorcellet.

the class CharacterSummaryPanelController method update.

/**
 * Update contents.
 */
public void update() {
    if (_summary != null) {
        // Name/region
        String name = _summary.getName();
        String region = _summary.getRegion();
        String text = name;
        if ((region != null) && (region.length() > 0)) {
            text = text + " of " + region;
        }
        _nameLabel.setText(text);
        // Level
        int level = _summary.getLevel();
        _levelLabel.setText(String.valueOf(level));
        // Character icon
        Race race = _summary.getRace();
        CharacterSex sex = _summary.getCharacterSex();
        ImageIcon characterIcon = LotroIconsManager.getCharacterIcon(race, sex);
        _characterIconLabel.setIcon(characterIcon);
    }
}
Also used : ImageIcon(javax.swing.ImageIcon) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex)

Example 10 with Race

use of delta.games.lotro.common.Race in project lotro-companion by dmorcellet.

the class CharacterSummaryPanelController method buildPanel.

private JPanel buildPanel() {
    JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0);
    // Grab data
    CharacterClass cClass = null;
    Race race = null;
    CharacterSex sex = null;
    if (_summary != null) {
        cClass = _summary.getCharacterClass();
        race = _summary.getRace();
        sex = _summary.getCharacterSex();
    }
    // Class
    ImageIcon classIcon = LotroIconsManager.getClassIcon(cClass, LotroIconsManager.COMPACT_SIZE);
    panel.add(GuiFactory.buildIconLabel(classIcon), c);
    // Character icon
    ImageIcon characterIcon = LotroIconsManager.getCharacterIcon(race, sex);
    c.gridx = 1;
    _characterIconLabel = GuiFactory.buildIconLabel(characterIcon);
    panel.add(_characterIconLabel, c);
    // Name
    _nameLabel = GuiFactory.buildLabel("", 28.0f);
    c.gridx = 2;
    c.anchor = GridBagConstraints.CENTER;
    c.weightx = 1.0;
    c.fill = GridBagConstraints.BOTH;
    panel.add(_nameLabel, c);
    // Level
    _levelLabel = GuiFactory.buildLabel("", 32.0f);
    c.gridx = 3;
    c.weightx = 0.0;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.EAST;
    panel.add(_levelLabel, c);
    c.gridx = 4;
    JButton edit = GuiFactory.buildButton("Edit...");
    ActionListener al = new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            editSummary();
        }
    };
    edit.addActionListener(al);
    panel.add(edit, c);
    update();
    return panel;
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) Race(delta.games.lotro.common.Race) CharacterSex(delta.games.lotro.common.CharacterSex) JButton(javax.swing.JButton) CharacterClass(delta.games.lotro.common.CharacterClass)

Aggregations

Race (delta.games.lotro.common.Race)13 CharacterClass (delta.games.lotro.common.CharacterClass)9 CharacterSex (delta.games.lotro.common.CharacterSex)6 ImageIcon (javax.swing.ImageIcon)3 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)2 CharacterData (delta.games.lotro.character.CharacterData)2 CharacterEquipment (delta.games.lotro.character.CharacterEquipment)2 EQUIMENT_SLOT (delta.games.lotro.character.CharacterEquipment.EQUIMENT_SLOT)2 SlotContents (delta.games.lotro.character.CharacterEquipment.SlotContents)2 BasicStatsSet (delta.games.lotro.character.stats.BasicStatsSet)2 DeedRaceRequirementFilter (delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 JPanel (javax.swing.JPanel)2 TypedProperties (delta.common.utils.misc.TypedProperties)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterStatsComputer (delta.games.lotro.character.stats.CharacterStatsComputer)1 STAT (delta.games.lotro.character.stats.STAT)1