Class BrolImageUtils

java.lang.Object
be.gaudry.model.drawing.BrolImageUtils

public class BrolImageUtils extends Object
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 Details

    • getImage

      public static Image getImage(Icon icon)
      Returns an Image from a given Icon. If the icon is null, an image from a new 16*16 px MissingIcon is returned.
      Parameters:
      icon -
      Returns:
      Image of the icon
    • getImage

      public static Image getImage(byte[] imagedata)
      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

      public static byte[] getImage(File file)
      Creates an image from a file. See the info and debug logs for more information.
      Parameters:
      file - of the image
      Returns:
      an array of bytes, representing image data, or null on error.
    • getIcon

      public static Icon getIcon(IBrolImage brolImage)
      Uses a cache mechanism to store Icons. If the resource file is not available, a MissingIcon is returned.
      Parameters:
      brolImage - IBrolImage containing the resource informations
      Returns:
      Icon from the IBrolImage
    • getImage

      public static Image getImage(IBrolImage brolImage)
      Use a cache mechanism to store Images
      Parameters:
      brolImage - IBrolImage containing the resource informations
      Returns:
      Image from the IBrolImage
    • debug

      public static void debug(IBrolImage[] enumValues)
      Debug method to manage Images resources. Outputs are System.out and System.err.
      Parameters:
      enumValues -