Repository: flex-asjs
Updated Branches:
  refs/heads/develop 33898b5b6 -> 65e22f756


Created proper horizontal scroll bar and differentiated vertical scroll bar 
from generic scroll bar 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/65e22f75
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/65e22f75
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/65e22f75

Branch: refs/heads/develop
Commit: 65e22f756d1f81ea388c3fce548305810ff73f79
Parents: 33898b5
Author: Peter Ent <[email protected]>
Authored: Mon Jul 27 16:23:08 2015 -0400
Committer: Peter Ent <[email protected]>
Committed: Mon Jul 27 16:23:08 2015 -0400

----------------------------------------------------------------------
 frameworks/projects/HTML/as/defaults.css        |  12 +-
 frameworks/projects/HTML/as/src/HTMLClasses.as  |   5 +-
 .../flex/html/beads/HScrollBarThumbView.as      | 126 ++++++++++
 .../flex/html/beads/HScrollBarTrackView.as      | 111 +++++++++
 .../apache/flex/html/beads/HScrollBarView.as    | 230 +++++++++++++++++++
 .../flex/html/beads/LeftArrowButtonView.as      | 112 +++++++++
 .../flex/html/beads/RightArrowButtonView.as     | 112 +++++++++
 .../apache/flex/html/beads/VScrollBarView.as    | 230 +++++++++++++++++++
 .../controllers/HScrollBarMouseController.as    | 101 ++++++++
 .../flex/html/beads/layouts/HScrollBarLayout.as | 121 ++++++++++
 .../flex/html/supportClasses/HScrollBar.as      |  49 ++++
 .../html/supportClasses/ScrollingViewport.as    |  10 +-
 .../flex/html/supportClasses/VScrollBar.as      |  49 ++++
 frameworks/projects/HTML/basic-manifest.xml     |   3 +-
 14 files changed, 1262 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css 
b/frameworks/projects/HTML/as/defaults.css
index c18570a..76cc7c3 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -383,14 +383,22 @@ RadioButton
     IBeadView:  ClassReference("org.apache.flex.html.beads.RadioButtonView");  
                
 }
 
-ScrollBar
+VScrollBar
 {
     IBeadLayout: 
ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
     IBeadModel: 
ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
-    IBeadView: ClassReference("org.apache.flex.html.beads.ScrollBarView");
+    IBeadView: ClassReference("org.apache.flex.html.beads.VScrollBarView");
     IBeadController: 
ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
 }
 
+HScrollBar
+{
+       IBeadLayout: 
ClassReference("org.apache.flex.html.beads.layouts.HScrollBarLayout");
+       IBeadModel: 
ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
+       IBeadView: ClassReference("org.apache.flex.html.beads.HScrollBarView");
+       IBeadController: 
ClassReference("org.apache.flex.html.beads.controllers.HScrollBarMouseController");
+}
+
 SimpleAlert
 {
     IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/HTMLClasses.as 
b/frameworks/projects/HTML/as/src/HTMLClasses.as
index e48bfe0..fc5c993 100644
--- a/frameworks/projects/HTML/as/src/HTMLClasses.as
+++ b/frameworks/projects/HTML/as/src/HTMLClasses.as
@@ -52,7 +52,8 @@ internal class HTMLClasses
     import org.apache.flex.html.beads.PanelView; PanelView;
     import org.apache.flex.html.beads.PanelWithControlBarView; 
PanelWithControlBarView;
        import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
-       import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
+       import org.apache.flex.html.beads.VScrollBarView; VScrollBarView;
+       import org.apache.flex.html.beads.HScrollBarView; HScrollBarView;
        import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
     import org.apache.flex.html.beads.SingleLineBorderBead; 
SingleLineBorderBead;
        import org.apache.flex.html.beads.SliderView; SliderView;
@@ -88,10 +89,12 @@ internal class HTMLClasses
        import org.apache.flex.html.beads.controllers.SliderMouseController; 
SliderMouseController;
        import org.apache.flex.html.beads.controllers.SpinnerMouseController; 
SpinnerMouseController;
     import org.apache.flex.html.beads.controllers.VScrollBarMouseController; 
VScrollBarMouseController;
+       import 
org.apache.flex.html.beads.controllers.HScrollBarMouseController; 
HScrollBarMouseController;
        import org.apache.flex.html.beads.layouts.ButtonBarLayout; 
ButtonBarLayout;
     import org.apache.flex.html.beads.layouts.VerticalLayout; VerticalLayout;  
        import org.apache.flex.html.beads.layouts.HorizontalLayout; 
HorizontalLayout;
     import org.apache.flex.html.beads.layouts.BasicLayout; BasicLayout;
+       import org.apache.flex.html.beads.layouts.HScrollBarLayout; 
HScrollBarLayout;
     import org.apache.flex.html.beads.layouts.VScrollBarLayout; 
VScrollBarLayout;
        import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
     import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; 
TextItemRendererFactoryForArrayData;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
new file mode 100644
index 0000000..7afa5d7
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
@@ -0,0 +1,126 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads
+{
+       import flash.display.Graphics;
+       import flash.display.Shape;
+       import flash.display.SimpleButton;
+    import flash.display.DisplayObject;
+
+    import org.apache.flex.core.BeadViewBase;
+    import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IStrand;
+       import org.apache.flex.events.Event;
+       import org.apache.flex.events.IEventDispatcher; 
+       
+    /**
+     *  The HScrollBarThumbView class is the view for
+     *  the thumb button in a Horizontal ScrollBar.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class HScrollBarThumbView extends BeadViewBase implements 
IBeadView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function HScrollBarThumbView()
+               {
+               }
+               
+               private function drawView(g:Graphics, bgColor:uint):void
+               {
+            var ww:Number = DisplayObject(_strand).width;
+            g.clear();
+                       g.lineStyle(1);
+                       g.beginFill(bgColor);
+                       g.drawRect(0, 0, ww, 16);
+                       g.endFill();
+            ww = Math.round(ww / 2);
+                       g.moveTo(ww, 4);
+                       g.lineTo(ww, 12);
+                       g.moveTo(ww - 4, 4);
+                       g.lineTo(ww - 4, 12);
+                       g.moveTo(ww + 4, 4);
+                       g.lineTo(ww + 4, 12);
+               }
+               
+               private var shape:Shape;
+               
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               override public function set strand(value:IStrand):void
+               {
+                       super.strand = value;
+            
+            upView = new Shape();
+            downView = new Shape();
+            overView = new Shape();
+            
+            drawView(upView.graphics, 0xCCCCCC);
+            drawView(downView.graphics, 0x808080);
+            drawView(overView.graphics, 0xEEEEEE);
+
+            shape = new Shape();
+                       shape.graphics.beginFill(0xCCCCCC);
+                       shape.graphics.drawRect(0, 0, 16, 16);
+                       shape.graphics.endFill();
+                       SimpleButton(value).upState = upView;
+                       SimpleButton(value).downState = downView;
+                       SimpleButton(value).overState = overView;
+                       SimpleButton(value).hitTestState = shape;
+            IEventDispatcher(_strand).addEventListener("widthChanged", 
widthChangedHandler);
+               }
+
+        private function widthChangedHandler(event:Event):void
+        {
+                       DisplayObject(_strand).scaleY = 1.0;
+                       DisplayObject(_strand).scaleX = 1.0;
+                       
+            var ww:Number = DisplayObject(_strand).width;
+            drawView(upView.graphics, 0xCCCCCC);
+            drawView(downView.graphics, 0x808080);
+            drawView(overView.graphics, 0xEEEEEE);
+            
+            shape.graphics.clear();
+            shape.graphics.beginFill(0xCCCCCC);
+            shape.graphics.drawRect(0, 0, ww, 16);
+            shape.graphics.endFill();
+        }
+        
+               private var upView:Shape;
+               private var downView:Shape;
+               private var overView:Shape;
+               
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
new file mode 100644
index 0000000..1558ff2
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
@@ -0,0 +1,111 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads
+{
+       import flash.display.DisplayObject;
+       import flash.display.Graphics;
+       import flash.display.Shape;
+       import flash.display.SimpleButton;
+       
+    import org.apache.flex.core.BeadViewBase;
+       import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IStrand;
+       import org.apache.flex.events.Event;
+       
+    /**
+     *  The HScrollBarTrackView class is the view for
+     *  the track in a Horizontal ScrollBar.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class HScrollBarTrackView extends BeadViewBase implements 
IBeadView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function HScrollBarTrackView()
+               {
+                       upView = new Shape();
+                       downView = new Shape();
+                       overView = new Shape();
+
+               }
+               
+               private function drawView(g:Graphics, bgColor:uint, 
w:Number):void
+               {
+                       g.clear();
+                       g.lineStyle(1);
+                       g.beginFill(bgColor);
+                       g.drawRect(0, 0, w, 16);
+                       g.endFill();
+                       g.lineStyle(0);
+               }
+
+               private function widthChangeHandler(event:Event):void
+               {
+                       DisplayObject(_strand).scaleY = 1.0;
+                       DisplayObject(_strand).scaleX = 1.0;
+                       
+                       var w:Number = SimpleButton(_strand).width;
+                       
+                       drawView(upView.graphics, 0xCCCCCC, w);
+                       drawView(downView.graphics, 0x808080, w);
+                       drawView(overView.graphics, 0xEEEEEE, w);       
+                       shape.graphics.clear();
+                       shape.graphics.beginFill(0xCCCCCC);
+                       shape.graphics.drawRect(0, 0, 16, w);
+                       shape.graphics.endFill();
+                       
+               }
+               
+               private var shape:Shape;
+               
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               override public function set strand(value:IStrand):void
+               {
+                       super.strand = value;
+                       SimpleButton(value).addEventListener("widthChanged", 
widthChangeHandler);
+                       shape = new Shape();
+                       SimpleButton(value).upState = upView;
+                       SimpleButton(value).downState = downView;
+                       SimpleButton(value).overState = overView;
+                       SimpleButton(value).hitTestState = shape;
+               }
+
+               private var upView:Shape;
+               private var downView:Shape;
+               private var overView:Shape;
+               
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as
new file mode 100644
index 0000000..a985cd4
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.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.flex.html.beads
+{
+       import flash.display.DisplayObject;
+       
+    import org.apache.flex.core.IBead;
+       import org.apache.flex.core.IBeadLayout;
+       import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IScrollBarModel;
+       import org.apache.flex.core.IStrand;
+       import org.apache.flex.core.IUIBase;
+       import org.apache.flex.core.Strand;
+       import org.apache.flex.core.UIBase;
+       import org.apache.flex.core.ValuesManager;
+    import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.Event;
+       import org.apache.flex.html.Button;
+       import 
org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+    /**
+     *  The HScrollBarView class is the default view for
+     *  the org.apache.flex.html.supportClasses.HScrollBar class.
+     *  It implements the classic desktop-like HScrollBar.
+     *  A different view would implement more modern scrollbars that hide 
themselves
+     *  until hovered over with the mouse.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class HScrollBarView extends Strand implements IBeadView, 
IStrand, IScrollBarView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function HScrollBarView()
+               {
+               }
+                               
+               private var sbModel:IScrollBarModel;
+               
+               private var _strand:IStrand;
+               
+        /**
+         *  The layout. 
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        private var layout:IBeadLayout;
+        
+        /**
+         *  The host component. 
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get host():IUIBase
+        {
+            return _strand as IUIBase;
+        }
+
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function set strand(value:IStrand):void
+               {
+                       _strand = value;
+            
+            for each (var bead:IBead in beads)
+                addBead(bead);
+                        
+                       sbModel = value.getBeadByType(IScrollBarModel) as 
IScrollBarModel;
+            sbModel = _strand.getBeadByType(IScrollBarModel) as 
IScrollBarModel;
+            sbModel.addEventListener("maximumChange", changeHandler);
+            sbModel.addEventListener("minimumChange", changeHandler);
+            sbModel.addEventListener("snapIntervalChange", changeHandler);
+            sbModel.addEventListener("stepSizeChange", changeHandler);
+            sbModel.addEventListener("pageSizeChange", changeHandler);
+            sbModel.addEventListener("valueChange", changeHandler);
+            
+            // TODO: (aharui) put in values impl
+                       _increment = new Button();
+                       Button(_increment).addBead(new RightArrowButtonView());
+            Button(_increment).addBead(new ButtonAutoRepeatController());
+                       _decrement = new Button();
+                       Button(_decrement).addBead(new LeftArrowButtonView());
+            Button(_decrement).addBead(new ButtonAutoRepeatController());
+                       _track = new Button();                          
+                       Button(_track).addBead(new HScrollBarTrackView());
+                       _thumb = new Button();                          
+                       Button(_thumb).addBead(new HScrollBarThumbView());
+            
+            UIBase(value).addChild(_decrement);
+            UIBase(value).addChild(_increment);
+            UIBase(value).addChild(_track);
+            UIBase(value).addChild(_thumb);
+            
+            IEventDispatcher(_strand).addEventListener("widthChanged", 
changeHandler);
+            
+            if( _strand.getBeadByType(IBeadLayout) == null ) {
+                layout = new (ValuesManager.valuesImpl.getValue(_strand, 
"iBeadLayout")) as IBeadLayout;
+                _strand.addBead(layout);
+            }
+            layout.layout();
+               }
+                                               
+        private function changeHandler(event:Event):void
+        {
+            layout.layout();    
+        }
+        
+               private var _decrement:DisplayObject;
+               private var _increment:DisplayObject;
+               private var _track:DisplayObject;
+               private var _thumb:DisplayObject;
+               
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#decrement
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get decrement():DisplayObject
+               {
+                       return _decrement;
+               }
+
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#increment
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get increment():DisplayObject
+               {
+                       return _increment;
+               }
+        
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#track
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get track():DisplayObject
+               {
+                       return _track;
+               }
+        
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#thumb
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get thumb():DisplayObject
+               {
+                       return _thumb;
+               }
+               
+        /**
+         *  @copy org.apache.flex.core.IBeadView#viewHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get viewHeight():Number
+        {
+            // don't want to put $height in an interface
+            return _strand["$height"];
+        }
+        
+        /**
+         *  @copy org.apache.flex.core.IBeadView#viewWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get viewWidth():Number
+        {
+            // don't want to put $width in an interface
+            return _strand["$width"];
+        }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
new file mode 100644
index 0000000..f367533
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads
+{
+       import flash.display.DisplayObject;
+       import flash.display.Graphics;
+       import flash.display.Shape;
+       import flash.display.SimpleButton;
+       
+       import org.apache.flex.core.BeadViewBase;
+       import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.Event;
+       
+    /**
+     *  The LeftArrowButtonView class is the view for
+     *  the left arrow button in a ScrollBar and other controls.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class LeftArrowButtonView extends BeadViewBase implements 
IBeadView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function LeftArrowButtonView()
+               {
+                       upView = new Shape();
+                       downView = new Shape();
+                       overView = new Shape();
+
+                       drawView(upView.graphics, 0xCCCCCC);
+                       drawView(downView.graphics, 0x808080);
+                       drawView(overView.graphics, 0xEEEEEE);
+               }
+               
+               private function drawView(g:Graphics, bgColor:uint):void
+               {
+                       g.lineStyle(1);
+                       g.beginFill(bgColor);
+                       g.drawRect(0, 0, 16, 16);
+                       g.endFill();
+                       g.lineStyle(0);
+                       g.beginFill(0);
+                       g.moveTo(4, 8);
+                       g.lineTo(12, 12);
+                       g.lineTo(12, 4);
+                       g.lineTo(4, 8);
+                       g.endFill();
+               }
+               
+               private var shape:Shape;
+               
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               override public function set strand(value:IStrand):void
+               {
+                       super.strand = value;
+                       shape = new Shape();
+                       shape.graphics.beginFill(0xCCCCCC);
+                       shape.graphics.drawRect(0, 0, 16, 16);
+                       shape.graphics.endFill();
+                       SimpleButton(value).upState = upView;
+                       SimpleButton(value).downState = downView;
+                       SimpleButton(value).overState = overView;
+                       SimpleButton(value).hitTestState = shape;
+            
+            
SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+            
SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+               }
+        
+               private var upView:Shape;
+               private var downView:Shape;
+               private var overView:Shape;
+               
+        private function sizeChangeHandler(event:Event):void
+        {
+            SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
+            SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+        }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
new file mode 100644
index 0000000..f6f956a
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads
+{
+       import flash.display.DisplayObject;
+       import flash.display.Graphics;
+       import flash.display.Shape;
+       import flash.display.SimpleButton;
+       
+       import org.apache.flex.core.BeadViewBase;
+       import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IStrand;
+    import org.apache.flex.events.Event;
+       
+    /**
+     *  The RightArrowButtonView class is the view for
+     *  the right arrow button in a ScrollBar and other controls.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class RightArrowButtonView extends BeadViewBase implements 
IBeadView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function RightArrowButtonView()
+               {
+                       upView = new Shape();
+                       downView = new Shape();
+                       overView = new Shape();
+
+                       drawView(upView.graphics, 0xCCCCCC);
+                       drawView(downView.graphics, 0x808080);
+                       drawView(overView.graphics, 0xEEEEEE);
+               }
+               
+               private function drawView(g:Graphics, bgColor:uint):void
+               {
+                       g.lineStyle(1);
+                       g.beginFill(bgColor);
+                       g.drawRect(0, 0, 16, 16);
+                       g.endFill();
+                       g.lineStyle(0);
+                       g.beginFill(0);
+                       g.moveTo(4, 4);
+                       g.lineTo(12, 8);
+                       g.lineTo(4, 12);
+                       g.lineTo(4, 4);
+                       g.endFill();
+               }
+               
+               private var shape:Shape;
+               
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               override public function set strand(value:IStrand):void
+               {
+                       super.strand = value;
+                       shape = new Shape();
+                       shape.graphics.beginFill(0xCCCCCC);
+                       shape.graphics.drawRect(0, 0, 16, 16);
+                       shape.graphics.endFill();
+                       SimpleButton(value).upState = upView;
+                       SimpleButton(value).downState = downView;
+                       SimpleButton(value).overState = overView;
+                       SimpleButton(value).hitTestState = shape;
+            
+            
SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+            
SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+               }
+        
+               private var upView:Shape;
+               private var downView:Shape;
+               private var overView:Shape;
+               
+        private function sizeChangeHandler(event:Event):void
+        {
+            SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
+            SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+        }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as
new file mode 100644
index 0000000..e116103
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.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.flex.html.beads
+{
+       import flash.display.DisplayObject;
+       
+    import org.apache.flex.core.IBead;
+       import org.apache.flex.core.IBeadLayout;
+       import org.apache.flex.core.IBeadView;
+       import org.apache.flex.core.IScrollBarModel;
+       import org.apache.flex.core.IStrand;
+       import org.apache.flex.core.IUIBase;
+       import org.apache.flex.core.Strand;
+       import org.apache.flex.core.UIBase;
+       import org.apache.flex.core.ValuesManager;
+    import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.Event;
+       import org.apache.flex.html.Button;
+       import 
org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+    /**
+     *  The ScrollBarView class is the default view for
+     *  the org.apache.flex.html.supportClasses.VScrollBar class.
+     *  It implements the classic desktop-like VScrollBar.
+     *  A different view would implement more modern scrollbars that hide 
themselves
+     *  until hovered over with the mouse.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class VScrollBarView extends Strand implements IBeadView, 
IStrand, IScrollBarView
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function VScrollBarView()
+               {
+               }
+                               
+               private var sbModel:IScrollBarModel;
+               
+               private var _strand:IStrand;
+               
+        /**
+         *  The layout. 
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        private var layout:IBeadLayout;
+        
+        /**
+         *  The host component. 
+         * 
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get host():IUIBase
+        {
+            return _strand as IUIBase;
+        }
+
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function set strand(value:IStrand):void
+               {
+                       _strand = value;
+            
+            for each (var bead:IBead in beads)
+                addBead(bead);
+                        
+                       sbModel = value.getBeadByType(IScrollBarModel) as 
IScrollBarModel;
+            sbModel = _strand.getBeadByType(IScrollBarModel) as 
IScrollBarModel;
+            sbModel.addEventListener("maximumChange", changeHandler);
+            sbModel.addEventListener("minimumChange", changeHandler);
+            sbModel.addEventListener("snapIntervalChange", changeHandler);
+            sbModel.addEventListener("stepSizeChange", changeHandler);
+            sbModel.addEventListener("pageSizeChange", changeHandler);
+            sbModel.addEventListener("valueChange", changeHandler);
+            
+            // TODO: (aharui) put in values impl
+                       _increment = new Button();
+                       Button(_increment).addBead(new DownArrowButtonView());
+            Button(_increment).addBead(new ButtonAutoRepeatController());
+                       _decrement = new Button();
+                       Button(_decrement).addBead(new UpArrowButtonView());
+            Button(_decrement).addBead(new ButtonAutoRepeatController());
+                       _track = new Button();                          
+                       Button(_track).addBead(new VScrollBarTrackView());
+                       _thumb = new Button();                          
+                       Button(_thumb).addBead(new VScrollBarThumbView());
+            
+            UIBase(value).addChild(_decrement);
+            UIBase(value).addChild(_increment);
+            UIBase(value).addChild(_track);
+            UIBase(value).addChild(_thumb);
+            
+            IEventDispatcher(_strand).addEventListener("heightChanged", 
changeHandler);
+            
+            if( _strand.getBeadByType(IBeadLayout) == null ) {
+                layout = new (ValuesManager.valuesImpl.getValue(_strand, 
"iBeadLayout")) as IBeadLayout;
+                _strand.addBead(layout);
+            }
+            layout.layout();
+               }
+                                               
+        private function changeHandler(event:Event):void
+        {
+            layout.layout();    
+        }
+        
+               private var _decrement:DisplayObject;
+               private var _increment:DisplayObject;
+               private var _track:DisplayObject;
+               private var _thumb:DisplayObject;
+               
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#decrement
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get decrement():DisplayObject
+               {
+                       return _decrement;
+               }
+
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#increment
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get increment():DisplayObject
+               {
+                       return _increment;
+               }
+        
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#track
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get track():DisplayObject
+               {
+                       return _track;
+               }
+        
+        /**
+         *  @copy org.apache.flex.html.beads.IScrollBarView#thumb
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function get thumb():DisplayObject
+               {
+                       return _thumb;
+               }
+               
+        /**
+         *  @copy org.apache.flex.core.IBeadView#viewHeight
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get viewHeight():Number
+        {
+            // don't want to put $height in an interface
+            return _strand["$height"];
+        }
+        
+        /**
+         *  @copy org.apache.flex.core.IBeadView#viewWidth
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function get viewWidth():Number
+        {
+            // don't want to put $width in an interface
+            return _strand["$width"];
+        }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
new file mode 100644
index 0000000..4abaffe
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads.controllers
+{
+       import flash.display.DisplayObject;
+       
+       import org.apache.flex.events.Event;
+    import org.apache.flex.events.MouseEvent;
+       import org.apache.flex.events.IEventDispatcher;
+       
+    /**
+     *  The HScrollBarMouseController class is the controller for
+     *  org.apache.flex.html.supportClasses.HScrollBar
+     *  that acts as the Horizontal ScrollBar.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class HScrollBarMouseController extends 
ScrollBarMouseControllerBase
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function HScrollBarMouseController()
+               {
+               }
+               
+        /**
+         *  @private
+         */
+               override protected function 
trackClickHandler(event:MouseEvent):void
+               {
+                       if (sbView.thumb.visible)
+                       {
+                               if (event.localX < sbView.thumb.x)
+                               {
+                                       sbModel.value = 
snap(Math.max(sbModel.minimum, sbModel.value - sbModel.pageStepSize));          
                                
+                                       
IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+                               }
+                               else
+                               {
+                                       sbModel.value = 
snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + 
sbModel.pageStepSize));
+                                       
IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+                               }
+                       }
+               }
+               
+               private var thumbDownX:Number;
+               private var lastThumbX:Number;
+               
+        /**
+         *  @private
+         */
+               override protected function 
thumbMouseDownHandler(event:MouseEvent):void
+               {
+                       
sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, 
thumbMouseMoveHandler);
+                       
sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
+                       thumbDownX = event.screenX;
+                       lastThumbX = sbView.thumb.x;
+               }
+               
+               private function thumbMouseMoveHandler(event:MouseEvent):void
+               {
+                       var thumb:DisplayObject = sbView.thumb;
+                       var track:DisplayObject = sbView.track;
+                       thumb.x = Math.max(track.x, Math.min(lastThumbX + 
(event.screenX - thumbDownX), track.x + track.width - thumb.width));
+                       var newValue:Number = snap((thumb.x - track.x) / 
(track.width - thumb.width) * (sbModel.maximum - sbModel.minimum - 
sbModel.pageSize));
+                       sbModel.value = newValue;
+                       IEventDispatcher(strand).dispatchEvent(new 
Event("scroll"));
+               }
+               
+               private function thumbMouseUpHandler(event:MouseEvent):void
+               {
+                       
sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_MOVE, 
thumbMouseMoveHandler);
+                       
sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_UP, 
thumbMouseUpHandler);                       
+               }
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
new file mode 100644
index 0000000..751c5a8
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads.layouts
+{
+       import flash.display.DisplayObject;
+       
+       import org.apache.flex.core.IBeadLayout;
+       import org.apache.flex.core.IScrollBarModel;
+       import org.apache.flex.core.IStrand;
+       import org.apache.flex.core.UIMetrics;
+       import org.apache.flex.events.Event;
+       import org.apache.flex.events.IEventDispatcher;
+       import org.apache.flex.html.beads.IScrollBarView;
+       import org.apache.flex.utils.BeadMetrics;
+
+    /**
+     *  The HScrollBarLayout class is a layout
+     *  bead that displays lays out the pieces of a
+     *  horizontal ScrollBar like the thumb, track
+     *  and arrow buttons.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+       public class HScrollBarLayout implements IBeadLayout
+       {
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function HScrollBarLayout()
+               {
+               }
+               
+               private var sbModel:IScrollBarModel;
+               private var sbView:IScrollBarView;
+               
+               private var _strand:IStrand;
+               
+        /**
+         *  @copy org.apache.flex.core.IBead#strand
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+               public function set strand(value:IStrand):void
+               {
+                       _strand = value;
+                       sbView = _strand.getBeadByType(IScrollBarView) as 
IScrollBarView;
+               }
+                       
+        /**
+         * @copy org.apache.flex.core.IBeadLayout#layout
+         */
+               public function layout():Boolean
+               {
+            if (!sbModel)
+                sbModel = _strand.getBeadByType(IScrollBarModel) as 
IScrollBarModel
+                                       
+                       var metrics:UIMetrics = BeadMetrics.getMetrics(_strand);
+                    
+                       var w:Number = DisplayObject(_strand).width + 
metrics.left + metrics.right;
+                       var increment:DisplayObject = sbView.increment;
+                       var decrement:DisplayObject = sbView.decrement;
+                       var track:DisplayObject = sbView.track;
+                       var thumb:DisplayObject = sbView.thumb;
+                       
+                       decrement.x = 0;
+                       decrement.y = 0;
+                       decrement.height = DisplayObject(_strand).height;
+                       decrement.width = DisplayObject(_strand).height;
+                       
+                       increment.height = DisplayObject(_strand).height;
+                       increment.width = DisplayObject(_strand).height;
+                       increment.x = w - increment.width - 1;
+                       increment.y = 0;
+
+                       track.x = decrement.width;
+                       track.y = 0;
+                       track.height = DisplayObject(_strand).height;
+                       track.width = increment.x - decrement.width;
+            thumb.width = sbModel.pageSize / (sbModel.maximum - 
sbModel.minimum) * track.width;
+                       if (track.width > thumb.width)
+                       {
+                               thumb.visible = true;
+                               thumb.x = (sbModel.value / (sbModel.maximum - 
sbModel.minimum - sbModel.pageSize) * (track.width - thumb.width)) + track.x;
+                       }
+                       else
+                       {
+                               thumb.visible = false;
+                       }
+                       
+            return true;
+               }
+                                               
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
new file mode 100644
index 0000000..0b56925
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.supportClasses
+{
+       import org.apache.flex.core.IChrome;
+       import org.apache.flex.core.IViewportScroller;
+       
+       /**
+        *  The ScrollBar class represents either a vertical or horizontal 
control
+        *  that allows the user to quickly scan through a component that does 
not
+        *  wholly fit within its container.
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion FlexJS 0.0
+        */
+       public class HScrollBar extends ScrollBar implements IChrome, 
IViewportScroller
+       {
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               public function HScrollBar()
+               {
+                       super();
+               }               
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
index fdce428..d53acb0 100644
--- 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
@@ -103,7 +103,7 @@ package org.apache.flex.html.supportClasses
                                
_verticalScroller.setWidthAndHeight(scrollerSize, model.viewportHeight - 
vbarAdjustHeightBy, false);
                        }
                        if (_horizontalScroller) {
-                               
_horizontalScroller.setWidthAndHeight(model.viewportHeight - hbarAdjustWidthBy, 
scrollerSize, false);
+                               
_horizontalScroller.setWidthAndHeight(model.viewportWidth - hbarAdjustWidthBy, 
scrollerSize, false);
                        } 
                        
                        if (!model.contentIsHost) {
@@ -246,8 +246,8 @@ package org.apache.flex.html.supportClasses
                        vsbm.stepSize = 1;
                        vsbm.value = 0;
                        
-                       var vsb:ScrollBar;
-                       vsb = new ScrollBar();
+                       var vsb:VScrollBar;
+                       vsb = new VScrollBar();
                        vsb.model = vsbm;
                        vsb.visible = false;
                        
@@ -278,8 +278,8 @@ package org.apache.flex.html.supportClasses
                        hsbm.stepSize = 1;
                        hsbm.value = 0;
                        
-                       var hsb:ScrollBar;
-                       hsb = new ScrollBar();
+                       var hsb:HScrollBar;
+                       hsb = new HScrollBar();
                        hsb.model = hsbm;
                        hsb.visible = false;
                        

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
new file mode 100644
index 0000000..a72c64c
--- /dev/null
+++ 
b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
@@ -0,0 +1,49 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.supportClasses
+{
+       import org.apache.flex.core.IChrome;
+       import org.apache.flex.core.IViewportScroller;
+       
+       /**
+        *  The ScrollBar class represents either a vertical or horizontal 
control
+        *  that allows the user to quickly scan through a component that does 
not
+        *  wholly fit within its container.
+        *
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion FlexJS 0.0
+        */
+       public class VScrollBar extends ScrollBar implements IChrome, 
IViewportScroller
+       {
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion FlexJS 0.0
+                */
+               public function VScrollBar()
+               {
+                       super();
+               }               
+       }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/65e22f75/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml 
b/frameworks/projects/HTML/basic-manifest.xml
index fcd23d5..6f822c6 100644
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ b/frameworks/projects/HTML/basic-manifest.xml
@@ -67,7 +67,8 @@
     <component id="StringItemRenderer" 
class="org.apache.flex.html.supportClasses.StringItemRenderer"/>
     <component id="DataItemRenderer" 
class="org.apache.flex.html.supportClasses.DataItemRenderer"/>
     <component id="ButtonBarButtonItemRenderer" 
class="org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer"/>
-    <component id="ScrollBar" 
class="org.apache.flex.html.supportClasses.ScrollBar"/>
+    <component id="HScrollBar" 
class="org.apache.flex.html.supportClasses.HScrollBar"/>
+    <component id="VScrollBar" 
class="org.apache.flex.html.supportClasses.VScrollBar"/>
     <component id="NumericOnlyTextInputBead" 
class="org.apache.flex.html.accessories.NumericOnlyTextInputBead" />
     <component id="PasswordInputBead" 
class="org.apache.flex.html.accessories.PasswordInputBead" />
     <component id="TextPromptBead" 
class="org.apache.flex.html.accessories.TextPromptBead" />

Reply via email to