use of delta.games.lotro.common.CharacterSex in project lotro-companion by dmorcellet.
the class CharacterSummaryPanelController method buildPanel.
private JPanel buildPanel() {
JPanel panel = GuiFactory.buildPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0);
// Grab data
CharacterClass cClass = null;
Race race = null;
CharacterSex sex = null;
if (_summary != null) {
cClass = _summary.getCharacterClass();
race = _summary.getRace();
sex = _summary.getCharacterSex();
}
// Class
ImageIcon classIcon = LotroIconsManager.getClassIcon(cClass, LotroIconsManager.COMPACT_SIZE);
panel.add(GuiFactory.buildIconLabel(classIcon), c);
// Character icon
ImageIcon characterIcon = LotroIconsManager.getCharacterIcon(race, sex);
c.gridx = 1;
_characterIconLabel = GuiFactory.buildIconLabel(characterIcon);
panel.add(_characterIconLabel, c);
// Name
_nameLabel = GuiFactory.buildLabel("", 28.0f);
c.gridx = 2;
c.anchor = GridBagConstraints.CENTER;
c.weightx = 1.0;
c.fill = GridBagConstraints.BOTH;
panel.add(_nameLabel, c);
// Level
_levelLabel = GuiFactory.buildLabel("", 32.0f);
c.gridx = 3;
c.weightx = 0.0;
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.EAST;
panel.add(_levelLabel, c);
c.gridx = 4;
JButton edit = GuiFactory.buildButton("Edit...");
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
editSummary();
}
};
edit.addActionListener(al);
panel.add(edit, c);
update();
return panel;
}
Aggregations