Class ImageProcessor

java.lang.Object
jadex.common.transformation.traverser.ImageProcessor
All Implemented Interfaces:
ITraverseProcessor

public class ImageProcessor extends Object implements ITraverseProcessor
  • Constructor Details

    • ImageProcessor

      public ImageProcessor()
  • Method Details

    • isApplicable

      public boolean isApplicable(Object object, Type type, ClassLoader targetcl, Object context)
      Test if the processor is applicable.
      Specified by:
      isApplicable in interface ITraverseProcessor
      Parameters:
      object - The object.
      targetcl - If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.
      Returns:
      True, if is applicable.
    • process

      public Object process(Object object, Type type, Traverser traverser, List<ITraverseProcessor> conversionprocessors, List<ITraverseProcessor> processors, IStringConverter converter, Traverser.MODE mode, ClassLoader targetcl, Object context)
      Process an object.
      Specified by:
      process in interface ITraverseProcessor
      Parameters:
      object - The object.
      targetcl - If not null, the traverser should make sure that the result object is compatible with the class loader, e.g. by cloning the object using the class loaded from the target class loader.
      Returns:
      The processed object.
    • imageFromBytes

      public static Image imageFromBytes(byte[] data, Class<?> clazz)
    • imageToStandardBytes

      public static byte[] imageToStandardBytes(Image image, String mimeType)
      Convert image to bytes. Method is a direct copy from protected method sun.awt.datatransfer.DataTransferer
    • imageToStandardBytesImpl

      protected static byte[] imageToStandardBytesImpl(RenderedImage renderedImage, String mimeType) throws IOException
      Convert image to bytes. Method is a direct copy from protected method sun.awt.datatransfer.DataTransferer
      Throws:
      IOException