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