Package rosequartz
Class ConsoleManager
java.lang.Object
rosequartz.ConsoleManager
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 Summary
Modifier and TypeMethodDescriptionaddFunction(String name, Function<String[],String> handler)
Add a function to be called from the console.callFunction(String name, String[] parameters, boolean printOutput)
Calls a function registered to the console.static ConsoleManager
get()
Gets the console manager.boolean
Gets if the console is visible.setToggleKey(Key key)
Sets the key used to toggle (open and close) the console.setVisible(boolean visible)
Sets if the console should be visible.
-
Method Details
-
get
Gets the console manager.- Returns:
- ConsoleManager-object
- See Also:
ConsoleManager
-
setToggleKey
Sets the key used to toggle (open and close) the console.- Parameters:
key
- key used to toggle- Returns:
- this
-
setVisible
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
Add a function to be called from the console.- Parameters:
name
- name of the functionhandler
- handler for the function that takes in an array of strings (parameters) and returns a string (output)- Returns:
- this
-
callFunction
Calls a function registered to the console.- Parameters:
name
- name of the function to callparameters
- parameters to give to the functionprintOutput
- if the output should be printed to the console- Returns:
- function output
-