Packagecom.adobe.portfolio.cards
Classpublic class CardFactory
InheritanceCardFactory Inheritance mx.core.ClassFactory

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

The CardFactory class is a singleton that can be called to construct Cards and associated ItemRenderer functions.

You specify a generator class when you construct the cardFactory object. Then you set the properties property on the cardFactory object. Flex uses the factory object to generate instances by calling the cardFactory object's newInstance() method.

The newInstance() method creates a new instance of the generator class, and sets the properties specified by properties in the new instance. If you need to further customize the generated instances, you can override the newInstance() method.

The CardFactory class implements the IFactory interface. Therefore, it lets you create objects that can be assigned to properties of type IFactory, such as the itemRenderer property.



Public Methods
 MethodDefined By
  
CardFactory(cardType:String, currentState:String = null, dropShadowPreference:String = null, rollOverPreference:String = null, alpha:Number = 1, enableThumbnailGeneration:Boolean = true, adjustAspectRatio:Boolean = false)
Returns new instances of the specified card type.
CardFactory
  
getItemRendererFunction(supportBasic:Boolean = true, supportFolder:Boolean = true, supportPlaceholders:Boolean = true, basicState:String = null, dropShadowPreference:String = null, rollOverPreference:String = null, alpha:Number = 1, enableThumbnailGeneration:Boolean = true, adjustAspectRatio:Boolean = false):Function
[static] Returns the function that will render the proper item for the attachment.
CardFactory
Public Constants
 ConstantDefined By
  BASIC_CARD : String = BasicCard
[static] String literal used to represent a BasicCard value for the cardType when constructing a CardFactory.
CardFactory
  DROP_SHADOW_BOTTOM : String = bottom
[static] A string literal used to represent the preferred location, "bottom" of a dropshadow effect.
CardFactory
  DROP_SHADOW_NONE : String = none
[static] A string literal used to represent the preferred location, "none", of a dropshadow effect.
CardFactory
  DROP_SHADOW_REAR : String = rear
[static] A string literal used to represent the preferred location, "rear" of a dropshadow effect.
CardFactory
  FOLDER_CARD : String = FolderCard
[static] String literal used to represent a FolderCard value for the cardType when constructing a CardFactory.
CardFactory
  PLACEHOLDER_CARD : String = PlaceholderCard
[static] String literal used to represent a PlaceholderCard value for the cardType when constructing a CardFactory.
CardFactory
  ROLL_OVER_GLOW : String = glow
[static] String literal used to represent "glow" as the preferred type of rollover effect.
CardFactory
  ROLL_OVER_NONE : String = none
[static] String literal used to represent "none" as the preferred type of rollover effect.
CardFactory
  ROLL_OVER_SCALE : String = scale
[static] String literal used to represent "scale" as the preferred type of rollover effect.
CardFactory
  SIMPLE_CARD : String = SimpleCard
[static] String literal used to represent a SimpleCard value for the cardType when constructing a CardFactory.
CardFactory
Constructor Detail
CardFactory()Constructor
public function CardFactory(cardType:String, currentState:String = null, dropShadowPreference:String = null, rollOverPreference:String = null, alpha:Number = 1, enableThumbnailGeneration:Boolean = true, adjustAspectRatio:Boolean = false)

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

Returns new instances of the specified card type.

Parameters
cardType:String (default = NaN) — The type of card to create; default is a basicCard
 
currentState:String (default = null) — The initial state of the card
 
dropShadowPreference:String (default = null) — The preferred drop shadown effect. This is a string specifying the preferred location for a drop shadow effect on this component. This is used as a hint to skins when specifying filters.
 
rollOverPreference:String (default = null) — The preferred rollover effect: none, glow, or scale.
 
alpha:Number (default = 1) — The alpha value (transparency) of the card; the default is 1 (completely opaque)
 
enableThumbnailGeneration:Boolean (default = true) — If true (the default) then generate thumbnail images for the card.
 
adjustAspectRatio:Boolean (default = false) — If true then adjust the aspect ratio when rendering; default is false.
Method Detail
getItemRendererFunction()method
public static function getItemRendererFunction(supportBasic:Boolean = true, supportFolder:Boolean = true, supportPlaceholders:Boolean = true, basicState:String = null, dropShadowPreference:String = null, rollOverPreference:String = null, alpha:Number = 1, enableThumbnailGeneration:Boolean = true, adjustAspectRatio:Boolean = false):Function

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

Returns the function that will render the proper item for the attachment. This will be a cardFactory, folderFactory, or placeholderFactory, based on the attachment type.

Parameters

supportBasic:Boolean (default = true) — If true then basicCards are supported; if false then simpleCards are used instead of basicCards.
 
supportFolder:Boolean (default = true) — If true then folders are supported.
 
supportPlaceholders:Boolean (default = true) — If true then placeholder cards are supported.
 
basicState:String (default = null)
 
dropShadowPreference:String (default = null) — The preferred drop shadow effect. This is a string specifying the preferred location for a drop shadow effect on this component. This is used as a hint to skins when specifying filters.
 
rollOverPreference:String (default = null) — The preferred rollover effect: none, glow, or scale.
 
alpha:Number (default = 1) — The alpha value (transparency) of the item; the default is 1 (completely opaque)
 
enableThumbnailGeneration:Boolean (default = true) — If true (the default) then generate thumbnail images for the card
 
adjustAspectRatio:Boolean (default = false) — If true then adjust the aspect ratio when rendering; default is false

Returns
Function
Constant Detail
BASIC_CARDConstant
public static const BASIC_CARD:String = BasicCard

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

String literal used to represent a BasicCard value for the cardType when constructing a CardFactory.

DROP_SHADOW_BOTTOMConstant 
public static const DROP_SHADOW_BOTTOM:String = bottom

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

A string literal used to represent the preferred location, "bottom" of a dropshadow effect.

See also

DROP_SHADOW_NONEConstant 
public static const DROP_SHADOW_NONE:String = none

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

A string literal used to represent the preferred location, "none", of a dropshadow effect.

See also

DROP_SHADOW_REARConstant 
public static const DROP_SHADOW_REAR:String = rear

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

A string literal used to represent the preferred location, "rear" of a dropshadow effect.

See also

FOLDER_CARDConstant 
public static const FOLDER_CARD:String = FolderCard

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

String literal used to represent a FolderCard value for the cardType when constructing a CardFactory.

PLACEHOLDER_CARDConstant 
public static const PLACEHOLDER_CARD:String = PlaceholderCard

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

String literal used to represent a PlaceholderCard value for the cardType when constructing a CardFactory.

ROLL_OVER_GLOWConstant 
public static const ROLL_OVER_GLOW:String = glow

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

String literal used to represent "glow" as the preferred type of rollover effect. This is used as a hint to skins when specifying filters.

See also

ROLL_OVER_NONEConstant 
public static const ROLL_OVER_NONE:String = none

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

String literal used to represent "none" as the preferred type of rollover effect. This is used as a hint to skins when specifying filters.

See also

ROLL_OVER_SCALEConstant 
public static const ROLL_OVER_SCALE:String = scale

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

String literal used to represent "scale" as the preferred type of rollover effect. This is used as a hint to skins when specifying filters.

See also

SIMPLE_CARDConstant 
public static const SIMPLE_CARD:String = SimpleCard

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

String literal used to represent a SimpleCard value for the cardType when constructing a CardFactory.