Search in sources :

Example 16 with ItemSelectionListener

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;
}
Also used : ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) ClassPointRewardFilter(delta.games.lotro.common.rewards.filters.ClassPointRewardFilter)

Example 17 with ItemSelectionListener

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;
}
Also used : ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) DeedClassRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedClassRequirementFilter) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 18 with ItemSelectionListener

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;
}
Also used : DeedRaceRequirementFilter(delta.games.lotro.lore.deeds.filters.DeedRaceRequirementFilter) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) Race(delta.games.lotro.common.Race)

Example 19 with ItemSelectionListener

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;
}
Also used : EmoteRewardFilter(delta.games.lotro.common.rewards.filters.EmoteRewardFilter) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener)

Example 20 with ItemSelectionListener

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;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) CharacterEvent(delta.games.lotro.character.events.CharacterEvent) GridBagLayout(java.awt.GridBagLayout) ItemSelectionListener(delta.common.ui.swing.combobox.ItemSelectionListener) DateEditionController(delta.common.ui.swing.text.dates.DateEditionController)

Aggregations

ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)23 JPanel (javax.swing.JPanel)10 FlowLayout (java.awt.FlowLayout)8 GridBagConstraints (java.awt.GridBagConstraints)7 GridBagLayout (java.awt.GridBagLayout)7 Insets (java.awt.Insets)7 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)2 DynamicTextEditionController (delta.common.ui.swing.text.DynamicTextEditionController)2 TextListener (delta.common.ui.swing.text.TextListener)2 Race (delta.games.lotro.common.Race)2 Profession (delta.games.lotro.lore.crafting.Profession)2 JLabel (javax.swing.JLabel)2 IntegerEditionController (delta.common.ui.swing.text.IntegerEditionController)1 DateEditionController (delta.common.ui.swing.text.dates.DateEditionController)1 TypedProperties (delta.common.utils.misc.TypedProperties)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1 LogItemType (delta.games.lotro.character.log.CharacterLogItem.LogItemType)1 CharacterClass (delta.games.lotro.common.CharacterClass)1 Size (delta.games.lotro.common.Size)1 VirtueId (delta.games.lotro.common.VirtueId)1