org.silverpeas.image
Class AbstractImageTool

java.lang.Object
  extended by org.silverpeas.image.AbstractImageTool
All Implemented Interfaces:
ImageTool
Direct Known Subclasses:
Im4javaImageTool

public abstract class AbstractImageTool
extends Object
implements ImageTool

Author:
Yohann Chastagnier

Constructor Summary
AbstractImageTool()
           
 
Method Summary
 void convert(File source, File destination, AbstractImageToolOption option, ImageToolDirective... directives)
          Converts and resizes an image with dimensions and directives
 void convert(File source, File destination, ImageToolDirective... directives)
          Converts an image with some directives
protected abstract  void convert(File source, File destination, Map<Class<AbstractImageToolOption>,AbstractImageToolOption> options, Set<ImageToolDirective> directives)
          Convert an image with dimensions and options directives
 void convert(File source, File destination, Set<AbstractImageToolOption> options, ImageToolDirective... directives)
          Converts and resizes an image with dimensions and directives
protected
<T extends AbstractImageToolOption>
T
getOption(Map<?,?> options, Class<T> key)
          Option getter tool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.silverpeas.image.ImageTool
isActivated
 

Constructor Detail

AbstractImageTool

public AbstractImageTool()
Method Detail

convert

protected abstract void convert(File source,
                                File destination,
                                Map<Class<AbstractImageToolOption>,AbstractImageToolOption> options,
                                Set<ImageToolDirective> directives)
                         throws Exception
Convert an image with dimensions and options directives

Parameters:
source - mandatory (if it not exists, no exception is generated and the process stops)
destination - if destination is not specified, the destination file is the same as the source
options - permits specifying multiple additional working options : - DIMENSION : resizing the image - BACKGROUND : setting a background color
directives - it is possible to specify some additional directives : - PREVIEW_WORK : the conversion concerns an preview result - GEOMETRY_SHRINK : shrinks images with dimension(s) larger than the corresponding width and/or height dimension(s).
Throws:
Exception

convert

public void convert(File source,
                    File destination,
                    ImageToolDirective... directives)
Description copied from interface: ImageTool
Converts an image with some directives

Specified by:
convert in interface ImageTool

convert

public void convert(File source,
                    File destination,
                    AbstractImageToolOption option,
                    ImageToolDirective... directives)
Description copied from interface: ImageTool
Converts and resizes an image with dimensions and directives

Specified by:
convert in interface ImageTool

convert

public void convert(File source,
                    File destination,
                    Set<AbstractImageToolOption> options,
                    ImageToolDirective... directives)
Description copied from interface: ImageTool
Converts and resizes an image with dimensions and directives

Specified by:
convert in interface ImageTool

getOption

protected <T extends AbstractImageToolOption> T getOption(Map<?,?> options,
                                                          Class<T> key)
Option getter tool

Parameters:
options -
key -
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.