use of delta.common.ui.swing.windows.WindowController in project lotro-companion by dmorcellet.
the class CharacterFileWindowController method actionPerformed.
/**
* Handle button actions.
* @param e Source event.
*/
@Override
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if (LOG_COMMAND.equals(command)) {
// Show log
String serverName = _toon.getServerName();
String toonName = _toon.getName();
String id = CharacterLogWindowController.getIdentifier(serverName, toonName);
WindowController controller = _windowsManager.getWindow(id);
if (controller == null) {
controller = new CharacterLogWindowController(_toon);
_windowsManager.registerWindow(controller);
controller.getWindow().setLocationRelativeTo(getFrame());
}
controller.bringToFront();
} else if (REPUTATION_COMMAND.equals(command)) {
// Reputation
CharacterReputationDialogController controller = new CharacterReputationDialogController(this, _toon);
controller.editModal();
} else if (LEVEL_COMMAND.equals(command)) {
// Level history
LevelHistoryEditionDialogController controller = new LevelHistoryEditionDialogController(this, _toon);
controller.editModal();
} else if (CRAFTING_COMMAND.equals(command)) {
// Crafting
CraftingWindowController controller = new CraftingWindowController(this, _toon);
controller.editModal();
} else if (STASH_COMMAND.equals(command)) {
showStash();
} else if (TRAIT_POINTS_COMMAND.equals(command)) {
editTraitPoints();
} else if (NEW_TOON_DATA_ID.equals(command)) {
startNewCharacterData();
} else if (CLONE_TOON_DATA_ID.equals(command)) {
cloneCharacterData();
} else if (EXPORT_TOON_DATA_ID.equals(command)) {
exportCharacterData();
} else if (REMOVE_TOON_DATA_ID.equals(command)) {
removeCharacterData();
} else if (GenericTableController.DOUBLE_CLICK.equals(command)) {
CharacterData data = (CharacterData) e.getSource();
showCharacterData(data);
}
}
use of delta.common.ui.swing.windows.WindowController in project lotro-companion by dmorcellet.
the class CharacterFileWindowController method removeCharacterData.
private void removeCharacterData() {
GenericTableController<CharacterData> controller = _toonsTable.getTableController();
CharacterData data = controller.getSelectedItem();
if (data != null) {
// Check deletion
String serverName = data.getServer();
String toonName = data.getName();
int result = GuiFactory.showQuestionDialog(getFrame(), "Do you really want to delete this configuration of " + toonName + "@" + serverName + "?", "Delete?", JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.OK_OPTION) {
String id = CharacterDataWindowController.getIdentifier(data);
WindowController windowController = _windowsManager.getWindow(id);
if (windowController != null) {
windowController.dispose();
}
boolean ok = _toon.getInfosManager().remove(data);
if (ok) {
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_REMOVED, _toon, data);
EventsManager.invokeEvent(event);
}
}
}
}
use of delta.common.ui.swing.windows.WindowController in project lotro-companion by dmorcellet.
the class CharacterFileWindowController method showCharacterData.
private void showCharacterData(CharacterData data) {
String id = CharacterDataWindowController.getIdentifier(data);
WindowController controller = _windowsManager.getWindow(id);
if (controller == null) {
controller = new CharacterDataWindowController(this, _toon, data);
_windowsManager.registerWindow(controller);
Window thisWindow = SwingUtilities.getWindowAncestor(_toonsTable.getTable());
controller.getWindow().setLocationRelativeTo(thisWindow);
}
controller.bringToFront();
}
use of delta.common.ui.swing.windows.WindowController in project lotro-companion by dmorcellet.
the class CharacterFileWindowController method showStash.
private void showStash() {
// Stash
String serverName = _toon.getServerName();
String toonName = _toon.getName();
String id = StashWindowController.getIdentifier(serverName, toonName);
WindowController controller = _windowsManager.getWindow(id);
if (controller == null) {
controller = new StashWindowController(_toon);
_windowsManager.registerWindow(controller);
controller.getWindow().setLocationRelativeTo(getFrame());
}
controller.bringToFront();
}
use of delta.common.ui.swing.windows.WindowController in project lotro-companion by dmorcellet.
the class StatCurvesWindowsManager method update.
/**
* Update contents with current toon data.
*/
public void update() {
for (WindowController controller : _childControllers.getAll()) {
StatCurvesWindowController statCurvesWindow = (StatCurvesWindowController) controller;
statCurvesWindow.update(_toon);
}
}
Aggregations