Renamed ILayoutObject to ILayoutView which is more descriptive.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5300c4e9 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5300c4e9 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5300c4e9 Branch: refs/heads/tlf Commit: 5300c4e9f943293991537dfd59b72f2e5bbfe55f Parents: e806fb9 Author: Peter Ent <[email protected]> Authored: Wed Mar 22 17:18:37 2017 -0400 Committer: Peter Ent <[email protected]> Committed: Wed Mar 22 17:18:37 2017 -0400 ---------------------------------------------------------------------- .../projects/Core/src/main/flex/CoreClasses.as | 2 +- .../flex/org/apache/flex/core/ILayoutHost.as | 2 +- .../flex/org/apache/flex/core/ILayoutObject.as | 86 ------------ .../flex/org/apache/flex/core/ILayoutView.as | 86 ++++++++++++ .../flex/org/apache/flex/utils/LayoutTweener.as | 32 ++--- .../org/apache/flex/utils/MockContentView.as | 94 ++++++------- .../org/apache/flex/utils/MockLayoutHost.as | 12 +- .../org/apache/flex/utils/MockLayoutParent.as | 132 +++++++++--------- .../main/flex/org/apache/flex/core/ViewBase.as | 28 ++-- .../flex/org/apache/flex/html/DataContainer.as | 90 ++++++------- .../src/main/flex/org/apache/flex/html/Group.as | 26 ++-- .../src/main/flex/org/apache/flex/html/List.as | 30 ++--- .../org/apache/flex/html/beads/ContainerView.as | 134 +++++++++---------- .../org/apache/flex/html/beads/GroupView.as | 120 ++++++++--------- .../org/apache/flex/html/beads/PanelView.as | 80 +++++------ .../flex/html/beads/layouts/BasicLayout.as | 62 ++++----- .../flex/html/beads/layouts/ButtonBarLayout.as | 54 ++++---- .../FlexibleFirstChildHorizontalLayout.as | 88 ++++++------ .../html/beads/layouts/HorizontalFlexLayout.as | 98 +++++++------- .../html/beads/layouts/HorizontalFlowLayout.as | 46 +++---- .../flex/html/beads/layouts/HorizontalLayout.as | 64 ++++----- .../layouts/OneFlexibleChildHorizontalLayout.as | 128 +++++++++--------- .../layouts/OneFlexibleChildVerticalLayout.as | 130 +++++++++--------- .../flex/html/beads/layouts/TileLayout.as | 2 +- .../html/beads/layouts/VerticalColumnLayout.as | 44 +++--- .../html/beads/layouts/VerticalFlexLayout.as | 96 ++++++------- .../flex/html/beads/layouts/VerticalLayout.as | 70 +++++----- .../html/supportClasses/ContainerContentArea.as | 40 +----- .../html/supportClasses/MXMLItemRenderer.as | 16 +-- .../html/supportClasses/PanelLayoutProxy.as | 40 +++--- 30 files changed, 952 insertions(+), 980 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Core/src/main/flex/CoreClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as index da4d657..529b8ef 100644 --- a/frameworks/projects/Core/src/main/flex/CoreClasses.as +++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as @@ -77,7 +77,7 @@ internal class CoreClasses import org.apache.flex.core.IItemRendererProvider; IItemRendererProvider; import org.apache.flex.core.ILayoutChild; ILayoutChild; import org.apache.flex.core.ILayoutHost; ILayoutHost; - import org.apache.flex.core.ILayoutObject; ILayoutObject; + import org.apache.flex.core.ILayoutView; ILayoutView; import org.apache.flex.core.ILayoutParent; ILayoutParent; import org.apache.flex.core.IListPresentationModel; IListPresentationModel; import org.apache.flex.core.IMeasurementBead; IMeasurementBead; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutHost.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutHost.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutHost.as index 15afca2..dfd85d6 100644 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutHost.as +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutHost.as @@ -39,6 +39,6 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ - function get contentView():ILayoutObject; + function get contentView():ILayoutView; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutObject.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutObject.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutObject.as deleted file mode 100644 index c621b35..0000000 --- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutObject.as +++ /dev/null @@ -1,86 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.core -{ - /** - * The ILayoutObject interface is implemented by any component that - * has ILayoutChild children. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - public interface ILayoutObject - { - /** - * Returns the width of the layout object's content area. This - * value may be NaN if the width is unknown. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - function get width():Number; - - /** - * Returns the height of the layout object's content area. This - * value may be NaN if the height is unknown. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - function get height():Number; - - /** - * Returns the number of element children that can be laid out. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - function get numElements():int; - - /** - * Returns the element child at the given index. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - function getElementAt(index:int):IChild; - - COMPILE::JS { - /** - * Returns the native element of the layout object itself. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.8 - */ - function get element():WrappedHTMLElement; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutView.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutView.as new file mode 100644 index 0000000..a3dbe72 --- /dev/null +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ILayoutView.as @@ -0,0 +1,86 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.core +{ + /** + * The ILayoutView interface is implemented by any component that + * has ILayoutChild children. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + public interface ILayoutView + { + /** + * Returns the width of the layout object's content area. This + * value may be NaN if the width is unknown. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + function get width():Number; + + /** + * Returns the height of the layout object's content area. This + * value may be NaN if the height is unknown. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + function get height():Number; + + /** + * Returns the number of element children that can be laid out. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + function get numElements():int; + + /** + * Returns the element child at the given index. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + function getElementAt(index:int):IChild; + + COMPILE::JS { + /** + * Returns the native element of the layout object itself. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.8 + */ + function get element():WrappedHTMLElement; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/LayoutTweener.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/LayoutTweener.as b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/LayoutTweener.as index e9cd533..8b105bf 100644 --- a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/LayoutTweener.as +++ b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/LayoutTweener.as @@ -21,7 +21,7 @@ package org.apache.flex.utils import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.ILayoutChild; import org.apache.flex.core.ILayoutParent; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IParentIUIBase; import org.apache.flex.core.IStrand; import org.apache.flex.effects.Effect; @@ -31,7 +31,7 @@ package org.apache.flex.utils import org.apache.flex.events.EventDispatcher; /** - * + * * @author Yishay */ public class LayoutTweener extends EventDispatcher @@ -41,7 +41,7 @@ package org.apache.flex.utils private var _mockLayoutParent:MockLayoutParent; private var _effectGenerators:Vector.<IEffectsGenerator>; /** - * + * * @param sourceLayout * @param sourceLayoutParent */ @@ -50,7 +50,7 @@ package org.apache.flex.utils this.sourceLayout = sourceLayout; this.sourceLayoutParent = sourceLayoutParent; } - + public function get effectGenerators():Vector.<IEffectsGenerator> { return _effectGenerators; @@ -62,8 +62,8 @@ package org.apache.flex.utils } /** - * - * @return + * + * @return */ public function get mockLayoutParent():MockLayoutParent { @@ -71,16 +71,16 @@ package org.apache.flex.utils } /** - * + * */ public function setBaseline():void { _mockLayoutParent = new MockLayoutParent(sourceLayoutParent); sourceLayout.strand = _mockLayoutParent as IStrand; } - + /** - * + * */ public function play():void { @@ -95,20 +95,20 @@ package org.apache.flex.utils parallel.play(); } } - + /** - * + * * @param event */ protected function effectEndHandler(event:Event):void { dispatchEvent(event); } - + private function getEffects(originalLayoutParent:ILayoutParent, mockLayoutParent:ILayoutParent):Array { - var originalContentView:ILayoutObject = originalLayoutParent.getLayoutHost().contentView; - var mockContentView:ILayoutObject = mockLayoutParent.getLayoutHost().contentView; + var originalContentView:ILayoutView = originalLayoutParent.getLayoutHost().contentView; + var mockContentView:ILayoutView = mockLayoutParent.getLayoutHost().contentView; var numElements:int = originalContentView.numElements; var effects:Array = []; for (var i:int = 0; i < numElements; i++) @@ -126,6 +126,6 @@ package org.apache.flex.utils } return effects; } - + } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockContentView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockContentView.as b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockContentView.as index f525e49..ce9b177 100644 --- a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockContentView.as +++ b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockContentView.as @@ -31,23 +31,23 @@ package org.apache.flex.utils import org.apache.flex.core.IChild; import org.apache.flex.core.IContentView; import org.apache.flex.core.ILayoutChild; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IParent; import org.apache.flex.core.IParentIUIBase; import org.apache.flex.events.IEventDispatcher; - - public class MockContentView implements IContentView, IParentIUIBase, ILayoutObject + + public class MockContentView implements IContentView, IParentIUIBase, ILayoutView { private var _x:Number; private var _y:Number; private var _width:Number; private var _height:Number; private var elements:Array = []; - - public function MockContentView(source:ILayoutObject) + + public function MockContentView(source:ILayoutView) { var p:IParentIUIBase = source as IParentIUIBase; - + x = p.x; y = p.y; width = p.width; @@ -58,119 +58,119 @@ package org.apache.flex.utils elements.push(mock); } } - + public function get x():Number { return _x; } - + public function set x(value:Number):void { _x = value; } - + public function get y():Number { return _y; } - + public function set y(value:Number):void { _y = value; } - + public function get width():Number { return _width; } - + public function set width(value:Number):void { _width = value; } - + public function get height():Number { return _height; } - + public function set height(value:Number):void { _height = value; } - + public function removeAllElements():void { - elements = []; + elements = []; } - + public function addElement(c:IChild, dispatchEvent:Boolean=true):void { elements.push(c); } - + public function addElementAt(c:IChild, index:int, dispatchEvent:Boolean=true):void { elements.splice(index, 0, c); } - + public function getElementIndex(c:IChild):int { return elements.indexOf(c); } - + public function removeElement(c:IChild, dispatchEvent:Boolean=true):void { var i:int = getElementIndex(c); elements.removeAt(i); } - + public function get numElements():int { return elements.length; } - + public function getElementAt(index:int):IChild { return elements[index] as IChild; } - + COMPILE::SWF public function get $displayObject():DisplayObject { // TODO Auto Generated method stub return null; } - + public function addBead(bead:IBead):void { // TODO Auto Generated method stub - + } - + public function getBeadByType(classOrInterface:Class):IBead { // TODO Auto Generated method stub return null; } - + public function removeBead(bead:IBead):IBead { // TODO Auto Generated method stub return null; } - + COMPILE::SWF public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void { // TODO Auto Generated method stub } - + COMPILE::JS public function addEventListener(type:String, handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object = null):void { } - + COMPILE::SWF public function dispatchEvent(event:flash.events.Event):Boolean { @@ -184,13 +184,13 @@ package org.apache.flex.utils // TODO Auto Generated method stub return false; } - + public function hasEventListener(type:String):Boolean { // TODO Auto Generated method stub return false; } - + COMPILE::SWF public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void { @@ -208,67 +208,67 @@ package org.apache.flex.utils // TODO Auto Generated method stub return false; } - + public function get parent():IParent { // TODO Auto Generated method stub return null; } - + public function addedToParent():void { // TODO Auto Generated method stub - + } - + public function get alpha():Number { // TODO Auto Generated method stub return 0; } - + public function set alpha(value:Number):void { // TODO Auto Generated method stub - + } - + public function get topMostEventDispatcher():IEventDispatcher { // TODO Auto Generated method stub return null; } - + public function set visible(value:Boolean):void { // TODO Auto Generated method stub - + } - + public function get visible():Boolean { // TODO Auto Generated method stub return false; } - + COMPILE::JS public function get positioner():WrappedHTMLElement { return null; } - + COMPILE::JS public function get element():WrappedHTMLElement { return null; } - + COMPILE::JS public function internalChildren():Array { return elements; } - + } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutHost.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutHost.as b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutHost.as index 34c7802..b7aaf8f 100644 --- a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutHost.as +++ b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutHost.as @@ -19,19 +19,19 @@ package org.apache.flex.utils { import org.apache.flex.core.ILayoutHost; - import org.apache.flex.core.ILayoutObject; - + import org.apache.flex.core.ILayoutView; + public class MockLayoutHost implements ILayoutHost { - private var _contentView:ILayoutObject; + private var _contentView:ILayoutView; public function MockLayoutHost(source:ILayoutHost) { _contentView = new MockContentView(source.contentView); } - - public function get contentView():ILayoutObject + + public function get contentView():ILayoutView { return _contentView; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutParent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutParent.as b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutParent.as index 03d8fe4..fe39f96 100644 --- a/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutParent.as +++ b/frameworks/projects/Effects/src/main/flex/org/apache/flex/utils/MockLayoutParent.as @@ -23,7 +23,7 @@ package org.apache.flex.utils import flash.display.DisplayObject; import flash.events.Event; } - + COMPILE::JS { import org.apache.flex.core.WrappedHTMLElement; @@ -32,13 +32,13 @@ package org.apache.flex.utils import org.apache.flex.core.IBead; import org.apache.flex.core.ILayoutChild; import org.apache.flex.core.ILayoutHost; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.ILayoutParent; import org.apache.flex.core.IParent; import org.apache.flex.core.IParentIUIBase; import org.apache.flex.core.IStrand; import org.apache.flex.events.IEventDispatcher; - + public class MockLayoutParent implements ILayoutParent, ILayoutHost, IStrand, ILayoutChild { private var _layoutHost:ILayoutHost; @@ -48,255 +48,255 @@ package org.apache.flex.utils _layoutHost = new MockLayoutHost(source.getLayoutHost()); _source = source; } - + public function get parent():IParent { // TODO Auto Generated method stub return null; } - - + + public function addedToParent():void { // TODO Auto Generated method stub - + } - + public function get alpha():Number { // TODO Auto Generated method stub return 0; } - + public function set alpha(value:Number):void { // TODO Auto Generated method stub - + } - + public function get height():Number { // TODO Auto Generated method stub return 0; } - + public function set height(value:Number):void { // TODO Auto Generated method stub - + } - + public function get topMostEventDispatcher():IEventDispatcher { // TODO Auto Generated method stub return null; } - + public function get visible():Boolean { // TODO Auto Generated method stub return false; } - + public function set visible(value:Boolean):void { // TODO Auto Generated method stub - + } - + public function get width():Number { // TODO Auto Generated method stub return 0; } - + public function set width(value:Number):void { // TODO Auto Generated method stub - + } - + public function get x():Number { // TODO Auto Generated method stub return 0; } - + public function set x(value:Number):void { // TODO Auto Generated method stub - + } - + public function get y():Number { // TODO Auto Generated method stub return 0; } - + public function set y(value:Number):void { // TODO Auto Generated method stub - + } - - + + public function getLayoutHost():ILayoutHost { return _layoutHost; } - - public function get contentView():ILayoutObject + + public function get contentView():ILayoutView { return _layoutHost.contentView; } - + public function addBead(bead:IBead):void { // TODO Auto Generated method stub } - + public function getBeadByType(classOrInterface:Class):IBead { - return (_source as IStrand).getBeadByType(classOrInterface); + return (_source as IStrand).getBeadByType(classOrInterface); } - + public function removeBead(bead:IBead):IBead { // TODO Auto Generated method stub return null; } - + public function get explicitHeight():Number { // TODO Auto Generated method stub return 0; } - + public function get explicitWidth():Number { // TODO Auto Generated method stub return 0; } - + public function isHeightSizedToContent():Boolean { // TODO Auto Generated method stub return false; } - + public function isWidthSizedToContent():Boolean { // TODO Auto Generated method stub return false; } - + public function get percentHeight():Number { // TODO Auto Generated method stub return 0; } - + public function set percentHeight(value:Number):void { // TODO Auto Generated method stub - + } - + public function get percentWidth():Number { // TODO Auto Generated method stub return 0; } - + public function set percentWidth(value:Number):void { // TODO Auto Generated method stub - + } - + public function setHeight(value:Number, noEvent:Boolean=false):void { // TODO Auto Generated method stub - + } - + public function setWidth(value:Number, noEvent:Boolean=false):void { // TODO Auto Generated method stub - + } - + public function setWidthAndHeight(newWidth:Number, newHeight:Number, noEvent:Boolean=false):void { // TODO Auto Generated method stub - + } - + public function setX(value:Number):void { // TODO Auto Generated method stub - + } - + public function setY(value:Number):void { // TODO Auto Generated method stub - + } - + COMPILE::JS public function addEventListener(type:String, handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object = null):void { } - + COMPILE::SWF public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void { } - + COMPILE::SWF public function dispatchEvent(event:Event):Boolean { return false; } - + COMPILE::JS public function dispatchEvent(event:Object):Boolean { return false; } - + public function hasEventListener(type:String):Boolean { // TODO Auto Generated method stub return false; } - + COMPILE::SWF public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void { } - + COMPILE::JS public function removeEventListener(type:String, handler:Function, opt_capture:Boolean = false, opt_handlerScope:Object = null):void { // TODO Auto Generated method stub } - + public function willTrigger(type:String):Boolean { // TODO Auto Generated method stub return false; } - + COMPILE::SWF public function get $displayObject():DisplayObject { // TODO Auto Generated method stub return null; } - + COMPILE::JS public function get positioner():WrappedHTMLElement { @@ -309,6 +309,6 @@ package org.apache.flex.utils return null; } - + } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ViewBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ViewBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ViewBase.as index 1af670e..3f862b4 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ViewBase.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/ViewBase.as @@ -23,36 +23,36 @@ package org.apache.flex.core //-------------------------------------- // Events //-------------------------------------- - + /** * Dispatched at startup. Attributes and sub-instances of * the MXML document have been created and assigned. * The component lifecycle is different * than the Flex SDK. There is no creationComplete event. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ [Event(name="initComplete", type="org.apache.flex.events.Event")] - + [DefaultProperty("mxmlContent")] - + /** * The ViewBase class is the base class for most views in a FlexJS * application. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ - public class ViewBase extends GroupBase implements IPopUpHost, IApplicationView, ILayoutParent, ILayoutObject + public class ViewBase extends GroupBase implements IPopUpHost, IApplicationView, ILayoutParent, ILayoutView { /** * Constructor. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -61,19 +61,19 @@ package org.apache.flex.core public function ViewBase() { super(); - + className = "flexjs"; } - + private var _applicationModel:Object; - + [Bindable("modelChanged")] - + /** * A reference to the Application's model. Usually, * a view is displaying the main model for an * application. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -83,7 +83,7 @@ package org.apache.flex.core { return _applicationModel; } - + /** * @private */ @@ -98,7 +98,7 @@ package org.apache.flex.core */ public function getLayoutHost():ILayoutHost { - return view as ILayoutHost; + return view as ILayoutHost; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as index cf6d82e..c40800e 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataContainer.as @@ -26,7 +26,7 @@ package org.apache.flex.html import org.apache.flex.core.IItemRendererClassFactory; import org.apache.flex.core.IItemRenderer; import org.apache.flex.core.IItemRendererParent; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IList; import org.apache.flex.core.IListPresentationModel; import org.apache.flex.core.IRollOverModel; @@ -47,34 +47,34 @@ package org.apache.flex.html import org.apache.flex.events.ItemRemovedEvent; import org.apache.flex.html.beads.models.ListPresentationModel; import org.apache.flex.html.supportClasses.DataItemRenderer; - + /** * Indicates that the initialization of the list is complete. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ [Event(name="initComplete", type="org.apache.flex.events.Event")] - + /** * The DataContainer class is a component that displays multiple data items. The DataContainer uses * the following bead types: - * + * * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider. * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the list. * org.apache.flex.core.IBeadController: the bead that handles input and output. * org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of the itemRenderers. * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders. * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the list. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ - public class DataContainer extends ListBase implements IList, IItemRendererParent, ILayoutObject + public class DataContainer extends ListBase implements IList, IItemRendererParent, ILayoutView { /** * constructor. @@ -89,7 +89,7 @@ package org.apache.flex.html super(); addEventListener("beadsAdded", beadsAddedHandler); } - + /** * The name of field within the data used for display. Each item of the * data should have a property with this name. @@ -107,7 +107,7 @@ package org.apache.flex.html { IDataProviderModel(model).labelField = value; } - + /** * The data being display by the List. * @@ -125,7 +125,7 @@ package org.apache.flex.html IDataProviderModel(model).dataProvider = value; } - + /** * The presentation model for the list. * @@ -143,11 +143,11 @@ package org.apache.flex.html } return presModel; } - + /* * IList and IItemRendererParent */ - + /** * Returns the sub-component that parents all of the item renderers. * @@ -160,9 +160,9 @@ package org.apache.flex.html { return this; } - + private var _itemRenderer:IFactory; - + /** * The class or factory used to display each item. * @@ -179,7 +179,7 @@ package org.apache.flex.html { _itemRenderer = value; } - + /** * Returns whether or not the itemRenderer property has been set. * @@ -193,95 +193,95 @@ package org.apache.flex.html public function get hasItemRenderer():Boolean { var result:Boolean = false; - + COMPILE::SWF { result = _itemRenderer != null; } - + COMPILE::JS { var test:* = _itemRenderer; result = _itemRenderer !== null && test !== undefined; } - + return result; } - + /* * IItemRendererParent */ - + /** * @copy org.apache.flex.core.IItemRendererParent#addItemRenderer() * @private - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ public function addItemRenderer(renderer:IItemRenderer):void - { + { addElement(renderer, true); - + var newEvent:ItemAddedEvent = new ItemAddedEvent("itemAdded"); newEvent.item = renderer; - + dispatchEvent(newEvent); } - + /** * @copy org.apache.flex.core.IItemRendererParent#removeItemRenderer() * @private - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ public function removeItemRenderer(renderer:IItemRenderer):void - { + { removeElement(renderer, true); - + var newEvent:ItemRemovedEvent = new ItemRemovedEvent("itemRemoved"); newEvent.item = renderer; - + dispatchEvent(newEvent); } - + /** * @copy org.apache.flex.core.IItemRendererParent#removeAllItemRenderers() * @private - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ public function removeAllItemRenderers():void - { + { while (numElements > 0) { var child:IChild = getElementAt(0); removeElement(child); } } - + /** * @copy org.apache.flex.core.IItemRendererParent#getItemRendererForIndex() - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ public function getItemRendererForIndex(index:int):IItemRenderer - { + { if (index < 0 || index >= numElements) return null; return getElementAt(index) as IItemRenderer; } - + /** * Refreshes the itemRenderers. Useful after a size change by the data group. - * + * * @copy org.apache.flex.core.IItemRendererParent#updateAllItemRenderers() * @langversion 3.0 * @playerversion Flash 10.2 @@ -289,7 +289,7 @@ package org.apache.flex.html * @productversion FlexJS 0.8 */ public function updateAllItemRenderers():void - { + { var n:Number = numElements; for (var i:Number = 0; i < n; i++) { @@ -300,21 +300,21 @@ package org.apache.flex.html } } } - + /* * UIBase */ - + /** * @private */ override public function addedToParent():void { super.addedToParent(); - + dispatchEvent(new Event("initComplete")); } - + /** * @private */ @@ -332,7 +332,7 @@ package org.apache.flex.html addBead(itemRendererFactory); } } - + /** * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement */ @@ -341,8 +341,8 @@ package org.apache.flex.html { super.createElement(); className = 'DataContainer'; - + return element; - } + } } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Group.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Group.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Group.as index 20ebf12..72db2e0 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Group.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Group.as @@ -22,7 +22,7 @@ package org.apache.flex.html import org.apache.flex.core.IContainer; import org.apache.flex.core.ILayoutHost; import org.apache.flex.core.ILayoutParent; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IMXMLDocument; import org.apache.flex.core.IStrand; import org.apache.flex.core.IBead; @@ -32,27 +32,27 @@ package org.apache.flex.html import org.apache.flex.core.ValuesManager; import org.apache.flex.events.Event; import org.apache.flex.utils.MXMLDataInterpreter; - + /** * Indicates that the children of the container is have been added. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ [Event(name="childrenAdded", type="org.apache.flex.events.Event")] - + /** * Default property */ [DefaultProperty("mxmlContent")] - + /** * The Group class provides a light-weight container for visual elements. By default * the Group does not have a layout, allowing its children to be sized and positioned - * using styles or CSS. - * + * using styles or CSS. + * * @toplevel * @see org.apache.flex.html.beads.layout * @see org.apache.flex.html.supportClasses.ScrollingViewport @@ -60,12 +60,12 @@ package org.apache.flex.html * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 - */ - public class Group extends GroupBase implements ILayoutParent, ILayoutObject + */ + public class Group extends GroupBase implements ILayoutParent, ILayoutView { /** * Constructor. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -75,10 +75,10 @@ package org.apache.flex.html { super(); } - + /** * Returns the ILayoutHost which is its view. From ILayoutParent. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -86,7 +86,7 @@ package org.apache.flex.html */ public function getLayoutHost():ILayoutHost { - return view as ILayoutHost; + return view as ILayoutHost; } } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as index 7caffff..b2cbce7 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as @@ -21,7 +21,7 @@ package org.apache.flex.html import org.apache.flex.core.ContainerBaseStrandChildren; import org.apache.flex.core.IContentViewHost; import org.apache.flex.core.IChild; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IDataProviderItemRendererMapper; import org.apache.flex.core.IFactory; import org.apache.flex.core.IItemRendererClassFactory; @@ -45,15 +45,15 @@ package org.apache.flex.html import org.apache.flex.events.ItemAddedEvent; import org.apache.flex.events.ItemClickedEvent; import org.apache.flex.events.ItemRemovedEvent; - + import org.apache.flex.core.IList; import org.apache.flex.core.IItemRendererParent; import org.apache.flex.core.IItemRendererProvider; import org.apache.flex.core.ListBase; - + /** * Indicates that the initialization of the list is complete. - * + * * @toplevel * @langversion 3.0 * @playerversion Flash 10.2 @@ -61,21 +61,21 @@ package org.apache.flex.html * @productversion FlexJS 0.0 */ [Event(name="initComplete", type="org.apache.flex.events.Event")] - + /** * The change event is dispatched whenever the list's selection changes. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ [Event(name="change", type="org.apache.flex.events.Event")] - + /** * The List class is a component that displays multiple data items. The List uses * the following bead types: - * + * * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and * so forth. * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the list. @@ -83,7 +83,7 @@ package org.apache.flex.html * org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of the itemRenderers. * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders. * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the list. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -138,7 +138,7 @@ package org.apache.flex.html { IRollOverModel(model).rollOverIndex = value; } - + /** * The default height of each cell in every column * @@ -155,9 +155,9 @@ package org.apache.flex.html { presentationModel.rowHeight = value; } - + /** - * The item currently selected. Changing this value also + * The item currently selected. Changing this value also * changes the selectedIndex property. * * @langversion 3.0 @@ -173,11 +173,11 @@ package org.apache.flex.html { ISelectionModel(model).selectedItem = value; } - + /* * UIBase */ - + /** * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement */ @@ -186,7 +186,7 @@ package org.apache.flex.html { super.createElement(); className = 'List'; - + return element; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as index 82b2a7a..81239a6 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as @@ -17,7 +17,7 @@ // //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.html.beads -{ +{ import org.apache.flex.core.BeadViewBase; import org.apache.flex.core.ContainerBase; import org.apache.flex.core.IBead; @@ -28,7 +28,7 @@ package org.apache.flex.html.beads import org.apache.flex.core.IContainerView; import org.apache.flex.core.IContentViewHost; import org.apache.flex.core.ILayoutChild; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.ILayoutHost; import org.apache.flex.core.IParent; import org.apache.flex.core.IParentIUIBase; @@ -48,18 +48,18 @@ package org.apache.flex.html.beads import org.apache.flex.html.supportClasses.ContainerContentArea; import org.apache.flex.html.supportClasses.Viewport; import org.apache.flex.utils.CSSContainerUtils; - + /** * This class creates and manages the contents of a Container. On the ActionScript * side, a Container has a contentView into which the offical children can be * placed. When adding an element that implements IChrome, that element is not * placed into the contentView, but is made a child of the Container directly. - * + * * Containers also have a layout associated with them which controls the size and * placement of the elements in the contentView. When a Container does not have an * explicit size (including a percent size), the content dictates the size of the * Container. - * + * * @viewbead * @langversion 3.0 * @playerversion Flash 10.2 @@ -74,7 +74,7 @@ package org.apache.flex.html.beads * the org.apache.flex.core.ContainerBase classes. * It lets you use some CSS styles to manage the border, background * and padding around the content area. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -84,25 +84,25 @@ package org.apache.flex.html.beads { super(); } - + /** * The sub-element used as the parent of the container's elements. This does not * include the chrome elements. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ - override public function get contentView():ILayoutObject + override public function get contentView():ILayoutView { - return viewport.contentView as ILayoutObject; + return viewport.contentView as ILayoutView; } - + /** * The viewport used to present the content and may display * scroll bars (depending on the actual type of viewport). - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -112,11 +112,11 @@ package org.apache.flex.html.beads { return _viewport; } - + /** * The data model used by the viewport to determine how it should * present the content area. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -126,14 +126,14 @@ package org.apache.flex.html.beads { return _viewportModel; } - + private var _viewportModel:IViewportModel; private var _viewport:IViewport; private var layoutRunning:Boolean; - + /** * Strand setter. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -142,19 +142,19 @@ package org.apache.flex.html.beads override public function set strand(value:IStrand):void { _strand = value; - + createViewport(); - + var chost:IContainer = host as IContainer; chost.$addElement(viewport.contentView); - + super.strand = value; } - + /** * Called when the host is ready to complete its setup (usually after its size has been * determined). - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -163,20 +163,20 @@ package org.apache.flex.html.beads override protected function completeSetup():void { super.completeSetup(); - + // when the first layout is complete, set up listeners for changes // to the childrens' sizes. host.addEventListener("layoutComplete", childrenChangedHandler); - + host.addEventListener("widthChanged", resizeHandler); host.addEventListener("heightChanged", resizeHandler); host.addEventListener("sizeChanged", resizeHandler); } - + /** * Creates the Viewport (or ScrollableViewport) through which the content * area is presented. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -196,7 +196,7 @@ package org.apache.flex.html.beads } } } - + if (viewport == null) { _viewport = _strand.getBeadByType(IViewport) as IViewport; if (viewport == null) { @@ -207,12 +207,12 @@ package org.apache.flex.html.beads _strand.addBead(viewport); } } - } + } } - + /** * Calculate the space taken up by non-content children like a TitleBar in a Panel. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -223,11 +223,11 @@ package org.apache.flex.html.beads var paddingMetrics:Rectangle = CSSContainerUtils.getPaddingMetrics(host); return paddingMetrics; } - + /** * Positions the viewport, then sets any known sizes of the Viewport prior * to laying out its content. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -239,21 +239,21 @@ package org.apache.flex.html.beads var vm:IViewportModel = viewportModel; var hostWidth:Number = host.width; var hostHeight:Number = host.height; - + vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host); - + viewport.setPosition(vm.borderMetrics.left, vm.borderMetrics.top); - + viewport.layoutViewportBeforeContentLayout( host.isWidthSizedToContent() ? NaN : hostWidth - vm.borderMetrics.left - vm.borderMetrics.right, host.isHeightSizedToContent() ? NaN : hostHeight - vm.borderMetrics.top - vm.borderMetrics.bottom); } - + /** * Executes the layout associated with this container. Once the layout has been * run, it may affect the size of the host or may cause the host to present scroll * bars view its viewport. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -262,13 +262,13 @@ package org.apache.flex.html.beads override protected function performLayout(event:Event):void { if (layoutRunning) return; - + layoutRunning = true; - + layoutViewBeforeContentLayout(); - + var host:UIBase = _strand as UIBase; - + var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout; if (layout == null) { var c:Class = ValuesManager.valuesImpl.getValue(host, "iBeadLayout"); @@ -277,16 +277,16 @@ package org.apache.flex.html.beads _strand.addBead(layout); } } - + if (layout) { layout.layout(); } - + layoutViewAfterContentLayout(); - + layoutRunning = false; } - + /** * @private */ @@ -295,7 +295,7 @@ package org.apache.flex.html.beads /** * Adjusts the size of the host, or adds scrollbars to the viewport, after * the layout has been run. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -306,19 +306,19 @@ package org.apache.flex.html.beads if (adjusting) return; adjusting = true; - + super.layoutViewAfterContentLayout(); - + var contentSize:Size = calculateContentSize(); viewport.layoutViewportAfterContentLayout(contentSize); - + adjusting = false; } - + /** * Handles dynamic changes to the host's size by running the layout once * the viewport has been adjusted. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -330,11 +330,11 @@ package org.apache.flex.html.beads performLayout(event); } } - + /** * Whenever children are added, listeners are added to detect changes - * in their size. - * + * in their size. + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -344,7 +344,7 @@ package org.apache.flex.html.beads { var host:UIBase = _strand as UIBase; host.removeEventListener(event.type, childrenChangedHandler); - + var n:Number = contentView.numElements; for (var i:int=0; i < n; i++) { var child:IUIBase = contentView.getElementAt(i) as IUIBase; @@ -353,11 +353,11 @@ package org.apache.flex.html.beads child.addEventListener("sizeChanged", childResizeHandler); } } - + /** * This event handles changes to the size of children of the container by running - * the layout again and adjusting the size of the container or viewport as necessary. - * + * the layout again and adjusting the size of the container or viewport as necessary. + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -368,20 +368,20 @@ package org.apache.flex.html.beads // during this process we don't want the layout to trigger // an endless event chain should any children get resized // by the layout. - if (layoutRunning) return; + if (layoutRunning) return; performLayout(event); } } - + COMPILE::JS public class ContainerView extends GroupView //??implements IParent - { + { private var _viewport:IViewport; - + /** * The viewport used to present the content and may display * scroll bars (depending on the actual type of viewport). - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -391,10 +391,10 @@ package org.apache.flex.html.beads { return _viewport; } - + /** * Strand setter. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -404,9 +404,9 @@ package org.apache.flex.html.beads { _strand = value; super.strand = value; - + var c:Class; - + if (viewport == null) { _viewport = _strand.getBeadByType(IViewport) as IViewport; if (viewport == null) { http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/GroupView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/GroupView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/GroupView.as index 98a6966..170f59b 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/GroupView.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/GroupView.as @@ -17,13 +17,13 @@ // //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.html.beads -{ +{ import org.apache.flex.core.IBead; import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.IBeadView; import org.apache.flex.core.ILayoutChild; import org.apache.flex.core.ILayoutHost; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IStrand; import org.apache.flex.core.IUIBase; import org.apache.flex.core.BeadViewBase; @@ -31,17 +31,17 @@ package org.apache.flex.html.beads import org.apache.flex.core.ValuesManager; import org.apache.flex.events.IEventDispatcher; import org.apache.flex.events.Event; - + COMPILE::SWF { import org.apache.flex.geom.Size; import org.apache.flex.geom.Rectangle; import org.apache.flex.utils.CSSContainerUtils; } - + /** * The GroupView is a bead that manages the layout bead (if any) attached to a Group. This class * also provides support for background and border styles for a Group on the SWF platform. - * + * * @viewbead * @langversion 3.0 * @playerversion Flash 10.2 @@ -55,7 +55,7 @@ package org.apache.flex.html.beads * the org.apache.flex.html.Group class. * It lets you use some CSS styles to manage the border, background * and padding around the content area. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -64,27 +64,27 @@ package org.apache.flex.html.beads public function GroupView() { super(); - + layoutRunning = false; } - + /** * The sub-element used as the parent of the container's elements. This does not * include the chrome elements. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ - public function get contentView():ILayoutObject + public function get contentView():ILayoutView { - return host as ILayoutObject; + return host as ILayoutView; } - + /** * The view that can be resized. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -94,13 +94,13 @@ package org.apache.flex.html.beads { return host; } - - + + private var layoutRunning:Boolean; - + /** * Strand setter. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -110,20 +110,20 @@ package org.apache.flex.html.beads { _strand = value; super.strand = value; - + COMPILE::SWF { displayBackgroundAndBorder(host as UIBase); } - + // listen for initComplete to signal that the strand is set with its size // and beads. host.addEventListener("beadsAdded", beadsAddedHandler); } - + /** * Handles the initComplete event by completing the setup and kicking off the * presentation of the Container. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -137,7 +137,7 @@ package org.apache.flex.html.beads if ((ilc.isHeightSizedToContent() || !isNaN(ilc.explicitHeight) || !isNaN(ilc.percentHeight)) && (ilc.isWidthSizedToContent() || !isNaN(ilc.explicitWidth) || !isNaN(ilc.percentWidth))) { completeSetup(); - + var num:Number = contentView.numElements; if (num > 0) performLayout(event); } @@ -148,11 +148,11 @@ package org.apache.flex.html.beads host.addEventListener("heightChanged", deferredSizeHandler); } } - + /** * Handles the case where the size of the host is not immediately known, usually do * to one of its dimensions being indicated as a percent size. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -164,55 +164,55 @@ package org.apache.flex.html.beads host.removeEventListener("widthChanged", deferredSizeHandler); host.removeEventListener("heightChanged", deferredSizeHandler); completeSetup(); - + var num:Number = contentView.numElements; - if (num > 0) + if (num > 0) { performLayout(event); } } - + /** * Called when the host is ready to complete its setup (usually after its size has been * determined). - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ protected function completeSetup():void - { + { // set up listeners for when children are added or there is a specific request // to perform the layout again. host.addEventListener("childrenAdded", handleChildrenAdded); host.addEventListener("layoutNeeded", performLayout); host.addEventListener("viewCreated", viewCreatedHandler); - + // listen for changes to strand's size and rerun the layout host.addEventListener("sizeChanged", performLayout); host.addEventListener("widthChanged", performLayout); host.addEventListener("heightChanged", performLayout); } - + /** * Handles the viewCreated event by performing the first layout if * there are children already present (ie, from MXML). - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ protected function viewCreatedHandler(event:Event):void - { + { var num:Number = contentView.numElements; - if (num > 0) + if (num > 0) { performLayout(event); } } - + /** * @private */ @@ -227,15 +227,15 @@ package org.apache.flex.html.beads child.addEventListener("sizeChanged", performLayout); } } - + performLayout(event); } - + /** * Executes the layout associated with this container. Once the layout has been * run, it may affect the size of the host or may cause the host to present scroll * bars view its viewport. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -244,11 +244,11 @@ package org.apache.flex.html.beads protected function performLayout(event:Event):void { if (layoutRunning) return; - + layoutRunning = true; - + var host:UIBase = _strand as UIBase; - + var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout; if (layout == null) { var c:Class = ValuesManager.valuesImpl.getValue(host, "iBeadLayout"); @@ -257,23 +257,23 @@ package org.apache.flex.html.beads _strand.addBead(layout); } } - + if (layout) { layout.layout(); } - + COMPILE::SWF { // the HTML/JS side automatically handles changes in child sizes and // will adjust the div if needed. layoutViewAfterContentLayout(); } - + layoutRunning = false; } - + /** * Returns the size of the content area including the padding. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -285,7 +285,7 @@ package org.apache.flex.html.beads var maxWidth:Number = 0; var maxHeight:Number = 0; var num:Number = contentView.numElements; - + for (var i:int=0; i < num; i++) { var child:IUIBase = contentView.getElementAt(i) as IUIBase; if (child == null || !child.visible) continue; @@ -294,23 +294,23 @@ package org.apache.flex.html.beads maxWidth = Math.max(maxWidth, childXMax); maxHeight = Math.max(maxHeight, childYMax); } - + var padding:org.apache.flex.geom.Rectangle = CSSContainerUtils.getPaddingMetrics(this._strand); var border:org.apache.flex.geom.Rectangle = CSSContainerUtils.getBorderMetrics(this._strand); - + // return the content size as the max plus right/bottom padding. the x,y position of // each child is already offset by the left/top padding by the layout algorithm. return new Size(maxWidth + padding.right - (border.left+border.right), maxHeight + padding.bottom - (border.top+border.bottom)); } - + /** * @private */ private var adjusting:Boolean = false; - + /** * Adjusts the size of the host after the layout has been run. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -320,13 +320,13 @@ package org.apache.flex.html.beads protected function layoutViewAfterContentLayout():void { if (adjusting) return; - + var host:UIBase = _strand as UIBase; - + adjusting = true; - + var contentSize:Size = calculateContentSize(); - + if (host.isWidthSizedToContent() && host.isHeightSizedToContent()) { host.setWidthAndHeight(contentSize.width, contentSize.height, true); } @@ -337,11 +337,11 @@ package org.apache.flex.html.beads else if (host.isWidthSizedToContent() && !host.isHeightSizedToContent()) { host.setWidth(contentSize.width, true); - } - + } + adjusting = false; } - + /** * @private */ @@ -358,7 +358,7 @@ package org.apache.flex.html.beads host.addBead( new c() as IBead ); } } - + var borderStyle:String; var borderStyles:Object = ValuesManager.valuesImpl.getValue(host, "border"); if (borderStyles is Array) http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as index 193ea3c..99de1c2 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as @@ -21,7 +21,7 @@ package org.apache.flex.html.beads import org.apache.flex.core.IBeadView; import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.ILayoutChild; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IChild; import org.apache.flex.core.IContainer; import org.apache.flex.core.IParent; @@ -43,16 +43,16 @@ package org.apache.flex.html.beads import org.apache.flex.utils.CSSUtils; import org.apache.flex.html.beads.layouts.VerticalFlexLayout; import org.apache.flex.html.supportClasses.PanelLayoutProxy; - + COMPILE::SWF { import org.apache.flex.core.SimpleCSSStyles; } - + /** - * The Panel class creates the visual elements of the org.apache.flex.html.Panel + * The Panel class creates the visual elements of the org.apache.flex.html.Panel * component. A Panel has a org.apache.flex.html.TitleBar, and content. A * different View, PanelWithControlBarView, can display a ControlBar. - * + * * @viewbead * @langversion 3.0 * @playerversion Flash 10.2 @@ -73,11 +73,11 @@ package org.apache.flex.html.beads { super(); } - + private var _titleBar:TitleBar; - + /** - * The org.apache.flex.html.TitleBar component of the + * The org.apache.flex.html.TitleBar component of the * org.apache.flex.html.Panel. * * @langversion 3.0 @@ -89,7 +89,7 @@ package org.apache.flex.html.beads { return _titleBar; } - + /** * @private */ @@ -97,9 +97,9 @@ package org.apache.flex.html.beads { _titleBar = value; } - + private var _contentArea:Container; - + /** * The content area of the panel. * @@ -116,12 +116,12 @@ package org.apache.flex.html.beads { _contentArea = value; } - + private var _strand:IStrand; - + /** * @copy org.apache.flex.core.IBead#strand - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -130,100 +130,100 @@ package org.apache.flex.html.beads override public function set strand(value:IStrand):void { _strand = value; - + var host:UIBase = UIBase(value); - + if (!_titleBar) { _titleBar = new TitleBar(); _titleBar.id = "panelTitleBar"; - + COMPILE::SWF { _titleBar.percentWidth = 100; - + if (_titleBar.style == null) { _titleBar.style = new SimpleCSSStyles(); } _titleBar.style.flexGrow = 0; _titleBar.style.order = 1; } - + COMPILE::JS { _titleBar.element.style["flex-grow"] = "0"; _titleBar.element.style["order"] = "1"; } } // replace the TitleBar's model with the Panel's model (it implements ITitleBarModel) so that - // any changes to values in the Panel's model that correspond values in the TitleBar will + // any changes to values in the Panel's model that correspond values in the TitleBar will // be picked up automatically by the TitleBar. titleBar.model = host.model; - + if (!_contentArea) { _contentArea = new Container(); _contentArea.id = "panelContent"; _contentArea.className = "PanelContent"; - + COMPILE::SWF { _contentArea.percentWidth = 100; - + if (_contentArea.style == null) { _contentArea.style = new SimpleCSSStyles(); } _contentArea.style.flexGrow = 1; _contentArea.style.order = 2; } - + COMPILE::JS { _contentArea.element.style["flex-grow"] = "1"; _contentArea.element.style["order"] = "2"; _contentArea.element.style["overflow"] = "auto"; // temporary } } - + COMPILE::SWF { IEventDispatcher(value).addEventListener("widthChanged", handleSizeChange); IEventDispatcher(value).addEventListener("heightChanged", handleSizeChange); IEventDispatcher(value).addEventListener("sizeChanged", handleSizeChange); IEventDispatcher(value).addEventListener("childrenAdded", handleChildrenAdded); } - + super.strand = value; - + // If the Panel was given a layout, transfer it to the content area. var layoutBead:IBeadLayout = value.getBeadByType(IBeadLayout) as IBeadLayout; if (layoutBead) { value.removeBead(layoutBead); - + var contentLayout:IBeadLayout = _contentArea.getBeadByType(IBeadLayout) as IBeadLayout; if (contentLayout) { _contentArea.removeBead(contentLayout); } _contentArea.addBead(layoutBead); } - + // If the Panel was given a viewport, transfer it to the content area. var viewportBead:IViewport = value.getBeadByType(IViewport) as IViewport; if (viewportBead) { value.removeBead(viewportBead); _contentArea.addBead(viewportBead); } - + // Now give the Panel its own layout layoutBead = new VerticalFlexLayout(); value.addBead(layoutBead); } - + private var _panelLayoutProxy:PanelLayoutProxy; - + /** * The sub-element used as the parent of the container's elements. This does not * include the chrome elements. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 * @productversion FlexJS 0.8 */ - override public function get contentView():ILayoutObject + override public function get contentView():ILayoutView { // we want to return a proxy for the host which will have numElements, getElementAt, etc. // functions that will use the host.$numElements, host.$getElementAt, etc. functions @@ -232,7 +232,7 @@ package org.apache.flex.html.beads } return _panelLayoutProxy; } - + override protected function completeSetup():void { if (titleBar.parent == null) { @@ -241,24 +241,24 @@ package org.apache.flex.html.beads if (contentArea.parent == null) { (_strand as Panel).$addElement(contentArea as IChild); } - + super.completeSetup(); } - + protected function handleSizeChange(event:Event):void { COMPILE::JS { _titleBar.percentWidth = 100; _contentArea.percentWidth = 100; } - + performLayout(event); } - + private function handleChildrenAdded(event:Event):void { _contentArea.dispatchEvent(new Event("layoutNeeded")); performLayout(event); - } + } } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as index d9ce367..7349bf3 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as @@ -18,12 +18,12 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.html.beads.layouts { - + import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.ILayoutChild; import org.apache.flex.core.ILayoutHost; import org.apache.flex.core.ILayoutParent; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.IParent; import org.apache.flex.core.IStrand; import org.apache.flex.core.IUIBase; @@ -38,7 +38,7 @@ package org.apache.flex.html.beads.layouts * bead. It takes the set of children and lays them out * as specified by CSS properties like left, right, top * and bottom. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -48,7 +48,7 @@ package org.apache.flex.html.beads.layouts { /** * Constructor. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -57,15 +57,15 @@ package org.apache.flex.html.beads.layouts public function BasicLayout() { } - + // the strand/host container is also an ILayoutChild because // can have its size dictated by the host's parent which is // important to know for layout optimization private var host:ILayoutChild; - + /** * @copy org.apache.flex.core.IBead#strand - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -75,7 +75,7 @@ package org.apache.flex.html.beads.layouts { host = value as ILayoutChild; } - + /** * @copy org.apache.flex.core.IBeadLayout#layout * @flexjsignorecoercion org.apache.flex.core.ILayoutHost @@ -86,35 +86,35 @@ package org.apache.flex.html.beads.layouts COMPILE::SWF { var viewBead:ILayoutHost = (host as ILayoutParent).getLayoutHost(); - var contentView:ILayoutObject = viewBead.contentView; - + var contentView:ILayoutView = viewBead.contentView; + var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent(); var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent(); - + var w:Number = hostWidthSizedToContent ? 0 : contentView.width; var h:Number = hostHeightSizedToContent ? 0 : contentView.height; - + var n:int = contentView.numElements; - + var gotMargin:Boolean; var marginLeft:Object; var marginRight:Object; var marginTop:Object; var marginBottom:Object; var margin:Object; - + for (var i:int = 0; i < n; i++) { var child:IUIBase = contentView.getElementAt(i) as IUIBase; if (child == null || !child.visible) continue; - + var left:Number = ValuesManager.valuesImpl.getValue(child, "left"); var right:Number = ValuesManager.valuesImpl.getValue(child, "right"); var top:Number = ValuesManager.valuesImpl.getValue(child, "top"); var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom"); var ww:Number = w; var hh:Number = h; - + margin = ValuesManager.valuesImpl.getValue(child, "margin"); marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left"); marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top"); @@ -128,9 +128,9 @@ package org.apache.flex.html.beads.layouts ml = 0; if (marginRight == "auto") mr = 0; - + var ilc:ILayoutChild = child as ILayoutChild; - + // set the top edge of the child if (!isNaN(left)) { @@ -140,7 +140,7 @@ package org.apache.flex.html.beads.layouts child.x = left+ml; ww -= left + ml; } - + // set the left edge of the child if (!isNaN(top)) { @@ -150,7 +150,7 @@ package org.apache.flex.html.beads.layouts child.y = top+mt; hh -= top + mt; } - + // set the right edge of the child if (!isNaN(right)) { @@ -176,7 +176,7 @@ package org.apache.flex.html.beads.layouts { ilc.setWidth((ww - mr - ml) * ilc.percentWidth/100, false); } - + // set the bottm edge of the child if (!isNaN(bottom)) { @@ -197,40 +197,40 @@ package org.apache.flex.html.beads.layouts child.y = h - bottom - child.height - mb; } } - } + } else if (ilc != null && !isNaN(ilc.percentHeight) && !hostHeightSizedToContent) { ilc.setHeight((hh - mt - mb) * ilc.percentHeight/100, false); } } - + host.dispatchEvent( new Event("layoutComplete") ); - + return true; - + } - + COMPILE::JS { var i:int var n:int; - + var viewBead:ILayoutHost = (host as ILayoutParent).getLayoutHost(); - var contentView:ILayoutObject = viewBead.contentView; + var contentView:ILayoutView = viewBead.contentView; n = contentView.numElements; - + // host must have either have position:absolute or position:relative if (contentView.element.style.position != "absolute" && contentView.element.style.position != "relative") { contentView.element.style.position = "relative"; } - + // each child must have position:absolute for BasicLayout to work for (i=0; i < n; i++) { var child:UIBase = contentView.getElementAt(i) as UIBase; child.positioner.style.position = "absolute"; } - + host.dispatchEvent( new Event("layoutComplete") ); return true; } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5300c4e9/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as index 24e3ef0..a080035 100644 --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as @@ -17,10 +17,10 @@ // //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.html.beads.layouts -{ +{ import org.apache.flex.core.IBeadLayout; import org.apache.flex.core.ILayoutHost; - import org.apache.flex.core.ILayoutObject; + import org.apache.flex.core.ILayoutView; import org.apache.flex.core.ILayoutParent; import org.apache.flex.core.IParentIUIBase; import org.apache.flex.core.ISelectableItemRenderer; @@ -35,13 +35,13 @@ package org.apache.flex.html.beads.layouts import org.apache.flex.html.List; import org.apache.flex.html.beads.ButtonBarView; import org.apache.flex.html.beads.models.ButtonBarModel; - + /** - * The ButtonBarLayout class bead sizes and positions the org.apache.flex.html.Button - * elements that make up a org.apache.flex.html.ButtonBar. This bead arranges the Buttons + * The ButtonBarLayout class bead sizes and positions the org.apache.flex.html.Button + * elements that make up a org.apache.flex.html.ButtonBar. This bead arranges the Buttons * horizontally and makes them all the same width unless the buttonWidths property has been set in which case * the values stored in that array are used. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -51,7 +51,7 @@ package org.apache.flex.html.beads.layouts { /** * constructor. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -60,12 +60,12 @@ package org.apache.flex.html.beads.layouts public function ButtonBarLayout() { } - + private var _strand:IStrand; - + /** * @copy org.apache.flex.core.IBead#strand - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -75,14 +75,14 @@ package org.apache.flex.html.beads.layouts { _strand = value; } - + private var _widthType:Number = ButtonBarModel.PIXEL_WIDTHS; private var _buttonWidths:Array = null; - + /** * An array of widths (Number), one per button. These values supersede the * default of equally-sized buttons. - * + * * @langversion 3.0 * @playerversion Flash 10.2 * @playerversion AIR 2.6 @@ -96,39 +96,39 @@ package org.apache.flex.html.beads.layouts { _buttonWidths = value; } - + /** * @copy org.apache.flex.core.IBeadLayout#layout */ public function layout():Boolean { - var layoutHost:ILayoutHost = (_strand as ILayoutParent).getLayoutHost(); - var contentView:ILayoutObject = layoutHost.contentView; - + var layoutHost:ILayoutHost = (_strand as ILayoutParent).getLayoutHost(); + var contentView:ILayoutView = layoutHost.contentView; + var model:ButtonBarModel = _strand.getBeadByType(ButtonBarModel) as ButtonBarModel; if (model) { buttonWidths = model.buttonWidths; _widthType = model.widthType; } - + var n:int = contentView.numElements; var realN:int = n; - + COMPILE::JS { contentView.element.style["display"] = "flex"; contentView.element.style["flex-flow"] = "row"; } - + for (var j:int=0; j < n; j++) { var child:IUIBase = contentView.getElementAt(j) as IUIBase; if (child == null || !child.visible) realN--; } - + var xpos:Number = 0; var useWidth:Number = contentView.width / realN; var useHeight:Number = contentView.height; - + for (var i:int=0; i < n; i++) { var ir:ISelectableItemRenderer = contentView.getElementAt(i) as ISelectableItemRenderer; @@ -139,7 +139,7 @@ package org.apache.flex.html.beads.layouts if (buttonWidths) { var widthValue:* = buttonWidths[i]; - + if (_widthType == ButtonBarModel.PIXEL_WIDTHS) { if (widthValue != null) UIBase(ir).width = Number(widthValue); } @@ -153,12 +153,12 @@ package org.apache.flex.html.beads.layouts UIBase(ir).width = useWidth; } } - + COMPILE::JS { // otherwise let the flexbox layout handle matters on its own. if (buttonWidths) { var widthValue:* = buttonWidths[i]; - + if (_widthType == ButtonBarModel.PIXEL_WIDTHS) { if (widthValue != null) UIBase(ir).width = Number(widthValue); } @@ -174,9 +174,9 @@ package org.apache.flex.html.beads.layouts } xpos += UIBase(ir).width; } - + IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") ); - + return true; } }
