Class ImageSourceResource
java.lang.Object
one.jpro.platform.image.manager.source.ImageSourceResource
- All Implemented Interfaces:
JsonConvertible,ImageSource
This class provides an implementation of the ImageSource interface
for image resources available on the classpath.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionImageSourceResource(String resourcePath) Creates a new instance with the given resource path. -
Method Summary
Modifier and TypeMethodDescriptionReturns the file name associated with this image source.longReturns the identity hash code associated with this image source.Loads an image and returns it as BufferedImage.org.json.JSONObjecttoJSON()Converts the object to a JSON representation.
-
Constructor Details
-
ImageSourceResource
Creates a new instance with the given resource path.- Parameters:
resourcePath- the path to the image resource.
-
-
Method Details
-
loadImage
Description copied from interface:ImageSourceLoads an image and returns it as BufferedImage.- Specified by:
loadImagein interfaceImageSource- Returns:
- The loaded image as a BufferedImage object.
-
identityHashValue
public long identityHashValue()Description copied from interface:ImageSourceReturns the identity hash code associated with this image source.- Specified by:
identityHashValuein interfaceImageSource- Returns:
- The identity hash value corresponding to this object.
-
toJSON
public org.json.JSONObject toJSON()Description copied from interface:JsonConvertibleConverts the object to a JSON representation.- Specified by:
toJSONin interfaceJsonConvertible- Returns:
- A JSONObject representing the object.
-
getFileName
Description copied from interface:ImageSourceReturns the file name associated with this image source.- Specified by:
getFileNamein interfaceImageSource- Returns:
- The file name as a string.
-