You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/08/02 00:44:12 UTC

[royale-asjs] 09/29: add missing APIs

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

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

commit 0fa894fc0c7485ae02568a6380ccdc4b3dda96ea
Author: Alex Harui <ah...@apache.org>
AuthorDate: Tue Jul 31 12:33:16 2018 -0700

    add missing APIs
---
 .../src/main/royale/mx/containers/Panel.as         | 27 +++++++++
 .../MXRoyale/src/main/royale/mx/controls/Tree.as   | 67 +++++++++++++++++-----
 .../royale/mx/controls/listClasses/ListBase.as     | 34 +++++++++++
 3 files changed, 115 insertions(+), 13 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
index e927e84..9a6a1fd 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
@@ -19,6 +19,11 @@
 
 package mx.containers
 {
+COMPILE::JS
+{
+    import goog.DEBUG;
+}
+
 /*
 import flash.display.DisplayObject;
 import flash.display.Graphics;
@@ -629,6 +634,28 @@ public class Panel extends Container
     }
     
     /**
+     *  dropShadowVisible (was a style in Flex)
+     * 
+     *  @inheritDoc
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get dropShadowVisible():String
+    {
+        if (GOOG::DEBUG)
+            trace("Panel:dropShadowVisible not implemented");
+        return null;
+    }
+    public function set dropShadowVisible(value:String):void
+    {
+        if (GOOG::DEBUG)
+            trace("Panel:dropShadowVisible not implemented");
+    }
+    
+    /**
      * @private
      * @royaleignorecoercion org.apache.royale.html.beads.PanelView
      */
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
index 9a52233..c9f5b4b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Tree.as
@@ -19,7 +19,10 @@
 
 package mx.controls
 {
-
+COMPILE::JS
+{
+    import goog.DEBUG;
+}
 /* import flash.display.DisplayObject;
 import flash.display.Graphics;
 import flash.display.Shape;
@@ -80,6 +83,8 @@ import mx.managers.ISystemManager;
 
 use namespace mx_internal;
 
+import org.apache.royale.events.Event;
+
 //--------------------------------------
 //  Events
 //--------------------------------------
@@ -514,6 +519,28 @@ public class Tree extends List
                          false, EventPriority.DEFAULT_HANDLER); */
     }
 
+    /**
+     *  Border Style
+     *
+     *  @default 0
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Royale 0.9.3
+     */
+    public function get borderStyle():String
+    {
+        if (GOOG::DEBUG)
+            trace("Tree:borderStyle not implemented");
+        return "none";
+    }
+    public function set borderStyle(value:String):void
+    {
+        if (GOOG::DEBUG)
+            trace("Tree:borderStyle not implemented");
+    }
+    
     //--------------------------------------------------------------------------
     //
     //  Variables
@@ -990,13 +1017,13 @@ public class Tree extends List
      *  @private
      *  Storage variable for showRoot flag.
      */
-    //mx_internal var _showRoot:Boolean = true;
+    mx_internal var _showRoot:Boolean = true;
 
     /**
      *  @private
      *  Storage variable for changes to showRoot.
      */
-    //mx_internal var showRootChanged:Boolean = false;
+    mx_internal var showRootChanged:Boolean = false;
     
     /** 
     *  @private
@@ -1029,15 +1056,15 @@ public class Tree extends List
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.3
      */
-    /* public function get showRoot():Boolean
+    public function get showRoot():Boolean
     {
         return _showRoot;
-    } */
+    }
 
     /**
      *  @private
      */
-    /* public function set showRoot(value:Boolean):void
+    public function set showRoot(value:Boolean):void
     {
         if (_showRoot != value)
         {
@@ -1045,7 +1072,7 @@ public class Tree extends List
             showRootChanged = true;
             invalidateProperties();
         }
-    } */
+    }
 
     /**
      *  Indicates that the current dataProvider has a root item; for example, 
@@ -1662,11 +1689,16 @@ public class Tree extends List
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.3
      */
-    /* public function isItemOpen(item:Object):Boolean
+    public function isItemOpen(item:Object):Boolean
     {
+        if (GOOG::DEBUG)
+            trace("Tree:isItemOpen not implemented");
+        /*
         var uid:String = itemToUID(item);
         return _openItems[uid] != null;
-    } */
+        */
+        return false;
+    }
 
     /**
      *  @private
@@ -1718,11 +1750,14 @@ public class Tree extends List
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.3
      */
-    /* public function expandItem(item:Object, open:Boolean,
+    public function expandItem(item:Object, open:Boolean,
                               animate:Boolean = false,
                               dispatchEvent:Boolean = false,    
                               cause:Event = null):void
     {
+        if (GOOG::DEBUG)
+            trace("Tree:getItemIndex not implemented");
+    /*
         //if the iterator is null, that indicates we have not been 
         //validated yet, so we will not continue. 
         if (iterator == null)
@@ -2183,7 +2218,8 @@ public class Tree extends List
         }
         //restore ItemSizeChangeNotification flag
         listContent.allowItemSizeChangeNotification = variableRowHeight;
-    } */
+        */
+    }
 
     /**
      *  @private
@@ -2510,8 +2546,11 @@ public class Tree extends List
     /**
     *  @private
     */
-    /* public function getItemIndex(item:Object):int
+    public function getItemIndex(item:Object):int
     {
+        if (GOOG::DEBUG)
+            trace("Tree:getItemIndex not implemented");
+        /*
         var cursor:IViewCursor = collection.createCursor();
         var i:int = 0;
         do
@@ -2525,7 +2564,9 @@ public class Tree extends List
 		// and causes the cursor to hit an unexpected IPE
 		cursor.seek(CursorBookmark.FIRST, 0);
         return i;
-    } */
+        */
+        return 0;
+    }
 
 	/**
     *  @private
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index 5811cd8..97e9f02 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -381,6 +381,34 @@ use namespace mx_internal;
     }
     
     //----------------------------------
+    //  selectedItem
+    //----------------------------------
+    
+    [Bindable("change")]
+    [Bindable("valueCommit")]
+    
+    /**
+     *  The selected item in the data provider.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    public function get selectedItem():Object
+    {
+        return (model as ISelectionModel).selectedItem;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set selectedItem(item:Object):void
+    {
+        (model as ISelectionModel).selectedItem = item;
+    }
+    
+    //----------------------------------
     //  selectedItems
     //----------------------------------
     
@@ -574,6 +602,12 @@ use namespace mx_internal;
             return _strandChildren;
         }
         
+        public function scrollToIndex(index):void
+        {
+            if (GOOG::DEBUG)
+                trace("ListBase:scrollToIndex not implemented");
+        }
+        
         /**
          *  @private
          */