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;
}
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);
}
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;
}
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;
}
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();
}
Aggregations