You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by pe...@apache.org on 2018/04/06 14:56:51 UTC

[royale-asjs] branch feature/MXRoyale updated: MoveEvent.as and ValidationResultEvent.as Added (#149)

This is an automated email from the ASF dual-hosted git repository.

pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
     new 43641c2  MoveEvent.as and ValidationResultEvent.as Added (#149)
43641c2 is described below

commit 43641c2af771400b5097b8af3e96d0b56198bbb8
Author: Alina <36...@users.noreply.github.com>
AuthorDate: Fri Apr 6 19:56:49 2018 +0500

    MoveEvent.as and ValidationResultEvent.as Added (#149)
    
    * MoveEvent.as Copied FlexSDK->Royale
    
    mx.events.MoveEvent Copied FlexSDK->Royale
    
    * Update MXRoyaleClasses.as for MoveEvent
    
    Update MXRoyaleClasses.as for MoveEvent
    
    * Update MoveEvent.as
    
    Update MoveEvent.as
    
    * ValidationResultEvent.as FlexSDK->Royale
    
    mx.events.ValidationResultEvent FlexSDK->Royale
    
    * Update ValidationResultEvent.as
    
    Update ValidationResultEvent.as
    
    * Update MXRoyaleClasses.as : ValidationResultEvent
    
    Update MXRoyaleClasses.as for  ValidationResultEvent
    
    * MoveEvent Product Version Updated
    
    MoveEvent Product Version Updated
    
    * ValidationResultEvent Productversion Updated
    
    ValidationResultEvent Productversion Updated
---
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   2 +
 .../src/main/royale/mx/events/MoveEvent.as         | 161 ++++++++++++++
 .../main/royale/mx/events/ValidationResultEvent.as | 239 +++++++++++++++++++++
 3 files changed, 402 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 9019e0b..22dd985 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -37,6 +37,8 @@ internal class MXRoyaleClasses
 	import mx.containers.ControlBar; ControlBar;
 	import mx.controls.ToolTip; ToolTip;
 	import mx.controls.beads.ToolTipBead; ToolTipBead;
+	import mx.events.MoveEvent; MoveEvent;
+	import mx.events.ValidationResultEvent; ValidationResultEvent;
 	import mx.containers.Tile; Tile;
 	import mx.containers.DividedBox; DividedBox;
 	import mx.containers.beads.ApplicationLayout; ApplicationLayout;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/MoveEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/MoveEvent.as
new file mode 100644
index 0000000..e06b048
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/MoveEvent.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.events
+{
+/* import mx.events.Event;*/
+import org.apache.royale.events.Event;
+import org.apache.royale.events.IRoyaleEvent;
+/**
+ *  Represents event objects that are dispatched when a Flex component moves.
+ *
+ *  @see mx.core.UIComponent
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Royale 0.9.3
+ *  @royalesuppresspublicvarwarning
+ */
+public class MoveEvent extends Event
+{
+   /*  include "../core/Version.as"; */
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  The <code>MoveEvent.MOVE</code> constant defines the value of the
+	 *  <code>type</code> property of the event object for a <code>move</code> event.
+	 *
+     *	<p>The properties of the event object have the following values:</p>
+	 *  <table class="innertable">
+	 *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines the
+     *       event listener that handles the event. For example, if you use
+     *       <code>myButton.addEventListener()</code> to register an event listener,
+     *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+     *     <tr><td><code>oldX</code></td><td>The previous x coordinate of the object, in pixels.</td></tr>
+     *     <tr><td><code>oldY</code></td><td>The previous y coordinate of the object, in pixels.</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the event;
+     *       it is not always the Object listening for the event.
+     *       Use the <code>currentTarget</code> property to always access the
+     *       Object listening for the event.</td></tr>
+	 *  </table>
+	 *
+     *  @eventType move
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public static const MOVE:String = "move";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param type The event type; indicates the action that caused the event.
+	 *
+	 *  @param bubbles Specifies whether the event can bubble
+	 *  up the display list hierarchy.
+	 *
+	 *  @param cancelable Specifies whether the behavior
+	 *  associated with the event can be prevented.
+	 *
+	 *  @param oldX The previous x coordinate of the object, in pixels.
+	 *
+	 *  @param oldY The previous y coordinate of the object, in pixels.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public function MoveEvent(type:String, bubbles:Boolean = false,
+							  cancelable:Boolean = false,
+							  oldX:Number = NaN, oldY:Number = NaN)
+	{
+		super(type, bubbles, cancelable);
+
+		this.oldX = oldX;
+		this.oldY = oldY;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  oldX
+	//----------------------------------
+
+	/**
+	 *  The previous <code>x</code> coordinate of the object, in pixels.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public var oldX:Number;
+
+	//----------------------------------
+	//  oldY
+	//----------------------------------
+
+	/**
+	 *  The previous <code>y</code> coordinate of the object, in pixels.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public var oldY:Number;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: Event
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override public function cloneEvent():IRoyaleEvent
+	{
+		return new MoveEvent(type, bubbles, cancelable, oldX, oldY);
+	}
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/ValidationResultEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/ValidationResultEvent.as
new file mode 100644
index 0000000..5147354
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/ValidationResultEvent.as
@@ -0,0 +1,239 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.events
+{
+
+/* import flash.events.Event; */
+
+import org.apache.royale.events.Event;
+import org.apache.royale.events.IRoyaleEvent;
+/**
+ *  The ValidationResultEvent class represents the event object 
+ *  passed to the listener for the <code>valid</code> validator event
+ *  or the <code>invalid</code> validator event. 
+ *
+ *  @see mx.validators.Validator
+ *  @see mx.validators.ValidationResult
+ *  @see mx.validators.RegExpValidationResult
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Royale 0.9.3
+ *  @royalesuppresspublicvarwarning
+ */
+public class ValidationResultEvent extends Event
+{
+/*     include "../core/Version.as"; */
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+	
+	/**
+	 *  The <code>ValidationResultEvent.INVALID</code> constant defines the value of the 
+	 *  <code>type</code> property of the event object for an <code>invalid</code> event.
+	 *  The value of this constant is "invalid".
+	 *
+	 *  <p>The properties of the event object have the following values:</p>
+	 *  <table class="innertable">
+	 *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines the 
+     *       event listener that handles the event. For example, if you use 
+     *       <code>myButton.addEventListener()</code> to register an event listener, 
+     *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+     *     <tr><td><code>field</code></td><td>The name of the field that failed validation.</td></tr>
+     *     <tr><td><code>message</code></td><td>A single string that contains 
+     *       every error message from all of the ValidationResult objects in the results Array.</td></tr>
+     *     <tr><td><code>results</code></td><td>An array of ValidationResult objects, 
+     *       one per validated field.</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the event; 
+     *       it is not always the Object listening for the event. 
+     *       Use the <code>currentTarget</code> property to always access the 
+     *       Object listening for the event.</td></tr>
+	 *  </table>
+	 *
+     *  @eventType invalid 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public static const INVALID:String = "invalid";
+
+	/**
+	 *  The <code>ValidationResultEvent.VALID</code> constant defines the value of the 
+	 *  <code>type</code> property of the event object for a <code>valid</code>event.
+	 *  The value of this constant is "valid".
+	 *
+	 *  <p>The properties of the event object have the following values:</p>
+	 *  <table class="innertable">
+	 *     <tr><th>Property</th><th>Value</th></tr>
+     *     <tr><td><code>bubbles</code></td><td>false</td></tr>
+     *     <tr><td><code>cancelable</code></td><td>false</td></tr>
+     *     <tr><td><code>currentTarget</code></td><td>The Object that defines the 
+     *       event listener that handles the event. For example, if you use 
+     *       <code>myButton.addEventListener()</code> to register an event listener, 
+     *       myButton is the value of the <code>currentTarget</code>. </td></tr>
+     *     <tr><td><code>field</code></td><td>An empty String.</td></tr>
+     *     <tr><td><code>message</code></td><td>An empty String.</td></tr>
+     *     <tr><td><code>results</code></td><td>An empty Array.</td></tr>
+     *     <tr><td><code>target</code></td><td>The Object that dispatched the event; 
+     *       it is not always the Object listening for the event. 
+     *       Use the <code>currentTarget</code> property to always access the 
+     *       Object listening for the event.</td></tr>
+	 *  </table>
+	 *
+     *  @eventType valid 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+	public static const VALID:String = "valid";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *
+	 *  @param type The event type; indicates the action that caused the event.
+	 *
+	 *  @param bubbles Specifies whether the event can bubble up the 
+	 *  display list hierarchy.
+	 *
+	 *  @param cancelable Specifies whether the behavior associated with the event can be prevented.
+	 *
+	 *  @param field The name of the field that failed validation and triggered the event.
+	 *
+	 *  @param results An array of ValidationResult objects, one per validated field. 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+    public function ValidationResultEvent(type:String, bubbles:Boolean = false,
+										  cancelable:Boolean = false,
+										  field:String = null,
+										  results:Array = null)
+    {
+        super(type, bubbles, cancelable);
+
+        this.field = field;
+        this.results = results;
+    }
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+    //  field
+    //----------------------------------
+
+	/**
+	 *  The name of the field that failed validation and triggered the event.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+    public var field:String;
+	
+	//----------------------------------
+    //  message
+    //----------------------------------
+
+	/**
+	 *  A single string that contains every error message from all
+	 *  of the ValidationResult objects in the results Array.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+    public function get message():String
+    {
+        var msg:String = "";
+		var n:int;
+		
+		if (results)
+			n = results.length;
+		
+		for (var i:int = 0; i < n; ++i)
+        {
+			if (results[i].isError)
+			{
+	            msg += msg == "" ? "" : "\n";
+				msg += results[i].errorMessage;
+			}
+        }
+        
+		return msg;
+    }
+
+	//----------------------------------
+    //  results
+    //----------------------------------
+
+	/**
+	 *  An array of ValidationResult objects, one per validated field. 
+	 *
+	 *  @see mx.validators.ValidationResult
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Royale 0.9.3
+	 */
+    public var results:Array;
+	
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: Event
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override public function cloneEvent():IRoyaleEvent
+	{
+		return new ValidationResultEvent(type, bubbles, cancelable,
+										 field, results);
+	}
+}
+
+}

-- 
To stop receiving notification emails like this one, please contact
pent@apache.org.