Repository: flex-asjs Updated Branches: refs/heads/develop a3327854e -> 95cb140a8
Adding new ContainerTest to the examples. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/95cb140a Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/95cb140a Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/95cb140a Branch: refs/heads/develop Commit: 95cb140a872a376d0465c9c2898fd9589eafb97e Parents: a332785 Author: Peter Ent <[email protected]> Authored: Thu Jul 23 16:41:13 2015 -0400 Committer: Peter Ent <[email protected]> Committed: Thu Jul 23 16:41:13 2015 -0400 ---------------------------------------------------------------------- examples/ContainerTest/build.xml | 48 +++++ examples/ContainerTest/src/ContainerTest.mxml | 39 ++++ examples/ContainerTest/src/MyInitialView.mxml | 180 +++++++++++++++++++ .../ContainerTest/src/assets/logo_orange.png | Bin 0 -> 33897 bytes .../ContainerTest/src/models/ProductsModel.as | 44 +++++ examples/ContainerTest/src/products/Product.as | 43 +++++ .../src/products/ProductItemRenderer.as | 83 +++++++++ examples/ContainerTest/src/smallbluerect.jpg | Bin 0 -> 13500 bytes examples/ContainerTest/src/smallgreenrect.jpg | Bin 0 -> 13542 bytes examples/ContainerTest/src/smallorangerect.gif | Bin 0 -> 821 bytes examples/ContainerTest/src/smallorangerect.jpg | Bin 0 -> 13571 bytes examples/ContainerTest/src/smallpurplerect.jpg | Bin 0 -> 13517 bytes examples/ContainerTest/src/smallredrect.jpg | Bin 0 -> 13477 bytes examples/ContainerTest/src/smallyellowrect.jpg | Bin 0 -> 13598 bytes examples/build.xml | 2 + .../flex/html/beads/models/ViewportModel.js | 162 +++++++++++++++++ .../html/supportClasses/ContainerContentArea.js | 60 +++++++ 17 files changed, 661 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/build.xml ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/build.xml b/examples/ContainerTest/build.xml new file mode 100644 index 0000000..4c39a58 --- /dev/null +++ b/examples/ContainerTest/build.xml @@ -0,0 +1,48 @@ +<?xml version="1.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. + +--> + + +<project name="containertest" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="ContainerTest" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <property name="FALCON_HOME" value="${env.FALCON_HOME}"/> + <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/> + <property name="GOOG_HOME" value="${env.GOOG_HOME}"/> + + <include file="${basedir}/../build_example.xml" /> + +<!-- temp remove build_example.compilejs --> + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + + + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/ContainerTest.mxml ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/ContainerTest.mxml b/examples/ContainerTest/src/ContainerTest.mxml new file mode 100644 index 0000000..5a101ef --- /dev/null +++ b/examples/ContainerTest/src/ContainerTest.mxml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--- +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +--> +<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:models="models.*" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:beads="org.apache.flex.html.beads.*" + > + + <js:valuesImpl> + <js:SimpleCSSValuesImpl /> + </js:valuesImpl> + + <js:model> + <models:ProductsModel /> + </js:model> + + <js:initialView> + <local:MyInitialView /> + </js:initialView> +</js:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/MyInitialView.mxml b/examples/ContainerTest/src/MyInitialView.mxml new file mode 100644 index 0000000..70f7c4e --- /dev/null +++ b/examples/ContainerTest/src/MyInitialView.mxml @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--- +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +--> +<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:models="models.*" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:controller="controller.*" + xmlns:views="views.*" + xmlns:beads="org.apache.flex.html.beads.*" xmlns:trial="trial.*" + > + + <fx:Style> + @namespace js "library://ns.apache.org/flexjs/basic"; + @namespace sample "products.*"; + + /* use className="productList" on the List element in place of itemRenderer if you want to specify + * the itemRenderer in a style definition along with other settings. + */ + .productList { + IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData"); + IItemRenderer: ClassReference("products.ProductItemRenderer"); + } + + sample|ProductItemRenderer { + height: 50; + IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController"); + } + + .Container1 { + background-color: #FFCC22; + padding: 2px; + } + + .Panel1 { + background-color: #CCFFCC; + padding: 2px; + } + + .Container2 { + background-color: #AADDAA; + } + + </fx:Style> + + <fx:Script> + <![CDATA[ + import org.apache.flex.html.Label; + + private function addAChild() : void + { + var label1:Label = new Label(); + label1.text = "Item: " + Math.random(); + label1.height = 50; + vcon.addElement(label1); + + var label2:Label = new Label(); + label2.text = "Panel: " + Math.random(); + label2.height = 50; + panel1.addElement(label2); + + var label3:Label = new Label(); + label3.text = "Random: " + Math.round(Math.random()*100); + tiler.addElement(label3); + } + ]]> + </fx:Script> + <js:beads> + <js:MXMLBeadViewBaseDataBinding /> + </js:beads> + + <!-- FIRST COLUMN --> + + <js:HContainer id="hcon" x="20" y="40" width="400" height="100" className="Container1"> + <js:Label text="Line 1" height="30" /> + <js:Label text="Line 2" height="30" /> + <js:Label text="Line 3 is wider" height="30" /> + <js:Label text="Line 4" height="30" /> + <js:Label text="Line 5" height="30" /> + <js:Label text="Line 6" height="30" /> + </js:HContainer> + + <js:TextButton text="Add Child" x="20" y="180" click="addAChild()" /> + + <js:VContainer id="vcon" x="20" y="220" width="200" height="275" className="Container1"> + <js:beads> + <js:ScrollingViewport /> + </js:beads> + <js:Label text="Line 1" height="30" /> + <js:Label text="Line 2" height="30" /> + <js:Label text="Line 3 is wider" height="30" /> + <js:Label text="Line 4" height="30" /> + <js:Label text="Line 5" height="30" /> + <js:Label text="Line 6" height="30" /> + </js:VContainer> + + <js:Container id="tiler" x="20" y="530" width="400" height="200" className="Container2"> + <js:beads> + <js:TileLayout numColumns="4" rowHeight="50" /> + <js:ScrollingViewport /> + </js:beads> + <js:TextButton text="Button 1" /> + <js:TextButton text="Button 2" /> + <js:TextButton text="Button 3" /> + <js:TextButton text="Button 4" /> + <js:TextButton text="Button 5" /> + <js:TextButton text="Button 6" /> + <js:TextButton text="Button 7" /> + <js:TextButton text="Button 8" /> + <js:TextButton text="Button 9" /> + <js:TextButton text="Button 10" /> + <js:TextButton text="Button 11" /> + <!--<js:TextButton text="Button 12" /> + <js:TextButton text="Button 13" /> + <js:TextButton text="Button 14" /> + <js:TextButton text="Button 15" /> + <js:TextButton text="Button 16" /> + <js:TextButton text="Button 17" />--> + </js:Container> + + <!-- SECOND COLUMN --> + + <js:List id="productList" itemRenderer="products.ProductItemRenderer" className="productList" + x="500" y="40" width="200" height="150"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="productList" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:List> + + <js:ButtonBar id="bbar" x="500" y="240" width="400" height="30"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="productList" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:ButtonBar> + + <js:Panel id="panel1" title="Hello World" x="500" y="300" width="400" height="300" showCloseButton="true" className="Panel1"> + <js:beads> + <js:ScrollingViewport /> + <js:VerticalLayout /> + </js:beads> + <js:Label text="Inside Panel" /> + <js:Container id="nested" width="100%" height="50" className="Container2"> + <js:Label text="Inside Nested" /> + </js:Container> + <js:Label text="Bottom of Panel 1" height="30" /> + <js:Label text="Bottom of Panel 2" height="30" /> + <js:Label text="Bottom of Panel 3" height="30" /> + <js:Label text="Bottom of Panel 4" height="30" /> + <!--<js:Label text="Bottom of Panel 5" height="30" /> + <js:Label text="Bottom of Panel 6" height="30" /> + <js:Label text="Bottom of Panel 7" height="30" /> + <js:Label text="Bottom of Panel 8" height="30" /> + <js:Label text="Bottom of Panel 9" height="30" />--> + </js:Panel> + + +</js:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/assets/logo_orange.png ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/assets/logo_orange.png b/examples/ContainerTest/src/assets/logo_orange.png new file mode 100755 index 0000000..c776c8c Binary files /dev/null and b/examples/ContainerTest/src/assets/logo_orange.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/models/ProductsModel.as ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/models/ProductsModel.as b/examples/ContainerTest/src/models/ProductsModel.as new file mode 100644 index 0000000..b69b1dc --- /dev/null +++ b/examples/ContainerTest/src/models/ProductsModel.as @@ -0,0 +1,44 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 models +{ + import org.apache.flex.events.EventDispatcher; + + import products.Product; + + public class ProductsModel extends EventDispatcher + { + public function ProductsModel() + { + } + + private var _productList:Array = [ + new Product("ps100", "Widgets", "44", 100, "smallbluerect.jpg"), + new Product("tx200", "Thingys", "out of stock", 10000, "smallgreenrect.jpg"), + new Product("rz300", "Sprockets", "8,000", 10, "smallyellowrect.jpg"), + new Product("dh440", "DooHickies", "out of stock", 20000, "smallredrect.jpg"), + new Product("ps220", "Weejets", "235", 300, "smallorangerect.jpg") + ]; + public function get productList():Array + { + return _productList; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/products/Product.as ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/products/Product.as b/examples/ContainerTest/src/products/Product.as new file mode 100644 index 0000000..b4854a3 --- /dev/null +++ b/examples/ContainerTest/src/products/Product.as @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 products +{ + public class Product + { + public function Product(id:String,title:String,detail:String,sales:Number,image:String) + { + this.id = id; + this.title = title; + this.detail = detail; + this.sales = sales; + this.image = image; + } + + public var id:String; + public var title:String; + public var detail:String; + public var image:String; + public var sales:Number; + + public function toString():String + { + return title; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/products/ProductItemRenderer.as ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/products/ProductItemRenderer.as b/examples/ContainerTest/src/products/ProductItemRenderer.as new file mode 100644 index 0000000..f7ca68b --- /dev/null +++ b/examples/ContainerTest/src/products/ProductItemRenderer.as @@ -0,0 +1,83 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 products +{ + import org.apache.flex.html.Image; + import org.apache.flex.html.Label; + import org.apache.flex.html.supportClasses.DataItemRenderer; + + public class ProductItemRenderer extends DataItemRenderer + { + public function ProductItemRenderer() + { + super(); + } + + private var image:Image; + private var title:Label; + private var detail:Label; + + override public function addedToParent():void + { + super.addedToParent(); + + // add an image and two labels + image = new Image(); + addElement(image); + + title = new Label(); + addElement(title); + + detail = new Label(); + addElement(detail); + } + + override public function get data():Object + { + return super.data; + } + + override public function set data(value:Object):void + { + super.data = value; + + image.source = data.image; + title.text = data.title; + detail.text = data.detail; + } + + override public function adjustSize():void + { + var cy:Number = this.height/2; + + image.x = 4; + image.y = cy - 16; + image.width = 32; + image.height = 32; + + title.x = 40; + title.y = cy - 16; + + detail.x = 40; + detail.y = cy; + + updateRenderer(); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallbluerect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallbluerect.jpg b/examples/ContainerTest/src/smallbluerect.jpg new file mode 100755 index 0000000..80ed275 Binary files /dev/null and b/examples/ContainerTest/src/smallbluerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallgreenrect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallgreenrect.jpg b/examples/ContainerTest/src/smallgreenrect.jpg new file mode 100755 index 0000000..c5f9ce6 Binary files /dev/null and b/examples/ContainerTest/src/smallgreenrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallorangerect.gif ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallorangerect.gif b/examples/ContainerTest/src/smallorangerect.gif new file mode 100644 index 0000000..603f810 Binary files /dev/null and b/examples/ContainerTest/src/smallorangerect.gif differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallorangerect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallorangerect.jpg b/examples/ContainerTest/src/smallorangerect.jpg new file mode 100755 index 0000000..4982d87 Binary files /dev/null and b/examples/ContainerTest/src/smallorangerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallpurplerect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallpurplerect.jpg b/examples/ContainerTest/src/smallpurplerect.jpg new file mode 100755 index 0000000..201f625 Binary files /dev/null and b/examples/ContainerTest/src/smallpurplerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallredrect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallredrect.jpg b/examples/ContainerTest/src/smallredrect.jpg new file mode 100644 index 0000000..d2cfa31 Binary files /dev/null and b/examples/ContainerTest/src/smallredrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/ContainerTest/src/smallyellowrect.jpg ---------------------------------------------------------------------- diff --git a/examples/ContainerTest/src/smallyellowrect.jpg b/examples/ContainerTest/src/smallyellowrect.jpg new file mode 100755 index 0000000..b17b62d Binary files /dev/null and b/examples/ContainerTest/src/smallyellowrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/examples/build.xml ---------------------------------------------------------------------- diff --git a/examples/build.xml b/examples/build.xml index fc48330..d6050c0 100644 --- a/examples/build.xml +++ b/examples/build.xml @@ -75,6 +75,7 @@ <target name="compile" description="Compile Examples" > <ant dir="${basedir}/CordovaCameraExample"/> + <ant dir="${basedir}/ContainerTest"/> <ant dir="${basedir}/DataBindingTest"/> <ant dir="${basedir}/DataBindingTest_as"/> <ant dir="${basedir}/DataGridExample"/> @@ -113,6 +114,7 @@ <target name="clean" description="Cleans all SWCs and their resource bundles"> <ant dir="${basedir}/CordovaCameraExample" target="clean"/> + <ant dir="${basedir}/ContainerTest" target="clean"/> <ant dir="${basedir}/DataBindingTest" target="clean"/> <ant dir="${basedir}/DataBindingTest_as" target="clean"/> <ant dir="${basedir}/DataGridExample" target="clean"/> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ViewportModel.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ViewportModel.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ViewportModel.js new file mode 100644 index 0000000..e0a245f --- /dev/null +++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ViewportModel.js @@ -0,0 +1,162 @@ +/** + * Licensed 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. + */ + +goog.provide('org.apache.flex.html.beads.models.ViewportModel'); + +goog.require('org.apache.flex.core.IStrand'); +goog.require('org.apache.flex.core.IViewportModel'); +goog.require('org.apache.flex.events.Event'); +goog.require('org.apache.flex.events.EventDispatcher'); + + + +/** + * @constructor + * @extends {org.apache.flex.events.EventDispatcher} + * @implements {org.apache.flex.core.IViewportModel} + */ +org.apache.flex.html.beads.models.ViewportModel = function() { + org.apache.flex.html.beads.models.ViewportModel.base(this, 'constructor'); +}; +goog.inherits( + org.apache.flex.html.beads.models.ViewportModel, + org.apache.flex.events.EventDispatcher); + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.FLEXJS_CLASS_INFO = + { names: [{ name: 'ViewportModel', + qName: 'org.apache.flex.html.beads.models.ViewportModel' }], + interfaces: [org.apache.flex.core.IViewportModel] + }; + + +/** + * @private + * @type {Object} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.strand_ = null; + + +/** + * @public + * @type {Object} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentIsHost = null; + + +/** + * @private + * @type {Object} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentArea_ = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentWidth = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentHeight = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentX = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.contentY = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.viewportWidth = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.viewportHeight = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.viewportX = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.viewportY = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.verticalScrollPosition = null; + + +/** + * @public + * @type {Number} + */ +org.apache.flex.html.beads.models.ViewportModel.prototype.horizontalScrollPosition = null; + + +Object.defineProperties(org.apache.flex.html.beads.models.ViewportModel.prototype, { + /** @export */ + contentArea: { + /** @this {org.apache.flex.html.beads.models.ViewportModel} */ + get: function() { + return this.contentArea_; + }, + set: function(value) { + this.contentArea_ = value; + } + }, + /** @export */ + strand: { + /** @this {org.apache.flex.html.beads.models.ViewportModel} */ + set: function(value) { + this.strand_ = value; + }, + get: function() { + return this.strand_; + } + } + +}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95cb140a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js new file mode 100644 index 0000000..3eedbb7 --- /dev/null +++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/supportClasses/ContainerContentArea.js @@ -0,0 +1,60 @@ +/** + * Licensed 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. + */ + +goog.provide('org.apache.flex.html.supportClasses.ContainerContentArea'); + +goog.require('org.apache.flex.core.UIBase'); + + + +/** + * @constructor + * @extends {org.apache.flex.core.UIBase} + */ +org.apache.flex.html.supportClasses.ContainerContentArea = +function() { + org.apache.flex.html.supportClasses.ContainerContentArea.base(this, 'constructor'); +}; +goog.inherits( + org.apache.flex.html.supportClasses.ContainerContentArea, + org.apache.flex.core.UIBase); + + +/** + * Metadata + * + * @type {Object.<string, Array.<Object>>} + */ +org.apache.flex.html.supportClasses.ContainerContentArea.prototype.FLEXJS_CLASS_INFO = + { names: [{ name: 'ContainerContentArea', + qName: 'org.apache.flex.html.supportClasses.ContainerContentArea' }]}; + + +/** + * @override + */ +org.apache.flex.html.supportClasses.ContainerContentArea.prototype.createElement = + function() { + this.element = document.createElement('div'); + + this.positioner = this.element; + // absolute positioned children need a non-null + // position value in the parent. It might + // get set to 'absolute' if the container is + // also absolutely positioned + this.positioner.style.position = 'relative'; + this.element.flexjs_wrapper = this; + + return this.element; +};
