Packagecom.adobe.portfolio.managers
Classpublic class ThumbnailManager
InheritanceThumbnailManager Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The ThumbnailManager caches and manages thumbnail images of attachments.



Public Properties
 PropertyDefined By
  cacheThumbFitSize : Point
The preferred fit size for preview thumbs
ThumbnailManager
  enableDynamicThumbnails : Boolean
True to enable processing of dynamic thumbs (they're still queue'ed regardless of this value).
ThumbnailManager
  initialQueueIsFIFO : Boolean
Type of initial queue (FIFO/FILO)
ThumbnailManager
  instance : ThumbnailManager
[static] [read-only] Returns the thumbnailManager instance; it creates one if is does not exist already.
ThumbnailManager
  minThumbQueuePriority : int
The minimum priority required to execute a queued thumb request.
ThumbnailManager
  pauseQueue : Boolean
Pauses or starts the thumbnail queue.
ThumbnailManager
Protected Properties
 PropertyDefined By
  audioImage : Class
ThumbnailManager
  DYNAMIC_CACHE_MAX_MEM_CACHE_SIZE : int = 50
ThumbnailManager
  dynamicThumbCache : OrderedDictionary
ThumbnailManager
  folderImage : Class
ThumbnailManager
  initialJobQueue : JobQueue
The thumbnail job queue active before dynamic thumbs are enabled.
ThumbnailManager
  jobQueue : JobQueue
The thumbnail job queue active after dynamic thumbs are enabled.
ThumbnailManager
  pendingRequests : Dictionary
ThumbnailManager
  pendingStaticRequests : Dictionary
ThumbnailManager
  smallPreviewDict : Dictionary
[static]
ThumbnailManager
  STATIC_CACHE_MAX_MEM_CACHE_SIZE : int = 200
ThumbnailManager
  staticThumbCache : OrderedDictionary
ThumbnailManager
  swfImage : Class
ThumbnailManager
  timeoutTimer : Timer
ThumbnailManager
  videoImage : Class
ThumbnailManager
Public Methods
 MethodDefined By
  
ThumbnailManager(token:Object)
Constructor
ThumbnailManager
  
getAspectRatio(attachment:IAttachment, mediaValue:Boolean = false, allowNaN:Boolean = false):Number
Returns the aspect ratio for the specified attachment.
ThumbnailManager
  
isSmallPreview(mimeType:String):Boolean
True if Acrobat generates small previews for the specified mimetype.
ThumbnailManager
  
isThumbnailCached(attachment:IAttachment, width:Number, height:Number, pageNumber:uint):Boolean
Returns true if the specified attachment has a dynamic thumb cached for the give width, height and pageNumber
ThumbnailManager
  
requestThumbnail(id:*, attachment:IAttachment, width:Number, height:Number, pageNumber:uint, callback:Function, downSampleOK:Boolean = true, upSampleOK:Boolean = true, queuePriority:int = 0):void
Requests a thumbnail to be generated that will fit into the specified width and height.
ThumbnailManager
  
setAspectRatio(attachment:IAttachment, aspectRatio:Number, mediaValue:Boolean = false, forceUpdate:Boolean = false):void
Sets the aspect ratio for the specified attachment.
ThumbnailManager
Protected Methods
 MethodDefined By
  
addToPending(thumbKey:Object, callback:Function, requests:Dictionary):void
ThumbnailManager
  
cacheThumb(thumbCache:OrderedDictionary, callback:Function, cacheObject:CacheObject, thumbnail:Bitmap, clearPendingRequests:Boolean = true):void
ThumbnailManager
  
callPendingCallbacks(thumbKey:Object, cacheObject:CacheObject, requests:Dictionary, clearPendingRequests:Boolean = true):void
ThumbnailManager
  
getDownsampledThumb(c:CacheObject, downSampleOK:Boolean):Bitmap
ThumbnailManager
  
Returns the predefined thumbnail images for the specified attachment, such as folders, SWF files, video, and audio files.
ThumbnailManager
  
getStaticCachedThumb(callback:Function, cacheObject:CacheObject, anySizeOK:Boolean = false, clearPendingRequests:Boolean = true):Boolean
ThumbnailManager
  
getThumbFromDynamicCache(thumbKey:String):Bitmap
ThumbnailManager
  
ThumbnailManager
  
innerSetAspectRatio(attachment:IAttachment, aspectRatio:Number, currentAspectRatio:Number, mediaValue:Boolean):void
ThumbnailManager
  
isPending(thumbKey:Object, requests:Dictionary):Boolean
ThumbnailManager
  
ThumbnailManager
  
onTimeout(e:Event):void
ThumbnailManager
  
startJobs():void
ThumbnailManager
  
ThumbnailManager
  
validateThumbSize(value:Number, downSampleOK:Boolean = true):Number
ThumbnailManager
  
wrapBitmapData(bitmapData:BitmapData):Bitmap
ThumbnailManager
Events
 Event Summary Defined By
  Dispatched when the aspectRatio of an attachment changes.ThumbnailManager
Public Constants
 ConstantDefined By
  ANY_THUMB_PRIORITY : int = -2.147483648E9
[static] The priority that allows any thumbnail job to be executed.
ThumbnailManager
  DYNAMIC_THUMB_PRIORITY : int = 0
[static] The nominal priority of dynamic thumb generation
ThumbnailManager
  IDLE_THUMB_PRIORITY : int = -1
[static] The nominal priority of idle thumb generation
ThumbnailManager
  PREVIEW_THUMB_PRIORITY : int = 10
[static] The nominal priority of preview thumb requests
ThumbnailManager
  SMALL_PREVIEW_THUMBSIZE : int = 512
[static] The size of "small" previews supplied by Acrobat.
ThumbnailManager
  SMALL_THUMB_FIT_HEIGHT : int = 128
[static] The fit height of static cached thumbnails
ThumbnailManager
  SMALL_THUMB_FIT_WIDTH : int = 128
[static] The fit width of static cached thumbnails
ThumbnailManager
  STATIC_THUMB_PRIORITY : int = 1
[static] The nominal priority of static thumb requests
ThumbnailManager
Property Detail
audioImageproperty
protected var audioImage:Class

cacheThumbFitSizeproperty 
cacheThumbFitSize:Point

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The preferred fit size for preview thumbs


Implementation
    public function get cacheThumbFitSize():Point
    public function set cacheThumbFitSize(value:Point):void
DYNAMIC_CACHE_MAX_MEM_CACHE_SIZEproperty 
protected var DYNAMIC_CACHE_MAX_MEM_CACHE_SIZE:int = 50

dynamicThumbCacheproperty 
protected var dynamicThumbCache:OrderedDictionary

enableDynamicThumbnailsproperty 
enableDynamicThumbnails:Boolean

True to enable processing of dynamic thumbs (they're still queue'ed regardless of this value).

This property can be used as the source for data binding.


Implementation
    public function get enableDynamicThumbnails():Boolean
    public function set enableDynamicThumbnails(value:Boolean):void
folderImageproperty 
protected var folderImage:Class

initialJobQueueproperty 
protected var initialJobQueue:JobQueue

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The thumbnail job queue active before dynamic thumbs are enabled.

initialQueueIsFIFOproperty 
initialQueueIsFIFO:Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Type of initial queue (FIFO/FILO)


Implementation
    public function get initialQueueIsFIFO():Boolean
    public function set initialQueueIsFIFO(value:Boolean):void
instanceproperty 
instance:ThumbnailManager  [read-only]

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns the thumbnailManager instance; it creates one if is does not exist already.


Implementation
    public static function get instance():ThumbnailManager
jobQueueproperty 
protected var jobQueue:JobQueue

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The thumbnail job queue active after dynamic thumbs are enabled.

minThumbQueuePriorityproperty 
minThumbQueuePriority:int

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The minimum priority required to execute a queued thumb request. Requests below this priority will remain in the queue.


Implementation
    public function get minThumbQueuePriority():int
    public function set minThumbQueuePriority(value:int):void
pauseQueueproperty 
pauseQueue:Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Pauses or starts the thumbnail queue.


Implementation
    public function get pauseQueue():Boolean
    public function set pauseQueue(value:Boolean):void
pendingRequestsproperty 
protected var pendingRequests:Dictionary

pendingStaticRequestsproperty 
protected var pendingStaticRequests:Dictionary

smallPreviewDictproperty 
protected static var smallPreviewDict:Dictionary

STATIC_CACHE_MAX_MEM_CACHE_SIZEproperty 
protected var STATIC_CACHE_MAX_MEM_CACHE_SIZE:int = 200

staticThumbCacheproperty 
protected var staticThumbCache:OrderedDictionary

swfImageproperty 
protected var swfImage:Class

timeoutTimerproperty 
protected var timeoutTimer:Timer

videoImageproperty 
protected var videoImage:Class

Constructor Detail
ThumbnailManager()Constructor
public function ThumbnailManager(token:Object)

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Constructor

Parameters
token:Object
Method Detail
addToPending()method
protected function addToPending(thumbKey:Object, callback:Function, requests:Dictionary):void

Parameters

thumbKey:Object
 
callback:Function
 
requests:Dictionary

cacheThumb()method 
protected function cacheThumb(thumbCache:OrderedDictionary, callback:Function, cacheObject:CacheObject, thumbnail:Bitmap, clearPendingRequests:Boolean = true):void

Parameters

thumbCache:OrderedDictionary
 
callback:Function
 
cacheObject:CacheObject
 
thumbnail:Bitmap
 
clearPendingRequests:Boolean (default = true)

callPendingCallbacks()method 
protected function callPendingCallbacks(thumbKey:Object, cacheObject:CacheObject, requests:Dictionary, clearPendingRequests:Boolean = true):void

Parameters

thumbKey:Object
 
cacheObject:CacheObject
 
requests:Dictionary
 
clearPendingRequests:Boolean (default = true)

getAspectRatio()method 
public function getAspectRatio(attachment:IAttachment, mediaValue:Boolean = false, allowNaN:Boolean = false):Number

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns the aspect ratio for the specified attachment. If object is null then it returns NaN if allowNaN is true, or 1 if allowNaN is false

Parameters

attachment:IAttachment — the attachment for which you are requesting the aspect ratio
 
mediaValue:Boolean (default = false) — true if the attachment is media content (audio/video)
 
allowNaN:Boolean (default = false) — if true then the defaultApectRatio is allowed to be NaN

Returns
Number
getDownsampledThumb()method 
protected function getDownsampledThumb(c:CacheObject, downSampleOK:Boolean):Bitmap

Parameters

c:CacheObject
 
downSampleOK:Boolean

Returns
Bitmap
getPredefinedThumbnail()method 
protected function getPredefinedThumbnail(attachment:IAttachment):Bitmap

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns the predefined thumbnail images for the specified attachment, such as folders, SWF files, video, and audio files. If the there is no predefined image for the attachment type, it returns null.

Parameters

attachment:IAttachment

Returns
Bitmap
getStaticCachedThumb()method 
protected function getStaticCachedThumb(callback:Function, cacheObject:CacheObject, anySizeOK:Boolean = false, clearPendingRequests:Boolean = true):Boolean

Parameters

callback:Function
 
cacheObject:CacheObject
 
anySizeOK:Boolean (default = false)
 
clearPendingRequests:Boolean (default = true)

Returns
Boolean
getThumbFromDynamicCache()method 
protected function getThumbFromDynamicCache(thumbKey:String):Bitmap

Parameters

thumbKey:String

Returns
Bitmap
getThumbFromStaticCache()method 
protected function getThumbFromStaticCache(attachment:IAttachment):Bitmap

Parameters

attachment:IAttachment

Returns
Bitmap
innerSetAspectRatio()method 
protected function innerSetAspectRatio(attachment:IAttachment, aspectRatio:Number, currentAspectRatio:Number, mediaValue:Boolean):void

Parameters

attachment:IAttachment
 
aspectRatio:Number
 
currentAspectRatio:Number
 
mediaValue:Boolean

isPending()method 
protected function isPending(thumbKey:Object, requests:Dictionary):Boolean

Parameters

thumbKey:Object
 
requests:Dictionary

Returns
Boolean
isSmallPreview()method 
public function isSmallPreview(mimeType:String):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

True if Acrobat generates small previews for the specified mimetype.

Parameters

mimeType:String

Returns
Boolean
isThumbnailCached()method 
public function isThumbnailCached(attachment:IAttachment, width:Number, height:Number, pageNumber:uint):Boolean

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Returns true if the specified attachment has a dynamic thumb cached for the give width, height and pageNumber

Parameters

attachment:IAttachment
 
width:Number
 
height:Number
 
pageNumber:uint

Returns
Boolean
onRootItemQueueChange()method 
protected function onRootItemQueueChange(e:CollectionManagerEvent):void

Parameters

e:CollectionManagerEvent

onTimeout()method 
protected function onTimeout(e:Event):void

Parameters

e:Event

requestThumbnail()method 
public function requestThumbnail(id:*, attachment:IAttachment, width:Number, height:Number, pageNumber:uint, callback:Function, downSampleOK:Boolean = true, upSampleOK:Boolean = true, queuePriority:int = 0):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Requests a thumbnail to be generated that will fit into the specified width and height.

Parameters

id:* — An id that the client can use for tracking purposes. If a request with the same id is already queued, then the new request will supercede the old request.
 
attachment:IAttachment — Specifies the attachment (an IAttachment) for which the thumbnail is generated.
 
width:Number — The desired width of the thumbnail, in pixels. It must be gt; 0 and <= 2048.
 
height:Number — The desired height of the thumbnail, in pixels. It must be > 0 and <= 2048.
 
pageNumber:uint — The desired page number of the attachment. It must be >= 1.
 
callback:Function — A callback function that will be called when the thumbnail has been generated.

It has the following signature and parameters:

callback(id: width:Number, height:Number, thumbnail:Bitmap)

callback parameters:

Parameter:TypeValue
id:Stringthe value of the id param passed to requestThumbnail
width:Numberthe value of the width parameter passed to requestThumbnail
height:Numberthe value of the height param to requestThumbnail
pageNumber:uintthe value of the pageNumber param to requestThumbnail
thumbnail:Bitmapthe generated thumbnail
 
downSampleOK:Boolean (default = true)
 
upSampleOK:Boolean (default = true)
 
queuePriority:int (default = 0)

setAspectRatio()method 
public function setAspectRatio(attachment:IAttachment, aspectRatio:Number, mediaValue:Boolean = false, forceUpdate:Boolean = false):void

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

Sets the aspect ratio for the specified attachment.

Parameters

attachment:IAttachment — The attachment
 
aspectRatio:Number — The aspect ratio
 
mediaValue:Boolean (default = false) — True if the attachment is media content (audio/video)
 
forceUpdate:Boolean (default = false) — True to force an update of the aspectRatio

startJobs()method 
protected function startJobs():void

startTimeOutTimer()method 
protected function startTimeOutTimer():void

validateThumbSize()method 
protected function validateThumbSize(value:Number, downSampleOK:Boolean = true):Number

Parameters

value:Number
 
downSampleOK:Boolean (default = true)

Returns
Number
wrapBitmapData()method 
protected function wrapBitmapData(bitmapData:BitmapData):Bitmap

Parameters

bitmapData:BitmapData

Returns
Bitmap
Event Detail
aspectRatioChanged Event
Event Object Type: com.adobe.portfolio.events.ThumbnailManagerEvent
ThumbnailManagerEvent.type property = com.adobe.portfolio.events.ThumbnailManagerEvent

Dispatched when the aspectRatio of an attachment changes.

Constant Detail
ANY_THUMB_PRIORITYConstant
public static const ANY_THUMB_PRIORITY:int = -2.147483648E9

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The priority that allows any thumbnail job to be executed.

DYNAMIC_THUMB_PRIORITYConstant 
public static const DYNAMIC_THUMB_PRIORITY:int = 0

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The nominal priority of dynamic thumb generation

IDLE_THUMB_PRIORITYConstant 
public static const IDLE_THUMB_PRIORITY:int = -1

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The nominal priority of idle thumb generation

PREVIEW_THUMB_PRIORITYConstant 
public static const PREVIEW_THUMB_PRIORITY:int = 10

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The nominal priority of preview thumb requests

SMALL_PREVIEW_THUMBSIZEConstant 
public static const SMALL_PREVIEW_THUMBSIZE:int = 512

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The size of "small" previews supplied by Acrobat.

SMALL_THUMB_FIT_HEIGHTConstant 
public static const SMALL_THUMB_FIT_HEIGHT:int = 128

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The fit height of static cached thumbnails

SMALL_THUMB_FIT_WIDTHConstant 
public static const SMALL_THUMB_FIT_WIDTH:int = 128

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The fit width of static cached thumbnails

STATIC_THUMB_PRIORITYConstant 
public static const STATIC_THUMB_PRIORITY:int = 1

Language Version : ActionScript 3.0
Product Version : Portfolio 10.0
Runtime Versions : Flash Player 10.1, AIR 2.0

The nominal priority of static thumb requests