org.ofbiz.common.image
Class ImageTransform

java.lang.Object
  extended by org.ofbiz.common.image.ImageTransform

public class ImageTransform
extends java.lang.Object

ImageTransform Class

Services to apply transformation to images


Field Summary
static java.lang.String module
           
static java.lang.String resource
           
 
Constructor Summary
ImageTransform()
           
 
Method Summary
static java.util.Map<java.lang.String,java.lang.Object> getBufferedImage(java.lang.String fileLocation, java.util.Locale locale)
          getBufferedImage
static java.util.Map<java.lang.String,java.lang.Object> getXMLValue(java.lang.String fileFullPath, java.util.Locale locale)
          getXMLValue
static java.util.Map<java.lang.String,java.lang.Object> scaleImage(java.awt.image.BufferedImage bufImg, double imgHeight, double imgWidth, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dimensionMap, java.lang.String sizeType, java.util.Locale locale)
          scaleImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static final java.lang.String module

resource

public static final java.lang.String resource
See Also:
Constant Field Values
Constructor Detail

ImageTransform

public ImageTransform()
Method Detail

getBufferedImage

public static java.util.Map<java.lang.String,java.lang.Object> getBufferedImage(java.lang.String fileLocation,
                                                                                java.util.Locale locale)
                                                                         throws java.lang.IllegalArgumentException,
                                                                                java.io.IOException
getBufferedImage

Set a buffered image

Parameters:
context -
fileLocation - Full file Path or URL
Returns:
URL images for all different size types
Throws:
java.io.IOException - Error prevents the document from being fully parsed
JDOMException - Errors occur in parsing
java.lang.IllegalArgumentException

scaleImage

public static java.util.Map<java.lang.String,java.lang.Object> scaleImage(java.awt.image.BufferedImage bufImg,
                                                                          double imgHeight,
                                                                          double imgWidth,
                                                                          java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> dimensionMap,
                                                                          java.lang.String sizeType,
                                                                          java.util.Locale locale)
scaleImage

scale original image related to the ImageProperties.xml dimensions

Parameters:
bufImg - Buffered image to scale
imgHeight - Original image height
imgwidth - Original image width
dimensionMap - Image dimensions by size type
sizeType - Size type to scale
Returns:
New scaled buffered image

getXMLValue

public static java.util.Map<java.lang.String,java.lang.Object> getXMLValue(java.lang.String fileFullPath,
                                                                           java.util.Locale locale)
                                                                    throws java.lang.IllegalStateException,
                                                                           java.io.IOException,
                                                                           JDOMException
getXMLValue

From a XML element, get a values map

Parameters:
fileFullPath - File path to parse
Returns:
Map contains asked attribute values by attribute name
Throws:
java.lang.IllegalStateException
java.io.IOException
JDOMException