use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.
the class DeedFilterController method buildClassPointsCombobox.
private ComboBoxController<Boolean> buildClassPointsCombobox() {
ComboBoxController<Boolean> combo = build3StatesBooleanCombobox();
ItemSelectionListener<Boolean> listener = new ItemSelectionListener<Boolean>() {
@Override
public void itemSelected(Boolean value) {
ClassPointRewardFilter filter = _filter.getClassPointsFilter();
filter.setHasClassPointFlag(value);
filterUpdated();
}
};
combo.addListener(listener);
return combo;
}
use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.
the class DeedFilterController method buildCharacterClassCombobox.
private ComboBoxController<CharacterClass> buildCharacterClassCombobox() {
ComboBoxController<CharacterClass> combo = CharacterUiUtils.buildClassCombo(true);
ItemSelectionListener<CharacterClass> listener = new ItemSelectionListener<CharacterClass>() {
@Override
public void itemSelected(CharacterClass requiredClass) {
DeedClassRequirementFilter filter = _filter.getClassFilter();
filter.setCharacterClass(requiredClass);
filterUpdated();
}
};
combo.addListener(listener);
return combo;
}
use of delta.common.ui.swing.combobox.ItemSelectionListener 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.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.
the class DeedFilterController method buildEmotesCombobox.
private ComboBoxController<String> buildEmotesCombobox() {
ComboBoxController<String> combo = DeedUiUtils.buildEmotesCombo();
ItemSelectionListener<String> listener = new ItemSelectionListener<String>() {
@Override
public void itemSelected(String emote) {
EmoteRewardFilter filter = _filter.getEmoteFilter();
filter.setEmote(emote);
filterUpdated();
}
};
combo.addListener(listener);
return combo;
}
use of delta.common.ui.swing.combobox.ItemSelectionListener in project lotro-companion by dmorcellet.
the class CharacterMainAttrsEditionPanelController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildBackgroundPanel(new GridBagLayout());
// 1st line
JPanel firstLinePanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1.0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
panel.add(firstLinePanel, c);
// Class icon
_classIcon = GuiFactory.buildIconLabel(null);
firstLinePanel.add(_classIcon);
// Race icon
_raceIcon = GuiFactory.buildIconLabel(null);
firstLinePanel.add(_raceIcon);
// Name
_name = GuiFactory.buildTextField("");
_name.setFont(_name.getFont().deriveFont(16f).deriveFont(Font.BOLD));
_name.setColumns(25);
firstLinePanel.add(_name);
// Level
_level = CharacterUiUtils.buildLevelCombo();
firstLinePanel.add(_level.getComboBox());
ItemSelectionListener<Integer> levelListener = new ItemSelectionListener<Integer>() {
@Override
public void itemSelected(Integer level) {
_toon.setLevel(level.intValue());
// Broadcast level update event...
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _toon);
EventsManager.invokeEvent(event);
}
};
_level.addListener(levelListener);
// Date
_date = new DateEditionController(DateFormat.getDateTimeCodec());
firstLinePanel.add(_date.getTextField());
// 2nd line
JPanel secondLinePanel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
// Short description
secondLinePanel.add(GuiFactory.buildLabel("Description:"));
_shortDescription = GuiFactory.buildTextField("");
_shortDescription.setColumns(50);
secondLinePanel.add(_shortDescription);
c = new GridBagConstraints(0, 1, 1, 1, 0.0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
panel.add(secondLinePanel, c);
return panel;
}
Aggregations