Package be.gaudry.model.drawing
Class BrolImageUtils
java.lang.Object
be.gaudry.model.drawing.BrolImageUtils
The BrolImageUtils helps to manage images.
\n
All the available image resources in a Broldev dependency are defined as enumerations to have a
low coupling between resources and Java code.
These enumerations implement the
IBrolImage
interface to give some image resources methods.
\nThe BrolImageUtils allows to get image resources from any IBrolImage
, and
uses cache mechanisms to avoid building or loading images on each call.
Provided by the broldev.core.model project.- Since:
- 1.0 Feb 27, 2009, broldev.core.model 0.0.1-SNAPSHOT dependency
- Version:
- 1.0 Feb 27, 2009
- Author:
- Steph GAUDRY
- See Also:
IBrolImage
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
debug(IBrolImage[] enumValues)
Debug method to manage Images resources.static Icon
getIcon(IBrolImage brolImage)
Uses a cache mechanism to storeIcons
.static Image
getImage(byte[] imagedata)
Creates an image which decodes the image stored in the specified byte array.static Image
getImage(IBrolImage brolImage)
Use a cache mechanism to storeImages
static byte[]
Creates an image from a file.static Image
-
Method Details
-
getImage
Returns anImage
from a givenIcon
. If the icon is null, an image from a new 16*16 pxMissingIcon
is returned.- Parameters:
icon
-- Returns:
- Image of the icon
-
getImage
Creates an image which decodes the image stored in the specified byte array.The data must be in GIF or JPEG image format. See the
logging information
to know how the logging is implemented.- Parameters:
imagedata
- an array of bytes, representing image data in a supported image format.- Returns:
- an image, or null on error.
-
getImage
Creates an image from a file. See the info and debuglogs
for more information.- Parameters:
file
- of the image- Returns:
- an array of bytes, representing image data, or null on error.
-
getIcon
Uses a cache mechanism to storeIcons
. If the resource file is not available, aMissingIcon
is returned.- Parameters:
brolImage
-IBrolImage
containing the resource informations- Returns:
Icon
from the IBrolImage
-
getImage
Use a cache mechanism to storeImages
- Parameters:
brolImage
-IBrolImage
containing the resource informations- Returns:
Image
from the IBrolImage
-
debug
Debug method to manage Images resources. Outputs areSystem.out
andSystem.err
.- Parameters:
enumValues
-
-