public class ResourceManager extends Object
Constructor and Description |
---|
ResourceManager() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all resource caches
|
Font |
getFont(String name)
Gets a font by name.
|
Font |
getFont(String name,
float size)
Gets a font by name derived to the provided size.
|
GifFrame[] |
getGif(String name)
Gets a GIF by name.
|
GifFrame[] |
getGif(String name,
int width,
int height,
boolean dithering)
Gets a GIF by name resized to the provided size
and applied dithering if requested.
|
BufferedImage |
getImage(String name)
Gets an image by name.
|
BufferedImage |
getImage(String name,
int width,
int height,
boolean dithering)
Gets an image by name resized to the provided size
and applied dithering if requested.
|
static ResourceManager |
getInstance()
Gets ResourceManager instance.
|
BufferedImage |
processImage(BufferedImage image,
int width,
int height,
boolean dithering)
Process an image without registering it to the ResourceManager.
|
Font |
registerFont(String name,
String base64Data)
Decodes a font from base64 and registers it.
|
GifFrame[] |
registerGif(String name,
String base64Data)
Decodes an gif from base64 and registers it.
|
BufferedImage |
registerImage(String name,
String base64Data)
Decodes an image from base64 and registers it.
|
public static ResourceManager getInstance()
public Font registerFont(String name, String base64Data)
name
- the font namebase64Data
- the base 64 datapublic BufferedImage registerImage(String name, String base64Data)
name
- the namebase64Data
- the base 64 datapublic GifFrame[] registerGif(String name, String base64Data)
name
- the namebase64Data
- the base 64 datapublic Font getFont(String name)
name
- the namepublic Font getFont(String name, float size)
name
- the namepublic BufferedImage getImage(String name)
name
- the namepublic BufferedImage getImage(String name, int width, int height, boolean dithering)
name
- the namewidth
- the widthheight
- the heightdithering
- whether to apply ditheringpublic GifFrame[] getGif(String name)
name
- the namepublic GifFrame[] getGif(String name, int width, int height, boolean dithering)
name
- the namewidth
- the widthheight
- the heightdithering
- whether to apply ditheringpublic BufferedImage processImage(BufferedImage image, int width, int height, boolean dithering)
image
- the imagewidth
- the new widthheight
- the new heightdithering
- whether to apply ditheringpublic void clear()
Copyright © 2021. All rights reserved.