java.lang.Object
org.tentackle.fx.ImageGraphicProvider
- All Implemented Interfaces:
GraphicProvider
Base implementation of a graphic provider based on image files.
- Author:
- harald
-
Constructor Summary
ConstructorDescriptionCreates an image provider for"<package>/images/"
.ImageGraphicProvider
(String imagePath) Creates an image provider. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.Node
createGraphic
(String name) Creates a graphic node.
ThrowsFxRuntimeException
, if loading the image failed or no such image found.String[]
Gets the file extensions supported by this image provider.protected javafx.scene.image.Image
Returns the cached image.
-
Constructor Details
-
ImageGraphicProvider
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
Gets the file extensions supported by this image provider.- Returns:
- the extensions
-
createGraphic
Description copied from interface:GraphicProvider
Creates a graphic node.
ThrowsFxRuntimeException
, if loading the image failed or no such image found.- Specified by:
createGraphic
in interfaceGraphicProvider
- Parameters:
name
- the graphic's name- Returns:
- the graphic node, never null
-
getImage
Returns the cached image.- Parameters:
name
- the image name- Returns:
- the image, null if no such image found
-