Search in sources :

Example 1 with UiCommand

use of com.helospark.tactview.ui.javafx.commands.UiCommand in project tactview by helospark.

the class UiCommandInterpreterService method synchronousSend.

public <T extends UiCommand> T synchronousSend(T uiCommand) {
    logger.info("Executing {}", uiCommand);
    dirtyRepository.setDirty(true);
    redoHistory.clear();
    uiCommand.execute();
    if (uiCommand.isRevertable()) {
        commandHistory.push(uiCommand);
        while (commandHistory.size() > historySize) {
            UiCommand command = commandHistory.pollLast();
            if (command != null) {
                command.preDestroy();
            }
        }
    }
    return uiCommand;
}
Also used : UiCommand(com.helospark.tactview.ui.javafx.commands.UiCommand)

Aggregations

UiCommand (com.helospark.tactview.ui.javafx.commands.UiCommand)1