Class ImageTransform


  • public class ImageTransform
    extends java.lang.Object
    ImageTransform Class

    Services to apply transformation to images

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
      static java.lang.String resource  
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageTransform()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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
      static java.awt.image.BufferedImage toBufferedImage​(java.awt.Image image)
      toBufferedImage
      static java.awt.image.BufferedImage toBufferedImage​(java.awt.Image image, int bufImgType)  
      • 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
    • 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:
        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
        java.lang.IllegalArgumentException - Errors occur in parsing
      • 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
        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
      • toBufferedImage

        public static java.awt.image.BufferedImage toBufferedImage​(java.awt.Image image)
        toBufferedImage

        Transform from an Image instance to a BufferedImage instance

        Parameters:
        image - Source image
        Returns:
        BufferedImage
      • toBufferedImage

        public static java.awt.image.BufferedImage toBufferedImage​(java.awt.Image image,
                                                                   int bufImgType)