Search in sources :

Example 11 with Faction

use of delta.games.lotro.lore.reputation.Faction in project lotro-companion by dmorcellet.

the class DeedFilterController method buildReputationCombobox.

private ComboBoxController<Faction> buildReputationCombobox() {
    ComboBoxController<Faction> combo = DeedUiUtils.buildFactionCombo();
    ItemSelectionListener<Faction> listener = new ItemSelectionListener<Faction>() {

        @Override
        public void itemSelected(Faction faction) {
            ReputationRewardFilter filter = _filter.getReputationFilter();
            filter.setFaction(faction);
            filterUpdated();
        }
    };
    combo.addListener(listener);
    return combo;
}
Also used : ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) ReputationRewardFilter(delta.games.lotro.common.rewards.filters.ReputationRewardFilter) Faction(delta.games.lotro.lore.reputation.Faction)

Example 12 with Faction

use of delta.games.lotro.lore.reputation.Faction 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 13 with Faction

use of delta.games.lotro.lore.reputation.Faction in project lotro-companion by dmorcellet.

the class CharacterReputationDialogController method buildPanel.

private JPanel buildPanel() {
    JPanel panel = GuiFactory.buildPanel(new BorderLayout());
    // Top: reputation deeds
    JPanel topPanel = buildTopPanel();
    panel.add(topPanel, BorderLayout.NORTH);
    // Center: faction levels
    FactionsRegistry registry = FactionsRegistry.getInstance();
    JTabbedPane tabs = GuiFactory.buildTabbedPane();
    List<String> categories = registry.getFactionCategories();
    for (String category : categories) {
        List<Faction> factions = registry.getFactionsForCategory(category);
        JPanel reputationPanel = buildReputationPanelForCategory(category, factions);
        JPanel tabPanel = GuiFactory.buildPanel(new BorderLayout());
        tabPanel.setOpaque(true);
        tabPanel.setBackground(Color.RED);
        tabPanel.add(reputationPanel, BorderLayout.CENTER);
        tabs.add(category, tabPanel);
    }
    TitledBorder factionsBorder = GuiFactory.buildTitledBorder("Factions");
    tabs.setBorder(factionsBorder);
    panel.add(tabs, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) FactionsRegistry(delta.games.lotro.lore.reputation.FactionsRegistry) JTabbedPane(javax.swing.JTabbedPane) TitledBorder(javax.swing.border.TitledBorder) Faction(delta.games.lotro.lore.reputation.Faction)

Example 14 with Faction

use of delta.games.lotro.lore.reputation.Faction in project lotro-companion by dmorcellet.

the class CharacterReputationDialogController method buildReputationPanelForCategory.

private JPanel buildReputationPanelForCategory(String category, List<Faction> factions) {
    JPanel panel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
    // Factions
    GridBagConstraints cLabel = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    GridBagConstraints cBar = new GridBagConstraints(1, 0, 1, 1, 1.0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 0, 5), 0, 0);
    GridBagConstraints cEdit = new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
    int y = 0;
    for (Faction faction : factions) {
        FactionEditionPanelController editionController = new FactionEditionPanelController(faction);
        _editors.put(faction.getKey(), editionController);
        // Label
        JLabel label = editionController.getLabel();
        cLabel.gridy = y;
        panel.add(label, cLabel);
        // Bar and buttons panel
        FlowLayout layout = new FlowLayout(FlowLayout.TRAILING);
        layout.setVgap(0);
        JPanel barButtonsPanel = GuiFactory.buildPanel(layout);
        // - button minus
        JButton minus = editionController.getMinusButton();
        minus.addActionListener(this);
        barButtonsPanel.add(minus);
        // - bar
        JProgressBar bar = editionController.getBar();
        barButtonsPanel.add(bar);
        // - button plus
        JButton plus = editionController.getPlusButton();
        plus.addActionListener(this);
        barButtonsPanel.add(plus);
        cBar.gridy = y;
        panel.add(barButtonsPanel, cBar);
        // - button edit
        JButton edit = editionController.getEditButton();
        edit.addActionListener(this);
        cEdit.gridy = y;
        panel.add(edit, cEdit);
        y++;
    }
    JPanel gluePanel = GuiFactory.buildPanel(new BorderLayout());
    GridBagConstraints glueC = new GridBagConstraints(0, y, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
    panel.add(gluePanel, glueC);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JLabel(javax.swing.JLabel) Faction(delta.games.lotro.lore.reputation.Faction)

Example 15 with Faction

use of delta.games.lotro.lore.reputation.Faction in project lotro-companion by dmorcellet.

the class FactionStatusEditionPanelController method handleDateChange.

private void handleDateChange(DateEditionController source, long completionDate) {
    int index = 0;
    Faction faction = _status.getFaction();
    for (FactionLevel level : faction.getLevels()) {
        FactionLevelStatus status = _status.getStatusForLevel(level);
        FactionLevelEditionGadgets proficiency = _gadgets.get(index);
        if (source == proficiency.getCompletionDate()) {
            status.setCompletionDate(completionDate);
        }
        index++;
    }
    triggerChartUpdateTimer();
}
Also used : FactionLevelStatus(delta.games.lotro.character.reputation.FactionLevelStatus) FactionLevel(delta.games.lotro.lore.reputation.FactionLevel) Faction(delta.games.lotro.lore.reputation.Faction)

Aggregations

Faction (delta.games.lotro.lore.reputation.Faction)20 FactionLevel (delta.games.lotro.lore.reputation.FactionLevel)6 JPanel (javax.swing.JPanel)5 FactionLevelStatus (delta.games.lotro.character.reputation.FactionLevelStatus)3 FactionStatus (delta.games.lotro.character.reputation.FactionStatus)3 ReputationItem (delta.games.lotro.common.ReputationItem)3 FactionsRegistry (delta.games.lotro.lore.reputation.FactionsRegistry)3 GridBagLayout (java.awt.GridBagLayout)3 CellDataProvider (delta.common.ui.swing.tables.CellDataProvider)2 TableColumnController (delta.common.ui.swing.tables.TableColumnController)2 Reputation (delta.games.lotro.common.Reputation)2 VirtueId (delta.games.lotro.common.VirtueId)2 ReputationRewardFilter (delta.games.lotro.common.rewards.filters.ReputationRewardFilter)2 BorderLayout (java.awt.BorderLayout)2 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 TableCellRenderer (javax.swing.table.TableCellRenderer)2 CheckboxController (delta.common.ui.swing.checkbox.CheckboxController)1 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1