Search in sources :

Example 11 with ComboBoxController

use of delta.common.ui.swing.combobox.ComboBoxController in project lotro-companion by dmorcellet.

the class DeedEditionPanelController method build.

private JPanel build() {
    JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    // Main data line
    {
        JPanel panelLine = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
        panel.add(panelLine, c);
        c.gridy++;
        // Icon
        _icon = GuiFactory.buildIconLabel(null);
        panelLine.add(_icon);
        // Name
        _name = GuiFactory.buildTextField("");
        _name.setFont(_name.getFont().deriveFont(16f).deriveFont(Font.BOLD));
        _name.setColumns(25);
        panelLine.add(_name);
    }
    // Line 2
    {
        JPanel panelLine = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEFT));
        panel.add(panelLine, c);
        c.gridy++;
        // Category
        _category = DeedUiUtils.buildCategoryCombo();
        panelLine.add(_category.getComboBox());
        // Type
        _type = DeedUiUtils.buildDeedTypeCombo();
        panelLine.add(_type.getComboBox());
        // Item level
        _requiredLevel = new ComboBoxController<Integer>(true, Integer.class);
        panelLine.add(GuiFactory.buildLabel("Required level:"));
        panelLine.add(_requiredLevel.getComboBox());
    }
    // Description
    _description = GuiFactory.buildTextArea("", false);
    JScrollPane descriptionPane = GuiFactory.buildScrollPane(_description);
    descriptionPane.setBorder(GuiFactory.buildTitledBorder("Description"));
    _description.setColumns(40);
    _description.setLineWrap(true);
    _description.setWrapStyleWord(true);
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1.0;
    c.weighty = 1.0;
    panel.add(descriptionPane, c);
    c.gridy++;
    // Objectives
    _objectives = GuiFactory.buildTextArea("", false);
    JScrollPane objectivesPane = GuiFactory.buildScrollPane(_objectives);
    objectivesPane.setBorder(GuiFactory.buildTitledBorder("Objectives"));
    _objectives.setColumns(40);
    _objectives.setLineWrap(true);
    _objectives.setWrapStyleWord(true);
    panel.add(objectivesPane, c);
    c.gridy++;
    _panel = panel;
    setItem();
    return _panel;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController)

Example 12 with ComboBoxController

use of delta.common.ui.swing.combobox.ComboBoxController in project lotro-companion by dmorcellet.

the class ItemEditionPanelController method buildSturdinessCombo.

private ComboBoxController<ItemSturdiness> buildSturdinessCombo() {
    ComboBoxController<ItemSturdiness> ctrl = new ComboBoxController<ItemSturdiness>();
    ctrl.addEmptyItem("");
    for (ItemSturdiness sturdiness : ItemSturdiness.ALL) {
        ctrl.addItem(sturdiness, sturdiness.getLabel());
    }
    ctrl.selectItem(null);
    return ctrl;
}
Also used : ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController) ItemSturdiness(delta.games.lotro.lore.items.ItemSturdiness)

Example 13 with ComboBoxController

use of delta.common.ui.swing.combobox.ComboBoxController in project lotro-companion by dmorcellet.

the class ItemEditionPanelController method buildBindingCombo.

private ComboBoxController<ItemBinding> buildBindingCombo() {
    ComboBoxController<ItemBinding> ctrl = new ComboBoxController<ItemBinding>();
    ctrl.addEmptyItem("");
    for (ItemBinding binding : ItemBinding.ALL) {
        ctrl.addItem(binding, binding.getLabel());
    }
    ctrl.selectItem(null);
    return ctrl;
}
Also used : ItemBinding(delta.games.lotro.lore.items.ItemBinding) ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController)

Example 14 with ComboBoxController

use of delta.common.ui.swing.combobox.ComboBoxController in project lotro-companion by dmorcellet.

the class ItemEditionPanelController method buildDamageTypeCombo.

private ComboBoxController<DamageType> buildDamageTypeCombo() {
    ComboBoxController<DamageType> ctrl = new ComboBoxController<DamageType>();
    ctrl.addEmptyItem("");
    for (DamageType damageType : DamageType.getAll()) {
        ctrl.addItem(damageType, damageType.getName());
    }
    ctrl.selectItem(null);
    return ctrl;
}
Also used : ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController) DamageType(delta.games.lotro.lore.items.DamageType)

Example 15 with ComboBoxController

use of delta.common.ui.swing.combobox.ComboBoxController in project lotro-companion by dmorcellet.

the class ItemUiTools method buildWeaponTypeCombo.

/**
 * Build a controller for a combo box to choose a weapon type.
 * @param weaponTypes Weapon types to use.
 * @return A new controller.
 */
public static ComboBoxController<WeaponType> buildWeaponTypeCombo(Iterable<WeaponType> weaponTypes) {
    ComboBoxController<WeaponType> ctrl = new ComboBoxController<WeaponType>();
    ctrl.addEmptyItem("");
    for (WeaponType weaponType : weaponTypes) {
        ctrl.addItem(weaponType, weaponType.getName());
    }
    ctrl.selectItem(null);
    return ctrl;
}
Also used : ComboBoxController(delta.common.ui.swing.combobox.ComboBoxController) WeaponType(delta.games.lotro.lore.items.WeaponType)

Aggregations

ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)18 FlowLayout (java.awt.FlowLayout)3 GridBagConstraints (java.awt.GridBagConstraints)3 GridBagLayout (java.awt.GridBagLayout)3 Insets (java.awt.Insets)3 JPanel (javax.swing.JPanel)3 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)2 Vocation (delta.games.lotro.lore.crafting.Vocation)2 FloatEditionController (delta.common.ui.swing.text.FloatEditionController)1 IntegerEditionController (delta.common.ui.swing.text.IntegerEditionController)1 TypedProperties (delta.common.utils.misc.TypedProperties)1 VirtueId (delta.games.lotro.common.VirtueId)1 StatsEditionPanelController (delta.games.lotro.gui.character.stats.StatsEditionPanelController)1 EssencesEditionPanelController (delta.games.lotro.gui.items.essences.EssencesEditionPanelController)1 RelicsEditionPanelController (delta.games.lotro.gui.items.relics.RelicsEditionPanelController)1 Profession (delta.games.lotro.lore.crafting.Profession)1 DeedType (delta.games.lotro.lore.deeds.DeedType)1 Armour (delta.games.lotro.lore.items.Armour)1 ArmourType (delta.games.lotro.lore.items.ArmourType)1 DamageType (delta.games.lotro.lore.items.DamageType)1