net.sourceforge.openutils.mgnlmedia.media.configuration
Class ImageProcessorsManager

java.lang.Object
  extended by info.magnolia.cms.beans.config.ObservedManager
      extended by net.sourceforge.openutils.mgnlmedia.media.configuration.ImageProcessorsManager

public class ImageProcessorsManager
extends info.magnolia.cms.beans.config.ObservedManager

ObservedManager that manages the maps of processors that handle images resize and processors that do operation on images after the resize.
default image resolution processors:

control chars image resolution processor description
b, o FitInAndFillWithBandsImageResolutionProcessor resize image to fit in required resolution and fills empty areas by color passed in parameters as "background"
l FitInImageResolutionProcessor resize image to fit in required resolution
x ResizeNoCropImageResolutionProcessor resize image to contain required resolution
no control char (default), c ResizeCropCenteredImageResolutionProcessor resize image to contain required resolution, and crop simmetric bands that outfits the required resolution rect

Version:
$Id: $
Author:
molaschi

Field Summary
 
Fields inherited from class info.magnolia.cms.beans.config.ObservedManager
log, registeredUUIDs
 
Constructor Summary
ImageProcessorsManager()
           
 
Method Summary
 ImageResolutionProcessor getDefaultImageResolutionProcessor()
          Get the default image resolution processor (by default config is ResizeCropCenteredImageResolutionProcessor)
 ImagePostProcessor getImagePostProcessor(String name)
          Get image post processor by its name
 Collection<ImagePostProcessor> getImagePostProcessorsList()
          Get all image post processors
 Map<String,ImagePostProcessor> getImagePostProcessorsMap()
          Get the map of image post processors
 ImageResolutionProcessor getImageResolutionProcessor(char controlChar)
          Get image resolution processor for a given control char
static ImageProcessorsManager getInstance()
          Get singleton instance
 boolean isValidControlChar(char controlChar)
          Check if control char is registered
protected  void onClear()
          
protected  void onRegister(info.magnolia.cms.core.Content parentNode)
          
 
Methods inherited from class info.magnolia.cms.beans.config.ObservedManager
clear, register, reload, reload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageProcessorsManager

public ImageProcessorsManager()
Method Detail

getInstance

public static ImageProcessorsManager getInstance()
Get singleton instance

Returns:
singleton manager instance

onClear

protected void onClear()

Specified by:
onClear in class info.magnolia.cms.beans.config.ObservedManager

onRegister

protected void onRegister(info.magnolia.cms.core.Content parentNode)

Specified by:
onRegister in class info.magnolia.cms.beans.config.ObservedManager

getImageResolutionProcessor

public ImageResolutionProcessor getImageResolutionProcessor(char controlChar)
Get image resolution processor for a given control char

Parameters:
controlChar - resolution control char
Returns:
image resolution processor for a given control char

isValidControlChar

public boolean isValidControlChar(char controlChar)
Check if control char is registered

Parameters:
controlChar - control char to check
Returns:
true if control char is registered

getDefaultImageResolutionProcessor

public ImageResolutionProcessor getDefaultImageResolutionProcessor()
Get the default image resolution processor (by default config is ResizeCropCenteredImageResolutionProcessor)

Returns:
the default image resolution processor

getImagePostProcessor

public ImagePostProcessor getImagePostProcessor(String name)
Get image post processor by its name

Parameters:
name - image post processor name
Returns:
image post processor

getImagePostProcessorsList

public Collection<ImagePostProcessor> getImagePostProcessorsList()
Get all image post processors

Returns:
image post processors list

getImagePostProcessorsMap

public Map<String,ImagePostProcessor> getImagePostProcessorsMap()
Get the map of image post processors

Returns:
image post processors map


Copyright © 2008-2011 Openmind. All Rights Reserved.