Class SolutionController

java.lang.Object
dev.zemco.codegame.presentation.solution.SolutionController

public class SolutionController extends Object
Controller for the solution view that manipulates provided solution model. The solution view presents the details about the problem to solve.

User solves this problem by writing a source code for a program that satisfies the problem's conditions. When user wants to test his solution, he can try to compile the program. If compilation fails, information about the failure is presented. When compilation succeeds, test evaluation of the solution becomes available.

Once user starts the test evaluation, he is presented with the current state of the execution. He may step through the execution. Once the execution successfully satisfies the given problem, the execution ends. If the execution however fails, user is presented with detailed information about the failure.

When the user is sure about validity of his solution, he may submit the solution for evaluation on all cases. If this final evaluation succeeds, the written source code is considered as a valid solution to a given problem. If this final evaluation fails, no details about the failure are provided.

This controller is intended to be initialized using the JavaFX FXML toolkit, as it requires view nodes to be injected using property injection. Target properties are annotated with the FXML annotation.

Some event handler methods are directly referenced by the solution view, and are intended to be bound by JavaFX. These event handlers are also annotated with the FXML annotation.

Author:
Erik Zemčík
See Also:
  • Constructor Details

    • SolutionController

      public SolutionController(ISolutionModel model, INavigator navigator, IDialogService dialogService, IHighlightStyleComputer highlightStyleComputer)
      Creates an instance of SolutionController. Instances created using this constructor are not ready for use, as they are required to be initialized by the JavaFX FXML toolkit.
      Parameters:
      model - solution model to manipulate
      navigator - navigator to use for navigation to different views
      dialogService - dialog service for presenting modal dialogs about the state of evaluation
      highlightStyleComputer - computer of highlight styles for user's solution
      Throws:
      IllegalArgumentException - if any argument is null