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 voiddebug(IBrolImage[] enumValues)Debug method to manage Images resources.static IcongetIcon(IBrolImage brolImage)Uses a cache mechanism to storeIcons.static ImagegetImage(byte[] imagedata)Creates an image which decodes the image stored in the specified byte array.static ImagegetImage(IBrolImage brolImage)Use a cache mechanism to storeImagesstatic byte[]Creates an image from a file.static Image
-
Method Details
-
getImage
Returns anImagefrom a givenIcon. If the icon is null, an image from a new 16*16 pxMissingIconis 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 informationto 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 debuglogsfor 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, aMissingIconis returned.- Parameters:
brolImage-IBrolImagecontaining the resource informations- Returns:
Iconfrom the IBrolImage
-
getImage
Use a cache mechanism to storeImages- Parameters:
brolImage-IBrolImagecontaining the resource informations- Returns:
Imagefrom the IBrolImage
-
debug
Debug method to manage Images resources. Outputs areSystem.outandSystem.err.- Parameters:
enumValues-
-