You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/06/22 18:59:15 UTC

[1/5] git commit: [flex-asjs] [refs/heads/tlf] - use different base class for FXG (requires 50f9d4530c669f1139b16129c45bca17c476fa3d from flex-falcon's tlf branch)

Repository: flex-asjs
Updated Branches:
  refs/heads/tlf f52192f24 -> 010c4fc0c


use different base class for FXG (requires 50f9d4530c669f1139b16129c45bca17c476fa3d from flex-falcon's tlf branch)


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4f3748b5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4f3748b5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4f3748b5

Branch: refs/heads/tlf
Commit: 4f3748b5c8e20052cdf918f0a9b4895117280c02
Parents: 04e2f74
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jun 22 11:55:17 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 22 11:57:28 2017 -0700

----------------------------------------------------------------------
 frameworks/flex-config-template.xml                              | 1 +
 frameworks/flex-config.xml                                       | 1 +
 frameworks/projects/Basic/src/main/config/compile-swf-config.xml | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4f3748b5/frameworks/flex-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config-template.xml b/frameworks/flex-config-template.xml
index 18f041e..493a4f3 100644
--- a/frameworks/flex-config-template.xml
+++ b/frameworks/flex-config-template.xml
@@ -124,6 +124,7 @@
       <states-event-override-class>org.apache.flex.states.SetEventHandler</states-event-override-class>
       <component-factory-class>org.apache.flex.core.ClassFactory</component-factory-class>
       <component-factory-interface>org.apache.flex.core.IFactory</component-factory-interface>
+      <fxg-base-class>flash.display.Sprite</fxg-base-class>
 
       <namespaces>
       <!-- Specify a URI to associate with a manifest of components for use as MXML -->

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4f3748b5/frameworks/flex-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config.xml b/frameworks/flex-config.xml
index 677284f..f883ed3 100644
--- a/frameworks/flex-config.xml
+++ b/frameworks/flex-config.xml
@@ -124,6 +124,7 @@
       <states-event-override-class>org.apache.flex.states.SetEventHandler</states-event-override-class>
       <component-factory-class>org.apache.flex.core.ClassFactory</component-factory-class>
       <component-factory-interface>org.apache.flex.core.IFactory</component-factory-interface>
+      <fxg-base-class>flash.display.Sprite</fxg-base-class>
 
       <namespaces>
       <!-- Specify a URI to associate with a manifest of components for use as MXML -->

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4f3748b5/frameworks/projects/Basic/src/main/config/compile-swf-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/config/compile-swf-config.xml b/frameworks/projects/Basic/src/main/config/compile-swf-config.xml
index 7d9b236..f77fad2 100644
--- a/frameworks/projects/Basic/src/main/config/compile-swf-config.xml
+++ b/frameworks/projects/Basic/src/main/config/compile-swf-config.xml
@@ -44,7 +44,8 @@
 		<binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
 		<binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
 		<binding-value-change-event-type>valueChange</binding-value-change-event-type>
-        
+        <fxg-base-class>flash.display.Sprite</fxg-base-class>
+
         <define>
             <name>COMPILE::SWF</name>
             <value>true</value>


[3/5] git commit: [flex-asjs] [refs/heads/tlf] - add copy cursor. Other cursors can be added from flex-sdk/frameworks/projects/framework/assets. Rename the base class inside the file before committing

Posted by ah...@apache.org.
add copy cursor.  Other cursors can be added from flex-sdk/frameworks/projects/framework/assets.  Rename the base class inside the file before committing


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8d5a8e6e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8d5a8e6e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8d5a8e6e

Branch: refs/heads/tlf
Commit: 8d5a8e6e858eb6871095db57a0524fb271a66756
Parents: 4f3748b
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jun 22 11:56:33 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 22 11:57:29 2017 -0700

----------------------------------------------------------------------
 .../Basic/src/main/flex/BasicClasses.as         |  7 +-
 .../src/main/flex/org/apache/flex/css2/Copy.fxg | 76 ++++++++++++++++++++
 2 files changed, 82 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8d5a8e6e/frameworks/projects/Basic/src/main/flex/BasicClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/BasicClasses.as b/frameworks/projects/Basic/src/main/flex/BasicClasses.as
index f8f4014..223a795 100644
--- a/frameworks/projects/Basic/src/main/flex/BasicClasses.as
+++ b/frameworks/projects/Basic/src/main/flex/BasicClasses.as
@@ -27,7 +27,6 @@ package
  */
 internal class BasicClasses
 {
-    import org.apache.flex.css2.Cursors; Cursors;
     import org.apache.flex.html.ToolTip; ToolTip;
 	import org.apache.flex.html.accessories.NumericOnlyTextInputBead; NumericOnlyTextInputBead;
     import org.apache.flex.html.beads.DispatchInputFinishedBead; DispatchInputFinishedBead;
@@ -233,6 +232,12 @@ internal class BasicClasses
 	import org.apache.flex.html.beads.layouts.SimpleTableLayout; SimpleTableLayout;
 	import org.apache.flex.html.beads.layouts.TableCellLayout; TableCellLayout;
 	import org.apache.flex.html.beads.layouts.TableHeaderLayout; TableHeaderLayout;
+    
+    import org.apache.flex.css2.Cursors; Cursors;
+    COMPILE::SWF
+    {
+        import org.apache.flex.css2.Copy; Copy;
+    }
 }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8d5a8e6e/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Copy.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Copy.fxg b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Copy.fxg
new file mode 100644
index 0000000..198a73c
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Copy.fxg
@@ -0,0 +1,76 @@
+<?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.
+
+-->
+<Graphic version="2.0" ATE:version="1.0.0" flm:version="1.0.0" d:using="" 
+	xmlns="http://ns.adobe.com/fxg/2008" xmlns:ATE="http://ns.adobe.com/ate/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" 
+	xmlns:flm="http://ns.adobe.com/flame/2008"
+	xmlns:afx="http://ns.apache.org/flex/2012" afx:className="org.apache.flex.css2.Copy" afx:baseClassName="flash.display.Sprite" >
+  <Library>
+    <Definition name="Drag_Cursors_Elements_Cursor" flm:originalName="Drag Cursors/Elements/Cursor">
+      <Group>
+        <Group d:type="layer" d:userLabel="Layer 1">
+          <Path data="M265.85 158 264.85 158 264.85 157 263.85 157 263.85 168 264.85 168 264.85 169 263.85 169 263.85 170 262.85 170 262.85 155 263.85 155 263.85 156 264.85 156 264.85 157 265.85 157 265.85 158 266.85 158 266.85 159 267.85 159 267.85 160 266.85 160
+ 266.85 159 265.85 159 265.85 158M269.85 162 268.85 162 268.85 161 267.85 161 267.85 160 268.85 160 268.85 161 269.85 161 269.85 162 270.85 162 270.85 163 271.85 163 271.85 164 270.85 164 270.85 163 269.85 163 269.85 162M266.85 167 265.85 167
+ 265.85 168 264.85 168 264.85 167 265.85 167 265.85 166 266.85 166 266.85 167 267.85 167 267.85 169 268.85 169 268.85 171 270.85 171 270.85 169 269.85 169 269.85 167 268.85 167 268.85 165 271.85 165 271.85 164 272.85 164 272.85 165 273.85 165
+ 273.85 166 269.85 166 269.85 167 270.85 167 270.85 169 271.85 169 271.85 172 268.85 172 268.85 171 267.85 171 267.85 169 266.85 169 266.85 167">
+            <fill>
+              <SolidColor color="#FFFFFF"/>
+            </fill>
+          </Path>
+          <Path data="M270.85 169 270.85 171 268.85 171 268.85 169 267.85 169 267.85 167 266.85 167 266.85 166 265.85 166 265.85 167 264.85 167 264.85 168 263.85 168 263.85 157 264.85 157 264.85 158 265.85 158 265.85 159 266.85 159 266.85 160 267.85 160 267.85 161
+ 268.85 161 268.85 162 269.85 162 269.85 163 270.85 163 270.85 164 271.85 164 271.85 165 268.85 165 268.85 167 269.85 167 269.85 169 270.85 169">
+            <fill>
+              <SolidColor/>
+            </fill>
+          </Path>
+        </Group>
+      </Group>
+    </Definition>
+  </Library>
+        <Group d:type="layer" d:userLabel="Layer 1">
+          <Group>
+            <Path data="M11.9 16.075Q10.014648 14.18125 10.025 11.475 10.014648 8.7685547 11.9 6.875 13.80625 4.9769531 16.525 4.975 19.231055 4.9769531 21.125 6.875 23.022852 8.7685547 23.025 11.475 23.022852 14.18125 21.125 16.075 19.231055 17.972852 16.525 17.975
+ 13.80625 17.972852 11.9 16.075">
+              <fill>
+                <SolidColor alpha="0.2"/>
+              </fill>
+            </Path>
+          </Group>
+          <Group>
+            <Path data="M22 11.55Q21.8 13.65 20.2 15.2 18.45 16.95 16 17 14.75 17 13.65 16.5 12.55 16.05 11.75 15.2 10.9 14.4 10.45 13.3 10.1 12.45 10.05 11.5 10 11.25 10 11 10 9.75 10.45 8.65 10.9 7.55 11.75 6.75 12.55 5.9 13.65 5.45 14.75 5 16 5 18.45 5 20.2 6.75
+ 21.95 8.5 22 11 22 11.3 22 11.55">
+              <fill>
+                <RadialGradient x="16" y="11" scaleX="11.975" scaleY="11.975">
+                  <GradientEntry ratio="0" color="#66DD55"/>
+                  <GradientEntry ratio="1" color="#009900"/>
+                </RadialGradient>
+              </fill>
+            </Path>
+          </Group>
+          <Group>
+            <Path data="M15 7 17 7 17 10 20 10 20 12 17 12 17 15 15 15 15 12 12 12 12 10 15 10 15 7">
+              <fill>
+                <SolidColor color="#FFFFFF"/>
+              </fill>
+            </Path>
+          </Group>
+          <Drag_Cursors_Elements_Cursor x="-263.85" y="-157"/>
+        </Group>
+  <Private/>
+</Graphic>
\ No newline at end of file


[5/5] git commit: [flex-asjs] [refs/heads/tlf] - example of custom cursor

Posted by ah...@apache.org.
example of custom cursor


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/010c4fc0
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/010c4fc0
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/010c4fc0

Branch: refs/heads/tlf
Commit: 010c4fc0cedcc591e54316103bf37a7c68803f01
Parents: b9d5e8e
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jun 22 11:57:19 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 22 11:57:29 2017 -0700

----------------------------------------------------------------------
 manualtests/CursorTest/src/CursorTest.mxml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/010c4fc0/manualtests/CursorTest/src/CursorTest.mxml
----------------------------------------------------------------------
diff --git a/manualtests/CursorTest/src/CursorTest.mxml b/manualtests/CursorTest/src/CursorTest.mxml
index 78b8d3b..f77eb81 100644
--- a/manualtests/CursorTest/src/CursorTest.mxml
+++ b/manualtests/CursorTest/src/CursorTest.mxml
@@ -36,6 +36,21 @@
                 
         ]]>
     </fx:Script>
+    <fx:Style>
+        @namespace models "models.*";
+        @namespace controllers "controllers.*";
+        @namespace js "library://ns.apache.org/flexjs/basic";
+
+        @media -flex-flash
+        {
+
+        global
+        {
+            copy: ClassReference("org.apache.flex.css2.Copy");
+        }
+        }
+
+    </fx:Style>
     <js:beads>
         <js:ApplicationDataBinding />
     </js:beads>


[2/5] git commit: [flex-asjs] [refs/heads/tlf] - first step for cursor management

Posted by ah...@apache.org.
first step for cursor management


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/04e2f745
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/04e2f745
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/04e2f745

Branch: refs/heads/tlf
Commit: 04e2f745a7a3cac90e55ccc072290755963bc101
Parents: f52192f
Author: Alex Harui <ah...@apache.org>
Authored: Wed Jun 21 22:13:41 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 22 11:57:28 2017 -0700

----------------------------------------------------------------------
 .../Basic/src/main/flex/BasicClasses.as         |   1 +
 .../main/flex/org/apache/flex/css2/Cursors.as   | 225 +++++++++++++++++++
 manualtests/CursorTest/build.xml                |  73 ++++++
 manualtests/CursorTest/src/CursorTest.mxml      |  56 +++++
 4 files changed, 355 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04e2f745/frameworks/projects/Basic/src/main/flex/BasicClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/BasicClasses.as b/frameworks/projects/Basic/src/main/flex/BasicClasses.as
index fbf9a67..f8f4014 100644
--- a/frameworks/projects/Basic/src/main/flex/BasicClasses.as
+++ b/frameworks/projects/Basic/src/main/flex/BasicClasses.as
@@ -27,6 +27,7 @@ package
  */
 internal class BasicClasses
 {
+    import org.apache.flex.css2.Cursors; Cursors;
     import org.apache.flex.html.ToolTip; ToolTip;
 	import org.apache.flex.html.accessories.NumericOnlyTextInputBead; NumericOnlyTextInputBead;
     import org.apache.flex.html.beads.DispatchInputFinishedBead; DispatchInputFinishedBead;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04e2f745/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
new file mode 100644
index 0000000..8671ca0
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
@@ -0,0 +1,225 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.css2
+{
+    import org.apache.flex.core.IUIBase;
+    import org.apache.flex.events.MouseEvent;
+    
+    COMPILE::SWF
+    {
+        import flash.display.DisplayObject;
+        import flash.geom.Point;
+        import flash.ui.Mouse;
+        import flash.ui.MouseCursor;
+    }
+    COMPILE::JS
+    {
+        import org.apache.flex.core.WrappedHTMLElement;
+    }
+
+    /**
+     *  The Label class implements the basic control for labeling
+     *  other controls.
+     *
+     *  @toplevel
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    public class Cursors
+	{
+        public static const AUTO:String = "auto";
+        
+        COMPILE::SWF
+        public static const DEFAULT:String = "arrow";
+        COMPILE::JS
+        public static const DEFAULT:String = "default";
+        
+        COMPILE::SWF
+        public static const POINTER:String = "button";
+        COMPILE::JS
+        public static const POINTER:String = "pointer";
+        
+        COMPILE::SWF
+        public static const MOVE:String = "hand";
+        COMPILE::JS
+        public static const MOVE:String = "move";
+        
+        COMPILE::SWF
+        public static const TEXT:String = "ibeam";
+        COMPILE::JS
+        public static const TEXT:String = "text";
+        
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function Cursors()
+		{
+			super();
+		}
+
+        /**
+         *  The name of the cursor
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public static function getCursor(obj:IUIBase):String
+		{
+            COMPILE::SWF
+            {
+                var cursorData:CursorData =  obj.getBeadByType(CursorData) as CursorData;
+                if (cursorData)
+                    return cursorData.cursor;
+                return Mouse.cursor;
+            }
+            COMPILE::JS
+            {
+                return obj.element.style.cursor;
+            }
+		}
+
+        /**
+         *  @private
+         */
+		public static function setCursor(obj:IUIBase, cursor:String):void
+		{
+            COMPILE::SWF
+            {
+                var cursorData:CursorData =  obj.getBeadByType(CursorData) as CursorData;
+                if (!cursorData)
+                {
+                    cursorData = new CursorData();
+                    obj.addBead(cursorData);
+                    obj.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
+                    obj.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
+                }
+                cursorData.cursor = cursor;
+                
+                var displayObject:DisplayObject = obj as DisplayObject;
+                var pt:Point = new Point(displayObject.mouseX, displayObject.mouseY);
+                pt = displayObject.localToGlobal(pt);
+                
+                var o:Array = displayObject.stage.getObjectsUnderPoint(pt);
+                for each (var s:DisplayObject in o) 
+                {
+                    var iui:IUIBase = s as IUIBase;
+                    if (!iui)
+                        iui = s.parent as IUIBase;
+                    if (!iui && s.parent)
+                        iui = s.parent.parent as IUIBase;
+                    if (iui)
+                    {
+                        var actualCursor:String = getCursor(iui);
+                        if (actualCursor)
+                        {
+                            Mouse.cursor = actualCursor;
+                            return;
+                        }
+                    }
+                }
+            }
+            COMPILE::JS
+            {
+                obj.element.style.cursor = cursor;
+            }
+
+		}
+
+
+        /**
+         *  @private
+         */
+        COMPILE::SWF
+        public static function overHandler(event:MouseEvent):void
+        {
+            var o:Array = event.target.stage.getObjectsUnderPoint(new Point(event.stageX, event.stageY));
+            for each (var s:DisplayObject in o) 
+            {
+                var iui:IUIBase = s as IUIBase;
+                if (!iui)
+                    iui = s.parent as IUIBase;
+                if (!iui && s.parent)
+                    iui = s.parent.parent as IUIBase;
+                if (iui)
+                if (iui)
+                {
+                    var cursor:String = getCursor(iui);
+                    if (cursor)
+                    {
+                        Mouse.cursor = cursor;
+                        return;
+                    }
+                }
+            }
+        }
+
+        /**
+         *  @private
+         */
+        COMPILE::SWF
+        public static function outHandler(event:MouseEvent):void
+        {
+            if (event.relatedObject)
+            {
+                var o:Array = event.relatedObject.stage.getObjectsUnderPoint(new Point(event.stageX, event.stageY));
+                for each (var s:DisplayObject in o) 
+                {
+                    var iui:IUIBase = s as IUIBase;
+                    if (!iui)
+                        iui = s.parent as IUIBase;
+                    if (!iui && s.parent)
+                        iui = s.parent.parent as IUIBase;
+                    if (iui)
+                    {
+                        var cursor:String = getCursor(iui);
+                        if (cursor)
+                        {
+                            Mouse.cursor = cursor;
+                            return;
+                        }
+                    }
+                }
+            }
+            Mouse.cursor = MouseCursor.AUTO;
+        }
+        
+	}
+}
+
+import org.apache.flex.core.IBead;
+import org.apache.flex.core.IStrand;
+
+class CursorData implements IBead
+{
+    public var cursor:String;
+
+    public function set strand(value:IStrand):void
+    {
+        
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04e2f745/manualtests/CursorTest/build.xml
----------------------------------------------------------------------
diff --git a/manualtests/CursorTest/build.xml b/manualtests/CursorTest/build.xml
new file mode 100644
index 0000000..c0f971f
--- /dev/null
+++ b/manualtests/CursorTest/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="cursortest" default="main" basedir=".">
+    <property name="FLEXJS_HOME" location="../.."/>
+    <property name="example" value="CursorTest" />
+    <property name="swf.version" value="11" />
+    
+    <property environment="env"/>
+    <property file="${FLEXJS_HOME}/build.properties"/>
+    <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+    <!-- use this to add keep metadata option -->
+    <property name="theme_arg" value="-keep-as3-metadata+=Event" />
+    <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 FlexJSUI.swc">
+    </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/04e2f745/manualtests/CursorTest/src/CursorTest.mxml
----------------------------------------------------------------------
diff --git a/manualtests/CursorTest/src/CursorTest.mxml b/manualtests/CursorTest/src/CursorTest.mxml
new file mode 100644
index 0000000..78b8d3b
--- /dev/null
+++ b/manualtests/CursorTest/src/CursorTest.mxml
@@ -0,0 +1,56 @@
+<?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:controllers="controllers.*"
+				   xmlns:js="library://ns.apache.org/flexjs/basic" 
+				   >
+	<fx:Script>
+        <![CDATA[
+            import org.apache.flex.css2.Cursors;
+            
+            private const dp:Array = [Cursors.AUTO, Cursors.DEFAULT, Cursors.POINTER, Cursors.MOVE, Cursors.TEXT,
+                    "alias", "all-scroll", "cell", "context-menu", "col-resize", "copy", "crosshair",
+                    "e-resize", "ew-resize", "help", "n-resize", "nw-resize", "nwse-resize", "no-drop",
+                    "not-allowed", "progress", "row-resize", "s-resize", "se-resize", "sw-resize", 
+                    "vertical-text", "w-resize", "wait", "zoom-in", "zoom-out"]
+                
+        ]]>
+    </fx:Script>
+    <js:beads>
+        <js:ApplicationDataBinding />
+    </js:beads>
+	<js:valuesImpl>
+		<js:SimpleCSSValuesImpl />
+	</js:valuesImpl>
+	<js:initialView>
+		<js:View width="100%" height="100%" >
+            <js:beads>
+                <js:BasicLayout />
+            </js:beads>
+            <js:Label id="foo" text="foo" x="10" y="10"/>
+            <js:Label id="bar" text="bar" x="10" y="100"/>
+            <js:DropDownList id="ddlfoo" dataProvider="{dp}" x="100" y="10" change="Cursors.setCursor(foo, ddlfoo.selectedItem as String)"/>
+            <js:DropDownList id="ddlbar" dataProvider="{dp}" x="100" y="100" change="Cursors.setCursor(bar, ddlbar.selectedItem as String)"/>
+        </js:View>
+	</js:initialView>
+</js:Application>


[4/5] git commit: [flex-asjs] [refs/heads/tlf] - lookup other cursors in ValuesManager

Posted by ah...@apache.org.
lookup other cursors in ValuesManager


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b9d5e8e1
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b9d5e8e1
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b9d5e8e1

Branch: refs/heads/tlf
Commit: b9d5e8e114e77270c30389d793024a89c43bc037
Parents: 8d5a8e6
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jun 22 11:57:04 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jun 22 11:57:29 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/css2/Cursors.as   | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b9d5e8e1/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
index 8671ca0..96ef8f4 100644
--- a/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/css2/Cursors.as
@@ -19,14 +19,18 @@
 package org.apache.flex.css2
 {
     import org.apache.flex.core.IUIBase;
+    import org.apache.flex.core.ValuesManager;
     import org.apache.flex.events.MouseEvent;
     
     COMPILE::SWF
     {
         import flash.display.DisplayObject;
+        import flash.display.BitmapData;
+        import flash.display.Sprite;
         import flash.geom.Point;
         import flash.ui.Mouse;
         import flash.ui.MouseCursor;
+        import flash.ui.MouseCursorData;
     }
     COMPILE::JS
     {
@@ -67,6 +71,12 @@ package org.apache.flex.css2
         COMPILE::JS
         public static const TEXT:String = "text";
         
+        COMPILE::SWF
+        private static const builtinCursors:Array = [MouseCursor.AUTO, 
+                                                MouseCursor.ARROW,
+                                                MouseCursor.BUTTON,
+                                                MouseCursor.IBEAM];
+        
         /**
          *  Constructor.
          *
@@ -118,6 +128,24 @@ package org.apache.flex.css2
                     obj.addEventListener(MouseEvent.MOUSE_OVER, overHandler);
                     obj.addEventListener(MouseEvent.MOUSE_OUT, outHandler);
                 }
+                if (builtinCursors.indexOf(cursor) == -1)
+                {
+                    var c:Class = ValuesManager.valuesImpl.getValue(obj, cursor) as Class;
+                    if (c)
+                    {
+                        var foo:Object = new c();
+                        var inst:Sprite = new c() as Sprite;
+                        if (inst)
+                        {
+                            var bd:BitmapData = new BitmapData(32, 32, true, 0);
+                            bd.draw(inst);
+                            var mcd:MouseCursorData = new MouseCursorData();
+                            mcd.data = Vector.<BitmapData>([bd]);
+                            Mouse.registerCursor(cursor, mcd);
+                            builtinCursors.push(cursor);
+                        }
+                    }
+                }
                 cursorData.cursor = cursor;
                 
                 var displayObject:DisplayObject = obj as DisplayObject;