The SimpleCard class extends NavSkinnableComponent to show a simple card that displays a thumbnail corresponding to an IAttachment.
SimpleCard is a skinnable renderer for an IAttachment. It implements IListItemRenderer,
so it can be used as an item renderer for relevant containers. The skin is not required
to provide all the relevant controls, which allows this object to act as the core for
both simple (mini-nav) and complex (basic click-through card) rendering.
[read-only]
Get a preview model that supports multipage preview of attachments, or
null if multipage preview is not supported by the current preview model.
Type: Class
Name of the skin class to use for this component when its data is
set to a folder attachment.
SimpleCard
Skin Parts
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
Skin Part
Description
Defined By
icon:spark.primitives.BitmapImage
Required: false Part Type: Static
The icon image for the card
SimpleCard
paddingGroup:mx.core.UIComponent
Required: false Part Type: Static
A UI Component whose left/right/top/bottom values can be adjusted to fit card
UI to a particular aspect ratio without affecting the bounds of the card.
Required: false Part Type: Static
A skin part representing the ribbon component that should be visible when the user
is editing the attament in an external application.
SimpleCard
Skin States
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
[static]
The navigator's thumbnailManager instance.
SimpleCard
Property Detail
allowMultiPage
property
allowMultiPage:Boolean [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Specifies whether or not this card should use a multi-page preview state.
Calculating the page count is expensive, so only allow multi-page at all
if the current attachment supports it.
Implementation protected function get allowMultiPage():Boolean
Implementation public function set doubleClickEnabled(value:Boolean):void
downSampleOK
property
downSampleOK:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
true if it is OK to scale down the image;
otherwise false.
Implementation public function get downSampleOK():Boolean public function set downSampleOK(value:Boolean):void
dragging
property
dragging:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the item renderer is being dragged;
otherwise false.
Implementation public function get dragging():Boolean public function set dragging(value:Boolean):void
dropShadowPreference
property
dropShadowPreference:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The drop shadow effect preference. 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. The
possible values are "none", "bottom", and "rear".
This property can be used as the source for data binding.
Implementation public function get dropShadowPreference():String public function set dropShadowPreference(value:String):void
Indicates whether generation of the thumbnail image is enabled or not.
Implementation public function get enableThumbnailGeneration():Boolean public function set enableThumbnailGeneration(value:Boolean):void
fileName
property
fileName:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The file name of this card's underlying attachment.
This property can be used as the source for data binding.
Implementation public function get fileName():String public function set fileName(value:String):void
generateThumb
property
generateThumb:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Indicates whether or not to generate a thumbnail image for the card
Implementation public function get generateThumb():Boolean public function set generateThumb(value:Boolean):void
invalidPreview
property
protected var invalidPreview:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
If true the preview for this card is invalid.
isOpen
property
isOpen:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the attachment is open in a native editor;
otherwise false.
This property can be used as the source for data binding.
Implementation public function get isOpen():Boolean public function set isOpen(value:Boolean):void
itemIndex
property
itemIndex:int
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The index of the item in the data set
that this renderer is visualizing.
Implementation public function get itemIndex():int public function set itemIndex(value:int):void
label
property
label:String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The String to display in the item renderer.
The host component of the item renderer can use the
itemToLabel() method to convert the data item
to a String for display by the item renderer.
For controls like List and ButtonBar, you can use the
labelField or labelFunction properties
to specify the field of the data item that contains the String.
Otherwise the host component uses the toString() method
to convert the data item to a String.
Implementation public function get label():String public function set label(value:String):void
maintainAspectRatio
property
maintainAspectRatio:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the aspect ratio of the card should be
maintained by setLayoutBoundsSize; otherwise it is false.
Implementation public function get maintainAspectRatio():Boolean public function set maintainAspectRatio(value:Boolean):void
modDate
property
modDate:Date
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The modification date of this card's underlying attachment.
This property can be used as the source for data binding.
Implementation public function get modDate():Date public function set modDate(value:Date):void
mouseIsOver
property
mouseIsOver:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns true if the mouse is over the card;
returns false otherwise.
Implementation protected function get mouseIsOver():Boolean protected function set mouseIsOver(value:Boolean):void
numAttachments
property
numAttachments:int
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The number of attachments in a folder
This property can be used as the source for data binding.
Implementation public function get numAttachments():int public function set numAttachments(value:int):void
padding
property
padding:Point [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the horizontal and vertical padding for this UI component.
Implementation public function get padding():Point
preferredPreviewState
property
preferredPreviewState:String [read-only]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The preferred preview state for this card
Implementation protected function get preferredPreviewState():String
A string specifying the preferred type of rollover effect on this component.
This is used as a hint to skins when specifying filters.
Possible values are "none", "glow", and "scale".
This property can be used as the source for data binding.
Implementation public function get rollOverPreference():String public function set rollOverPreference(value:String):void
Is true if the item renderer
can show itself as selected; otherwise it is false.
This property can be used as the source for data binding.
Implementation public function get selected():Boolean public function set selected(value:Boolean):void
showsCaret
property
showsCaret:Boolean
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Is true if the item renderer can show itself as focused;
otherwise it is false.
Implementation public function get showsCaret():Boolean public function set showsCaret(value:Boolean):void
size
property
size:uint
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
The size of this card's underlying attachment, if it were to be uncompressed.
This property can be used as the source for data binding.
Implementation public function get size():uint public function set size(value:uint):void
visible
property
visible:Boolean [write-only] [override]
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Implementation public function set visible(value:Boolean):void
Constructor Detail
SimpleCard
()
Constructor
public function SimpleCard()
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Default constructor for SimpleCard.
Method Detail
commitProperties
()
method
override protected function commitProperties():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
extensionFromAttachment
()
method
protected function extensionFromAttachment():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns the file extension for the attachment.
If the attachment is a folder, this returns null.
Returns
String
generateThumbnail
()
method
protected function generateThumbnail():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Generate a thumbnail image for the underlying attachment.
getAspectRatio
()
method
protected function getAspectRatio():Number
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the aspect ratio of the thumbnail for the attachment.
Returns
Number — The aspect ratio as a single number representing width/height
getCurrentSkinState
()
method
override protected function getCurrentSkinState():String
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Returns
String
getPreviewSize
()
method
protected function getPreviewSize():Point
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Get the size of the preview image
Returns
Point — the width and height of the preview image as an (x,y) pair.
handlePreview
()
method
protected function handlePreview():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Have the collectionManager handle modal previe experience
for the underlying attachment. This is usually handled within
the portfolio by the NavPreview component, or by the host
application through the preview command.
See also
NavPreview CommandType.PREVIEW
hostPageCountChanged
()
method
protected function hostPageCountChanged(val:uint):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
This function is called if the page count of the multipage model
has changed
Parameters
val:uint — If 0 then do nothing; otherwise invalidate the preview.
initPageCount
()
method
protected function initPageCount():void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Initialize the page count for the preview multipage model
to the page count of the underlying attachement.
Calculating the page count is expensive, so avoid calling this function
when allowMultiPage is false.
override public function setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean = true):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Sets the layout size of the card. This is the size that
the card element uses to draw on screen.
If the width and/or height parameters are left unspecified,
Flex sets the element's layout size to its preferred width and/or
preferred height.
Note that calls to the setLayoutBoundSize() method can affect
the layout position, so call setLayoutBoundPosition() after
calling setLayoutBoundSize().
If maintainAspectRatio is true, then this call will attempt to
size the card around its preview component by reducing the width or height,
or by adjusting the layout values of paddingGroup.
Parameters
width:Number — The desired width for the card
height:Number — The desired height for the card
postLayoutTransform:Boolean (default = true) — When postLayoutTransform is true,
the specified sizes are those of the card's bounding box. The bounding box
is in card's parent coordinate space and is calculated from the card's layout size,
layout position and layout transform matrix.
For controls that do not have labelField
or labelFunction properties to specify the field
of the data item that contains the string to display,
use toString() to convert the data item to a string.
Returns
String — The String to display in the item renderer.
updatePreview
()
method
protected function updatePreview(oldRenderer:ISimpleCard):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Update the preview for this card.
Parameters
oldRenderer:ISimpleCard — The previous simpleCard renderer to use
as the basis for the updated preview
updatePreviewModelListeners
()
method
protected function updatePreviewModelListeners(adding:Boolean):void
Language Version :
ActionScript 3.0
Product Version :
Portfolio 10.0
Runtime Versions :
Flash Player 10.1, AIR 2.0
Update the listeners for preview model events.
Parameters
adding:Boolean — Set to true if you are adding attachments
updateRenderer
()
method
public function updateRenderer(oldRenderer:ISimpleCard):void