|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object magoffin.matt.ma2.support.AbstractMediaHandler magoffin.matt.ma2.image.BaseImageMediaHandler magoffin.matt.ma2.image.awt.BaseAwtImageMediaHandler magoffin.matt.ma2.image.iio.BaseImageIOMediaHandler
public abstract class BaseImageIOMediaHandler
Base implemenation of MediaHandler
using the Java ImageIO library for image operations.
Field Summary |
---|
Fields inherited from class magoffin.matt.ma2.image.BaseImageMediaHandler |
---|
DEFAULT_ORIENTATION_180_VALUE, DEFAULT_ORIENTATION_90_CLOCKWISE_VALUE, DEFAULT_ORIENTATION_90_COUNTER_CLOCKWISE_VALUE, DEFAULT_ORIENTATION_METADATA_KEY, ROTATE_180, ROTATE_90_CCW, ROTATE_90_CW |
Fields inherited from class magoffin.matt.ma2.support.AbstractMediaHandler |
---|
log, METADATA_PARAMETER_KEY |
Constructor Summary | |
---|---|
BaseImageIOMediaHandler(java.lang.String mime)
Construct with MIME type. |
Method Summary | |
---|---|
protected java.awt.image.BufferedImage |
defaultHandleDelegateRequest(org.springframework.core.io.Resource mediaResource,
java.lang.String mimeType,
MediaItem item,
MediaRequest request,
MediaResponse response)
Handle a delegate media request. |
protected java.awt.image.BufferedImage |
defaultHandleRequest(MediaItem item,
MediaRequest request,
org.springframework.core.io.Resource itemResource,
MediaResponse response)
Handle a media request. |
protected java.awt.image.BufferedImage |
getBufferedImage(java.lang.String mimeType,
MediaItem item,
MediaRequest request,
org.springframework.core.io.Resource itemResource)
Get a BufferedImage for a MediaItem. |
ImageMediaHelper |
getImageMediaHelper()
|
void |
setImageMediaHelper(ImageMediaHelper imageMediaHelper)
|
protected void |
setupBaseItemProperties(MediaItem item,
javax.imageio.ImageReader reader)
Setup some basic properties from an ImageReader. |
Methods inherited from class magoffin.matt.ma2.image.awt.BaseAwtImageMediaHandler |
---|
getAwtMediaEffectMap, getEffect, setAwtMediaEffectMap |
Methods inherited from class magoffin.matt.ma2.image.BaseImageMediaHandler |
---|
getOrientation180Value, getOrientation90ClockwiseValue, getOrientation90CounterClockwiseValue, getOrientationMetadataKey, handleMetadata, needToRotate, setOrientation180Value, setOrientation90ClockwiseValue, setOrientation90CounterClockwiseValue, setOrientationMetadataKey |
Methods inherited from class magoffin.matt.ma2.support.AbstractMediaHandler |
---|
applyEffects, createMetadataList, defaultHandleRequestOriginal, getDomainObjectFactory, getFileExtension, getMediaBiz, getMediaMetadataInstance, getMime, getNoWatermarkSizes, getPreferredFileExtension, getRequestEffects, getSmetaPropertyMap, getUserBiz, needToAlter, setDomainObjectFactory, setMediaBiz, setMime, setNoWatermarkSizes, setPreferredFileExtension, setSmetaPropertyMap, setUserBiz |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface magoffin.matt.ma2.MediaHandler |
---|
createNewMediaItem, handleMediaRequest |
Constructor Detail |
---|
public BaseImageIOMediaHandler(java.lang.String mime)
mime
- the MIME typeMethod Detail |
---|
protected java.awt.image.BufferedImage defaultHandleDelegateRequest(org.springframework.core.io.Resource mediaResource, java.lang.String mimeType, MediaItem item, MediaRequest request, MediaResponse response)
This method will operate in the following way:
AbstractMediaHandler.needToAlter(MediaItem, MediaRequest)
method. If
this returnes false then call
AbstractMediaHandler.defaultHandleRequestOriginal(magoffin.matt.ma2.domain.MediaItem, org.springframework.core.io.Resource, magoffin.matt.ma2.MediaResponse)
and return.BufferedImage
by calling getBufferedImage(java.lang.String, magoffin.matt.ma2.domain.MediaItem, magoffin.matt.ma2.MediaRequest, org.springframework.core.io.Resource)
.BufferedImage
instance onto the request parameters
using the AwtMediaEffect.INPUT_BUFFERED_IMAGE_KEY
key.AbstractMediaHandler.needToRotate(magoffin.matt.ma2.domain.MediaItem, magoffin.matt.ma2.MediaRequest)
method.AbstractMediaHandler.applyEffects(magoffin.matt.ma2.domain.MediaItem, magoffin.matt.ma2.MediaRequest, magoffin.matt.ma2.MediaResponse)
method.BufferedImage
object on the request parameter
AwtMediaEffect.INPUT_BUFFERED_IMAGE_KEY
key.These steps allow for standard request processing, and effects are
assumed to alter the BufferedImage
instance as sneeded.
mediaResource
- the resource data to processmimeType
- the mediaResource
's MIME typeitem
- the media item being processedrequest
- the requestresponse
- the response
protected java.awt.image.BufferedImage defaultHandleRequest(MediaItem item, MediaRequest request, org.springframework.core.io.Resource itemResource, MediaResponse response)
This method will simply call the
defaultHandleDelegateRequest(org.springframework.core.io.Resource, java.lang.String, magoffin.matt.ma2.domain.MediaItem, magoffin.matt.ma2.MediaRequest, magoffin.matt.ma2.MediaResponse)
, passing in the
MediaItem.getMime()
type of the item
parameter.
item
- the media itemrequest
- the requestitemResource
- the media item's Resourceresponse
- the response
protected java.awt.image.BufferedImage getBufferedImage(java.lang.String mimeType, MediaItem item, MediaRequest request, org.springframework.core.io.Resource itemResource)
mimeType
- of the resouce being handled (may be different from item's MIME
if handling a delegate request)item
- the media itemrequest
- the requestitemResource
- the item Resource
protected void setupBaseItemProperties(MediaItem item, javax.imageio.ImageReader reader) throws java.io.IOException
This will set up the item's width, height, and MIME type.
item
- the MediaItem to setupreader
- the ImageReader to read from
java.io.IOException
- if an error occurspublic ImageMediaHelper getImageMediaHelper()
public void setImageMediaHelper(ImageMediaHelper imageMediaHelper)
imageMediaHelper
- the imageMediaHelper to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |