Packagecom.adobe.portfolio.cards
Classpublic class PreviewCard
InheritancePreviewCard Inheritance SimpleCard Inheritance NavSkinnableComponent Inheritance spark.components.supportClasses.SkinnableComponent
Implements IPreviewCard

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

PreviewCard 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.



Public Properties
 PropertyDefined By
 InheritedadjustAspectRatio : Boolean
Is true if the aspect ratio of the simple card can be changed; otherwise it is false.
SimpleCard
 InheritedcolorPalette : ColorPalette
The color palette being used by this object.
SimpleCard
 InheritedcompressedSize : uint
The size of this card's underlying attachment as it is currently compressed in the Navigator file.
SimpleCard
 InheritedcreationDate : Date
The creation date of this card's underlying attachment.
SimpleCard
 Inheriteddata : Object
The data object to be rendered.
SimpleCard
 InheriteddelayThumbnailGeneration : Boolean
Indicates whether generation of the thumbnail image should be delayed or not.
SimpleCard
 Inheriteddescription : String
The description of this card's underlying attachment.
SimpleCard
 InheriteddoubleClickEnabled : Boolean
[override] [write-only] Enables and disables double click events for this card.
SimpleCard
 InheriteddownSampleOK : Boolean
Indicates whether it is OK to reduce the size of the image.
SimpleCard
 Inheriteddragging : Boolean
Is true if the item renderer is being dragged; otherwise false.
SimpleCard
 InheriteddropShadowPreference : String
The drop shadow effect preference.
SimpleCard
 InheritedenableThumbnailGeneration : Boolean
Indicates whether generation of the thumbnail image is enabled or not.
SimpleCard
 InheritedfileName : String
The file name of this card's underlying attachment.
SimpleCard
 InheritedgenerateThumb : Boolean
Indicates whether or not to generate a thumbnail image for the card
SimpleCard
 InheritedisOpen : Boolean
Is true if the attachment is open in a native editor; otherwise false.
SimpleCard
 InheriteditemIndex : int
The index of the item in the data set that this renderer is visualizing.
SimpleCard
 Inheritedlabel : String
The String to display in the item renderer.
SimpleCard
 InheritedmediumPreviewHasGlow : Boolean
[read-only] A boolean specifying if the skin should apply a glow to the mid-level preview
SimpleCard
 InheritedmodDate : Date
The modification date of this card's underlying attachment.
SimpleCard
 Inheritedpadding : Point
[read-only] Get the horizontal and vertical padding for this UI component.
SimpleCard
 InheritedpreviewComponent : IPreview
[read-only] The preview component for the simpleCard
SimpleCard
 InheritedrollOverPreference : String
A string specifying the preferred type of rollover effect on this component.
SimpleCard
 Inheritedselected : Boolean
Is true if the item renderer can show itself as selected; otherwise it is false.
SimpleCard
 InheritedshowsCaret : Boolean
Is true if the item renderer can show itself as focused; otherwise it is false.
SimpleCard
 Inheritedsize : uint
The size of this card's underlying attachment, if it were to be uncompressed.
SimpleCard
 InheritedskinState : String
NavSkinnableComponent
 Inheritedvisible : Boolean
[override] [write-only] Set the visibility of the card
SimpleCard
Protected Properties
 PropertyDefined By
  allowMultiPage : Boolean
[override] [read-only] Determines if the attachement supports calculating the number of pages it contains.
PreviewCard
 Inheritedattachment : IAttachment = null
The IAttachment data object being rendered by this component.
SimpleCard
 InheritedautoListen : AutoListen
NavSkinnableComponent
 InheritedautoWatch : AutoWatch
NavSkinnableComponent
 InheritedinvalidPreview : Boolean
If true the preview for this card is invalid.
SimpleCard
 InheritedmouseIsOver : Boolean
Returns true if the mouse is over the card; returns false otherwise.
SimpleCard
  preferredPreviewState : String
[override] [read-only] Returns the preferred PreviewState.
PreviewCard
  prefersMediaPreview : Boolean
[override] [read-only] Returns true when the associated attachement has a preferredPreviewState of AUDIO or VIDEO; returns false otherwise.
PreviewCard
 InheritedpreviewMultiPageModel : IPreviewMultiPageModel
[read-only] Get a preview model that supports multipage preview of attachments
SimpleCard
 Inherited_skinState : String
NavSkinnableComponent
 InheritedthumbnailMgr : ThumbnailManager
[static] The navigator's thumbnailManager instance.
SimpleCard
Public Methods
 MethodDefined By
  
Constructor
PreviewCard
 Inherited
NavSkinnableComponent
 Inherited
getDimensionsUsingPreview(fitWidth:Number, fitHeight:Number):Point
Get the dimensions of the preview image.
SimpleCard
 Inherited
invalidatePreview(invalidateModel:Boolean = false, generateThumb:Boolean = true):void
Invalidate the current preview state for the card
SimpleCard
 Inherited
NavSkinnableComponent
  
setCurrentState(stateName:String, playTransition:Boolean = true):void
[override] Sets the current state of the skin as well as the current state of this instance.
PreviewCard
 Inherited
setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean = true):void
[override] Sets the layout size of the card.
SimpleCard
 Inherited
toString():String
[override] The String to display in the item renderer.
SimpleCard
 Inherited
updateRenderer(oldRenderer:ISimpleCard):void
Update the renderer to use for the simpleCard
SimpleCard
Protected Methods
 MethodDefined By
 Inherited
addListener(listener:IEventDispatcher, type:String, handler:Function, useCapture:Boolean = false, priority:int = 0):void
NavSkinnableComponent
 Inherited
addWatcher(watcher:ChangeWatcher):void
NavSkinnableComponent
 Inherited
[override] Save the current properties of this card.
SimpleCard
 Inherited
detachSkin():void
[override]
NavSkinnableComponent
 Inherited
Returns the file extension for the attachment.
SimpleCard
 Inherited
Generate a thumbnail image for the underlying attachment.
SimpleCard
 Inherited
Get the aspect ratio of the thumbnail for the attachment.
SimpleCard
  
[override] Returns the current state of this instance, which is a variant of the component state depending on whether or not the component is selected.
PreviewCard
  
[override] XXXXX
PreviewCard
 Inherited
Have the collectionManager handle the preview for the underlying attachment.
SimpleCard
 Inherited
hostPageCountChanged(val:uint):void
This function is called if the page count of the multipage model has changed
SimpleCard
 Inherited
Initialize the page count for the preview multipage model to the page count of the underlying attachement.
SimpleCard
 Inherited
initStates():void
NavSkinnableComponent
  
[override] Invalidate the preview because a new data object to be rendered has been set.
PreviewCard
 Inherited
Returns the MIME type for the attachment.
SimpleCard
 Inherited
onAspectRatioChanged(event:PropertyChangeEvent):void
The event handler for changes in aspect ratio of the thumbnail.
SimpleCard
 Inherited
onAttachmentChange(evt:Event):void
Handles changes in the underlying attachement events
SimpleCard
  
onCloseClick(evt:Event):void
Dispatches a closeButton event
PreviewCard
 Inherited
onEnableDynamicThumbnails(value:Boolean):void
Handle the enabling of dynamic thumbnails.
SimpleCard
 Inherited
onHostPropertyChange(event:PropertyChangeEvent):void
A listener for PropertyChangeEvents on the collectionManager.
SimpleCard
 Inherited
onIconChange(event:Event):void
Handle icon change events
SimpleCard
  
onInfoCloseClick(evt:Event):void
The event handler for closing the previewCard's info state.
PreviewCard
  
partAdded(partName:String, instance:Object):void
[override] This function is called when a skin has added a skin part for this previewCard instance.
PreviewCard
  
partRemoved(partName:String, instance:Object):void
[override] This function is called when a skin has removed a skin part for this previewCard instance.
PreviewCard
 Inherited
setAspectRatio(value:Number, mediaValue:Boolean = false):void
Set the aspect ratio of the thumbnail for the attachment.
SimpleCard
 Inherited
setAspectRatioField(value:Number):void
Set the aspect ratio of the appropriate field for the attachment
SimpleCard
 Inherited
updatePreview(oldRenderer:ISimpleCard):void
Update the preview for this card.
SimpleCard
 Inherited
updatePreviewModelListeners(adding:Boolean):void
Update the listeners for preview model events.
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
  
closeButton:spark.components.Button
Required: false Part Type: Static
closeButton is the button control to close the preview card. It is an optional skin part, so it is not necessarily implemented for all skins.
PreviewCard
 Inherited
icon:mx.controls.Image
Required: false Part Type: Static
The icon image for the card
SimpleCard
  
infoCloseButton:spark.components.Button
Required: false Part Type: Static
infoCloseButton is the button control to close the info card. It is an optional skin part, so not necessarily implemented for all skins.
PreviewCard
 Inherited
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.
SimpleCard
 Inherited
ribbon:spark.components.Group
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.


 Skin State Description Defined By
 InheritedSimpleCard
 InheritedSimpleCard
 InheritedSimpleCard
  
previewInfo
PreviewCard
  
previewNormal
PreviewCard
 InheritedSimpleCard
Public Constants
 ConstantDefined By
 InheritedASPECT_RATIO_FIELD : String = adobe:AspectRatio
[static] A string literal representing the name for the aspect ratio field
SimpleCard
 InheritedPART_ICON : String = icon
[static] A string literal used to represent the icon skin part exposed by SimpleCard
SimpleCard
 InheritedPART_PREVIEW : String = preview
[static] A string literal used to represent the preview skin part exposed by SimpleCard
SimpleCard
 InheritedPART_RIBBON : String = ribbon
[static] A string literal used to represent the ribbon skin part exposed by SimpleCard
SimpleCard
 InheritedSKIN_STATE_NORMAL : String = normal
[static] A string literal used to represent the normal skin state of the SimpleCard
SimpleCard
 InheritedSKIN_STATE_OVER : String = over
[static] A string literal used to represent the "over" skin state of the SimpleCard
SimpleCard
 InheritedSKIN_STATE_OVER_AND_SELECTED : String = overAndSelected
[static] A string literal used to represent the over and selected skin state of the SimpleCard
SimpleCard
  SKIN_STATE_PREVIEW_INFO : String = previewInfo
[static] A string literal used to represent the info state of a PreviewCard skin.
PreviewCard
  SKIN_STATE_PREVIEW_NORMAL : String = previewNormal
[static] A string literal used to represent the preview state of a PreviewCard skin.
PreviewCard
 InheritedSKIN_STATE_SELECTED : String = selected
[static] A string literal used to represent the selected skin state of the SimpleCard
SimpleCard
 InheritedSTATE_DISABLED : String = disabled
[static]
NavSkinnableComponent
  STATE_INFO : String = info
[static] A string literal used to represent the info state of a previewCard.
PreviewCard
 InheritedSTATE_NORMAL : String = normal
[static]
NavSkinnableComponent
  STATE_PREVIEW : String = preview
[static] A string literal used to represent the preview state of a previewCard.
PreviewCard
Protected Constants
 ConstantDefined By
 InheritedcollectionManager : CollectionManager
The navigator's CollectionManager instance.
SimpleCard
Property Detail
allowMultiPageproperty
allowMultiPage:Boolean  [read-only] [override]

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

Determines if the attachement supports calculating the number of pages it contains.


Implementation
    protected function get allowMultiPage():Boolean
preferredPreviewStateproperty 
preferredPreviewState:String  [read-only] [override]

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

Returns the preferred PreviewState. This is based on the MIME type of the associated attachement if supported.


Implementation
    protected function get preferredPreviewState():String
prefersMediaPreviewproperty 
prefersMediaPreview:Boolean  [read-only] [override]

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

Returns true when the associated attachement has a preferredPreviewState of AUDIO or VIDEO; returns false otherwise.


Implementation
    protected function get prefersMediaPreview():Boolean
Constructor Detail
PreviewCard()Constructor
public function PreviewCard()

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

Constructor

Method Detail
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 the current state of this instance, which is a variant of the component state depending on whether or not the component is selected.

Returns
String
getPreviewSize()method 
override protected function getPreviewSize():Point

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

XXXXX

Returns
Point
invalidatePreviewFromSetData()method 
override protected function invalidatePreviewFromSetData():void

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

Invalidate the preview because a new data object to be rendered has been set.

onCloseClick()method 
protected function onCloseClick(evt:Event):void

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

Dispatches a closeButton event

Parameters

evt:Event — The triggering event

onInfoCloseClick()method 
protected function onInfoCloseClick(evt:Event):void

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

The event handler for closing the previewCard's info state.

Parameters

evt:Event

partAdded()method 
override protected function partAdded(partName:String, instance:Object):void

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

This function is called when a skin has added a skin part for this previewCard instance.

Parameters

partName:String
 
instance:Object

partRemoved()method 
override protected function partRemoved(partName:String, instance:Object):void

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

This function is called when a skin has removed a skin part for this previewCard instance.

Parameters

partName:String
 
instance:Object

setCurrentState()method 
override public function setCurrentState(stateName:String, playTransition:Boolean = true):void

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

Sets the current state of the skin as well as the current state of this instance.

Parameters

stateName:String
 
playTransition:Boolean (default = true)

Constant Detail
SKIN_STATE_PREVIEW_INFOConstant
public static const SKIN_STATE_PREVIEW_INFO:String = previewInfo

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 info state of a PreviewCard skin.

SKIN_STATE_PREVIEW_NORMALConstant 
public static const SKIN_STATE_PREVIEW_NORMAL:String = previewNormal

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 preview state of a PreviewCard skin.

STATE_INFOConstant 
public static const STATE_INFO:String = info

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 info state of a previewCard.

STATE_PREVIEWConstant 
public static const STATE_PREVIEW:String = preview

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 preview state of a previewCard.