Class ImageGraphicProvider

java.lang.Object
org.tentackle.fx.ImageGraphicProvider
All Implemented Interfaces:
GraphicProvider

public abstract class ImageGraphicProvider extends Object implements GraphicProvider
Base implementation of a graphic provider based on image files.
Author:
harald
  • Constructor Details

    • ImageGraphicProvider

      public ImageGraphicProvider(String imagePath)
      Creates an image provider.
      Parameters:
      imagePath - the image path, null if "<package>/images/".
    • ImageGraphicProvider

      public ImageGraphicProvider()
      Creates an image provider for "<package>/images/".
  • Method Details

    • getExtensions

      public String[] getExtensions()
      Gets the file extensions supported by this image provider.
      Returns:
      the extensions
    • createGraphic

      public javafx.scene.Node createGraphic(String name)
      Description copied from interface: GraphicProvider
      Creates a graphic node.
      Throws FxRuntimeException, if loading the image failed or no such image found.
      Specified by:
      createGraphic in interface GraphicProvider
      Parameters:
      name - the graphic's name
      Returns:
      the graphic node, never null
    • getImage

      protected javafx.scene.image.Image getImage(String name)
      Returns the cached image.
      Parameters:
      name - the image name
      Returns:
      the image, null if no such image found