Package rosequartz

Class ConsoleManager

java.lang.Object
rosequartz.ConsoleManager

public class ConsoleManager extends Object
Class for managing the RoseQuartz-Console. All prints and error messages are redirected there. The console also accepts input in the form of functions.
  • Method Details

    • get

      public static ConsoleManager get()
      Gets the console manager.
      Returns:
      ConsoleManager-object
      See Also:
      ConsoleManager
    • setToggleKey

      public ConsoleManager setToggleKey(Key key)
      Sets the key used to toggle (open and close) the console.
      Parameters:
      key - key used to toggle
      Returns:
      this
    • setVisible

      public ConsoleManager setVisible(boolean visible)
      Sets if the console should be visible.
      Parameters:
      visible - console visible
      Returns:
      this
    • getVisible

      public boolean getVisible()
      Gets if the console is visible.
      Returns:
      console visible
    • addFunction

      public ConsoleManager addFunction(String name, Function<String[],​String> handler)
      Add a function to be called from the console.
      Parameters:
      name - name of the function
      handler - handler for the function that takes in an array of strings (parameters) and returns a string (output)
      Returns:
      this
    • callFunction

      public String callFunction(String name, String[] parameters, boolean printOutput)
      Calls a function registered to the console.
      Parameters:
      name - name of the function to call
      parameters - parameters to give to the function
      printOutput - if the output should be printed to the console
      Returns:
      function output