Search in sources :

Example 6 with WindowController

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);
    }
}
Also used : CharacterLogWindowController(delta.games.lotro.gui.log.CharacterLogWindowController) CraftingWindowController(delta.games.lotro.gui.stats.crafting.CraftingWindowController) LevelHistoryEditionDialogController(delta.games.lotro.gui.stats.levelling.LevelHistoryEditionDialogController) CharacterData(delta.games.lotro.character.CharacterData) CharacterReputationDialogController(delta.games.lotro.gui.stats.reputation.CharacterReputationDialogController) CraftingWindowController(delta.games.lotro.gui.stats.crafting.CraftingWindowController) WindowController(delta.common.ui.swing.windows.WindowController) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) StashWindowController(delta.games.lotro.gui.character.stash.StashWindowController) TraitPointsEditionWindowController(delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController) CharacterLogWindowController(delta.games.lotro.gui.log.CharacterLogWindowController)

Example 7 with WindowController

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);
            }
        }
    }
}
Also used : CharacterEvent(delta.games.lotro.character.events.CharacterEvent) CharacterData(delta.games.lotro.character.CharacterData) CraftingWindowController(delta.games.lotro.gui.stats.crafting.CraftingWindowController) WindowController(delta.common.ui.swing.windows.WindowController) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) StashWindowController(delta.games.lotro.gui.character.stash.StashWindowController) TraitPointsEditionWindowController(delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController) CharacterLogWindowController(delta.games.lotro.gui.log.CharacterLogWindowController)

Example 8 with WindowController

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();
}
Also used : Window(java.awt.Window) CraftingWindowController(delta.games.lotro.gui.stats.crafting.CraftingWindowController) WindowController(delta.common.ui.swing.windows.WindowController) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) StashWindowController(delta.games.lotro.gui.character.stash.StashWindowController) TraitPointsEditionWindowController(delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController) CharacterLogWindowController(delta.games.lotro.gui.log.CharacterLogWindowController)

Example 9 with WindowController

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();
}
Also used : StashWindowController(delta.games.lotro.gui.character.stash.StashWindowController) CraftingWindowController(delta.games.lotro.gui.stats.crafting.CraftingWindowController) WindowController(delta.common.ui.swing.windows.WindowController) DefaultWindowController(delta.common.ui.swing.windows.DefaultWindowController) StashWindowController(delta.games.lotro.gui.character.stash.StashWindowController) TraitPointsEditionWindowController(delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController) CharacterLogWindowController(delta.games.lotro.gui.log.CharacterLogWindowController)

Example 10 with WindowController

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);
    }
}
Also used : WindowController(delta.common.ui.swing.windows.WindowController)

Aggregations

WindowController (delta.common.ui.swing.windows.WindowController)18 DefaultWindowController (delta.common.ui.swing.windows.DefaultWindowController)12 DeedsExplorerWindowController (delta.games.lotro.gui.deed.DeedsExplorerWindowController)8 CraftingSynopsisWindowController (delta.games.lotro.gui.stats.crafting.synopsis.CraftingSynopsisWindowController)8 CharacterLevelWindowController (delta.games.lotro.gui.stats.levelling.CharacterLevelWindowController)8 ReputationSynopsisWindowController (delta.games.lotro.gui.stats.reputation.synopsis.ReputationSynopsisWindowController)8 WarbandsWindowController (delta.games.lotro.gui.stats.warbands.WarbandsWindowController)8 MapWindowController (delta.games.lotro.maps.ui.MapWindowController)8 Window (java.awt.Window)6 StashWindowController (delta.games.lotro.gui.character.stash.StashWindowController)4 CharacterLogWindowController (delta.games.lotro.gui.log.CharacterLogWindowController)4 CraftingWindowController (delta.games.lotro.gui.stats.crafting.CraftingWindowController)4 TraitPointsEditionWindowController (delta.games.lotro.gui.stats.traitPoints.TraitPointsEditionWindowController)4 JDialog (javax.swing.JDialog)3 CharacterData (delta.games.lotro.character.CharacterData)2 CharacterFileWindowController (delta.games.lotro.gui.character.CharacterFileWindowController)2 JFrame (javax.swing.JFrame)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharactersManager (delta.games.lotro.character.CharactersManager)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1