http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/examples/RollEventsTest/src/RollEventController.as ---------------------------------------------------------------------- diff --git a/examples/RollEventsTest/src/RollEventController.as b/examples/RollEventsTest/src/RollEventController.as deleted file mode 100644 index 09b80cb..0000000 --- a/examples/RollEventsTest/src/RollEventController.as +++ /dev/null @@ -1,79 +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 -{ - import org.apache.flex.core.IBeadController; - import org.apache.flex.core.IStrand; - import org.apache.flex.events.Event; - import org.apache.flex.events.EventDispatcher; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.events.MouseEvent; - - [Event("rollEvent")] - - public class RollEventController extends EventDispatcher implements IBeadController - { - public function RollEventController() - { - super(); - } - - private var _strand:IStrand; - - public function set strand(value:IStrand):void - { - _strand = value; - - var dispatcher:IEventDispatcher = value as IEventDispatcher; - - dispatcher.addEventListener(MouseEvent.MOUSE_OVER, handleOver); - dispatcher.addEventListener(MouseEvent.MOUSE_OUT, handleOut); - dispatcher.addEventListener(MouseEvent.MOUSE_DOWN, handleDown); - dispatcher.addEventListener(MouseEvent.MOUSE_UP, handleUp); - } - - private function handleOver(event:MouseEvent):void - { - trace("RolledOver"); - - dispatchEvent(new RollEvent("rollOver")); - } - - private function handleOut(event:MouseEvent):void - { - trace("RolledOut"); - - dispatchEvent(new RollEvent("rollOut")); - } - - private function handleDown(event:MouseEvent):void - { - trace("Detected Down"); - - dispatchEvent(new RollEvent("mouseDown")); - } - - private function handleUp(event:MouseEvent):void - { - trace("Detected Up"); - - dispatchEvent(new RollEvent("mouseUp")); - } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/examples/RollEventsTest/src/RollEventsTest.mxml ---------------------------------------------------------------------- diff --git a/examples/RollEventsTest/src/RollEventsTest.mxml b/examples/RollEventsTest/src/RollEventsTest.mxml deleted file mode 100644 index 80e3e08..0000000 --- a/examples/RollEventsTest/src/RollEventsTest.mxml +++ /dev/null @@ -1,52 +0,0 @@ -<?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:controller="controller.*" - xmlns:views="views.*" - > - - <js:valuesImpl> - <js:SimpleCSSValuesImpl /> - </js:valuesImpl> - - <fx:Style> - @namespace js "library://ns.apache.org/flexjs/basic"; - - .ContainerBackground { - background-color: #FFFFCC; - } - </fx:Style> - - <js:initialView> - <js:ViewBase> - <js:Container x="50" y="50" width="400" height="400" className="ContainerBackground"> - <js:beads> - <js:BasicLayout /> - <local:RollEventController rollEvent="output.text=(event as RollEvent).rollEventType" /> - </js:beads> - </js:Container> - <js:Label id="output" x="500" y="50" text="roll here" /> - </js:ViewBase> - </js:initialView> -</js:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/examples/VanillaSDK_POC/build.xml ---------------------------------------------------------------------- diff --git a/examples/VanillaSDK_POC/build.xml b/examples/VanillaSDK_POC/build.xml deleted file mode 100644 index ee188cb..0000000 --- a/examples/VanillaSDK_POC/build.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?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="build-with-falconjx" default="main" basedir="."> - - <property name="FLEX_HOME" - location="/Users/erik/Documents/ApacheFlex/repo/sdk.done" /> - - <property name="APP_ROOT" - value="${basedir}/src/" /> - - <property name="DIR_APACHE_JS_GOOG_PROJECT" - location="${FLEX_HOME}/frameworks/projects/apache-js-goog" /> - - <property name="DIR_CLOSURE_LIBRARY" - location="/Users/erik/Documents/ApacheFlex/dependencies/GoogleClosure/library" /> - - <property name="DIR_FALCONJX_COMPILE_SCRIPT" - location="/Users/erik/Documents/ApacheFlex/repo/falcon/compiler.jx/bin" /> - - <target name="main"> - <exec executable="./mxmlc" dir="${DIR_FALCONJX_COMPILE_SCRIPT}"> - <arg value="-library-path+=${DIR_APACHE_JS_GOOG_PROJECT}/bin" /> - <arg value="${APP_ROOT}/Example.as" /> - <arg value="-js-output-type=GOOG" /> - <arg value="-vanilla-sdk-lib=${DIR_APACHE_JS_GOOG_PROJECT}/src" /> - <arg value="-closure-lib=${DIR_CLOSURE_LIBRARY}" /> - </exec> - </target> - -</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/examples/VanillaSDK_POC/src/Example.as ---------------------------------------------------------------------- diff --git a/examples/VanillaSDK_POC/src/Example.as b/examples/VanillaSDK_POC/src/Example.as deleted file mode 100644 index 39195f9..0000000 --- a/examples/VanillaSDK_POC/src/Example.as +++ /dev/null @@ -1,83 +0,0 @@ -package -{ - -import flash.events.MouseEvent; - -import js.goog.spark.components.Button; -import js.goog.spark.components.Group; -import js.goog.spark.components.Label; - -public class Example extends Group -{ - private const BYEBYE:String = "Bye Bye"; - private const HELLOWORLD:String = "Hello World"; - - private var _counter:int = 100; - - public function Example() - { - init(); - } - - private var _btn1:Button; - private var _btn2:Button; - private var _btn3:Button; - private var _lbl1:Label; - private var _lbl2:Label; - - public function init():void - { - _lbl1 = new Label(); - _lbl1.x = 100; - _lbl1.y = 25; - _lbl1.text = HELLOWORLD; - addElement(_lbl1); - - _lbl2 = new Label(); - _lbl2.x = 200; - _lbl2.y = 25; - _lbl2.text = _counter + ""; - addElement(_lbl2); - - _btn1 = new Button(); - _btn1.x = 100; - _btn1.y = 50; - _btn1.label = "Click me"; - addElement(_btn1); - _btn1.addEventListener(MouseEvent.CLICK, btn1clickHandler); - - _btn2 = new Button(); - _btn2.x = 200; - _btn2.y = 50; - _btn2.label = "Add it"; - addElement(_btn2); - _btn2.addEventListener(MouseEvent.CLICK, btn2clickHandler); - - _btn3 = new Button(); - _btn3.x = 300; - _btn3.y = 50; - _btn3.label = "Move it"; - addElement(_btn3); - _btn3.addEventListener(MouseEvent.CLICK, btn3clickHandler); - } - - protected function btn1clickHandler(event:MouseEvent):void - { - if (_lbl1.text == HELLOWORLD) - _lbl1.text = BYEBYE; - else - _lbl1.text = HELLOWORLD; - } - - protected function btn2clickHandler(event:MouseEvent):void - { - _lbl2.text = --_counter + ""; - } - - protected function btn3clickHandler(event:MouseEvent):void - { - _btn3.x += 10; - } - -} -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/examples/VanillaSDK_POC/src/Main.mxml ---------------------------------------------------------------------- diff --git a/examples/VanillaSDK_POC/src/Main.mxml b/examples/VanillaSDK_POC/src/Main.mxml deleted file mode 100644 index bb91c17..0000000 --- a/examples/VanillaSDK_POC/src/Main.mxml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<g:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:g="http://flex.apache.org/jsg" - creationComplete="creationCompleteHandler(event)" > - - <fx:Script><![CDATA[ - - import js.goog.mx.events.FlexEvent; - - protected function creationCompleteHandler(event:FlexEvent):void - { - var main:Example = new Example(); - - this.addElement(main); - } - - ]]></fx:Script> - - <fx:Declarations /> - -</g:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/build.xml b/manualtests/ContainerTest/build.xml new file mode 100644 index 0000000..1b3a266 --- /dev/null +++ b/manualtests/ContainerTest/build.xml @@ -0,0 +1,74 @@ +<?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}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <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/0485c8b6/manualtests/ContainerTest/src/ContainerTest.mxml ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/ContainerTest.mxml b/manualtests/ContainerTest/src/ContainerTest.mxml new file mode 100644 index 0000000..5a101ef --- /dev/null +++ b/manualtests/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/0485c8b6/manualtests/ContainerTest/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/MyInitialView.mxml b/manualtests/ContainerTest/src/MyInitialView.mxml new file mode 100644 index 0000000..a90db33 --- /dev/null +++ b/manualtests/ContainerTest/src/MyInitialView.mxml @@ -0,0 +1,188 @@ +<?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); + + var label4:Label = new Label(); + label4.text = " /HCon: " + Math.random(); + label4.height = 50; + hcon.addElement(label4); + } + ]]> + </fx:Script> + <js:beads> + <js:MXMLBeadViewBaseDataBinding /> + </js:beads> + + <!-- FIRST COLUMN --> + + <js:TextButton text="Add Child" x="20" y="20" click="addAChild()" /> + + <js:HContainer id="hcon" x="20" y="80" width="400" height="100" 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:HContainer> + + <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/0485c8b6/manualtests/ContainerTest/src/assets/logo_orange.png ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/assets/logo_orange.png b/manualtests/ContainerTest/src/assets/logo_orange.png new file mode 100755 index 0000000..c776c8c Binary files /dev/null and b/manualtests/ContainerTest/src/assets/logo_orange.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/models/ProductsModel.as ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/models/ProductsModel.as b/manualtests/ContainerTest/src/models/ProductsModel.as new file mode 100644 index 0000000..b69b1dc --- /dev/null +++ b/manualtests/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/0485c8b6/manualtests/ContainerTest/src/products/Product.as ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/products/Product.as b/manualtests/ContainerTest/src/products/Product.as new file mode 100644 index 0000000..b4854a3 --- /dev/null +++ b/manualtests/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/0485c8b6/manualtests/ContainerTest/src/products/ProductItemRenderer.as ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/products/ProductItemRenderer.as b/manualtests/ContainerTest/src/products/ProductItemRenderer.as new file mode 100644 index 0000000..f7ca68b --- /dev/null +++ b/manualtests/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/0485c8b6/manualtests/ContainerTest/src/smallbluerect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallbluerect.jpg b/manualtests/ContainerTest/src/smallbluerect.jpg new file mode 100755 index 0000000..80ed275 Binary files /dev/null and b/manualtests/ContainerTest/src/smallbluerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallgreenrect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallgreenrect.jpg b/manualtests/ContainerTest/src/smallgreenrect.jpg new file mode 100755 index 0000000..c5f9ce6 Binary files /dev/null and b/manualtests/ContainerTest/src/smallgreenrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallorangerect.gif ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallorangerect.gif b/manualtests/ContainerTest/src/smallorangerect.gif new file mode 100644 index 0000000..603f810 Binary files /dev/null and b/manualtests/ContainerTest/src/smallorangerect.gif differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallorangerect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallorangerect.jpg b/manualtests/ContainerTest/src/smallorangerect.jpg new file mode 100755 index 0000000..4982d87 Binary files /dev/null and b/manualtests/ContainerTest/src/smallorangerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallpurplerect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallpurplerect.jpg b/manualtests/ContainerTest/src/smallpurplerect.jpg new file mode 100755 index 0000000..201f625 Binary files /dev/null and b/manualtests/ContainerTest/src/smallpurplerect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallredrect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallredrect.jpg b/manualtests/ContainerTest/src/smallredrect.jpg new file mode 100644 index 0000000..d2cfa31 Binary files /dev/null and b/manualtests/ContainerTest/src/smallredrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/ContainerTest/src/smallyellowrect.jpg ---------------------------------------------------------------------- diff --git a/manualtests/ContainerTest/src/smallyellowrect.jpg b/manualtests/ContainerTest/src/smallyellowrect.jpg new file mode 100755 index 0000000..b17b62d Binary files /dev/null and b/manualtests/ContainerTest/src/smallyellowrect.jpg differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/build.xml b/manualtests/DataGridXcompile/build.xml new file mode 100644 index 0000000..ccc86f8 --- /dev/null +++ b/manualtests/DataGridXcompile/build.xml @@ -0,0 +1,71 @@ +<?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="datagridxcompile" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="DataGridXcompile" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <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/0485c8b6/manualtests/DataGridXcompile/src/DataGridXcompile.mxml ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/DataGridXcompile.mxml b/manualtests/DataGridXcompile/src/DataGridXcompile.mxml new file mode 100644 index 0000000..1139add --- /dev/null +++ b/manualtests/DataGridXcompile/src/DataGridXcompile.mxml @@ -0,0 +1,37 @@ +<?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:staticControls="org.apache.flex.html.*" + > + + <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/0485c8b6/manualtests/DataGridXcompile/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/MyInitialView.mxml b/manualtests/DataGridXcompile/src/MyInitialView.mxml new file mode 100644 index 0000000..140a7f7 --- /dev/null +++ b/manualtests/DataGridXcompile/src/MyInitialView.mxml @@ -0,0 +1,83 @@ +<?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:js="library://ns.apache.org/flexjs/basic" + xmlns:local="*" + xmlns:models="models.*" + initComplete="initControls()" + xmlns:customControls="org.apache.flex.html.customControls.*" + xmlns:beads="org.apache.flex.html.customControls.beads.*"> + + <fx:Style> + @namespace basic "library://ns.apache.org/flexjs/basic"; + @namespace custom "org.apache.flex.html.customControls.*"; + + .boxGrid { + background-color: #FF0000; + IBeadView: ClassReference('org.apache.flex.html.beads.BoxGridView'); + } + + custom|DataGrid + { + IDataGridPresentationModel: ClassReference("org.apache.flex.html.beads.models.DataGridPresentationModel"); + IBeadView: ClassReference("org.apache.flex.html.customControls.beads.DataGridView"); + IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel"); + IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory"); + IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer"); + + background-color: #FFFFFF; + } + + </fx:Style> + + <fx:Script> + <![CDATA[ + + private function initControls() : void + { + + } + + private function dataGridChange() : void + { + //output.text = "Clicked on row "+dataGrid.selectedIndex; + //trace("Click on row "+dataGrid.selectedIndex); + } + ]]> + </fx:Script> + + <js:Label id="output" text="here" x="450" y="30" width="100" /> + + <customControls:DataGrid id="dataGrid" x="20" y="30" width="400" height="300" change="dataGridChange()" > + <customControls:beads> + <models:MyGridPresentation rowHeight="50" /> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="productList" + destinationPropertyName="dataProvider" /> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="labelFields" + destinationPropertyName="labelFields" /> + <beads:DataGridView /> + </customControls:beads> + </customControls:DataGrid> + +</js:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/models/MyGridPresentation.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/models/MyGridPresentation.as b/manualtests/DataGridXcompile/src/models/MyGridPresentation.as new file mode 100644 index 0000000..a724722 --- /dev/null +++ b/manualtests/DataGridXcompile/src/models/MyGridPresentation.as @@ -0,0 +1,32 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads.models.DataGridPresentationModel; + + public class MyGridPresentation extends DataGridPresentationModel + { + public function MyGridPresentation() + { + super(); + + this.columnLabels = ["ID","Title","Inventory"]; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/models/ProductsModel.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/models/ProductsModel.as b/manualtests/DataGridXcompile/src/models/ProductsModel.as new file mode 100644 index 0000000..be0bfe2 --- /dev/null +++ b/manualtests/DataGridXcompile/src/models/ProductsModel.as @@ -0,0 +1,53 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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","smallbluerect.jpg"), + new Product("tx200","Thingys","out of stock","smallgreenrect.jpg"), + new Product("rz300","Sprockets","8,000","smallyellowrect.jpg"), + new Product("dh440","Doohickies","out of stock","smallredrect.jpg"), + new Product("ps220","Weejets","235","smallorangerect.jpg") + ]; + public function get productList():Array + { + return _productList; + } + + private var _labelFields:Array = [ "id", "title", "detail" ]; + public function get labelFields():Object + { + return _labelFields; + } + public function set labelFields(value:Object):void + { + // ignore + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/core/IDataGridPresentationModel.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/core/IDataGridPresentationModel.as b/manualtests/DataGridXcompile/src/org/apache/flex/core/IDataGridPresentationModel.as new file mode 100644 index 0000000..34a5d84 --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/core/IDataGridPresentationModel.as @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + import org.apache.flex.events.IEventDispatcher; + + public interface IDataGridPresentationModel extends IEventDispatcher, IBead + { + function get columnLabels():Array; + function set columnLabels(value:Array):void; + + function get rowHeight():Number; + function set rowHeight(value:Number):void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/DataGrid.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/DataGrid.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/DataGrid.as new file mode 100644 index 0000000..b4ded72 --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/DataGrid.as @@ -0,0 +1,60 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls +{ + import org.apache.flex.core.IDataGridModel; + import org.apache.flex.core.UIBase; + + [Event(name="change", type="org.apache.flex.events.Event")] + + public class DataGrid extends UIBase + { + public function DataGrid() + { + super(); + } + + public function get dataProvider():Object + { + return IDataGridModel(model).dataProvider; + } + public function set dataProvider(value:Object):void + { + //IDataGridModel(model).dataProvider = value; + var dgm:IDataGridModel = model as IDataGridModel + dgm.dataProvider = value; + } + + public function get labelFields():Object + { + return IDataGridModel(model).labelFields; + } + public function set labelFields(value:Object):void + { + //IDataGridModel(model).labelFields = value; + var dgm:IDataGridModel = model as IDataGridModel + dgm.labelFields = value; + } + + public function get selectedIndex():int + { + return IDataGridModel(model).selectedIndex; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridColumnView.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridColumnView.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridColumnView.as new file mode 100644 index 0000000..88bd2ff --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridColumnView.as @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads +{ + import org.apache.flex.core.IStrand; + import org.apache.flex.html.beads.ListView; + + public class DataGridColumnView extends ListView + { + public function DataGridColumnView() + { + } + + private var _strand:IStrand; + override public function set strand(value:IStrand):void + { + super.strand = value; + _strand = value; + } + + private var _columnIndex:uint; + public function get columnIndex():uint + { + return _columnIndex; + } + public function set columnIndex(value:uint):void + { + _columnIndex = value; + } + + private var _labelField:String; + public function get labelField():String + { + return _labelField; + } + public function set labelField(value:String):void + { + _labelField = value; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridView.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridView.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridView.as new file mode 100644 index 0000000..15fe694 --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataGridView.as @@ -0,0 +1,149 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads +{ +// import flash.display.DisplayObject; +// import flash.display.DisplayObjectContainer; +// import flash.display.Shape; + + import org.apache.flex.core.IBeadModel; + import org.apache.flex.core.IDataGridModel; + import org.apache.flex.core.IDataGridPresentationModel; + import org.apache.flex.core.IStrand; + import org.apache.flex.core.UIBase; + import org.apache.flex.core.ValuesManager; + import org.apache.flex.events.Event; + import org.apache.flex.events.IEventDispatcher; + import org.apache.flex.html.ButtonBar; + import org.apache.flex.html.Container; + import org.apache.flex.html.List; + import org.apache.flex.html.SimpleList; + import org.apache.flex.html.beads.layouts.HorizontalLayout; + import org.apache.flex.html.beads.models.ArraySelectionModel; + + public class DataGridView implements IDataGridView + { + public function DataGridView() + { + } + +// private var background:Shape; + private var buttonBar:ButtonBar; + private var buttonBarModel:ArraySelectionModel; + private var columnContainer:Container; + private var columns:Array; + + private var _strand:IStrand; + public function set strand(value:IStrand):void + { + _strand = value; + +// background = new Shape(); +// DisplayObjectContainer(_strand).addChild(background); + + var pm:IDataGridPresentationModel = _strand.getBeadByType(IDataGridPresentationModel) as IDataGridPresentationModel; + buttonBarModel = new ArraySelectionModel(); + buttonBarModel.dataProvider = pm.columnLabels; + buttonBar = new ButtonBar(); + buttonBar.addBead(buttonBarModel); + buttonBar.height = 20; + buttonBar.width = UIBase(_strand).width; + UIBase(_strand).addElement(buttonBar); + + columnContainer = new Container(); + var layout:HorizontalLayout = new HorizontalLayout(); + columnContainer.addBead(layout); + UIBase(_strand).addElement(columnContainer); + + var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel; + var columnWidth:Number = UIBase(_strand).width / pm.columnLabels.length; + var columnHeight:Number = UIBase(_strand).height - buttonBar.height; + + columns = new Array(); + for(var i:int=0; i < pm.columnLabels.length; i++) { + var column:List = new List(); + var columnView:DataGridColumnView = new DataGridColumnView(); + columnView.labelField = sharedModel.labelFields[i]; + var factory:DataItemRendererFactoryForColumnData = new DataItemRendererFactoryForColumnData(); + columnView.columnIndex = i; + column.width = columnWidth; + column.height = columnHeight; + column.addBead(sharedModel); + column.addBead(columnView); + column.addBead(factory); + columnContainer.addElement(column); + columns.push(column); + + column.addEventListener('change',columnListChangeHandler); + } + + IEventDispatcher(_strand).addEventListener("widthChanged",handleSizeChange); + IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange); + + handleSizeChange(null); // initial sizing + } + + private function handleSizeChange(event:Event):void + { + var sw:Number = UIBase(_strand).width; + var sh:Number = UIBase(_strand).height; + +/* var backgroundColor:Number = 0xDDDDDD; + var value:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color"); + if (value != null) backgroundColor = Number(value);*/ + +/* background.graphics.clear(); + background.graphics.beginFill(backgroundColor); + background.graphics.drawRect(0,0,sw,sh); + background.graphics.endFill();*/ + + buttonBar.x = 0; + buttonBar.y = 0; + buttonBar.width = sw; + buttonBar.height = 25; + + columnContainer.x = 0; + columnContainer.y = 30; + columnContainer.width = sw; + columnContainer.height = sh - 25; + + for(var i:int=0; i < columns.length; i++) { + var column:List = columns[i]; + + var cw:Number = sw/(columns.length); + column.x = i*cw; // should be positioned by the Container's layout + column.y = 0; + column.width = cw; + column.height = columnContainer.height; // this will actually be Nitem*rowHeight + } + } + + private function columnListChangeHandler(event:Event):void + { + var list:List = event.target as List; + for(var i:int=0; i < columns.length; i++) { + if (list != columns[i]) { + columns[i].selectedIndex = list.selectedIndex; + } + } + + IEventDispatcher(_strand).dispatchEvent(new Event('change')); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataItemRendererFactoryForColumnData.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataItemRendererFactoryForColumnData.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataItemRendererFactoryForColumnData.as new file mode 100644 index 0000000..493984f --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/DataItemRendererFactoryForColumnData.as @@ -0,0 +1,101 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads +{ + import org.apache.flex.core.IBead; + import org.apache.flex.core.IBeadView; + import org.apache.flex.core.IItemRenderer; + import org.apache.flex.core.IItemRendererClassFactory; + import org.apache.flex.core.IItemRendererParent; + import org.apache.flex.core.ISelectionModel; + import org.apache.flex.core.IStrand; + import org.apache.flex.core.ValuesManager; + import org.apache.flex.events.Event; + import org.apache.flex.events.IEventDispatcher; + import org.apache.flex.html.supportClasses.DataItemRenderer; + import org.apache.flex.html.beads.IListView; + + public class DataItemRendererFactoryForColumnData implements IBead, IDataProviderItemRendererMapper + { + public function DataItemRendererFactoryForColumnData() + { + } + + private var selectionModel:ISelectionModel; + + private var _strand:IStrand; + + public function set strand(value:IStrand):void + { + _strand = value; + selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel; + var listView:IListView = value.getBeadByType(IListView) as IListView; + dataGroup = listView.dataGroup; + selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler); + + if (!itemRendererFactory) + { + var c:Class = ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory"); + _itemRendererFactory = (new c()) as IItemRendererClassFactory; + _strand.addBead(_itemRendererFactory); + } + + dataProviderChangeHandler(null); + } + + public var _itemRendererFactory:IItemRendererClassFactory; + + public function get itemRendererFactory():IItemRendererClassFactory + { + return _itemRendererFactory + } + + public function set itemRendererFactory(value:IItemRendererClassFactory):void + { + _itemRendererFactory = value; + } + + protected var dataGroup:IItemRendererParent; + + private function dataProviderChangeHandler(event:Event):void + { + var dp:Array = selectionModel.dataProvider as Array; + if (!dp) + return; + + dataGroup.removeAllElements(); + + var view:DataGridColumnView = _strand.getBeadByType(IBeadView) as DataGridColumnView; + if (view == null) return; + + var n:int = dp.length; + for (var i:int = 0; i < n; i++) + { + + var tf:IItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as IItemRenderer; + tf.index = i; + dataGroup.addElement(tf); + tf.data = dp[i]; + //tf.text = dp[i][view.labelField]; + } + + IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated")); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataGridView.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataGridView.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataGridView.as new file mode 100644 index 0000000..2b1bf61 --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataGridView.as @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads +{ + import org.apache.flex.core.IBeadView; + + public interface IDataGridView extends IBeadView + { + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataProviderItemRendererMapper.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataProviderItemRendererMapper.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataProviderItemRendererMapper.as new file mode 100644 index 0000000..8a406de --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/IDataProviderItemRendererMapper.as @@ -0,0 +1,34 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads +{ + import org.apache.flex.core.IBead; + import org.apache.flex.core.IItemRendererClassFactory; + + /** + * Classes that generate ItemRenderers based on dataProvider contents. + * These classes use an IItemRendererFactory to generate the actual + * ItemRenderer instances + */ + public interface IDataProviderItemRendererMapper extends IBead + { + function get itemRendererFactory():IItemRendererClassFactory; + function set itemRendererFactory(value:IItemRendererClassFactory):void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/models/DataGridPresentationModel.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/models/DataGridPresentationModel.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/models/DataGridPresentationModel.as new file mode 100644 index 0000000..de24473 --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/customControls/beads/models/DataGridPresentationModel.as @@ -0,0 +1,65 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.customControls.beads.models +{ + import org.apache.flex.core.IDataGridPresentationModel; + import org.apache.flex.core.IStrand; + import org.apache.flex.events.Event; + import org.apache.flex.events.EventDispatcher; + + public class DataGridPresentationModel extends EventDispatcher implements IDataGridPresentationModel + { + public function DataGridPresentationModel() + { + super(); + } + + private var _columnLabels:Array; + public function get columnLabels():Array + { + return _columnLabels; + } + public function set columnLabels(value:Array):void + { + if (value != _columnLabels) { + _columnLabels = value; + dispatchEvent(new Event("columnsChanged")); + } + } + + private var _rowHeight:Number = 30; + public function get rowHeight():Number + { + return _rowHeight; + } + public function set rowHeight(value:Number):void + { + if (value != _rowHeight) { + _rowHeight = value; + dispatchEvent(new Event("rowHeightChanged")); + } + } + + private var _strand:IStrand; + public function set strand(value:IStrand):void + { + _strand = value; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/org/apache/flex/html/staticControls/beads/BoxGridView.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/org/apache/flex/html/staticControls/beads/BoxGridView.as b/manualtests/DataGridXcompile/src/org/apache/flex/html/staticControls/beads/BoxGridView.as new file mode 100644 index 0000000..a9d7b8f --- /dev/null +++ b/manualtests/DataGridXcompile/src/org/apache/flex/html/staticControls/beads/BoxGridView.as @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.beads +{ + import org.apache.flex.core.IBeadView; + import org.apache.flex.core.IStrand; + import org.apache.flex.core.UIBase; + import org.apache.flex.html.Label; + + public class BoxGridView implements IBeadView + { + public function BoxGridView() + { + } + + private var label:Label; + + private var _strand:IStrand; + public function set strand(value:IStrand):void + { + _strand = value; + + label = new Label(); + label.text = "BoxGrid"; + label.x = 0; + label.y = 0; + label.width = 100; + label.height = 25; + UIBase(_strand).addElement(label); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DataGridXcompile/src/products/Product.as ---------------------------------------------------------------------- diff --git a/manualtests/DataGridXcompile/src/products/Product.as b/manualtests/DataGridXcompile/src/products/Product.as new file mode 100644 index 0000000..34abf6b --- /dev/null +++ b/manualtests/DataGridXcompile/src/products/Product.as @@ -0,0 +1,41 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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,image:String) + { + this.id = id; + this.title = title; + this.detail = detail; + this.image = image; + } + + public var id:String; + public var title:String; + public var detail:String; + public var image:String; + + public function toString():String + { + return title; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DateChooserExample/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/DateChooserExample/build.xml b/manualtests/DateChooserExample/build.xml new file mode 100644 index 0000000..c4e09af --- /dev/null +++ b/manualtests/DateChooserExample/build.xml @@ -0,0 +1,73 @@ +<?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="datechooserexample" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="DateChooserExample" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <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/0485c8b6/manualtests/DateChooserExample/src/DateChooserExample.mxml ---------------------------------------------------------------------- diff --git a/manualtests/DateChooserExample/src/DateChooserExample.mxml b/manualtests/DateChooserExample/src/DateChooserExample.mxml new file mode 100644 index 0000000..8afdb77 --- /dev/null +++ b/manualtests/DateChooserExample/src/DateChooserExample.mxml @@ -0,0 +1,36 @@ +<?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" + > + + <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/0485c8b6/manualtests/DateChooserExample/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/DateChooserExample/src/MyInitialView.mxml b/manualtests/DateChooserExample/src/MyInitialView.mxml new file mode 100644 index 0000000..02132e7 --- /dev/null +++ b/manualtests/DateChooserExample/src/MyInitialView.mxml @@ -0,0 +1,44 @@ +<?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:js="library://ns.apache.org/flexjs/basic" + xmlns:local="*" + xmlns:models="models.*"> + <fx:Script> + <![CDATA[ + + + private function dateChanged():void + { + trace("Selected date: "+dateChooser.selectedDate); + output.text = String(dateChooser.selectedDate); + + dateField.selectedDate = dateChooser.selectedDate; + } + ]]> + </fx:Script> + + <js:Label id="output" x="450" y="30" width="100" /> + + <js:DateChooser id="dateChooser" x="20" y="30" width="280" height="240" change="dateChanged()" /> + + <js:DateField id="dateField" x="450" y="90" /> + +</js:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/DateChooserExample/src/README.txt ---------------------------------------------------------------------- diff --git a/manualtests/DateChooserExample/src/README.txt b/manualtests/DateChooserExample/src/README.txt new file mode 100644 index 0000000..4d147d7 --- /dev/null +++ b/manualtests/DateChooserExample/src/README.txt @@ -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. +// +//////////////////////////////////////////////////////////////////////////////// + +DESCRIPTION + +The DateChooserExample demonstrates the DateChooser and DateField components. The +DataChooser displays a calendar in place while the DateField displays a calendar +in a pop-up. + +This Flex application may be run as a Flash SWF or cross-compiled (using Falcon JX) +into JavaScript and HTML and run without Flash. + +Selecting a date from the DateChooser sets the date in the DateField. + +COMPONENTS and BEADS + +- DateChooser +- DateField +- Label + +NOTES + +In the ActionScript/SWF version, each button/date in the DateChooser has a hit area +that's smaller than the button itself. + +In the ActionScript/SWF version, the last-selected date in the DateField pop-up +calendar may remain selected. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/EffectsExample/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/EffectsExample/build.xml b/manualtests/EffectsExample/build.xml new file mode 100644 index 0000000..de6a574 --- /dev/null +++ b/manualtests/EffectsExample/build.xml @@ -0,0 +1,77 @@ +<?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="effectexample" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="EffectExample" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + <!-- Uncomment to reproduce cross-compilation error in compilejs step + <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/0485c8b6/manualtests/EffectsExample/src/EffectExample.mxml ---------------------------------------------------------------------- diff --git a/manualtests/EffectsExample/src/EffectExample.mxml b/manualtests/EffectsExample/src/EffectExample.mxml new file mode 100644 index 0000000..2d5c972 --- /dev/null +++ b/manualtests/EffectsExample/src/EffectExample.mxml @@ -0,0 +1,33 @@ +<?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" + > + + <js:valuesImpl> + <js:SimpleCSSValuesImpl /> + </js:valuesImpl> + <js:initialView> + <local:MyInitialView /> + </js:initialView> +</js:Application>
