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.
cardType:String (default = NaN) — The type of card to create; default is a BasicCard
defaultState: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.
maintainAspectRatio:Boolean (default = false) — If true then adjust the aspect ratio when rendering; default is false.
Method Detail
getClassForType
()
method
protected function getClassForType(cardType:String):Class
Returns the Class corresponding to a particular card type.
Subclasses can override this function to provide support for
alternative or additional card classes.
Returns a function that will provide an appropriate CardFactory based on a particular IAttachment.
This returned function can be used as a dataGroup's itemRendererFunction.
Parameters
defaultType:String (default = BasicCard) — The type of card to be used for standard attachment types.
defaultState:String (default = null) — The initial state to be used for standard attachment types.
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
maintainAspectRatio:Boolean (default = false) — If true then adjust the aspect ratio when rendering; default is false
supportFolder:Boolean (default = true) — If true then folders are supported.
Returns
Function
getStateForType
()
method
protected function getStateForType(cardType:String, cardState:String):String
Returns the state string corresponding to a particular card type and state.
Parameters
cardType:String
cardState:String
Returns
String — The state name string representing the given card state for
the class indicated by the card type. The returned value may
not match the given card state, or may be null if the state is
unsupported by the given card type.