use of delta.games.lotro.lore.deeds.filters.DeedNameFilter in project lotro-companion by dmorcellet.
the class DeedFilterController method buildDeedPanel.
private JPanel buildDeedPanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
int y = 0;
JPanel line1Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
// Label filter
{
JPanel containsPanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
containsPanel.add(GuiFactory.buildLabel("Name filter:"));
_contains = GuiFactory.buildTextField("");
_contains.setColumns(20);
containsPanel.add(_contains);
TextListener listener = new TextListener() {
@Override
public void textChanged(String newText) {
if (newText.length() == 0)
newText = null;
DeedNameFilter nameFilter = _filter.getNameFilter();
nameFilter.setPattern(newText);
filterUpdated();
}
};
_textController = new DynamicTextEditionController(_contains, listener);
line1Panel.add(containsPanel);
}
GridBagConstraints c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
panel.add(line1Panel, c);
y++;
JPanel line2Panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING, 5, 0));
// Type
{
JLabel label = GuiFactory.buildLabel("Type:");
line2Panel.add(label);
_type = DeedUiUtils.buildDeedTypeCombo();
ItemSelectionListener<DeedType> typeListener = new ItemSelectionListener<DeedType>() {
@Override
public void itemSelected(DeedType type) {
DeedTypeFilter typeFilter = _filter.getTypeFilter();
typeFilter.setDeedType(type);
filterUpdated();
}
};
_type.addListener(typeListener);
line2Panel.add(_type.getComboBox());
}
// Category
{
JLabel label = GuiFactory.buildLabel("Category:");
line2Panel.add(label);
_category = DeedUiUtils.buildCategoryCombo();
ItemSelectionListener<String> categoryListener = new ItemSelectionListener<String>() {
@Override
public void itemSelected(String category) {
DeedCategoryFilter categoryFilter = _filter.getCategoryFilter();
categoryFilter.setDeedCategory(category);
filterUpdated();
}
};
_category.addListener(categoryListener);
line2Panel.add(_category.getComboBox());
}
c = new GridBagConstraints(0, y, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0);
panel.add(line2Panel, c);
y++;
return panel;
}
use of delta.games.lotro.lore.deeds.filters.DeedNameFilter 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);
}
Aggregations