Class JFXRenderer
java.lang.Object
nl.colorize.multimedialib.renderer.jfx.JFXRenderer
- All Implemented Interfaces:
Renderer
Renderer based on OpenJFX, which was
previously known as JavaFX. Note that JavaFX is only used for the animation
loop, graphics, and input. Other renderer capabilities are identical to the
Java2D renderer, since both are based on the Java standard library.
-
Method Summary
Modifier and TypeMethodDescriptionprotected static JFXRenderer
Returns the single currently activeJFXRenderer
instance.getInput()
static JFXRenderer
launch
(DisplayMode displayMode, WindowOptions windowOptions) Launches the JavaFX renderer.void
start
(Scene initialScene, ErrorHandler errorHandler) Initializes this renderer and starts playing the requested scene.void
Ends the animation loop, stops this renderer, and quits the application.toString()
-
Method Details
-
start
Description copied from interface:Renderer
Initializes this renderer and starts playing the requested scene. Errors that occur during the application will be forwarded to the specified error handler.As explained in the class documentation, this is the only method in
Renderer
that can be safely called from outside the renderer's application loop. -
terminate
public void terminate()Description copied from interface:Renderer
Ends the animation loop, stops this renderer, and quits the application.Renderer
instances cannot be reused, restarting a previously terminated renderer is not possible. -
getDisplayMode
- Specified by:
getDisplayMode
in interfaceRenderer
-
getGraphicsMode
- Specified by:
getGraphicsMode
in interfaceRenderer
-
toString
-
launch
Launches the JavaFX renderer. Note that JavaFX does not support multiple instances of the renderer to be active simultaneously.- Throws:
IllegalStateException
- if this method is called at a moment when anotherJFXRenderer
instance is already active.
-
accessInstance
Returns the single currently activeJFXRenderer
instance. This method is used to access the renderer from the JavaFX application thread.- Throws:
IllegalStateException
- when trying to call this method before the renderer has been initialized.
-
getWindowOptions
-
getGraphics
-
getInput
-
getMediaLoader
-
getNetwork
-
getContext
-
getErrorHandler
-