You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/03/27 08:32:21 UTC

[royale-asjs] 26/49: introduce jewel checkbox and refactor styles to make more easy handle the rest of components to be included

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

carlosrovira pushed a commit to branch feature/jewel-ui-set
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 9c443caa4e17eac3ac0e6f2a43627d7e997769f9
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Mon Mar 19 12:16:16 2018 +0100

    introduce jewel checkbox and refactor styles to make more easy handle the rest of components to be included
---
 .../src/main/royale/TextInputPlayGround.mxml       |   2 +-
 .../projects/Jewel/src/main/resources/defaults.css |  32 ++-
 .../Jewel/src/main/resources/jewel-manifest.xml    |   1 +
 .../projects/Jewel/src/main/royale/JewelClasses.as |   4 +-
 .../royale/org/apache/royale/jewel/CheckBox.as     | 230 +++++++++++++++++++++
 .../{RadioButtonView.as => views/CheckBoxView.as}  | 205 +++++++++---------
 .../jewel/beads/{ => views}/RadioButtonView.as     |   2 +-
 .../projects/Jewel/src/main/sass/_global.sass      |  37 ----
 .../Jewel/src/main/sass/components/_button.sass    |  20 ++
 .../Jewel/src/main/sass/components/_check.sass     |  27 +++
 .../Jewel/src/main/sass/components/_label.sass     |  27 +++
 .../Jewel/src/main/sass/components/_radio.sass     |  18 ++
 .../sass/{_global.sass => components/_slider.sass} |  38 +---
 .../src/main/sass/components/_textbutton.sass      |  20 ++
 .../Jewel/src/main/sass/components/_textfield.sass |  24 +++
 .../projects/Jewel/src/main/sass/defaults.sass     |  10 +
 16 files changed, 523 insertions(+), 174 deletions(-)

diff --git a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
index 489bfb9..cb236e9 100644
--- a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
@@ -24,5 +24,5 @@ limitations under the License.
 	
 	<j:RadioButton/>
 	<j:TextField text="Text Input" width="120" height="40"/>
-	
+	<j:CheckBox/>
 </js:Group>
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 583ef87..627c8e3 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -30,16 +30,24 @@
   display: block !important;
 }
 
-Label {
-  iBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
+@media -royale-swf {
+  CheckBox {
+    IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
+    IBeadView: ClassReference("org.apache.royale.html.beads.CheckBoxView");
+  }
 }
-
 .jewel.label {
   white-space: nowrap;
 }
 
-TextField {
-  IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
+Label {
+  iBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
+}
+
+.jewel.slider {
+  width: 100px;
+  height: 30px;
+  position: relative;
 }
 
 Slider {
@@ -49,12 +57,6 @@ Slider {
   IBeadController: ClassReference("org.apache.royale.html.beads.controllers.HSliderMouseController");
 }
 
-.jewel.slider {
-  width: 100px;
-  height: 30px;
-  position: relative;
-}
-
 .SliderTrack {
   position: absolute;
 }
@@ -74,6 +76,14 @@ Slider {
     IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel");
     IBeadView: ClassReference("org.apache.royale.jewel.beads.RadioButtonView");
   }
+
+  CheckBox {
+    IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
+    IBeadView: ClassReference("org.apache.royale.html.beads.CheckBoxView");
+  }
+}
+TextField {
+  IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
 }
 
 /*# sourceMappingURL=defaults.css.map */
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index c0840b8..7799373 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -28,6 +28,7 @@
     <component id="TextField" class="org.apache.royale.jewel.TextField"/>
     <component id="Slider" class="org.apache.royale.jewel.Slider"/>
     <component id="RadioButton" class="org.apache.royale.jewel.RadioButton"/>
+    <component id="CheckBox" class="org.apache.royale.jewel.CheckBox"/>
 
     <component id="Disabled" class="org.apache.royale.jewel.beads.Disabled"/>
 
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 4f909d2..41f586d 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -36,7 +36,9 @@ package
             import org.apache.royale.jewel.beads.SliderThumbView; SliderThumbView;
             import org.apache.royale.jewel.beads.SliderTrackView; SliderTrackView;
 
-            import org.apache.royale.jewel.beads.RadioButtonView; RadioButtonView;
+            import org.apache.royale.jewel.beads.views.RadioButtonView; RadioButtonView;
+		    import org.apache.royale.jewel.beads.views.CheckBoxView; CheckBoxView;
+	
         }
 
         import org.apache.royale.jewel.beads.layouts.HorizontalLayout; HorizontalLayout;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
new file mode 100644
index 0000000..ee8dbff
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/CheckBox.as
@@ -0,0 +1,230 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.royale.jewel
+{
+    import org.apache.royale.html.CheckBox;
+    import org.apache.royale.core.IToggleButtonModel;
+
+    COMPILE::JS
+    {
+        import org.apache.royale.core.WrappedHTMLElement;
+        import org.apache.royale.events.Event;
+        import org.apache.royale.html.util.addElementToWrapper;
+        import org.apache.royale.core.CSSClassList;
+    }
+
+    /**
+     *  The CheckBox class provides a Jewel UI-like appearance for a CheckBox.
+     *
+     *  A checkbox consists of a small square and, typically, text that clearly 
+     *  communicates a binary condition that will be set or unset when the user 
+     *  clicks or touches it. 
+     *  Checkboxes typically, but not necessarily, appear in groups, and can be
+     *  selected and deselected individually. The Jewel checkbox component allows
+     *  you to add display and click effects.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.9.3
+     */
+	public class CheckBox extends org.apache.royale.html.CheckBox
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9.3
+         */
+		public function CheckBox()
+		{
+			super();
+
+            typeNames = "jewel checkbox";
+        }
+
+        COMPILE::JS
+        protected var input:HTMLInputElement;
+
+        COMPILE::JS
+        protected var checkbox:HTMLSpanElement;
+
+        COMPILE::JS
+        protected var label:HTMLLabelElement;
+        
+        /**
+         * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
+         * @royaleignorecoercion HTMLLabelElement
+         * @royaleignorecoercion HTMLInputElement
+         * @royaleignorecoercion HTMLSpanElement
+         * @royaleignorecoercion Text
+         */
+        COMPILE::JS
+        override protected function createElement():WrappedHTMLElement
+        {
+            label = addElementToWrapper(this,'label') as HTMLLabelElement;
+            
+            input = document.createElement('input') as HTMLInputElement;
+            input.type = 'checkbox';    
+            //input.className = 'input';
+            label.appendChild(input);
+            
+            checkbox = document.createElement('span') as HTMLSpanElement;
+            //checkbox.className = 'label';
+            label.appendChild(checkbox);
+            
+            (input as WrappedHTMLElement).royale_wrapper = this;
+            (checkbox as WrappedHTMLElement).royale_wrapper = this;
+            return element;
+        }
+
+        /**
+         *  The text label for the CheckBox.
+         *
+         *  @royaleignorecoercion Text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.8
+         */
+		override public function get text():String
+		{
+            COMPILE::SWF
+            {
+    			return IToggleButtonModel(model).text;
+            }
+            COMPILE::JS
+            {
+                return textNode ? textNode.nodeValue : "";
+            }
+		}
+
+        /**
+         *  @private
+         */
+        override public function set text(value:String):void
+		{
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).text = value;
+            }
+
+            COMPILE::JS
+			{
+                if(!textNode)
+                {
+                    textNode = document.createTextNode('') as Text;
+                    checkbox.appendChild(textNode);
+                }
+                
+                textNode.nodeValue = value;	
+			}
+		}
+
+        /**
+         *  The value associated with the CheckBox.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.9
+         */
+        public function get value():String
+        {
+            COMPILE::SWF
+            {
+                return IToggleButtonModel(model).html;
+            }
+
+            COMPILE::JS
+            {
+                return input.value;
+            }
+        }
+        public function set value(newValue:String):void
+        {
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).html = newValue;
+            }
+
+            COMPILE::JS
+            {
+                input.value = newValue;
+            }
+        }
+
+        COMPILE::JS
+        protected var textNode:Text;
+
+        [Bindable("change")]
+        /**
+         *  <code>true</code> if the check mark is displayed.
+         *
+         *  @default false
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.8
+         */
+		override public function get selected():Boolean
+		{
+            COMPILE::SWF
+            {
+    			return IToggleButtonModel(model).selected;
+            }
+            COMPILE::JS
+            {
+                return input.checked;
+            }
+		}
+
+        /**
+         *  @private
+         */
+        override public function set selected(value:Boolean):void
+        {
+            COMPILE::SWF
+            {
+                IToggleButtonModel(model).selected = value;
+            }
+
+            COMPILE::JS
+			{
+                if(input.checked == value)
+                    return;
+                var instance:Object = element['JewelCheckbox'];
+                if(instance)
+                {
+                    if(value)
+                        instance["check"]();
+                    else
+                        instance["uncheck"]();
+                }
+                else
+                    input.checked = value;
+                dispatchEvent(new Event(Event.CHANGE));
+            }
+        }
+    }
+
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/CheckBoxView.as
similarity index 61%
copy from frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as
copy to frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/CheckBoxView.as
index 984b7b5..6a0424c 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/CheckBoxView.as
@@ -16,7 +16,7 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.jewel.beads
+package org.apache.royale.jewel.beads.views
 {
 	import flash.display.Shape;
 	import flash.display.SimpleButton;
@@ -28,29 +28,37 @@ package org.apache.royale.jewel.beads
 	import org.apache.royale.core.CSSTextField;
 	import org.apache.royale.core.IBeadView;
 	import org.apache.royale.core.IStrand;
-	import org.apache.royale.core.IValueToggleButtonModel;
+	import org.apache.royale.core.IToggleButtonModel;
 	import org.apache.royale.events.Event;
 	
-	/**
-	 *  The RadioButtonView class creates the visual elements of the org.apache.royale.html.RadioButton 
-	 *  component. 
-	 *  
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10.2
-	 *  @playerversion AIR 2.6
-	 *  @productversion Royale 0.0
-	 */
-	public class RadioButtonView extends BeadViewBase implements IBeadView
+    /**
+     *  The CheckBoxView class is the default view for
+     *  the org.apache.royale.html.CheckBox class.
+     *  It displays a simple checkbox with an 'x' if checked,
+     *  and a label on the right.  There are no styles or
+     *  properties to configure the look of the 'x' or the
+     *  position of the label relative to the checkbox as
+     *  there are no equivalents in the standard HTML checkbox.
+     * 
+     *  A more complex CheckBox could implement more view
+     *  configuration.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+	public class CheckBoxView extends BeadViewBase implements IBeadView
 	{
-		/**
-		 *  constructor.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
-		 */
-		public function RadioButtonView()
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+		public function CheckBoxView()
 		{
 			sprites = [ upSprite = new Sprite(),
 				        downSprite = new Sprite(),
@@ -81,46 +89,38 @@ package org.apache.royale.jewel.beads
 		
 		private var sprites:Array;
 		
-		private var _toggleButtonModel:IValueToggleButtonModel;
-		
-		/**
-		 *  The model used for the RadioButton.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
-		 */
-		public function get toggleButtonModel() : IValueToggleButtonModel
+		private var _toggleButtonModel:IToggleButtonModel;
+
+        // TODO: Can we remove this?
+		private function get toggleButtonModel() : IToggleButtonModel
 		{
 			return _toggleButtonModel;
 		}
 		
-		/**
-		 *  @copy org.apache.royale.core.IBead#strand
-		 *  
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
-		 */
+        /**
+         *  @copy org.apache.royale.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
 		override public function set strand(value:IStrand):void
 		{
 			super.strand = value;
-			_toggleButtonModel = value.getBeadByType(IValueToggleButtonModel) as IValueToggleButtonModel;
+            
+			_toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
 			_toggleButtonModel.addEventListener("textChange", textChangeHandler);
 			_toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
-			_toggleButtonModel.addEventListener("selectedValueChange", selectedValueChangeHandler);
-			if (_toggleButtonModel.text != null)
+			_toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
+			if (_toggleButtonModel.text !== null)
 				text = _toggleButtonModel.text;
-			if (_toggleButtonModel.html != null)
-				html = _toggleButtonModel.html;
             for each( var s:Sprite in sprites )
             {
                 var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
                 tf.styleParent = value;
             }
-			
+            
 			layoutControl();
 			
 			var hitArea:Shape = new Shape();
@@ -137,25 +137,25 @@ package org.apache.royale.jewel.beads
 				text = toggleButtonModel.text;
 			if (toggleButtonModel.html !== null)
 				html = toggleButtonModel.html;
-			
-			if (toggleButtonModel.selected && toggleButtonModel.value == value) {
-				selected = true;
-			}
 		}
 		
-		/**
-		 *  The string label for the org.apache.royale.html.RadioButton.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
-		 */
+        /**
+         *  @copy org.apache.royale.html.Label#text
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
 		public function get text():String
 		{
 			var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
 			return tf.text;
 		}
+		
+        /**
+         *  @private
+         */
 		public function set text(value:String):void
 		{
 			for each( var s:Sprite in sprites )
@@ -167,19 +167,23 @@ package org.apache.royale.jewel.beads
 			layoutControl();
 		}
 		
-		/**
-		 *  The HTML string for the org.apache.royale.html.RadioButton.
-		 *
-		 *  @langversion 3.0
-		 *  @playerversion Flash 10.2
-		 *  @playerversion AIR 2.6
-		 *  @productversion Royale 0.0
-		 */
+        /**
+         *  @copy org.apache.royale.html.Label#html
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
 		public function get html():String
 		{
 			var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
 			return tf.htmlText;
 		}
+		
+        /**
+         *  @private
+         */
 		public function set html(value:String):void
 		{
 			for each(var s:Sprite in sprites)
@@ -191,17 +195,11 @@ package org.apache.royale.jewel.beads
 			layoutControl();
 		}
 		
-		/**
-		 * @private
-		 */
 		private function textChangeHandler(event:Event):void
 		{
 			text = toggleButtonModel.text;
 		}
 		
-		/**
-		 * @private
-		 */
 		private function htmlChangeHandler(event:Event):void
 		{
 			html = toggleButtonModel.html;
@@ -209,17 +207,28 @@ package org.apache.royale.jewel.beads
 		
 		private var _selected:Boolean;
 		
-		/**
-		 * The selection state of the RadioButton
-		 */
+        /**
+         *  @copy org.apache.royale.core.IToggleButtonModel#selected
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
 		public function get selected():Boolean
 		{
 			return _selected;
 		}
+		
+        /**
+         *  @private
+         */
 		public function set selected(value:Boolean):void
 		{
 			_selected = value;
 			
+			layoutControl();
+			
 			if( value ) {
 				SimpleButton(_strand).upState = upAndSelectedSprite;
 				SimpleButton(_strand).downState = downAndSelectedSprite;
@@ -230,21 +239,21 @@ package org.apache.royale.jewel.beads
 				SimpleButton(_strand).downState = downSprite;
 				SimpleButton(_strand).overState = overSprite;
 			}
-			
-			layoutControl();
 		}
 		
-		/**
-		 * @private
-		 */
-		private function selectedValueChangeHandler(event:Event):void
+		private function selectedChangeHandler(event:Event):void
 		{
-			selected = _toggleButtonModel.value == _toggleButtonModel.selectedValue;
+			selected = toggleButtonModel.selected;
 		}
 		
-		/**
-		 * @private
-		 */
+        /**
+         *  Display the icon and text label
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
 		protected function layoutControl() : void
 		{
 			for each(var s:Sprite in sprites)
@@ -252,7 +261,7 @@ package org.apache.royale.jewel.beads
 				var icon:Shape = s.getChildByName("icon") as Shape;
 				var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
 				
-				drawRadioButton(icon);
+				drawCheckBox(icon);
 				
 				var mh:Number = Math.max(icon.height,tf.height);
 				
@@ -265,21 +274,27 @@ package org.apache.royale.jewel.beads
 			
 		}
 		
-		/**
-		 * @private
-		 */
-		protected function drawRadioButton(icon:Shape) : void
+        /**
+         *  Draw the checkbox
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+		protected function drawCheckBox(icon:Shape) : void
 		{
 			icon.graphics.clear();
 			icon.graphics.beginFill(0xf8f8f8);
 			icon.graphics.lineStyle(1,0x808080);
-			icon.graphics.drawEllipse(0,0,10,10);
+			icon.graphics.drawRect(0,0,10,10);
 			icon.graphics.endFill();
 			
-			if( selected ) {
-				icon.graphics.beginFill(0);
-				icon.graphics.drawEllipse(3,3,4,4);
-				icon.graphics.endFill();
+			if( _toggleButtonModel.selected ) {
+                icon.graphics.lineStyle(2,0);
+				icon.graphics.moveTo(3,4);
+				icon.graphics.lineTo(5,7);
+				icon.graphics.lineTo(9,0);
 			}
 		}
 	}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/RadioButtonView.as
similarity index 99%
rename from frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as
rename to frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/RadioButtonView.as
index 984b7b5..f5752ee 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/RadioButtonView.as
@@ -16,7 +16,7 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.jewel.beads
+package org.apache.royale.jewel.beads.views
 {
 	import flash.display.Shape;
 	import flash.display.SimpleButton;
diff --git a/frameworks/projects/Jewel/src/main/sass/_global.sass b/frameworks/projects/Jewel/src/main/sass/_global.sass
index 4233a68..9fa8336 100644
--- a/frameworks/projects/Jewel/src/main/sass/_global.sass
+++ b/frameworks/projects/Jewel/src/main/sass/_global.sass
@@ -29,43 +29,6 @@
 	> *
 		display: block !important
 
-Label
-	iBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
-	//iBeadView: ClassReference("org.apache.royale.jewel.beads.views.JewelLabelViewBead")
-	//iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextFieldLabelMeasurementBead")
-.jewel.label	
-	white-space: nowrap
-
-TextField
-	IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
-	//IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView")
-	//IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController")
-
-Slider
-	IBeadModel: ClassReference("org.apache.royale.html.beads.models.RangeModel")
-	IBeadView:  ClassReference("org.apache.royale.jewel.beads.SliderView")
-	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalSliderLayout")
-	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.HSliderMouseController")
-
-.jewel.slider
-	width: 100px
-	height: 30px
-	position: relative
-
-.SliderTrack
-	position: absolute
 
-.SliderThumb
-	position: absolute
-	border-radius: 15px
 
-@media -royale-swf
-	Slider
-		iThumbView: ClassReference("org.apache.royale.jewel.beads.SliderThumbView")
-		iTrackView: ClassReference("org.apache.royale.jewel.beads.SliderTrackView")
 
-	RadioButton
-		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel")
-		IBeadView:  ClassReference("org.apache.royale.jewel.beads.RadioButtonView")
-		//font-size: 11px
-		//font-family: Arial
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_button.sass b/frameworks/projects/Jewel/src/main/sass/components/_button.sass
new file mode 100644
index 0000000..019c818
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_button.sass
@@ -0,0 +1,20 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_check.sass b/frameworks/projects/Jewel/src/main/sass/components/_check.sass
new file mode 100644
index 0000000..a4b504a
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_check.sass
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+.jewel.check
+
+@media -royale-swf
+	CheckBox
+		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel")
+		IBeadView:  ClassReference("org.apache.royale.html.beads.CheckBoxView")
+		//font-size: 11px
+		//font-family: Arial
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_label.sass b/frameworks/projects/Jewel/src/main/sass/components/_label.sass
new file mode 100644
index 0000000..628e3ca
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_label.sass
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+.jewel.label	
+	white-space: nowrap
+
+Label
+	iBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
+	//iBeadView: ClassReference("org.apache.royale.jewel.beads.views.JewelLabelViewBead")
+	//iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextFieldLabelMeasurementBead")
+
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_radio.sass b/frameworks/projects/Jewel/src/main/sass/components/_radio.sass
new file mode 100644
index 0000000..0c6fb82
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_radio.sass
@@ -0,0 +1,18 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
diff --git a/frameworks/projects/Jewel/src/main/sass/_global.sass b/frameworks/projects/Jewel/src/main/sass/components/_slider.sass
similarity index 70%
copy from frameworks/projects/Jewel/src/main/sass/_global.sass
copy to frameworks/projects/Jewel/src/main/sass/components/_slider.sass
index 4233a68..b61e110 100644
--- a/frameworks/projects/Jewel/src/main/sass/_global.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_slider.sass
@@ -17,29 +17,10 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 
-@namespace "library://ns.apache.org/royale/jewel"
-
-.layout.horizontal
-	white-space: nowrap
-	display: block
-	> *
-		display: inline-block !important
-.layout.vertical
-	vertical-align: top
-	> *
-		display: block !important
-
-Label
-	iBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
-	//iBeadView: ClassReference("org.apache.royale.jewel.beads.views.JewelLabelViewBead")
-	//iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextFieldLabelMeasurementBead")
-.jewel.label	
-	white-space: nowrap
-
-TextField
-	IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
-	//IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView")
-	//IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController")
+.jewel.slider
+	width: 100px
+	height: 30px
+	position: relative
 
 Slider
 	IBeadModel: ClassReference("org.apache.royale.html.beads.models.RangeModel")
@@ -47,11 +28,6 @@ Slider
 	IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalSliderLayout")
 	IBeadController: ClassReference("org.apache.royale.html.beads.controllers.HSliderMouseController")
 
-.jewel.slider
-	width: 100px
-	height: 30px
-	position: relative
-
 .SliderTrack
 	position: absolute
 
@@ -69,3 +45,9 @@ Slider
 		IBeadView:  ClassReference("org.apache.royale.jewel.beads.RadioButtonView")
 		//font-size: 11px
 		//font-family: Arial
+
+	CheckBox
+		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel")
+		IBeadView:  ClassReference("org.apache.royale.html.beads.CheckBoxView")
+		//font-size: 11px
+		//font-family: Arial
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_textbutton.sass b/frameworks/projects/Jewel/src/main/sass/components/_textbutton.sass
new file mode 100644
index 0000000..019c818
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_textbutton.sass
@@ -0,0 +1,20 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_textfield.sass b/frameworks/projects/Jewel/src/main/sass/components/_textfield.sass
new file mode 100644
index 0000000..7742b3f
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/sass/components/_textfield.sass
@@ -0,0 +1,24 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+TextField
+	IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel")
+	//IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView")
+	//IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController")
+
diff --git a/frameworks/projects/Jewel/src/main/sass/defaults.sass b/frameworks/projects/Jewel/src/main/sass/defaults.sass
index 10e81d9..a113a73 100644
--- a/frameworks/projects/Jewel/src/main/sass/defaults.sass
+++ b/frameworks/projects/Jewel/src/main/sass/defaults.sass
@@ -19,3 +19,13 @@
     
 // Global
 @import "global"
+
+// Components
+@import "components/button"
+@import "components/check"
+@import "components/label"
+@import "components/radio"
+@import "components/slider"
+@import "components/textbutton"
+@import "components/textfield"
+

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