use of delta.games.lotro.character.stats.virtues.VirtuesSet in project lotro-companion by dmorcellet.
the class CharacterDataWindowController method buildVirtuesPanel.
private JPanel buildVirtuesPanel() {
JPanel panel = GuiFactory.buildPanel(new FlowLayout());
JPanel virtuesPanel = _virtuesController.getPanel();
panel.add(virtuesPanel);
JButton button = GuiFactory.buildButton("Edit...");
panel.add(button);
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
VirtuesSet virtues = VirtuesEditionDialogController.editVirtues(CharacterDataWindowController.this, _data.getVirtues());
if (virtues != null) {
_data.getVirtues().copyFrom(virtues);
_virtuesController.setVirtues(virtues);
// Broadcast virtues update event...
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _data);
EventsManager.invokeEvent(event);
}
}
};
button.addActionListener(al);
return panel;
}
use of delta.games.lotro.character.stats.virtues.VirtuesSet in project lotro-companion by dmorcellet.
the class VirtuesEditionPanelController method getVirtues.
/**
* Get the current virtues values.
* @return the currently displayed virtues definition.
*/
public VirtuesSet getVirtues() {
VirtuesSet ret = new VirtuesSet();
for (VirtueId virtueId : VirtueId.values()) {
VirtueEditionUiController ui = _virtues.get(virtueId);
int tier = ui.getTier();
ret.setVirtueValue(virtueId, tier);
}
_selectedVirtues.getSelectedVirtues(ret);
return ret;
}
use of delta.games.lotro.character.stats.virtues.VirtuesSet in project lotro-companion by dmorcellet.
the class VirtuesEditionDialogController method editVirtues.
/**
* Edit virtues.
* @param parent Parent controller.
* @param virtues Virtues to show.
* @return The edited virtues or <code>null</code> if the window was closed or canceled.
*/
public static VirtuesSet editVirtues(WindowController parent, VirtuesSet virtues) {
VirtuesEditionDialogController controller = new VirtuesEditionDialogController(parent, virtues);
VirtuesSet editedVirtues = controller.editModal();
return editedVirtues;
}
use of delta.games.lotro.character.stats.virtues.VirtuesSet in project lotro-companion by dmorcellet.
the class MainTestVirtuesDisplayPanel method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
CharacterGenerationTools tools = new CharacterGenerationTools();
CharacterGeneratorMeva mevaGenerator = new CharacterGeneratorMeva(tools);
CharacterData meva = mevaGenerator.buildCharacter();
meva.setDate(Long.valueOf(System.currentTimeMillis()));
VirtuesDisplayPanelController panelCtrl = new VirtuesDisplayPanelController();
VirtuesSet virtues = meva.getVirtues();
virtues.setSelectedVirtue(null, 1);
panelCtrl.setVirtues(virtues);
JFrame frame = new JFrame();
frame.add(panelCtrl.getPanel());
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
}
use of delta.games.lotro.character.stats.virtues.VirtuesSet in project lotro-companion by dmorcellet.
the class MainTestVirtuesEditionPanel method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
CharacterGenerationTools tools = new CharacterGenerationTools();
CharacterGeneratorMeva mevaGenerator = new CharacterGeneratorMeva(tools);
CharacterData meva = mevaGenerator.buildCharacter();
VirtuesSet virtues = meva.getVirtues();
virtues.setSelectedVirtue(null, 1);
VirtuesEditionPanelController panelCtrl = new VirtuesEditionPanelController();
panelCtrl.setVirtues(virtues);
JFrame frame = new JFrame("Virtues edition");
frame.add(panelCtrl.getPanel());
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
}
Aggregations