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