Packagecom.adobe.portfolio.layouts
Classpublic class LinearLayout
InheritanceLinearLayout Inheritance spark.layouts.supportClasses.LayoutBase
Implements IListenAndWatch, ICardLayout

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

The LinearLayout class extends LayoutBase to implement the layout of the Linear navigator.



Public Properties
 PropertyDefined By
  cardLayoutHelper : CardLayoutHelper
[read-only] The instance of CardLayoutHelper used by this layout.
LinearLayout
  horizontalScrollPosition : Number
[override] [write-only] Set the x coordinate of the origin of the viewport in the target's coordinate system, where 0 corresponding to the left side of the target
LinearLayout
  target : GroupBase
[override] Sets the UI container instance for this layout and handles setting and removing event listeners for the target.
LinearLayout
  thumbFitSize : Point
The largest size of a thumbnail image that will fit in the layout.
LinearLayout
Protected Properties
 PropertyDefined By
  currentFocus : IAttachment
The IAttachment that currently has the focus
LinearLayout
  focusEffect : Effect = null
The effect to currently playing due to a focus change
LinearLayout
  lastFocus : IAttachment
The IAttachment that had the focus immediately prior to the currentFocus.
LinearLayout
  pendingFocus : IAttachment
The IAttachement that is to get the focus next.
LinearLayout
Public Methods
 MethodDefined By
  
Constructor
LinearLayout
  
Add an event listener to the collection manager to listen for host events
LinearLayout
  
findCardsThatIntersect(marqueeRect:Rectangle):Vector.<int>
Find the list of cards that overlap the specified marquee rectangle.
LinearLayout
  
getHorizontalFocusPosition(unscaledWidth:Number, unscaledHeight:Number):Number
[static] Returns the desired horizontal position within this layout for the active card.
LinearLayout
  
getMaxDimension(unscaledWidth:Number, unscaledHeight:Number):Number
[static] The maximum linear size of a square that can fit within the target container.
LinearLayout
  
[override] Find the horizontal distance needed to scroll to reach the specified element.
LinearLayout
  
getScrollPositionForIndex(index:int, unscaledWidth:Number = 0, unscaledHeight:Number = 0):Number
Returns the horizontal position within this layout for element with the given index value.
LinearLayout
  
Remove the current event listener for host events from the collection manager
LinearLayout
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override] Draws the layout and positions and sizes the target GroupBase's card elements
LinearLayout
Protected Methods
 MethodDefined By
  
generateFocusEffect(oldIndex:int, newIndex:int, duration:Number):Effect
Create a focus effect for the change of focus.
LinearLayout
  
onEffectEnd(evt:EffectEvent):void
Clean up at the end of an effect
LinearLayout
  
Handle the specified navigator host event.
LinearLayout
  
onTargetResize(event:ResizeEvent):void
Updates the layout scroll position when the target container has been resized.
LinearLayout
  
setFocusAttachment(newFocus:IAttachment, oldFocus:IAttachment):void
Set the target's focus to be an IAttachment
LinearLayout
Events
 Event Summary Defined By
  Dispatched after the layout has set its focus to a valid attachment.LinearLayout
Protected Constants
 ConstantDefined By
  collectionManager : CollectionManager
The collection manager instance used by this Navigator
LinearLayout
Property Detail
cardLayoutHelperproperty
cardLayoutHelper:CardLayoutHelper  [read-only]

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

The instance of CardLayoutHelper used by this layout.


Implementation
    public function get cardLayoutHelper():CardLayoutHelper
currentFocusproperty 
protected var currentFocus:IAttachment

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

The IAttachment that currently has the focus

focusEffectproperty 
protected var focusEffect:Effect = null

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

The effect to currently playing due to a focus change

horizontalScrollPositionproperty 
horizontalScrollPosition:Number  [write-only] [override]

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

Set the x coordinate of the origin of the viewport in the target's coordinate system, where 0 corresponding to the left side of the target


Implementation
    public function set horizontalScrollPosition(value:Number):void
lastFocusproperty 
protected var lastFocus:IAttachment

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

The IAttachment that had the focus immediately prior to the currentFocus.

pendingFocusproperty 
protected var pendingFocus:IAttachment

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

The IAttachement that is to get the focus next.

targetproperty 
target:GroupBase[override]

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

Sets the UI container instance for this layout and handles setting and removing event listeners for the target.


Implementation
    public function get target():GroupBase
    public function set target(value:GroupBase):void
thumbFitSizeproperty 
thumbFitSize:Point

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

The largest size of a thumbnail image that will fit in the layout.


Implementation
    public function get thumbFitSize():Point
    public function set thumbFitSize(value:Point):void
Constructor Detail
LinearLayout()Constructor
public function LinearLayout()

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

Constructor

Method Detail
addListenAndWatch()method
public function addListenAndWatch():void

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

Add an event listener to the collection manager to listen for host events

findCardsThatIntersect()method 
public function findCardsThatIntersect(marqueeRect:Rectangle):Vector.<int>

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

Find the list of cards that overlap the specified marquee rectangle.

Parameters

marqueeRect:Rectangle — The bounding rectangle for the marquee

Returns
Vector.<int> — A vector of integers that represent the indexes of the cards in the layout that intersect the specified marqueeRect.
generateFocusEffect()method 
protected function generateFocusEffect(oldIndex:int, newIndex:int, duration:Number):Effect

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

Create a focus effect for the change of focus.

Parameters

oldIndex:int — The index value of the card that currently has the focus
 
newIndex:int — The index value of the card that is getting the focus
 
duration:Number — The time, in milliseconds, for the focus effect to last

Returns
Effect — The focus effect to run
getHorizontalFocusPosition()method 
public static function getHorizontalFocusPosition(unscaledWidth:Number, unscaledHeight:Number):Number

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

Returns the desired horizontal position within this layout for the active card.

Parameters

unscaledWidth:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleX property of the target.
 
unscaledHeight:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleY property of the target.

Returns
Number — the desired horizontal position in pixels within this layout for the active item. This will be offset a small amount to the left of the current layout.
getMaxDimension()method 
public static function getMaxDimension(unscaledWidth:Number, unscaledHeight:Number):Number

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

The maximum linear size of a square that can fit within the target container. This is used to calculate the layout position of element that are in the layout.

Parameters

unscaledWidth:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleX property of the target.
 
unscaledHeight:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleY property of the target.

Returns
Number — The minimum of the scaled width and scaled height of the target
getScrollPositionDeltaToElement()method 
override public function getScrollPositionDeltaToElement(index:int):Point

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

Find the horizontal distance needed to scroll to reach the specified element. The element is identified by its index number.

Parameters

index:int — The index value for the element to which you want to scroll

Returns
Point — Returns the distance to the element as an ordered pair (delta_x, 0)
getScrollPositionForIndex()method 
public function getScrollPositionForIndex(index:int, unscaledWidth:Number = 0, unscaledHeight:Number = 0):Number

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

Returns the horizontal position within this layout for element with the given index value.

Parameters

index:int — The index value of the element for which you want the horizontal scroll position
 
unscaledWidth:Number (default = 0) — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleX property of the target.
 
unscaledHeight:Number (default = 0) — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleY property of the target.

Returns
Number — The horizontal position, in pixels from the left side of the target, for the element with the given index position.
onEffectEnd()method 
protected function onEffectEnd(evt:EffectEvent):void

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

Clean up at the end of an effect

Parameters

evt:EffectEvent — The effect event that was listening for the effect end

onNavHostEvent()method 
protected function onNavHostEvent(evt:CollectionManagerEvent):void

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

Handle the specified navigator host event.

Parameters

evt:CollectionManagerEvent — The navigator host event to handle primarily this will be either an ITEMS_DID_CHANGE event or a FOCUS_DID_CHANGE_KIND event.

onTargetResize()method 
protected function onTargetResize(event:ResizeEvent):void

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

Updates the layout scroll position when the target container has been resized.

Parameters

event:ResizeEvent — The resize event caused by the target container being resized.

removeListenAndWatch()method 
public function removeListenAndWatch():void

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

Remove the current event listener for host events from the collection manager

setFocusAttachment()method 
protected function setFocusAttachment(newFocus:IAttachment, oldFocus:IAttachment):void

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

Set the target's focus to be an IAttachment

Parameters

newFocus:IAttachment — The IAttachement element that is to be the new focus
 
oldFocus:IAttachment — the IAttachment element is the the current focus

updateDisplayList()method 
override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

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

Draws the layout and positions and sizes the target GroupBase's card elements

Parameters

unscaledWidth:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleX property of the target.
 
unscaledHeight:Number — Specifies the width of the target, in pixels, in the target's coordinates, regardless of the value of the scaleY property of the target.

Event Detail
HANDLED_ATTACHMENT_FOCUS Event
Event Object Type: com.adobe.portfolio.events.LayoutEvent
LayoutEvent.type property = com.adobe.portfolio.events.NavLayoutEvent.HANDLED_ATTACHMENT_FOCUS

Dispatched after the layout has set its focus to a valid attachment.

Constant Detail
collectionManagerConstant
protected const collectionManager:CollectionManager

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

The collection manager instance used by this Navigator