This is an automated email from the ASF dual-hosted git repository. aharui pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit f94ffc651cc4a9dbf08b7f2ebbe7204584265829 Author: Alex Harui <[email protected]> AuthorDate: Mon Sep 10 14:27:47 2018 -0700 changes to get a clean compile of a subset of TDF that Alina uses --- .../src/main/resources/spark-royale-manifest.xml | 3 + .../src/main/royale/spark/components/DataGroup.as | 26 +- .../royale/spark/components/RichEditableText.as | 44 +- .../src/main/royale/spark/components/TextArea.as | 10 +- .../src/main/royale/spark/components/TileGroup.as | 685 +++++++++++++++++++++ .../spark/components/supportClasses/GroupBase.as | 39 +- .../src/main/royale/spark/layouts/ColumnAlign.as | 66 ++ .../src/main/royale/spark/layouts/RowAlign.as | 66 ++ .../src/main/royale/spark/layouts/TileLayout.as | 8 +- .../main/royale/spark/layouts/TileOrientation.as | 56 ++ 10 files changed, 933 insertions(+), 70 deletions(-) diff --git a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml index 4bc5d2c..97fe44b 100644 --- a/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml +++ b/frameworks/projects/SparkRoyale/src/main/resources/spark-royale-manifest.xml @@ -55,6 +55,7 @@ <component id="GroupBase" class="spark.components.supportClasses.GroupBase"/> <component id="HGroup" class="spark.components.HGroup"/> <component id="VGroup" class="spark.components.VGroup"/> + <component id="TileGroup" class="spark.components.TileGroup"/> <component id="ListBase" class="spark.components.supportClasses.ListBase"/> <component id="ItemRenderer" class="spark.components.supportClasses.ItemRenderer"/> <component id="GradientEntry" class="mx.graphics.GradientEntry" lookupOnly="true"/> @@ -71,8 +72,10 @@ <component id="BitmapImage" class="spark.primitives.BitmapImage"/> <component id="Image" class="spark.components.Image"/> <component id="HorizontalLayout" class="spark.layouts.HorizontalLayout"/> + <component id="TileLayout" class="spark.layouts.TileLayout"/> <component id="Module" class="mx.modules.Module" lookupOnly="true"/> + <component id="ArrayCollection" class="mx.collections.ArrayCollection" lookupOnly="true"/> <!-- Text Layout Framework (TLF) --> <component id="a" class="org.apache.royale.textLayout.elements.LinkElement" lookupOnly="true"/> diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DataGroup.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DataGroup.as index 1a378b7..d70b9ff 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DataGroup.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/DataGroup.as @@ -26,7 +26,7 @@ import flash.geom.Rectangle; import flash.utils.Dictionary; import flash.utils.getQualifiedClassName; */ -/* import mx.collections.IList; +/* import mx.core.IDataRenderer; import mx.core.IInvalidating; import mx.core.ILayoutElement; @@ -42,13 +42,14 @@ import spark.events.RendererExistenceEvent; */ import mx.core.IFactory; import mx.core.IVisualElement; - +import mx.collections.IList; import spark.components.supportClasses.GroupBase; import mx.core.IUIComponent; import mx.core.mx_internal; use namespace mx_internal; // for mx_internal property contentChangeDelta +import org.apache.royale.core.ISelectionModel; /** * Dispatched when a renderer is added to this dataGroup. @@ -613,27 +614,20 @@ public class DataGroup extends GroupBase * @playerversion Flash 10 * @playerversion AIR 1.5 * @productversion Flex 4 + * @royaleignorecoercion mx.collections.IList */ - /* public function get dataProvider():IList + public function get dataProvider():IList { - return _dataProvider; + return (model as ISelectionModel).dataProvider as IList; } - */ /** - * @private + * @royaleignorecoercion org.apache.royale.core.ISelectionModel */ - /* public function set dataProvider(value:IList):void + public function set dataProvider(value:IList):void { - if (_dataProvider == value) - return; - - removeDataProviderListener(); - _dataProvider = value; // listener will be added by commitProperties() - dataProviderChanged = true; - invalidateProperties(); - dispatchEvent(new Event("dataProviderChanged")); + (model as ISelectionModel).dataProvider = value; } - */ + /** * @private * Used below for sorting the virtualRendererIndices Vector. diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichEditableText.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichEditableText.as index f412763..72fe595 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichEditableText.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/RichEditableText.as @@ -80,7 +80,6 @@ package spark.components import mx.core.IIMESupport; import mx.core.ISystemCursorClient; import mx.core.mx_internal; - import mx.events.FlexEvent; import mx.managers.IFocusManager; import mx.utils.StringUtil; @@ -94,6 +93,7 @@ package spark.components use namespace mx_internal; use namespace tlf_internal; */ + import mx.events.FlexEvent; import mx.core.UIComponent; import mx.managers.IFocusManagerComponent; @@ -140,7 +140,7 @@ package spark.components * @playerversion AIR 1.5 * @productversion Royale 0.9.4 */ - // [Event(name="change", type="spark.events.TextOperationEvent")] + [Event(name="change", type="spark.events.TextOperationEvent")] /** * Dispatched when the user presses the Enter key, @@ -1247,7 +1247,7 @@ package spark.components /** * @private */ - //private var _content:Object; + private var _content:Object; /** * @private @@ -1269,7 +1269,7 @@ package spark.components * Similar metadata on TLF classes causes the same rules to apply * within <p>, <span>, etc. */ - //[RichTextContent] + [RichTextContent] /** * This property is intended for use in MXML at compile time; @@ -1307,15 +1307,15 @@ package spark.components * @playerversion AIR 1.5 * @productversion Royale 0.9.4 */ - /* public function get content():Object + public function get content():Object { - return textFlow; - } */ + return _content; //return textFlow; + } /** * @private */ - /* public function set content(value:Object):void + public function set content(value:Object):void { // Treat setting the 'content' to null // as if 'text' were being set to the empty String @@ -1330,23 +1330,25 @@ package spark.components return; _content = value; - contentChanged = true; - source = "content"; + //contentChanged = true; + //source = "content"; // Of 'text', 'textFlow', and 'content', the last one set wins. - textChanged = false; - textFlowChanged = false; + //textChanged = false; + //textFlowChanged = false; // The other two are now invalid and must be recalculated when needed. _text = null; - _textFlow = null; - + //_textFlow = null; + + /* invalidateProperties(); invalidateSize(); invalidateDisplayList(); + */ dispatchEvent(new FlexEvent(FlexEvent.VALUE_COMMIT)); - } */ + } //---------------------------------- // displayAsPassword @@ -1400,7 +1402,7 @@ package spark.components /** * @private */ - //private var _editable:Boolean = true; + private var _editable:Boolean = true; /** * @private @@ -1429,25 +1431,27 @@ package spark.components * @playerversion AIR 1.5 * @productversion Royale 0.9.4 */ - /* public function get editable():Boolean + public function get editable():Boolean { return _editable; - } */ + } /** * @private */ - /* public function set editable(value:Boolean):void + public function set editable(value:Boolean):void { if (value == _editable) return; _editable = value; + /* editableChanged = true; invalidateProperties(); invalidateDisplayList(); - } */ + */ + } //---------------------------------- // editingMode diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextArea.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextArea.as index 3008dad..f716a60 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextArea.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TextArea.as @@ -20,9 +20,9 @@ package spark.components { +import org.apache.royale.textLayout.elements.TextFlow; /* import flash.events.Event; -import flashx.textLayout.elements.TextFlow; import flashx.textLayout.formats.TextLayoutFormat; import mx.core.ScrollPolicy; @@ -563,10 +563,12 @@ public class TextArea extends SkinnableTextBase * @playerversion AIR 1.5 * @productversion Royale 0.9.4 */ - /* public function get textFlow():TextFlow + public function get textFlow():TextFlow { - return getTextFlow(); - } */ + trace("TextArea textFlow not implemented"); + //return getTextFlow(); + return null; + } /** * @private diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TileGroup.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TileGroup.as new file mode 100644 index 0000000..73c0bae --- /dev/null +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/TileGroup.as @@ -0,0 +1,685 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 spark.components +{ +import org.apache.royale.events.Event; +import spark.layouts.TileLayout; +import spark.layouts.supportClasses.LayoutBase; + +//[IconFile("TileGroup.png")] + +[Exclude(name="layout", kind="property")] + +/** + * The TileGroup container is an instance of the Group container + * that uses the TileLayout class. + * Do not modify the <code>layout</code> property. + * Instead, use the properties of the TileGroup class to modify the + * characteristics of the TileLayout class. + * + * <p>The TileGroup container has the following default characteristics:</p> + * <table class="innertable"> + * <tr><th>Characteristic</th><th>Description</th></tr> + * <tr><td>Default size</td><td>Large enough to display its children</td></tr> + * <tr><td>Minimum size</td><td>0 pixels</td></tr> + * <tr><td>Maximum size</td><td>10000 pixels wide and 10000 pixels high</td></tr> + * </table> + * + * @mxml + * + * <p>The <code><s:TileGroup></code> tag inherits all of the tag + * attributes of its superclass and adds the following tag attributes:</p> + * + * <pre> + * <s:TileGroup + * <strong>Properties</strong> + * columnAlign="left" + * columnCount="-1" + * columnWidth="0" + * horizontalAlign="justify" + * horizontalGap="6" + * orientation="rows" + * padding="0" + * paddingBottom="0" + * paddingLeft="0" + * paddingRight="0" + * paddingTop="0" + * requestedColumnCount"-1" + * requestedRowCount="-1" + * rowAlign="top" + * rowCount="-1" + * rowHeight="0" + * verticalAlign="justify" + * verticalGap="6" + * /> + * </pre> + * + * @see spark.layouts.TileLayout + * @includeExample examples/TileGroupExample.mxml + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ +public class TileGroup extends Group +{ +// include "../core/Version.as"; + + /** + * Constructor. + * Initializes the <code>layout</code> property to an instance of + * the TileLayout class. + * + * @see spark.layouts.TileLayout + * @see spark.components.HGroup + * @see spark.components.VGroup + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function TileGroup():void + { + super(); + super.layout = new TileLayout(); + } + + private function get tileLayout():TileLayout + { + return TileLayout(layout); + } + + //-------------------------------------------------------------------------- + // + // Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // columnAlign + //---------------------------------- + + [Inspectable(category="General", enumeration="left,justifyUsingGap,justifyUsingWidth", defaultValue="left")] + + /** + * @copy spark.layouts.TileLayout#columnAlign + * + * @default "left" + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get columnAlign():String + { + return tileLayout.columnAlign; + } + + /** + * @private + */ + public function set columnAlign(value:String):void + { + tileLayout.columnAlign = value; + } + + //---------------------------------- + // columnCount + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General")] + + /** + * @copy spark.layouts.TileLayout#columnCount + * + * @default -1 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get columnCount():int + { + return tileLayout.columnCount; + } + + //---------------------------------- + // columnWidth + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General", minValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#columnWidth + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get columnWidth():int + { + return tileLayout.columnWidth; + } + + /** + * @private + */ + public function set columnWidth(value:int):void + { + tileLayout.columnWidth = value; + } + + //---------------------------------- + // horizontalAlign + //---------------------------------- + + [Inspectable(category="General", enumeration="left,right,center,justify", defaultValue="justify")] + + /** + * @copy spark.layouts.TileLayout#horizontalAlign + * + * @default "justify" + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get horizontalAlign():String + { + return tileLayout.horizontalAlign; + } + + /** + * @private + */ + public function set horizontalAlign(value:String):void + { + tileLayout.horizontalAlign = value; + } + + //---------------------------------- + // horizontalGap + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General", defaultValue="6")] + + /** + * @copy spark.layouts.TileLayout#horizontalGap + * + * @default 6 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get horizontalGap():int + { + return tileLayout.horizontalGap; + } + + /** + * @private + */ + public function set horizontalGap(value:int):void + { + tileLayout.horizontalGap = value; + } + + //---------------------------------- + // orientation + //---------------------------------- + + [Inspectable(category="General", enumeration="rows,columns", defaultValue="rows")] + + /** + * @copy spark.layouts.TileLayout#orientation + * + * @default "rows" + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get orientation():String + { + return tileLayout.orientation; + } + + /** + * @private + */ + public function set orientation(value:String):void + { + tileLayout.orientation = value; + } + + //---------------------------------- + // padding + //---------------------------------- + + [Inspectable(category="General", defaultValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#padding + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get padding():Number + { + return tileLayout.padding; + } + + /** + * @private + */ + public function set padding(value:Number):void + { + tileLayout.padding = value; + } + + //---------------------------------- + // paddingLeft + //---------------------------------- + + [Inspectable(category="General", defaultValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#paddingLeft + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + override public function get paddingLeft():Number + { + return tileLayout.paddingLeft; + } + + /** + * @private + */ + override public function set paddingLeft(value:Number):void + { + tileLayout.paddingLeft = value; + } + + //---------------------------------- + // paddingRight + //---------------------------------- + + [Inspectable(category="General", defaultValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#paddingRight + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + override public function get paddingRight():Number + { + return tileLayout.paddingRight; + } + + /** + * @private + */ + override public function set paddingRight(value:Number):void + { + tileLayout.paddingRight = value; + } + + //---------------------------------- + // paddingTop + //---------------------------------- + + [Inspectable(category="General", defaultValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#paddingTop + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + override public function get paddingTop():Number + { + return tileLayout.paddingTop; + } + + /** + * @private + */ + override public function set paddingTop(value:Number):void + { + tileLayout.paddingTop = value; + } + + //---------------------------------- + // paddingBottom + //---------------------------------- + + [Inspectable(category="General", defaultValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#paddingBottom + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + override public function get paddingBottom():Number + { + return tileLayout.paddingBottom; + } + + /** + * @private + */ + override public function set paddingBottom(value:Number):void + { + tileLayout.paddingBottom = value; + } + + //---------------------------------- + // requestedColumnCount + //---------------------------------- + + [Inspectable(category="General", minValue="-1")] + + /** + * @copy spark.layouts.TileLayout#requestedColumnCount + * + * @default -1 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get requestedColumnCount():int + { + return tileLayout.requestedColumnCount; + } + + /** + * @private + */ + public function set requestedColumnCount(value:int):void + { + tileLayout.requestedColumnCount = value; + } + + //---------------------------------- + // requestedRowCount + //---------------------------------- + + [Inspectable(category="General", minValue="-1")] + + /** + * @copy spark.layouts.TileLayout#requestedRowCount + * + * @default -1 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get requestedRowCount():int + { + return tileLayout.requestedRowCount; + } + + /** + * @private + */ + public function set requestedRowCount(value:int):void + { + tileLayout.requestedRowCount = value; + } + + //---------------------------------- + // rowAlign + //---------------------------------- + + [Inspectable(category="General", enumeration="top,justifyUsingGap,justifyUsingHeight", defaultValue="top")] + + /** + * @copy spark.layouts.TileLayout#rowAlign + * + * @default "top" + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get rowAlign():String + { + return tileLayout.rowAlign; + } + + /** + * @private + */ + public function set rowAlign(value:String):void + { + tileLayout.rowAlign = value; + } + + //---------------------------------- + // rowCount + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General")] + + /** + * @copy spark.layouts.TileLayout#rowCount + * + * @default -1 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get rowCount():int + { + return tileLayout.rowCount; + } + + //---------------------------------- + // rowHeight + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General", minValue="0.0")] + + /** + * @copy spark.layouts.TileLayout#rowHeight + * + * @default 0 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get rowHeight():int + { + return tileLayout.rowHeight; + } + + /** + * @private + */ + public function set rowHeight(value:int):void + { + tileLayout.rowHeight = value; + } + + //---------------------------------- + // verticalAlign + //---------------------------------- + + [Inspectable(category="General", enumeration="top,bottom,middle,justify", defaultValue="justify")] + + /** + * @copy spark.layouts.TileLayout#verticalAlign + * + * @default "justify" + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get verticalAlign():String + { + return tileLayout.verticalAlign; + } + + /** + * @private + */ + public function set verticalAlign(value:String):void + { + tileLayout.verticalAlign = value; + } + + //---------------------------------- + // verticalGap + //---------------------------------- + + [Bindable("propertyChange")] + [Inspectable(category="General", defaultValue="6")] + + /** + * @copy spark.layouts.TileLayout#verticalGap + * + * @default 6 + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public function get verticalGap():int + { + return tileLayout.verticalGap; + } + + /** + * @private + */ + public function set verticalGap(value:int):void + { + tileLayout.verticalGap = value; + } + + //-------------------------------------------------------------------------- + // + // Overridden Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // layout + //---------------------------------- + + /** + * @private + override public function set layout(value:LayoutBase):void + { + throw(new Error(resourceManager.getString("components", "layoutReadOnly"))); + } + */ + + //-------------------------------------------------------------------------- + // + // Event Handlers + // + //-------------------------------------------------------------------------- + + /** + * @private + override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void + { + if (type == "propertyChange") + { + if (!hasEventListener(type)) + tileLayout.addEventListener(type, redispatchHandler); + } + super.addEventListener(type, listener, useCapture, priority, useWeakReference) + } + */ + + /** + * @private + override public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void + { + super.removeEventListener(type, listener, useCapture); + if (type == "propertyChange") + { + if (!hasEventListener(type)) + tileLayout.removeEventListener(type, redispatchHandler); + } + } + */ + + private function redispatchHandler(event:Event):void + { + dispatchEvent(event); + } + +} +} diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as index ef4ff64..51aa21e 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/components/supportClasses/GroupBase.as @@ -728,7 +728,7 @@ public class GroupBase extends UIComponent implements ILayoutParent // clipAndEnableScrolling //---------------------------------- - //private var clipAndEnableScrollingExplicitlySet:Boolean = false; + private var _clipAndEnableScrolling:Boolean = false; /** * @copy spark.core.IViewport#clipAndEnableScrolling @@ -740,45 +740,32 @@ public class GroupBase extends UIComponent implements ILayoutParent * @playerversion AIR 1.5 * @productversion Royale 0.9.4 */ - /* public function get clipAndEnableScrolling():Boolean + public function get clipAndEnableScrolling():Boolean { - if (_layout) - { - return _layout.clipAndEnableScrolling; - } - else if (_layoutProperties && - _layoutProperties.clipAndEnableScrolling !== undefined) + COMPILE::JS { - return _layoutProperties.clipAndEnableScrolling; + return element.style.overflow == "auto"; } - else + COMPILE::SWF { - return false; + return _clipAndEnableScrolling; } - } */ + } /** * @private */ - /* public function set clipAndEnableScrolling(value:Boolean):void + public function set clipAndEnableScrolling(value:Boolean):void { - clipAndEnableScrollingExplicitlySet = true; - if (_layout) + COMPILE::JS { - _layout.clipAndEnableScrolling = value; + element.style.overflow = value ? "auto" : "none"; } - else if (_layoutProperties) - { - _layoutProperties.clipAndEnableScrolling = value; - } - else + COMPILE::SWF { - _layoutProperties = {clipAndEnableScrolling: value}; + _clipAndEnableScrolling = value; } - - // clipAndEnableScrolling affects measured minimum size - invalidateSize(); - } */ + } //---------------------------------- // scrollRect diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/ColumnAlign.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/ColumnAlign.as new file mode 100644 index 0000000..c78360f --- /dev/null +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/ColumnAlign.as @@ -0,0 +1,66 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 spark.layouts +{ + +/** + * The ColumnAlign class defines the possible values for the + * <code>columnAlign</code> property of the TileLayout class. + * + * @see TileLayout#columnAlign + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ +public final class ColumnAlign +{ + /** + * Do not justify the rows. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const LEFT:String = "left"; + + /** + * Justify the rows by increasing the vertical gap. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const JUSTIFY_USING_GAP:String = "justifyUsingGap"; + + /** + * Justify the rows by increasing the row height. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const JUSTIFY_USING_WIDTH:String = "justifyUsingWidth"; +} +} diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/RowAlign.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/RowAlign.as new file mode 100644 index 0000000..5c9c460 --- /dev/null +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/RowAlign.as @@ -0,0 +1,66 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 spark.layouts +{ + +/** + * The RowAlign class defines the possible values for the + * <code>rowAlign</code> property of the TileLayout class. + * + * @see TileLayout#rowAlign + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ +public final class RowAlign +{ + /** + * Do not justify the rows. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const TOP:String = "top"; + + /** + * Justify the rows by increasing the vertical gap. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const JUSTIFY_USING_GAP:String = "justifyUsingGap"; + + /** + * Justify the rows by increasing the row height. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const JUSTIFY_USING_HEIGHT:String = "justifyUsingHeight"; +} +} diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileLayout.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileLayout.as index c13748e..08f6e5f 100644 --- a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileLayout.as +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileLayout.as @@ -1344,7 +1344,7 @@ public class TileLayout extends LayoutBase _numElementsCached = count; for (var i:int = 0; i < count; i++) { - var el:ILayoutElement = layoutTarget.getElementAt(i); + var el:ILayoutElement = layoutTarget.getElementAt(i) as ILayoutElement; if (!el || !el.includeInLayout) { _numElementsCached--; @@ -1391,7 +1391,7 @@ public class TileLayout extends LayoutBase for (var i:int = 0; i < count; i++) { - var el:ILayoutElement = layoutTarget.getElementAt(i); + var el:ILayoutElement = layoutTarget.getElementAt(i) as ILayoutElement; if (!el || !el.includeInLayout) _numElementsCached--; } @@ -1484,7 +1484,7 @@ public class TileLayout extends LayoutBase i = visibleEndIndex; continue; } - var el:ILayoutElement = layoutTarget.getElementAt(i); + var el:ILayoutElement = layoutTarget.getElementAt(i) as ILayoutElement; if (!el) continue; if (el is IVisualElement) @@ -2009,7 +2009,7 @@ public class TileLayout extends LayoutBase IVisualElement(el).visible = true; } else - el = layoutTarget.getElementAt(index); + el = layoutTarget.getElementAt(index) as ILayoutElement; if (!el || !el.includeInLayout) continue; diff --git a/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileOrientation.as b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileOrientation.as new file mode 100644 index 0000000..7921c06 --- /dev/null +++ b/frameworks/projects/SparkRoyale/src/main/royale/spark/layouts/TileOrientation.as @@ -0,0 +1,56 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 spark.layouts +{ + +/** + * The TileOrientation class defines the possible values for the + * <code>orientation</code> property of the TileLayout class. + * + * @see TileLayout#orientation + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ +public final class TileOrientation +{ + /** + * Arranges elements row by row. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const ROWS:String = "rows"; + + /** + * Arranges elements column by column. + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4 + */ + public static const COLUMNS:String = "columns"; +} +} \ No newline at end of file
