Packagecom.adobe.portfolio.layouts.supportClasses
Classpublic class CardDistributor
InheritanceCardDistributor Inheritance Object

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

The CardDistributor class implements an algorithm for placing Cards pseudo-randomly in the layout.



Public Properties
 PropertyDefined By
  cardAngle : Number
The maximum angle at which new cards are rotated (if applicable)
CardDistributor
Protected Properties
 PropertyDefined By
  autoListen : AutoListen
CardDistributor
  autoPositionCardSize : Number
CardDistributor
  autoPositionCardSizeDiameter : Number
CardDistributor
  cardProperties : ICardProperties
CardDistributor
  cardsChangedMap : Dictionary
CardDistributor
  gridPoints : Array
CardDistributor
Public Methods
 MethodDefined By
  
Constructor
CardDistributor
  
ensureAllPositionsAreValid(collection:IList):void
Verifies that all card positions are valid.
CardDistributor
Protected Methods
 MethodDefined By
  
getCardPositions(collection:IList, setPositions:Array, unsetPositions:Array):void
This method goes through all the cards in the unsetPositions array it is passed, gets their position, then adds them to the setPositions array and removes them from the unsetPositions array.
CardDistributor
  
getCardSize(sizeName:String):Number
[static] Returns the size, in pixels of the specified card size name.
CardDistributor
  
CardDistributor
  
onCollectionChange(event:CollectionEvent):void
CardDistributor
Property Detail
autoListenproperty
protected var autoListen:AutoListen

autoPositionCardSizeproperty 
protected var autoPositionCardSize:Number

autoPositionCardSizeDiameterproperty 
protected var autoPositionCardSizeDiameter:Number

cardAngleproperty 
cardAngle:Number

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

The maximum angle at which new cards are rotated (if applicable)


Implementation
    public function get cardAngle():Number
    public function set cardAngle(value:Number):void
cardPropertiesproperty 
protected var cardProperties:ICardProperties

cardsChangedMapproperty 
protected var cardsChangedMap:Dictionary

gridPointsproperty 
protected var gridPoints:Array

Constructor Detail
CardDistributor()Constructor
public function CardDistributor(cardProperties:ICardProperties)

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

Constructor

Parameters
cardProperties:ICardProperties — An interface that allows for setting/getting card location and angle properties.
Method Detail
ensureAllPositionsAreValid()method
public function ensureAllPositionsAreValid(collection:IList):void

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

Verifies that all card positions are valid. This method should be called whenever there is a change in the collection or the target size.

Parameters

collection:IList — A collection (list) of attachments.

getCardPositions()method 
protected function getCardPositions(collection:IList, setPositions:Array, unsetPositions:Array):void

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

This method goes through all the cards in the unsetPositions array it is passed, gets their position, then adds them to the setPositions array and removes them from the unsetPositions array.

Parameters

collection:IList — A collection of attachments
 
setPositions:Array — an Array that is filled with the attachments that have their position set
 
unsetPositions:Array — an Array that is filled with the attachments that have NOT had their position set

getCardSize()method 
protected static function getCardSize(sizeName:String):Number

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

Returns the size, in pixels of the specified card size name.

Parameters

sizeName:String — The name of the card size: one of: PROPERTY_CARD_SIZE_SMALL, PROPERTY_CARD_SIZE_MEDIUM, or PROPERTY_CARD_SIZE_LARGE

Returns
Number

See also

initAutoPositionCardSize()method 
protected function initAutoPositionCardSize():Boolean

Returns
Boolean
onCollectionChange()method 
protected function onCollectionChange(event:CollectionEvent):void

Parameters

event:CollectionEvent