flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [21/28] git commit: [flex-asjs] [refs/heads/develop] - Move Drag/Drop controllers to FlexJSJX
Date Tue, 11 Nov 2014 22:08:37 GMT
Move Drag/Drop controllers to FlexJSJX


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

Branch: refs/heads/develop
Commit: ad25e3ffb989ae7b56fa9c2b5ec792f4e6b9ef9e
Parents: 6a9ea39
Author: Alex Harui <aharui@apache.org>
Authored: Fri Nov 7 11:07:39 2014 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Nov 11 14:07:59 2014 -0800

----------------------------------------------------------------------
 .../as/projects/FlexJSJX/basic-manifest.xml     |   3 +
 .../as/projects/FlexJSJX/src/FlexJSJXClasses.as |   1 +
 .../src/org/apache/flex/core/DropType.as        |  64 +++++
 .../beads/controllers/DragMouseController.as    | 286 +++++++++++++++++++
 .../beads/controllers/DropMouseController.as    | 188 ++++++++++++
 .../as/projects/FlexJSUI/basic-manifest.xml     |   2 -
 .../as/projects/FlexJSUI/src/FlexJSUIClasses.as |   2 +-
 .../src/org/apache/flex/core/DropType.as        |  64 -----
 .../beads/controllers/DragMouseController.as    | 284 ------------------
 .../beads/controllers/DropMouseController.as    | 188 ------------
 10 files changed, 543 insertions(+), 539 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSJX/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/basic-manifest.xml b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
index 6508bf5..8070963 100644
--- a/frameworks/as/projects/FlexJSJX/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSJX/basic-manifest.xml
@@ -57,6 +57,9 @@
     <component id="SVGWedgeItemRenderer" class="org.apache.flex.charts.supportClasses.optimized.SVGWedgeItemRenderer"/>
     <component id="SVGLineSegmentItemRenderer" class="org.apache.flex.charts.supportClasses.optimized.SVGLineSegmentItemRenderer"/>
 
+    <component id="DragMouseController" class="org.apache.flex.html.beads.controllers.DragMouseController"
/>
+    <component id="DropMouseController" class="org.apache.flex.html.beads.controllers.DropMouseController"
/>
+
     <component id="Fade" class="org.apache.flex.effects.Fade"/>
     <component id="Move" class="org.apache.flex.effects.Move"/>
     <component id="Resize" class="org.apache.flex.effects.Resize"/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as b/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
index 423ac18..d4e51a6 100644
--- a/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
+++ b/frameworks/as/projects/FlexJSJX/src/FlexJSJXClasses.as
@@ -76,6 +76,7 @@ internal class FlexJSJXClasses
     import org.apache.flex.html.beads.TitleBarView; TitleBarView;
     import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
 
+    import org.apache.flex.core.DropType; DropType;
     import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead;
     import org.apache.flex.core.StatesWithTransitionsImpl; StatesWithTransitionsImpl;
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/DropType.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/DropType.as b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/DropType.as
new file mode 100644
index 0000000..9df59cf
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/core/DropType.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.core
+{
+    /**
+     *  The DropType class provides a set of constant values of
+     *  types of drops in a drag/drop operation
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class DropType
+	{
+		
+        /**
+         *  The data should be moved.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public static const MOVE:String = "move";
+		
+        /**
+         *  The data should be copied.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const COPY:String = "copy";
+        
+        /**
+         *  The drop should be cancelled.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const CANCEL:String = "cancel";
+        
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
new file mode 100644
index 0000000..5cb5f54
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DragMouseController.as
@@ -0,0 +1,286 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controllers
+{
+	
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IDragInitiator;
+    import org.apache.flex.core.IPopUpHost;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.DragEvent;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.geom.Point;
+	import org.apache.flex.utils.PointUtils;
+    import org.apache.flex.utils.UIUtils;
+	
+    /**
+     *  Indicates that a drag/drop operation is starting.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragStart", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that the mouse is moving during
+     *  a drag/drop operation.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragMove", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that a drag/drop operation is ending.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragEnd", type="org.apache.flex.events.DragEvent")]
+    
+	/**
+	 *  The DragMouseController bead handles mouse events on the 
+	 *  a component, looking for activity that constitutes the start
+     *  of a drag drop operation.
+	 *  
+     *  @flexjsignoreimport org.apache.flex.core.IDragInitiator
+     *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DragMouseController extends EventDispatcher implements IBead
+	{
+        /**
+         *  The data being dragged. Or an instance
+         *  of an object describing the data.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragSource:Object;
+        
+        /**
+         *  The object that wants to know if a
+         *  drop is accepted.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragInitiator:IDragInitiator;
+        
+        /**
+         *  Whether there is a drag operation
+         *  in progress.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragging:Boolean;
+        
+        /**
+         *  The drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImage:IUIBase;
+        
+        /**
+         *  The offset of the drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImageOffsetX:Number = 0;
+        
+        /**
+         *  The offset of the drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImageOffsetY:Number = 0;
+        
+        /**
+         *  The default movement in x and or y that
+         *  means a drag should start
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var defaultThreshold:int = 4;
+        
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DragMouseController()
+		{
+            threshold = defaultThreshold;
+		}
+		
+        /**
+         *  The movement in x and or y that
+         *  means a drag should start
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var threshold:int = 4;
+        
+		private var _strand:IStrand;
+		
+		/**
+		 *  @copy org.apache.flex.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+            IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_DOWN, dragMouseDownHandler);
+		}
+		
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+        
+        private var mouseDownX:Number;
+        private var mouseDownY:Number;
+        
+        private var host:IPopUpHost;
+        
+        /**
+         *  @private
+         */
+        private function dragMouseDownHandler(event:MouseEvent):void
+        {
+            trace("dragMouseDown");
+            IUIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_MOVE,
dragMouseMoveHandler);
+            IUIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_UP,
dragMouseUpHandler);
+            mouseDownX = event.stageX;
+            mouseDownY = event.stageY;
+        }
+        
+        private function dragMouseMoveHandler(event:MouseEvent):void
+        {
+            var pt:Point;
+            var dragEvent:DragEvent;
+            trace("dragMouseMove");
+            
+            if (!dragging)
+            {
+                trace("not dragging anything else");
+                if (Math.abs(event.stageX - mouseDownX) > threshold ||
+                    Math.abs(event.stageY - mouseDownY) > threshold)
+                {
+                    trace("sending dragStart");
+                    dragEvent = new DragEvent("dragStart", true, true);
+                    dragEvent.copyMouseEventProperties(event);
+                    IEventDispatcher(_strand).dispatchEvent(dragEvent);
+                    if (dragSource != null)
+                    {
+                        dragging = true;
+                        host = UIUtils.findPopUpHost(_strand as IUIBase);
+                        host.addElement(dragImage);
+                        pt = PointUtils.globalToLocal(new Point(event.stageX, event.stageY),
host);
+                        dragImage.x = pt.x + dragImageOffsetX;
+                        dragImage.y = pt.y + dragImageOffsetY;
+                    }
+                }
+            }
+            else
+            {
+                trace("sending dragMove", event.target);
+                dragEvent = new DragEvent("dragMove", true, true);
+                event.stopImmediatePropagation();
+                dragEvent.copyMouseEventProperties(event);
+                dragEvent.dragSource = dragSource;
+                dragEvent.dragInitiator = dragInitiator;
+                pt = PointUtils.globalToLocal(new Point(event.stageX, event.stageY), host);
+                dragImage.x = pt.x + dragImageOffsetX;
+                dragImage.y = pt.y + dragImageOffsetY;
+                event.target.dispatchEvent(dragEvent);
+            }
+        }
+        
+        private function dragMouseUpHandler(event:MouseEvent):void
+        {
+            trace("dragMouseUp");
+            var dragEvent:DragEvent;
+            
+            if (dragging)
+            {
+                trace("sending dragEnd");
+                dragEvent = new DragEvent("dragEnd", true, true);
+                dragEvent.copyMouseEventProperties(event);
+                event.stopImmediatePropagation();
+                dragEvent.dragSource = dragSource;
+                dragEvent.dragInitiator = dragInitiator;
+                event.target.dispatchEvent(dragEvent);
+            }
+            dragging = false;
+            dragSource = null;
+            dragInitiator = null;
+            if (dragImage && host)
+                host.removeElement(dragImage);
+            dragImage = null;
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_MOVE,
dragMouseMoveHandler);
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_UP,
dragMouseUpHandler);			
+        }
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DropMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DropMouseController.as
b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DropMouseController.as
new file mode 100644
index 0000000..82a277a
--- /dev/null
+++ b/frameworks/as/projects/FlexJSJX/src/org/apache/flex/html/beads/controllers/DropMouseController.as
@@ -0,0 +1,188 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controllers
+{
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IDragInitiator;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.DragEvent;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.MouseEvent;
+
+    /**
+     *  Indicates that the mouse has entered the component during
+     *  a drag operatino.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragEnter", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that the mouse is moving over a component during
+     *  a drag/drop operation.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragOver", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that a drop operation should be executed.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragDrop", type="org.apache.flex.events.DragEvent")]
+    
+	/**
+	 *  The DropMouseController bead handles mouse events on the 
+	 *  a component, looking for events from a drag/drop operation.
+	 *  
+     *  @flexjsignoreimport org.apache.flex.core.IDragInitiator
+     * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DropMouseController extends EventDispatcher implements IBead
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DropMouseController()
+		{
+		}
+		        
+		private var _strand:IStrand;
+		
+		/**
+		 *  @copy org.apache.flex.core.IBead#strand
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+            IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_MOVE, dragMoveHandler);
+		}
+		
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+        
+        private var inside:Boolean;
+        
+        private var dragSource:Object;
+        private var dragInitiator:IDragInitiator;
+        
+        public function acceptDragDrop(target:IUIBase, type:String):void
+        {
+            // TODO: aharui: switch icons
+        }
+        
+        /**
+         *  @private
+         */
+        private function dragMoveHandler(event:DragEvent):void
+        {
+            trace("dragMove");
+            var dragEvent:DragEvent;
+            if (!inside)
+            {
+                dragEvent = new DragEvent("dragEnter", true, true);
+                dragEvent.copyMouseEventProperties(event);
+                dragSource = dragEvent.dragSource = event.dragSource;
+                dragInitiator = dragEvent.dragInitiator = event.dragInitiator;
+                dispatchEvent(dragEvent);
+                inside = true;
+                IUIBase(_strand).topMostEventDispatcher.addEventListener(DragEvent.DRAG_END,
dragEndHandler);
+                IUIBase(_strand).addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
+            }
+            else
+            {
+                dragEvent = new DragEvent("dragOver", true, true);
+                dragEvent.copyMouseEventProperties(event);
+                dragEvent.dragSource = event.dragSource;
+                dragEvent.dragInitiator = event.dragInitiator;
+                IEventDispatcher(_strand).dispatchEvent(dragEvent);
+            }
+        }
+        
+        private function rollOutHandler(event:MouseEvent):void
+        {
+            var dragEvent:DragEvent;
+            
+            if (inside)
+            {
+                dragEvent = new DragEvent("dragExit", true, true);
+                dragEvent.copyMouseEventProperties(event);
+                dragEvent.dragSource = dragSource;
+                dragEvent.dragInitiator = dragInitiator;
+                dragSource = null;
+                dragInitiator = null;
+                event.stopImmediatePropagation();
+                dispatchEvent(dragEvent);
+                inside = false;
+            }
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(DragEvent.DRAG_END,
dragEndHandler);
+            IUIBase(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);		

+        }
+        
+        private function dragEndHandler(event:DragEvent):void
+        {
+            trace("dragEnd");
+            var dragEvent:DragEvent;
+            
+            dragEvent = new DragEvent("dragDrop", true, true);
+            dragEvent.copyMouseEventProperties(event);
+            dragEvent.dragSource = event.dragSource;
+            dragEvent.dragInitiator = event.dragInitiator;
+            dragSource = null;
+            dragInitiator = null;
+            event.stopImmediatePropagation();
+            dispatchEvent(dragEvent);
+            
+            inside = false;
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(DragEvent.DRAG_END,
dragEndHandler);
+            IUIBase(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);		

+        }
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSUI/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/basic-manifest.xml b/frameworks/as/projects/FlexJSUI/basic-manifest.xml
index 7672b35..b5d4405 100644
--- a/frameworks/as/projects/FlexJSUI/basic-manifest.xml
+++ b/frameworks/as/projects/FlexJSUI/basic-manifest.xml
@@ -88,8 +88,6 @@
     <component id="MixinManager" class="org.apache.flex.utils.MixinManager" />
     <component id="HRule" class="org.apache.flex.html.HRule" />
     <component id="Spacer" class="org.apache.flex.html.Spacer" />
-    <component id="DragMouseController" class="org.apache.flex.html.beads.controllers.DragMouseController"
/>
-    <component id="DropMouseController" class="org.apache.flex.html.beads.controllers.DropMouseController"
/>
     <component id="MXMLDragInitiator" class="org.apache.flex.core.MXMLDragInitiator" />
     <component id="CallLaterBead" class="org.apache.flex.core.CallLaterBead" />
     <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView"
/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
index 7dae39f..f6f998e 100644
--- a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
+++ b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
@@ -130,9 +130,9 @@ internal class FlexJSUIClasses
 	import org.apache.flex.core.graphics.Text; Text;
 	import org.apache.flex.core.graphics.GraphicsContainer; GraphicsContainer;
 	import org.apache.flex.core.graphics.LinearGradient; LinearGradient;
-    import org.apache.flex.core.DropType; DropType;
     import org.apache.flex.core.DataBindingBase; DataBindingBase;
     import org.apache.flex.effects.PlatformWiper; PlatformWiper;    
+    import org.apache.flex.events.DragEvent; DragEvent;    
     import org.apache.flex.geom.Rectangle; Rectangle;    
     
 	import mx.core.ClassFactory; ClassFactory;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/DropType.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/DropType.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/DropType.as
deleted file mode 100644
index 9df59cf..0000000
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/DropType.as
+++ /dev/null
@@ -1,64 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.core
-{
-    /**
-     *  The DropType class provides a set of constant values of
-     *  types of drops in a drag/drop operation
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-	public class DropType
-	{
-		
-        /**
-         *  The data should be moved.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-		public static const MOVE:String = "move";
-		
-        /**
-         *  The data should be copied.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static const COPY:String = "copy";
-        
-        /**
-         *  The drop should be cancelled.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static const CANCEL:String = "cancel";
-        
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DragMouseController.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DragMouseController.as
deleted file mode 100644
index 0fbee44..0000000
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DragMouseController.as
+++ /dev/null
@@ -1,284 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
-	import flash.display.DisplayObject;
-	import flash.geom.Point;
-	
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IDragInitiator;
-    import org.apache.flex.core.IPopUpHost;
-	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IUIBase;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.events.DragEvent;
-	import org.apache.flex.events.EventDispatcher;
-	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.events.MouseEvent;
-	import org.apache.flex.utils.UIUtils;
-	
-    /**
-     *  Indicates that a drag/drop operation is starting.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragStart", type="org.apache.flex.events.DragEvent")]
-    
-    /**
-     *  Indicates that the mouse is moving during
-     *  a drag/drop operation.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragMove", type="org.apache.flex.events.DragEvent")]
-    
-    /**
-     *  Indicates that a drag/drop operation is ending.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragEnd", type="org.apache.flex.events.DragEvent")]
-    
-	/**
-	 *  The DragMouseController bead handles mouse events on the 
-	 *  a component, looking for activity that constitutes the start
-     *  of a drag drop operation.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class DragMouseController extends EventDispatcher implements IBead
-	{
-        /**
-         *  The data being dragged. Or an instance
-         *  of an object describing the data.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragSource:Object;
-        
-        /**
-         *  The object that wants to know if a
-         *  drop is accepted.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragInitiator:IDragInitiator;
-        
-        /**
-         *  Whether there is a drag operation
-         *  in progress.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragging:Boolean;
-        
-        /**
-         *  The drag image.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragImage:IUIBase;
-        
-        /**
-         *  The offset of the drag image.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragImageOffsetX:Number = 0;
-        
-        /**
-         *  The offset of the drag image.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var dragImageOffsetY:Number = 0;
-        
-        /**
-         *  The default movement in x and or y that
-         *  means a drag should start
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public static var defaultThreshold:int = 4;
-        
-		/**
-		 *  constructor.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function DragMouseController()
-		{
-            threshold = defaultThreshold;
-		}
-		
-        /**
-         *  The movement in x and or y that
-         *  means a drag should start
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion FlexJS 0.0
-         */
-        public var threshold:int = 4;
-        
-		private var _strand:IStrand;
-		
-		/**
-		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			
-            IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_DOWN, dragMouseDownHandler);
-		}
-		
-		public function get strand():IStrand
-		{
-			return _strand;
-		}
-        
-        private var mouseDownX:Number;
-        private var mouseDownY:Number;
-        
-        private var host:IPopUpHost;
-        
-        /**
-         *  @private
-         */
-        private function dragMouseDownHandler(event:MouseEvent):void
-        {
-            trace("dragMouseDown");
-            DisplayObject(_strand).stage.addEventListener(MouseEvent.MOUSE_MOVE, dragMouseMoveHandler);
-            DisplayObject(_strand).stage.addEventListener(MouseEvent.MOUSE_UP, dragMouseUpHandler);
-            mouseDownX = event.stageX;
-            mouseDownY = event.stageY;
-        }
-        
-        private function dragMouseMoveHandler(event:MouseEvent):void
-        {
-            var pt:Point;
-            var dragEvent:DragEvent;
-            trace("dragMouseMove");
-            
-            if (!dragging)
-            {
-                trace("not dragging anything else");
-                if (Math.abs(event.stageX - mouseDownX) > threshold ||
-                    Math.abs(event.stageY - mouseDownY) > threshold)
-                {
-                    trace("sending dragStart");
-                    dragEvent = new DragEvent("dragStart", true, true);
-                    dragEvent.copyMouseEventProperties(event);
-                    IEventDispatcher(_strand).dispatchEvent(dragEvent);
-                    if (dragSource != null)
-                    {
-                        dragging = true;
-                        host = UIUtils.findPopUpHost(_strand as IUIBase);
-                        host.addElement(dragImage);
-                        pt = DisplayObject(host).globalToLocal(new Point(event.stageX, event.stageY));
-                        dragImage.x = pt.x + dragImageOffsetX;
-                        dragImage.y = pt.y + dragImageOffsetY;
-                    }
-                }
-            }
-            else
-            {
-                trace("sending dragMove", event.target);
-                dragEvent = new DragEvent("dragMove", true, true);
-                event.stopImmediatePropagation();
-                dragEvent.copyMouseEventProperties(event);
-                dragEvent.dragSource = dragSource;
-                dragEvent.dragInitiator = dragInitiator;
-                pt = DisplayObject(host).globalToLocal(new Point(event.stageX, event.stageY));
-                dragImage.x = pt.x + dragImageOffsetX;
-                dragImage.y = pt.y + dragImageOffsetY;
-                event.target.dispatchEvent(dragEvent);
-            }
-        }
-        
-        private function dragMouseUpHandler(event:MouseEvent):void
-        {
-            trace("dragMouseUp");
-            var dragEvent:DragEvent;
-            
-            if (dragging)
-            {
-                trace("sending dragEnd");
-                dragEvent = new DragEvent("dragEnd", true, true);
-                dragEvent.copyMouseEventProperties(event);
-                event.stopImmediatePropagation();
-                dragEvent.dragSource = dragSource;
-                dragEvent.dragInitiator = dragInitiator;
-                event.target.dispatchEvent(dragEvent);
-            }
-            dragging = false;
-            dragSource = null;
-            dragInitiator = null;
-            if (dragImage && host)
-                host.removeElement(dragImage);
-            dragImage = null;
-            DisplayObject(_strand).stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragMouseMoveHandler);
-            DisplayObject(_strand).stage.removeEventListener(MouseEvent.MOUSE_UP, dragMouseUpHandler);
		
-        }
-		
-	}
-}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ad25e3ff/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DropMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DropMouseController.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DropMouseController.as
deleted file mode 100644
index e3a7ac6..0000000
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/beads/controllers/DropMouseController.as
+++ /dev/null
@@ -1,188 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
-	import flash.display.DisplayObject;
-	
-	import org.apache.flex.core.IBead;
-	import org.apache.flex.core.IDragInitiator;
-	import org.apache.flex.core.IStrand;
-    import org.apache.flex.core.IUIBase;
-	import org.apache.flex.core.UIBase;
-	import org.apache.flex.events.DragEvent;
-	import org.apache.flex.events.EventDispatcher;
-	import org.apache.flex.events.IEventDispatcher;
-    import org.apache.flex.events.MouseEvent;
-
-    /**
-     *  Indicates that the mouse has entered the component during
-     *  a drag operatino.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragEnter", type="org.apache.flex.events.DragEvent")]
-    
-    /**
-     *  Indicates that the mouse is moving over a component during
-     *  a drag/drop operation.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragOver", type="org.apache.flex.events.DragEvent")]
-    
-    /**
-     *  Indicates that a drop operation should be executed.
-     *  
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    [Event(name="dragDrop", type="org.apache.flex.events.DragEvent")]
-    
-	/**
-	 *  The DropMouseController bead handles mouse events on the 
-	 *  a component, looking for events from a drag/drop operation.
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion FlexJS 0.0
-	 */
-	public class DropMouseController extends EventDispatcher implements IBead
-	{
-		/**
-		 *  constructor.
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function DropMouseController()
-		{
-		}
-		        
-		private var _strand:IStrand;
-		
-		/**
-		 *  @copy org.apache.flex.core.IBead#strand
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion FlexJS 0.0
-		 */
-		public function set strand(value:IStrand):void
-		{
-			_strand = value;
-			
-            IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_MOVE, dragMoveHandler);
-		}
-		
-		public function get strand():IStrand
-		{
-			return _strand;
-		}
-        
-        private var inside:Boolean;
-        
-        private var dragSource:Object;
-        private var dragInitiator:IDragInitiator;
-        
-        public function acceptDragDrop(target:IUIBase, type:String):void
-        {
-            // TODO: aharui: switch icons
-        }
-        
-        /**
-         *  @private
-         */
-        private function dragMoveHandler(event:DragEvent):void
-        {
-            trace("dragMove");
-            var dragEvent:DragEvent;
-            if (!inside)
-            {
-                dragEvent = new DragEvent("dragEnter", true, true);
-                dragEvent.copyMouseEventProperties(event);
-                dragSource = dragEvent.dragSource = event.dragSource;
-                dragInitiator = dragEvent.dragInitiator = event.dragInitiator;
-                dispatchEvent(dragEvent);
-                inside = true;
-                DisplayObject(_strand).stage.addEventListener(DragEvent.DRAG_END, dragEndHandler);
-                DisplayObject(_strand).addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
-            }
-            else
-            {
-                dragEvent = new DragEvent("dragOver", true, true);
-                dragEvent.copyMouseEventProperties(event);
-                dragEvent.dragSource = event.dragSource;
-                dragEvent.dragInitiator = event.dragInitiator;
-                IEventDispatcher(_strand).dispatchEvent(dragEvent);
-            }
-        }
-        
-        private function rollOutHandler(event:MouseEvent):void
-        {
-            var dragEvent:DragEvent;
-            
-            if (inside)
-            {
-                dragEvent = new DragEvent("dragExit", true, true);
-                dragEvent.copyMouseEventProperties(event);
-                dragEvent.dragSource = dragSource;
-                dragEvent.dragInitiator = dragInitiator;
-                dragSource = null;
-                dragInitiator = null;
-                event.stopImmediatePropagation();
-                dispatchEvent(dragEvent);
-                inside = false;
-            }
-            DisplayObject(_strand).stage.removeEventListener(DragEvent.DRAG_END, dragEndHandler);
-            DisplayObject(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
		
-        }
-        
-        private function dragEndHandler(event:DragEvent):void
-        {
-            trace("dragEnd");
-            var dragEvent:DragEvent;
-            
-            dragEvent = new DragEvent("dragDrop", true, true);
-            dragEvent.copyMouseEventProperties(event);
-            dragEvent.dragSource = event.dragSource;
-            dragEvent.dragInitiator = event.dragInitiator;
-            dragSource = null;
-            dragInitiator = null;
-            event.stopImmediatePropagation();
-            dispatchEvent(dragEvent);
-            
-            inside = false;
-            DisplayObject(_strand).stage.removeEventListener(DragEvent.DRAG_END, dragEndHandler);
-            DisplayObject(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
		
-        }
-		
-	}
-}


Mime
View raw message