use of delta.games.lotro.gui.character.chooser.CharactersSelectorPanelController in project lotro-companion by dmorcellet.
the class CharacterLevelPanelController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildBackgroundPanel(new BorderLayout());
_chartController = new CharacterLevelChartController(_stats);
JPanel chartPanel = _chartController.getPanel();
panel.add(chartPanel, BorderLayout.CENTER);
JPanel toonsControlPanel = GuiFactory.buildPanel(new GridBagLayout());
{
// Toons show/hide
List<CharacterFile> toons = _stats.getToonsList();
_toonSelectionController = new CharactersSelectorPanelController(toons);
for (CharacterFile toon : toons) {
_toonSelectionController.setToonSelected(toon, true);
_toonSelectionController.setToonEnabled(toon, true);
}
_toonSelectionController.setGridConfiguration(1, 10);
JPanel selectionPanel = _toonSelectionController.getPanel();
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
toonsControlPanel.add(selectionPanel, c);
_toonSelectionController.getListenersManager().addListener(this);
// Choose toons button
JButton chooser = GuiFactory.buildButton("Choose characters...");
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
doChooseToons();
}
};
chooser.addActionListener(al);
chooser.setAlignmentY(Component.CENTER_ALIGNMENT);
c.gridy++;
toonsControlPanel.add(chooser, c);
}
panel.add(toonsControlPanel, BorderLayout.EAST);
return panel;
}
Aggregations