Class Controller


  • public class Controller
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Model model
      instance variables for the two other components of the MVC model
      View view  
    • Constructor Summary

      Constructors 
      Constructor Description
      Controller()
      we don't really need a constructor method, but include one to print a debugging message if required
    • Field Detail

      • model

        public Model model
        instance variables for the two other components of the MVC model
      • view

        public View view
    • Constructor Detail

      • Controller

        public Controller()
        we don't really need a constructor method, but include one to print a debugging message if required
    • Method Detail

      • userKeyInteraction

        public void userKeyInteraction​(javafx.scene.input.KeyEvent event)
        This is how the View talks to the Controller AND how the Controller talks to the Model This method is called by the View to respond to key presses in the GUI The controller's job is to decide what to do. In this case it converts the keypresses into commands which are run in the model