flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pio...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Add MaterialIconBase class for common properties to all material icons derived class
Date Sat, 03 Dec 2016 08:36:24 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 36a7f7d76 -> e6df3721e


Add MaterialIconBase class for common properties to all material icons derived class


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

Branch: refs/heads/develop
Commit: e6df3721ecccf169914c0db1e434bc27da768706
Parents: 36a7f7d
Author: piotrz <piotrz@apache.org>
Authored: Sat Dec 3 09:36:13 2016 +0100
Committer: piotrz <piotrz@apache.org>
Committed: Sat Dec 3 09:36:13 2016 +0100

----------------------------------------------------------------------
 .../mdl/beads/materialIcons/MaterialIconAdd.as  | 16 ++--
 .../beads/materialIcons/MaterialIconCancel.as   | 14 ++--
 .../ItemRendererFactoryForArrayData.as          |  1 -
 .../flex/mdl/supportClasses/MaterialIconBase.as | 80 ++++++++++++++++++++
 .../flex/mdl/supportClasses/MaterialIcons.as    | 61 ---------------
 5 files changed, 93 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e6df3721/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
index d05a1f9..522e685 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconAdd.as
@@ -21,7 +21,7 @@ package org.apache.flex.mdl.beads.materialIcons
     import org.apache.flex.core.IBead;
     import org.apache.flex.core.IStrand;
     import org.apache.flex.core.UIBase;
-    import org.apache.flex.mdl.supportClasses.MaterialIcons;
+    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
      *  The MaterialIconCancel bead class is a specialty bead that add "add" icon
@@ -32,7 +32,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconAdd implements IBead
+    public class MaterialIconAdd extends MaterialIconBase implements IBead
     {
         /**
          *  constructor.
@@ -44,10 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
          */
         public function MaterialIconAdd()
         {
+            super();
         }
-
-        private var add:MaterialIcons;
-
+        
         private var _strand:IStrand;
 
         /**
@@ -62,12 +61,11 @@ package org.apache.flex.mdl.beads.materialIcons
             COMPILE::JS
             {
                 var host:UIBase = value as UIBase;
-                var element:HTMLElement = host.element as HTMLElement;
+                var htmlElement:HTMLElement = host.element as HTMLElement;
 
-                add = new MaterialIcons();
-                add.text = MaterialIconsType.ADD;
+                materialIcon.text = MaterialIconsType.ADD;
 
-                element.appendChild(add.element as HTMLElement);
+                htmlElement.appendChild(element);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e6df3721/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
index b179b1d..9925e91 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/materialIcons/MaterialIconCancel.as
@@ -21,7 +21,7 @@ package org.apache.flex.mdl.beads.materialIcons
     import org.apache.flex.core.IBead;
     import org.apache.flex.core.IStrand;
     import org.apache.flex.core.UIBase;
-    import org.apache.flex.mdl.supportClasses.MaterialIcons;
+    import org.apache.flex.mdl.supportClasses.MaterialIconBase;
 
     /**
      *  The MaterialIconCancel bead class is a specialty bead that add "cancel" icon
@@ -32,7 +32,7 @@ package org.apache.flex.mdl.beads.materialIcons
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class MaterialIconCancel implements IBead
+    public class MaterialIconCancel extends MaterialIconBase implements IBead
     {
         /**
          *  constructor.
@@ -44,10 +44,9 @@ package org.apache.flex.mdl.beads.materialIcons
          */
         public function MaterialIconCancel()
         {
+            super();
         }
 
-        private var cancel:MaterialIcons;
-
         private var _strand:IStrand;
 
         /**
@@ -62,12 +61,11 @@ package org.apache.flex.mdl.beads.materialIcons
             COMPILE::JS
             {
                 var host:UIBase = value as UIBase;
-                var element:HTMLElement = host.element as HTMLElement;
+                var hostElement:HTMLElement = host.element as HTMLElement;
 
-                cancel = new MaterialIcons();
-                cancel.text = MaterialIconsType.CANCEL;
+                materialIcon.text = MaterialIconsType.CANCEL;
 
-                element.appendChild(cancel.element as HTMLElement);
+                hostElement.appendChild(element);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e6df3721/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
index 6d86ee1..dedd429 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ItemRendererFactoryForArrayData.as
@@ -27,7 +27,6 @@ package org.apache.flex.mdl.supportClasses
 	import org.apache.flex.core.ISelectableItemRenderer;
 	import org.apache.flex.core.ISelectionModel;
 	import org.apache.flex.core.IStrand;
-	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.SimpleCSSStyles;
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e6df3721/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
new file mode 100644
index 0000000..d633acf
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIconBase.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.mdl.supportClasses
+{
+    import org.apache.flex.html.I;
+
+    /**
+     *  Provide common features for all material icons type
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    COMPILE::SWF
+    public class MaterialIconBase
+    {
+        public function MaterialIconBase()
+        {
+        }
+    }
+
+    /**
+     *  Provide HTML element and common features for all material icons type
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    COMPILE::JS
+    public class MaterialIconBase
+    {
+        /**
+         *  constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         *
+         *  @flexjsignorecoercion HTMLElement
+         */
+        public function MaterialIconBase()
+        {
+            materialIcon = new I();
+            element.classList.add("material-icons");
+        }
+
+        private var _md48:Boolean;
+        protected var materialIcon:I;
+
+        public function get element():HTMLElement
+        {
+            return materialIcon.element as HTMLElement;
+        }
+
+        public function set md48(value:Boolean):void
+        {
+            _md48 = value;
+            element.classList.toggle("md-48", _md48);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e6df3721/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIcons.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIcons.as
b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIcons.as
deleted file mode 100644
index 64b5295..0000000
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/MaterialIcons.as
+++ /dev/null
@@ -1,61 +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.mdl.supportClasses
-{
-    import org.apache.flex.html.I;
-    COMPILE::JS
-    {
-        import org.apache.flex.core.WrappedHTMLElement;
-    }
-
-    /**
-     *  Provide HTML element for material icons derived class
-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion FlexJS 0.0
-     */
-    public class MaterialIcons extends I
-    {
-        public function MaterialIcons()
-        {
-            super();
-        }
-
-        /**
-         * @flexjsignorecoercion HTMLElement
-         *
-         * @param value
-         */
-        COMPILE::JS
-        override protected function createElement():WrappedHTMLElement
-        {
-            super.createElement();
-
-            var materialIconElement:HTMLElement = element as HTMLElement;
-            materialIconElement.classList.add("material-icons");
-
-            positioner = element;
-            element.flexjs_wrapper = this;
-
-            return element;
-        }
-    }
-}


Mime
View raw message