Class JFXMediaLoader

java.lang.Object
nl.colorize.multimedialib.renderer.jfx.JFXMediaLoader
All Implemented Interfaces:
MediaLoader

public class JFXMediaLoader extends Object implements MediaLoader
Media implementation for JavaFX. Everything related to graphics uses a JavaFX-specific implementation that does not rely on AWT, Java2D, or Swing. Everything not related to graphics is delegated to the Java2D renderer.
  • Constructor Details

    • JFXMediaLoader

      public JFXMediaLoader()
  • Method Details

    • loadImage

      public JFXImage loadImage(FilePointer file)
      Description copied from interface: MediaLoader
      Loads an image from a file. Images in JPEG and PNG format are supported by all renderers.
      Specified by:
      loadImage in interface MediaLoader
    • loadAudio

      public Audio loadAudio(FilePointer file)
      Description copied from interface: MediaLoader
      Loads an audio clip from a file. MP3 files are supported by all renderers.
      Specified by:
      loadAudio in interface MediaLoader
    • loadFont

      public FontFace loadFont(FilePointer file, String family, FontStyle style)
      Description copied from interface: MediaLoader
      Loads a TrueType or FreeType font and converts it to a format that can be used by the renderer. The loaded font will be attached to the font family name specified in the font style.
      Specified by:
      loadFont in interface MediaLoader
    • getFont

      protected javafx.scene.text.Font getFont(FontFace key)
    • loadModel

      public PolygonModel loadModel(FilePointer file)
      Description copied from interface: MediaLoader
      Loads a polygon model from the specified file. Only the GLTF format is guaranteed to be supported, other file formats are only supported by specific renderers.
      Specified by:
      loadModel in interface MediaLoader
    • getGeometryBuilder

      public GeometryBuilder getGeometryBuilder()
      Description copied from interface: MediaLoader
      Provides access to a GeometryBuilder instance that can be used to create simple 3D geometry in a programmatic way.
      Specified by:
      getGeometryBuilder in interface MediaLoader
    • loadText

      public String loadText(FilePointer file)
      Description copied from interface: MediaLoader
      Loads a text-based resource file using UTF-8 encoding.
      Specified by:
      loadText in interface MediaLoader
    • containsResourceFile

      public boolean containsResourceFile(FilePointer file)
      Description copied from interface: MediaLoader
      Returns whether the specified resource file is available.
      Specified by:
      containsResourceFile in interface MediaLoader
    • loadApplicationData

      public Properties loadApplicationData(String appName)
      Description copied from interface: MediaLoader
      Loads the application data for the application with the specified name. Application data is limited to key/value properties, as this type of data is supported by all platforms. Returns an empty Properties when no application data exists.
      Specified by:
      loadApplicationData in interface MediaLoader
    • saveApplicationData

      public void saveApplicationData(String appName, Properties data)
      Description copied from interface: MediaLoader
      Saves the application data for the application with the specified name. Application data is limited to key/value properties, as this type of data is supported by all platforms.
      Specified by:
      saveApplicationData in interface MediaLoader