/* Copyright (c) 2009 Yahoo! Inc. All rights reserved. The copyrights embodied in the content of this file are licensed under the BSD (revised) open source license */ package com.yahoo.astra.fl.containers { import com.yahoo.astra.fl.containers.layoutClasses.AdvancedLayoutPane; import com.yahoo.astra.layout.modes.FlowLayout; import com.yahoo.astra.layout.modes.HorizontalAlignment; import com.yahoo.astra.layout.modes.VerticalAlignment; import fl.core.InvalidationType; /** * A scrolling container that arranges its children using a flow algorithm * similar to the flow of text in a document or webpage. * * @example The following code configures a FlowPane container: *
This layout container supports advanced options specified through the
* configuration
property.
target
: DisplayObjectincludeInLayout
: Booleanfalse
, the target will not be included in layout calculations. The default value is true
."vertical"
or "horizontal"
.
*/
public function get direction():String
{
return this._direction;
}
/**
* @private
*/
public function set direction(value:String):void
{
this._direction = value;
this.invalidate(INVALIDATION_TYPE_LAYOUT);
}
/**
* @private
* Storage for the verticalGap property.
*/
private var _verticalGap:Number = 0;
/**
* The number of pixels appearing between the container's children
* vertically.
*/
public function get verticalGap():Number
{
return this._verticalGap;
}
/**
* @private
*/
public function set verticalGap(value:Number):void
{
this._verticalGap = value;
this.invalidate(INVALIDATION_TYPE_LAYOUT);
}
/**
* @private
* Storage for the horizontalGap property.
*/
private var _horizontalGap:Number = 0;
/**
* The number of pixels appearing between the container's children
* horizontally.
*/
public function get horizontalGap():Number
{
return this._horizontalGap;
}
/**
* @private
*/
public function set horizontalGap(value:Number):void
{
this._horizontalGap = value;
this.invalidate(INVALIDATION_TYPE_LAYOUT);
}
/**
* @private
* Storage for the verticalAlign property.
*/
private var _verticalAlign:String = VerticalAlignment.TOP;
/**
* The vertical alignment of children displayed in the container.
*
* @see com.yahoo.astra.layout.VerticalAlignment
*/
public function get verticalAlign():String
{
return this._verticalAlign;
}
/**
* @private
*/
public function set verticalAlign(value:String):void
{
this._verticalAlign = value;
this.invalidate(INVALIDATION_TYPE_LAYOUT);
}
/**
* @private
* Storage for the horizontalAlign property.
*/
private var _horizontalAlign:String = HorizontalAlignment.LEFT;
/**
* The horizontal alignment of children displayed in the container.
*
* @see com.yahoo.astra.layout.HorizontalAlignment
*/
public function get horizontalAlign():String
{
return this._horizontalAlign;
}
/**
* @private
*/
public function set horizontalAlign(value:String):void
{
this._horizontalAlign = value;
this.invalidate(INVALIDATION_TYPE_LAYOUT);
}
//--------------------------------------
// Protected Methods
//--------------------------------------
/**
* @private
*/
override protected function draw():void
{
var flowLayout:FlowLayout = this.layoutMode as FlowLayout;
if(flowLayout)
{
//pass the various properties to the layout mode
flowLayout.direction = this.direction;
flowLayout.horizontalAlign = this.horizontalAlign;
flowLayout.verticalAlign = this.verticalAlign;
flowLayout.horizontalGap = this.horizontalGap;
flowLayout.verticalGap = this.verticalGap;
}
super.draw();
}
}
}