Packagecom.adobe.portfolio.layouts.supportClasses
Classpublic class CardLayoutHelper
InheritanceCardLayoutHelper Inheritance flash.events.EventDispatcher

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

The CardLayoutHelper class is a set of utility functions to help Card-based layouts.



Public Properties
 PropertyDefined By
  enableIdle : Boolean
True if thumbnail idle is enabled
CardLayoutHelper
  pendingFade : Boolean
True if a fade (of cards) is pending
CardLayoutHelper
Protected Properties
 PropertyDefined By
  attachmentProperties : Dictionary
CardLayoutHelper
  autoListen : AutoListen
CardLayoutHelper
  cardLayout : ICardLayout
CardLayoutHelper
  cardProvider : ICardProvider
CardLayoutHelper
  enableDynamicThumbnailsTimer : Timer
CardLayoutHelper
  idleDelay : int = 2000
CardLayoutHelper
  idleItems : Array
CardLayoutHelper
  idleTimer : Timer
CardLayoutHelper
  sequentialFade : SequentialFade
CardLayoutHelper
  target : GroupBase
[read-only]
CardLayoutHelper
  thumbFitSize : Point
CardLayoutHelper
  thumbnailMgr : ThumbnailManager
CardLayoutHelper
Public Methods
 MethodDefined By
  
Constructor.
CardLayoutHelper
  
Returns true if the dataProvider is "current".
CardLayoutHelper
  
elementIntersectsRect(element:IVisualElement, rect:Rectangle):Boolean
Returns true if an element intersects the specified rectangle
CardLayoutHelper
  
Iterates the cards in a layout and enables thumbnail generation.
CardLayoutHelper
  
fadeInCards(delay:Number, duration:Number = 50):void
Fades in cards in a layout
CardLayoutHelper
  
findCardsThatIntersect(rect:Rectangle):Vector.<int>
Returns a vector of indices of cards that intersect a given rectangle
CardLayoutHelper
  
getAlpha(card:ISimpleCard):Number
Returns the alpha value of a card
CardLayoutHelper
  
getCard(index:int):ISimpleCard
Returns the card in the target at the specified index
CardLayoutHelper
  
getCurrentIndex(attachment:IAttachment, dataProvider:IList = null):int
Returns the index in the specified dataProvider of the given attachement
CardLayoutHelper
  
Returns the layout target's dataProvider
CardLayoutHelper
  
getLayoutElement(index:int):IVisualElement
Returns the element in the target at the specified index
CardLayoutHelper
  
getLayoutRect(element:IVisualElement):Rectangle
Returns the bounding box of a layout element
CardLayoutHelper
  
idleCardsAroundFocus(dataProvider:IList, focusAttachment:IAttachment, delta:int):void
Lazily rebuilds thumbnails in a region around a specified focus after a resize of the layout
CardLayoutHelper
  
Invalidate the displaylist of the target of the associated layout
CardLayoutHelper
  
True if a fade (of cards) is pending or the fade is active
CardLayoutHelper
  
resizeCachedThumbs(dataProvider:IList, width:Number, height:Number, delta:int):void
Responds to a layout resize by resetting the ThumbnailManager thumb size and idling thumbs around the focus card
CardLayoutHelper
  
scrollRect(group:GroupBase):Rectangle
Returns a scroll rect for the group.
CardLayoutHelper
  
toString():String
[override]
CardLayoutHelper
Protected Methods
 MethodDefined By
  
CardLayoutHelper
  
handleItemIdle(attachment:IAttachment):void
CardLayoutHelper
  
onElementDone(target:Object):void
CardLayoutHelper
  
onIdleTime(e:TimerEvent):void
CardLayoutHelper
  
preloadThumb(attachment:IAttachment, fitSize:Point):void
CardLayoutHelper
  
CardLayoutHelper
  
CardLayoutHelper
Protected Constants
 ConstantDefined By
  collectionMgr : CollectionManager
[static]
CardLayoutHelper
  logger : ILogger
[static]
CardLayoutHelper
Property Detail
attachmentPropertiesproperty
protected var attachmentProperties:Dictionary

autoListenproperty 
protected var autoListen:AutoListen

cardLayoutproperty 
protected var cardLayout:ICardLayout

cardProviderproperty 
protected var cardProvider:ICardProvider

enableDynamicThumbnailsTimerproperty 
protected var enableDynamicThumbnailsTimer:Timer

enableIdleproperty 
enableIdle:Boolean

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

True if thumbnail idle is enabled


Implementation
    public function get enableIdle():Boolean
    public function set enableIdle(value:Boolean):void
idleDelayproperty 
protected var idleDelay:int = 2000

idleItemsproperty 
protected var idleItems:Array

idleTimerproperty 
protected var idleTimer:Timer

pendingFadeproperty 
pendingFade:Boolean

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

True if a fade (of cards) is pending


Implementation
    public function get pendingFade():Boolean
    public function set pendingFade(value:Boolean):void
sequentialFadeproperty 
protected var sequentialFade:SequentialFade

targetproperty 
target:GroupBase  [read-only]


Implementation
    protected function get target():GroupBase
thumbFitSizeproperty 
thumbFitSize:Point


Implementation
    protected function get thumbFitSize():Point
    protected function set thumbFitSize(value:Point):void
thumbnailMgrproperty 
protected var thumbnailMgr:ThumbnailManager

Constructor Detail
CardLayoutHelper()Constructor
public function CardLayoutHelper(cardLayout:ICardLayout)

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

Constructor.

Parameters
cardLayout:ICardLayout — ICardLayout to help
Method Detail
dataProviderIsCurrent()method
public function dataProviderIsCurrent():Boolean

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

Returns true if the dataProvider is "current".

Returns
Boolean — True if the dataProvider is "current".

See also

elementIntersectsRect()method 
public function elementIntersectsRect(element:IVisualElement, rect:Rectangle):Boolean

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

Returns true if an element intersects the specified rectangle

Parameters

element:IVisualElement — The element
 
rect:Rectangle — The rectangle

Returns
Boolean — True if the element intersects the specified rectangle
enableDynamicThumbnails()method 
protected function enableDynamicThumbnails():void

enableThumbnailGeneration()method 
public function enableThumbnailGeneration():void

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

Iterates the cards in a layout and enables thumbnail generation.

fadeInCards()method 
public function fadeInCards(delay:Number, duration:Number = 50):void

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

Fades in cards in a layout

Parameters

delay:Number — The delay in msec before starting the fade
 
duration:Number (default = 50) — The duration of the fade for each card in msec

findCardsThatIntersect()method 
public function findCardsThatIntersect(rect:Rectangle):Vector.<int>

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

Returns a vector of indices of cards that intersect a given rectangle

Parameters

rect:Rectangle — The rectangle

Returns
Vector.<int> — A vector of indices
getAlpha()method 
public function getAlpha(card:ISimpleCard):Number

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

Returns the alpha value of a card

Parameters

card:ISimpleCard — The card

Returns
Number — The alpha value
getCard()method 
public function getCard(index:int):ISimpleCard

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

Returns the card in the target at the specified index

Parameters

index:int — The index

Returns
ISimpleCard — The card (of the layout)
getCurrentIndex()method 
public function getCurrentIndex(attachment:IAttachment, dataProvider:IList = null):int

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

Returns the index in the specified dataProvider of the given attachement

Parameters

attachment:IAttachment — attachment
 
dataProvider:IList (default = null) — dataProvider (if null it uses the dataProvider associated with the layout)

Returns
int — The index of the attachment in the dataProvider. Returns -1 if not found.
getDataProvider()method 
public function getDataProvider():IList

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

Returns the layout target's dataProvider

Returns
IList — The dataProvider of the layout target
getLayoutElement()method 
public function getLayoutElement(index:int):IVisualElement

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

Returns the element in the target at the specified index

Parameters

index:int — The index

Returns
IVisualElement — The element (of the layout)
getLayoutRect()method 
public function getLayoutRect(element:IVisualElement):Rectangle

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

Returns the bounding box of a layout element

Parameters

element:IVisualElement — The element

Returns
Rectangle — The bounding box of the element
handleItemIdle()method 
protected function handleItemIdle(attachment:IAttachment):void

Parameters

attachment:IAttachment

idleCardsAroundFocus()method 
public function idleCardsAroundFocus(dataProvider:IList, focusAttachment:IAttachment, delta:int):void

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

Lazily rebuilds thumbnails in a region around a specified focus after a resize of the layout

Parameters

dataProvider:IList — The dataProvider of the layout (a list of attachments)
 
focusAttachment:IAttachment — Specifies how many cards from the focusAttachment to idle (i.e. 1 idles focusAttachment-1, focusAttachment, focusAttachment+1, etc.)
 
delta:int

invalidateTarget()method 
public function invalidateTarget():void

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

Invalidate the displaylist of the target of the associated layout

isPendingOrFading()method 
public function isPendingOrFading():Boolean

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

True if a fade (of cards) is pending or the fade is active

Returns
Boolean
onElementDone()method 
protected function onElementDone(target:Object):void

Parameters

target:Object

onIdleTime()method 
protected function onIdleTime(e:TimerEvent):void

Parameters

e:TimerEvent

preloadThumb()method 
protected function preloadThumb(attachment:IAttachment, fitSize:Point):void

Parameters

attachment:IAttachment
 
fitSize:Point

resetIdleItems()method 
protected function resetIdleItems():void

resizeCachedThumbs()method 
public function resizeCachedThumbs(dataProvider:IList, width:Number, height:Number, delta:int):void

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

Responds to a layout resize by resetting the ThumbnailManager thumb size and idling thumbs around the focus card

Parameters

dataProvider:IList — The dataProvider of the layout (a list of attachments)
 
width:Number — The thumb fit width
 
height:Number — The thumb fit height
 
delta:int — Specifies how many cards from the focus card to idle (i.e. 1 idles focusCard-1, focusCard, focusCard+1, etc.)

saveAlpha()method 
protected function saveAlpha(card:ISimpleCard):void

Parameters

card:ISimpleCard

scrollRect()method 
public function scrollRect(group:GroupBase):Rectangle

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

Returns a scroll rect for the group.

Parameters

group:GroupBase — The group

Returns
Rectangle — A Rectangle corresponding to the scrollRect
toString()method 
override public function toString():String

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

Returns
String
Constant Detail
collectionMgrConstant
protected static const collectionMgr:CollectionManager

loggerConstant 
protected static const logger:ILogger