Package view

Class ViewController

java.lang.Object
view.ViewController

public class ViewController extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    javafx.beans.property.StringProperty
     
    javafx.beans.property.StringProperty
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    The ViewController function is the main function of the ViewController class.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Back(javafx.event.ActionEvent event)
    The Back function is used to return the user to the ChooseGameMode screen.
    void
    The ChooseGameMode function is a function that allows the user to choose between playing in single player mode or multiplayer mode.
    void
    Exit(javafx.event.ActionEvent event)
    The Exit function is a function that exits the program.
    void
    The loadHomePage function is used to load the HomePage.fxml file into the main window of our application.
    void
    loadScene(String sceneName)
    The loadScene function is used to load a new scene into the stage.
    void
    The setViewSharedData function is used to set the viewSharedData variable.
    void
    The StartTutorial function is called when the user clicks on the "Tutorial" button.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • wordFromPlayer

      public javafx.beans.property.StringProperty wordFromPlayer
    • playerAction

      public javafx.beans.property.StringProperty playerAction
  • Constructor Details

    • ViewController

      public ViewController()
      The ViewController function is the main function of the ViewController class. It creates a new instance of the GameModel class, and then calls its startGame() method. The ViewController also sets up all the GUI elements for this game, including: - A TextField for entering words to guess (wordFromPlayer) - A Label that displays whether a word was guessed correctly (playerAction)
  • Method Details

    • setViewSharedData

      public void setViewSharedData(ViewSharedData viewSharedData)
      The setViewSharedData function is used to set the viewSharedData variable.
      Parameters:
      viewSharedData - viewSharedData Set the viewSharedData variable to the viewSharedData object passed in
    • loadScene

      public void loadScene(String sceneName) throws IOException
      The loadScene function is used to load a new scene into the stage.
      Parameters:
      sceneName - sceneName Load the scene that is passed in
      Throws:
      IOException
    • StartTutorial

      public void StartTutorial() throws IOException
      The StartTutorial function is called when the user clicks on the "Tutorial" button. It loads a new scene, which displays instructions for how to play the game.
      Throws:
      IOException
    • ChooseGameMode

      public void ChooseGameMode() throws IOException
      The ChooseGameMode function is a function that allows the user to choose between playing in single player mode or multiplayer mode. It does this by loading the GameModePage scene.
      Throws:
      IOException
    • loadHomePage

      public void loadHomePage() throws IOException
      The loadHomePage function is used to load the HomePage.fxml file into the main window of our application. This function is called when a user clicks on the "Home" button in our application's menu bar, and it will display all the information that we have stored about each student in our database. It also allows us to add new students, edit existing students' information, or delete any student from our database entirely.
      Throws:
      IOException
    • Exit

      public void Exit(javafx.event.ActionEvent event) throws IOException
      The Exit function is a function that exits the program.
      Parameters:
      event - event Get the source of the action
      Throws:
      IOException
    • Back

      public void Back(javafx.event.ActionEvent event) throws IOException
      The Back function is used to return the user to the ChooseGameMode screen.
      Parameters:
      event - event Get the source of the action
      Throws:
      IOException