use of delta.games.lotro.common.Size in project lotro-companion by dmorcellet.
the class WarbandsFilterController method setFilter.
private void setFilter() {
String region = _filter.getRegion();
_region.selectItem(region);
Integer minLevel = _filter.getMinLevel();
_minLevel.selectItem(minLevel);
Size size = _filter.getSize();
_size.selectItem(size);
}
use of delta.games.lotro.common.Size in project lotro-companion by dmorcellet.
the class WarbandsFilterController method build.
private JPanel build() {
JPanel panel = GuiFactory.buildPanel(new FlowLayout(FlowLayout.LEADING));
// Regions
String[] regions = getRegions();
_region = new ComboBoxController<String>();
_region.addEmptyItem(" ");
for (String region : regions) {
_region.addItem(region, region);
}
ItemSelectionListener<String> regionListener = new ItemSelectionListener<String>() {
@Override
public void itemSelected(String region) {
_filter.setRegion(region);
updateFilter();
}
};
_region.addListener(regionListener);
panel.add(GuiFactory.buildLabel("Region:"));
panel.add(_region.getComboBox());
// Sizes
Size[] sizes = { Size.SOLO, Size.SMALL_FELLOWSHIP, Size.FELLOWSHIP, Size.RAID };
_size = new ComboBoxController<Size>();
_size.addEmptyItem(" ");
for (Size size : sizes) {
_size.addItem(size, size.toString());
}
ItemSelectionListener<Size> sizeListener = new ItemSelectionListener<Size>() {
@Override
public void itemSelected(Size size) {
_filter.setSize(size);
updateFilter();
}
};
_size.addListener(sizeListener);
panel.add(GuiFactory.buildLabel("Size:"));
panel.add(_size.getComboBox());
// Levels
Integer[] minLevels = getMinLevels();
_minLevel = new ComboBoxController<Integer>();
_minLevel.addEmptyItem(" ");
for (Integer minLevel : minLevels) {
_minLevel.addItem(minLevel, minLevel.toString());
}
ItemSelectionListener<Integer> minLevelListener = new ItemSelectionListener<Integer>() {
@Override
public void itemSelected(Integer minLevel) {
_filter.setMinLevel(minLevel);
updateFilter();
}
};
_minLevel.addListener(minLevelListener);
panel.add(GuiFactory.buildLabel("Minimum level:"));
panel.add(_minLevel.getComboBox());
// Reset
_reset = GuiFactory.buildButton("Reset");
_reset.addActionListener(this);
panel.add(_reset);
return panel;
}
Aggregations