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
ConstructorsConstructorDescriptionCreates an image provider for"<package>/images/".ImageGraphicProvider(String imagePath) Creates an image provider. -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.NodecreateGraphic(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.ImageReturns 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:GraphicProviderCreates a graphic node.
ThrowsFxRuntimeException, if loading the image failed or no such image found.- Specified by:
createGraphicin 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
-