You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/03/25 10:45:37 UTC

[royale-asjs] branch develop updated (a3158ab -> 3507f9c)

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

gregdove pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git.


    from a3158ab  some layouts were being missed
     new c08c41d  Responder is not an IEventDispatcher
     new 540ef1e  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
     new 0b90c16  Support more legacy code.
     new 3a810bc  restore unwatch method in ChangeWatcher
     new 370efba  Adding ZipCodeFormatter (function still to be verified/tested)
     new 3507f9c  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   1 +
 .../main/royale/mx/binding/utils/ChangeWatcher.as  |   4 +-
 .../menuClasses/IMenuDataDescriptor.as}            | 143 +++++-----
 .../controls/treeClasses/DefaultDataDescriptor.as  |   3 +-
 .../royale/mx/formatters/SwitchSymbolFormatter.as  |  11 +-
 .../main/royale/mx/formatters/ZipCodeFormatter.as  | 296 +++++++++++++++++++++
 .../main/royale/org/apache/royale/net/Responder.as |   4 +-
 7 files changed, 370 insertions(+), 92 deletions(-)
 copy frameworks/projects/MXRoyale/src/main/royale/mx/{core/IDisplayObjectInterface.as => controls/menuClasses/IMenuDataDescriptor.as} (52%)
 create mode 100644 frameworks/projects/MXRoyale/src/main/royale/mx/formatters/ZipCodeFormatter.as


[royale-asjs] 01/06: Responder is not an IEventDispatcher

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c08c41d29e82b1a4331adec5481a560951614f41
Author: greg-dove <gr...@gmail.com>
AuthorDate: Tue Mar 24 12:42:04 2020 +1300

    Responder is not an IEventDispatcher
---
 .../Network/src/main/royale/org/apache/royale/net/Responder.as        | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/Responder.as b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/Responder.as
index 61822bf..82fa940 100755
--- a/frameworks/projects/Network/src/main/royale/org/apache/royale/net/Responder.as
+++ b/frameworks/projects/Network/src/main/royale/org/apache/royale/net/Responder.as
@@ -22,9 +22,7 @@ package org.apache.royale.net
     {
         import flash.net.Responder;
     }
-        
-	[Event(name="result", type="org.apache.royale.net.events.ResultEvent")]
-	[Event(name="fault", type="org.apache.royale.net.events.FaultEvent")]
+
 	public class Responder
 	{		
 		/** 


[royale-asjs] 02/06: Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 540ef1e7d57fa55f04c3f03541fb237ef337b104
Merge: c08c41d 7499534
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 25 06:24:49 2020 +1300

    Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

 build.properties                                   |   2 +-
 examples/build.xml                                 |   4 +-
 .../src/main/royale/AdvancedListPlayGround.mxml    |   2 +-
 .../src/main/royale/ButtonPlayGround.mxml          |   8 +-
 .../src/main/royale/ComboBoxPlayGround.mxml        |  16 ++--
 .../src/main/royale/DataGridPlayGround.mxml        |   2 +-
 .../src/main/royale/DropDownListPlayGround.mxml    |  18 ++--
 .../src/main/royale/GridPlayGround.mxml            |   4 +-
 .../src/main/royale/LayoutsPlayGround.mxml         |   8 +-
 .../src/main/royale/ListPlayGround.mxml            |   4 +-
 .../src/main/royale/NumericStepperPlayGround.mxml  |   8 +-
 .../src/main/royale/TablePlayGround.mxml           |   4 +-
 .../src/main/royale/WelcomeSection.mxml            |   2 +-
 .../src/main/royale/WizardPlayGround.mxml          |   2 +-
 .../ExampleAndSourceCodeTabbedSectionContent.as    |   2 +-
 .../src/main/royale/components/FormExample.mxml    |   2 +-
 .../itemRenderers/SimpleIconListItemRenderer.mxml  |   2 +-
 .../TabBarHorizontalIconItemRenderer.mxml          |   2 +-
 .../TabBarVerticalIconItemRenderer.mxml            |   2 +-
 .../Basic/src/main/resources/basic-manifest.xml    |   1 +
 .../projects/Basic/src/main/royale/BasicClasses.as |   3 +-
 .../org/apache/royale/html/beads/SetFocus.as       |  97 +++++++++++++++++++
 .../projects/Jewel/src/main/resources/defaults.css |   3 +
 .../royale/org/apache/royale/jewel/Container.as    |   5 +-
 .../main/royale/org/apache/royale/jewel/Group.as   |   5 +-
 .../royale/jewel/beads/layouts/StyledLayoutBase.as |   5 +-
 .../royale/jewel/beads/views/FormItemView.as       |   4 +-
 .../apache/royale/jewel/beads/views/WizardView.as  |   4 +-
 pom.xml                                            |  45 +++++----
 releasesteps.xml                                   | 106 ++++++++++-----------
 30 files changed, 242 insertions(+), 130 deletions(-)


[royale-asjs] 04/06: restore unwatch method in ChangeWatcher

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3a810bc9a9d79efc3ec5b882281ee4369f32d720
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 25 12:22:14 2020 +1300

    restore unwatch method in ChangeWatcher
---
 .../MXRoyale/src/main/royale/mx/binding/utils/ChangeWatcher.as        | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/binding/utils/ChangeWatcher.as b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/utils/ChangeWatcher.as
index e5805d6..addd3aa 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/binding/utils/ChangeWatcher.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/binding/utils/ChangeWatcher.as
@@ -438,10 +438,10 @@ public class ChangeWatcher
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    /*public function unwatch():void
+    public function unwatch():void
     {
         reset(null);
-    }*/
+    }
 
     /**
      *  Retrieves the current value of the watched property or property chain,


[royale-asjs] 03/06: Support more legacy code.

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0b90c16d263f106f304bae234e8012564d0e2298
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 25 10:35:02 2020 +1300

    Support more legacy code.
---
 .../mx/controls/menuClasses/IMenuDataDescriptor.as | 169 +++++++++++++++++++++
 .../controls/treeClasses/DefaultDataDescriptor.as  |   3 +-
 2 files changed, 171 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/menuClasses/IMenuDataDescriptor.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/menuClasses/IMenuDataDescriptor.as
new file mode 100644
index 0000000..762e058
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/menuClasses/IMenuDataDescriptor.as
@@ -0,0 +1,169 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.controls.menuClasses
+{
+
+import mx.collections.ICollectionView;
+
+/**
+ *  The IMenuDataDescriptor interface defines the interface that a 
+ *  dataDescriptor for a Menu or MenuBar control must implement. 
+ *  The interface provides methods for parsing and modifyng a collection
+ *  of data that is displayed by a Menu or MenuBar control.
+ *
+ *  @see mx.collections.ICollectionView
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public interface IMenuDataDescriptor
+{
+	//--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#getChildren()  
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function getChildren(node:Object, model:Object = null):ICollectionView;
+	
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#hasChildren() 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function hasChildren(node:Object, model:Object = null):Boolean;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#getData() 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function getData(node:Object, model:Object = null):Object;
+
+    /**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#isBranch() 
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function isBranch(node:Object, model:Object = null):Boolean;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#getType()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function getType(node:Object):String;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#addChildAt()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function addChildAt(parent:Object, newChild:Object, index:int,
+						model:Object = null):Boolean;
+
+    /**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#removeChildAt()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    function removeChildAt(parent:Object, child:Object, index:int,
+						   model:Object = null):Boolean;
+	
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#isEnabled()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function isEnabled(node:Object):Boolean;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#setEnabled()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function setEnabled(node:Object, value:Boolean):void;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#isToggled()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function isToggled(node:Object):Boolean;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#setToggled()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function setToggled(node:Object, value:Boolean):void;
+
+	/**
+     *  @copy mx.controls.treeClasses.DefaultDataDescriptor#getGroupName()
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+	function getGroupName(node:Object):String;
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/DefaultDataDescriptor.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/DefaultDataDescriptor.as
index 2ae72ca..5dda85d 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/DefaultDataDescriptor.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/DefaultDataDescriptor.as
@@ -27,6 +27,7 @@ import mx.collections.IList;
 import mx.collections.IViewCursor;
 import mx.collections.XMLListCollection;
 import mx.core.mx_internal;
+import mx.controls.menuClasses.IMenuDataDescriptor;
 
 import org.apache.royale.utils.UIDUtil;
 
@@ -55,7 +56,7 @@ use namespace mx_internal;
  *  @playerversion AIR 1.1
  *  @productversion Flex 3
  */
-public class DefaultDataDescriptor implements ITreeDataDescriptor2 //, IMenuDataDescriptor
+public class DefaultDataDescriptor implements ITreeDataDescriptor2 , IMenuDataDescriptor
 {
 //    include "../../core/Version.as";
 


[royale-asjs] 05/06: Adding ZipCodeFormatter (function still to be verified/tested)

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 370efba0e62af0177975782989864204b8528eb7
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 25 13:30:22 2020 +1300

    Adding ZipCodeFormatter (function still to be verified/tested)
---
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   1 +
 .../royale/mx/formatters/SwitchSymbolFormatter.as  |  11 +-
 .../main/royale/mx/formatters/ZipCodeFormatter.as  | 296 +++++++++++++++++++++
 3 files changed, 302 insertions(+), 6 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 50e7b37..c2fab52 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -138,6 +138,7 @@ internal class MXRoyaleClasses
 	import mx.styles.StyleManagerImpl; StyleManagerImpl;
 	import mx.modules.IModuleInfo; IModuleInfo;
 	import mx.formatters.SwitchSymbolFormatter; SwitchSymbolFormatter;
+	import mx.formatters.ZipCodeFormatter; ZipCodeFormatter;
 	import mx.printing.FlexPrintJob; FlexPrintJob; 
 	import mx.utils.URLUtil; URLUtil;
 	import mx.core.UITextField; UITextField;
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/SwitchSymbolFormatter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/SwitchSymbolFormatter.as
index 8287c09..f357484 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/SwitchSymbolFormatter.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/SwitchSymbolFormatter.as
@@ -87,8 +87,7 @@ public class SwitchSymbolFormatter
     {
         super();
 
-        //this.numberSymbol = numberSymbol;
-        //isValid = true;
+        this.numberSymbol = numberSymbol;
     }
 
     //--------------------------------------------------------------------------
@@ -100,12 +99,12 @@ public class SwitchSymbolFormatter
     /**
      *  @private
      */
-   // private var numberSymbol:String;
+    private var numberSymbol:String;
     
     /**
      *  @private
      */
-   // private var isValid:Boolean;
+    private var isValid:Boolean = true;
 
     //--------------------------------------------------------------------------
     //
@@ -129,7 +128,7 @@ public class SwitchSymbolFormatter
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.3
      */
-   /*  public function formatValue(format:String, source:Object):String
+     public function formatValue(format:String, source:Object):String
     {
         var numStr:String = "";
 
@@ -146,7 +145,7 @@ public class SwitchSymbolFormatter
         }
         
         return numStr;
-    } */
+    }
 }
 
 }
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/ZipCodeFormatter.as b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/ZipCodeFormatter.as
new file mode 100644
index 0000000..704d007
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/formatters/ZipCodeFormatter.as
@@ -0,0 +1,296 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.formatters
+{
+
+import mx.managers.ISystemManager;
+import mx.managers.SystemManager;
+
+//[ResourceBundle("formatters")]
+
+/**
+ *  The ZipCodeFormatter class formats a valid number
+ *  into one of the following formats, based on a
+ *  user-supplied <code>formatString</code> property.
+ *  
+ *  <ul>
+ *    <li>#####-####</li>
+ *    <li>##### ####</li>
+ *    <li>#####</li>
+ *    <li>### ### (Canadian)</li>
+ *  </ul>
+ *  
+ *  <p>A six-digit number must be supplied for a six-digit mask.
+ *  If you use a five-digit or a nine-digit mask, you can use
+ *  either a five-digit or a nine-digit number for formatting.</p>
+ *
+ *  <p>If an error occurs, an empty String is returned and a String that  
+ *  describes the error is saved to the <code>error</code> property.  
+ *  The <code>error</code> property can have one of the following values:</p>
+ *
+ *  <ul>
+ *    <li><code>"Invalid value"</code> means an invalid numeric value is passed 
+ *    to the <code>format()</code> method. The value should be a valid number 
+ *    in the form of a Number or a String, except for Canadian postal code, 
+ *    which allows alphanumeric values, or the number of digits does not match 
+ *    the allowed digits from the <code>formatString</code> property.</li>
+ *    <li> <code>"Invalid format"</code> means any of the characters in the 
+ *    <code>formatString</code> property do not match the allowed characters 
+ *    specified in the <code>validFormatChars</code> property, 
+ *    or the number of numeric placeholders does not equal 9, 5, or 6.</li>
+ *  </ul>
+ *  
+ *  @mxml
+ *  
+ *  <p>The <code>&lt;mx:ZipCodeFormatter&gt;</code> tag
+ *  inherits all of the tag attributes of its superclass,
+ *  and adds the following tag attributes:</p>
+ *  
+ *  <pre>
+ *  &lt;mx:ZipCodeFormatter
+ *    formatString="#####|#####-####|### ###"
+ *  />
+ *  </pre>
+ *  
+ *  @includeExample examples/ZipCodeFormatterExample.mxml
+ *  
+ *  @see mx.formatters.SwitchSymbolFormatter
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class ZipCodeFormatter extends Formatter
+{
+    //include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private    
+     */	
+	private static const VALID_LENGTHS:String = "9,5,6";
+	
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  Constructor.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function ZipCodeFormatter()
+	{
+		super();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+	//----------------------------------
+	//  formatString
+	//----------------------------------
+
+    /**
+	 *  @private
+	 *  Storage for the formatString property.
+	 */
+	private var _formatString:String;
+	
+    /**
+	 *  @private
+	 */
+	private var formatStringOverride:String;
+	
+	[Inspectable(category="General", defaultValue="null")]
+
+	/**
+	 *  The mask pattern.
+	 *  Possible values are <code>"#####-####"</code>,
+	 *  <code>"##### ####"</code>, <code>"#####"</code>,
+	 *  <code>"###-###"</code> and <code>"### ###"</code>.
+	 *  	 
+	 *  @default "#####"
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	public function get formatString():String
+	{
+		return _formatString;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set formatString(value:String):void
+	{
+		formatStringOverride = value;
+
+		_formatString = value != null ?
+						value : '#####';
+						/*resourceManager.getString(
+							"formatters", "zipCodeFormat")*/;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overidden methods
+	//
+	//--------------------------------------------------------------------------
+
+    /**
+	 *  @private    
+     */
+	/*override protected function resourcesChanged():void
+	{
+		super.resourcesChanged();
+
+		formatString = formatStringOverride;
+	}*/
+
+ 	/**
+	 *  Formats the String by using the specified format.
+	 *  If the value cannot be formatted, return an empty String 
+	 *  and write a description of the error to the <code>error</code> property.
+	 *
+	 *  @param value Value to format.
+	 *
+	 *  @return Formatted String. Empty if an error occurs. A description 
+	 *  of the error condition is written to the <code>error</code> property.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 */
+	override public function format(value:Object):String
+	{
+		// Reset any previous errors.
+		if (error)
+			error = null;
+		
+		// -- lengths --
+
+		var fStrLen:int;
+		var uStrLen:int = String(value).length;
+
+		if (VALID_LENGTHS.indexOf("" + uStrLen) == -1)
+		{
+			error = defaultInvalidValueError;
+			return "";
+		}
+
+		if (formatString == "#####-####" || formatString == "##### ####")
+		{
+			if (uStrLen != 5 && uStrLen != 9)
+			{
+				error = defaultInvalidValueError;
+				return "";
+			}
+			fStrLen = 9;
+		}
+
+		else if (formatString == "#####")
+		{
+			if (uStrLen != 5 && uStrLen != 9)
+			{
+				error = defaultInvalidValueError;
+				return "";
+			}
+			fStrLen = 5;
+		}
+
+		else if (formatString == "### ###" || formatString == "###-###")
+		{
+			if (uStrLen != 6)
+			{
+				error = defaultInvalidValueError;
+				return "";
+			}
+			fStrLen = 6;
+		}
+
+		else
+		{
+			error = defaultInvalidFormatError;
+			return "";
+		}
+
+		if (fStrLen == 6 && uStrLen != 6)
+		{
+			error = defaultInvalidValueError;
+			return "";
+		}
+
+		// -- value --
+
+		if (fStrLen == 6)
+		{
+			for (var i:int = 0; i < uStrLen; i++)
+			{
+				if ((value.charCodeAt(i) < 64 || value.charCodeAt(i) > 90) &&
+					(value.charCodeAt(i) < 48 || value.charCodeAt(i) > 57))
+				{
+					error = defaultInvalidValueError;
+					return "";
+				}
+			}
+		}
+		else
+		{
+			if (value === null || isNaN(Number(value)))
+			{
+				error = defaultInvalidValueError;
+				return "";
+			}
+		}
+
+		// --format--
+
+		if (fStrLen == 9 && uStrLen == 5)
+			value = String(value).concat("0000");
+
+		if (fStrLen == 5 && uStrLen == 9)
+			value = value.substr(0, 5);
+
+		var dataFormatter:SwitchSymbolFormatter = new SwitchSymbolFormatter();
+
+		return dataFormatter.formatValue(formatString, value);
+	}
+}
+
+}


[royale-asjs] 06/06: Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3507f9c47a33bf2dfd4d21781afd64af05098e6e
Merge: 370efba a3158ab
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Mar 25 23:44:53 2020 +1300

    Merge branch 'develop' of https://github.com/apache/royale-asjs into develop

 .../org/apache/royale/jewel/beads/views/DataGridView.as  | 12 +++++++++++-
 .../MXRoyale/src/main/royale/mx/core/UIComponent.as      |  6 +++---
 .../src/main/royale/spark/components/Scroller.as         | 16 +++++++++++-----
 .../spark/layouts/supportClasses/SparkLayoutBead.as      | 12 ++++++++++++
 4 files changed, 37 insertions(+), 9 deletions(-)