flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [03/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - move AS classes from FlexJSJX to final home. Build scripts will be fixed up in a later commit
Date Wed, 15 Apr 2015 21:43:08 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateChooserView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateChooserView.as
new file mode 100644
index 0000000..4baa17b
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateChooserView.as
@@ -0,0 +1,256 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.html.beads.models.DateChooserModel;
+	import org.apache.flex.html.supportClasses.DateChooserButton;
+	
+    import org.apache.flex.core.BeadViewBase;
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IBeadView;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.beads.layouts.TileLayout;
+	import org.apache.flex.html.Container;
+	import org.apache.flex.html.TextButton;
+	
+	/**
+	 * The DateChooserView class is a view bead for the DateChooser. This class
+	 * creates the elements for the DateChooser: the buttons to move between
+	 * months, the labels for the days of the week, and the buttons for each day
+	 * of the month.
+	 */
+	public class DateChooserView extends BeadViewBase implements IBeadView
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DateChooserView()
+		{
+		}
+		
+		/**
+		 *  @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;
+			
+			// make sure there is a model.
+			model = _strand.getBeadByType(IBeadModel) as DateChooserModel;
+			if (model == null) {
+				model = new (ValuesManager.valuesImpl.getValue(_strand,"iBeadModel")) as DateChooserModel;
+			}
+			model.addEventListener("displayedMonthChanged",handleModelChange);
+			model.addEventListener("displayedYearChanged",handleModelChange);
+			
+			createChildren();
+		}
+		
+		private var _prevMonthButton:TextButton;
+		private var _nextMonthButton:TextButton;
+		private var _dayButtons:Array;
+		private var monthLabel:TextButton;
+		private var dayContainer:Container;
+		
+		private var model:DateChooserModel;
+		
+		/**
+		 *  The button that causes the previous month to be displayed by the DateChooser.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get prevMonthButton():TextButton
+		{
+			return _prevMonthButton;
+		}
+		
+		/**
+		 *  The button that causes the next month to be displayed by the DateChooser.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get nextMonthButton():TextButton
+		{
+			return _nextMonthButton;
+		}
+		
+		/**
+		 * The array of DateChooserButton instances that represent each day of the month.
+		 */
+		public function get dayButtons():Array
+		{
+			return _dayButtons;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function createChildren():void
+		{
+			_prevMonthButton = new TextButton();
+			_prevMonthButton.width = 40;
+			_prevMonthButton.height = 20;
+			_prevMonthButton.x = 0;
+			_prevMonthButton.y = 0;
+			_prevMonthButton.text = "<";
+			UIBase(_strand).addElement(_prevMonthButton);
+			
+			_nextMonthButton = new TextButton();
+			_nextMonthButton.width = 40;
+			_nextMonthButton.height = 20;
+			_nextMonthButton.x = UIBase(_strand).width - _nextMonthButton.width;
+			_nextMonthButton.y = 0;
+			_nextMonthButton.text = ">";
+			UIBase(_strand).addElement(_nextMonthButton);
+			
+			monthLabel = new TextButton();
+			monthLabel.text = "Month Here";
+			monthLabel.width = 100;
+			monthLabel.height = 20;
+			monthLabel.x = (UIBase(_strand).width - monthLabel.width)/2;
+			monthLabel.y = 0;
+			UIBase(_strand).addElement(monthLabel);
+			
+			dayContainer = new Container();
+			var tileLayout:TileLayout = new TileLayout();
+			dayContainer.addBead(tileLayout);
+            UIBase(_strand).addElement(dayContainer, false);
+            
+			tileLayout.numColumns = 7;
+			dayContainer.x = 0;
+			dayContainer.y = monthLabel.y + monthLabel.height + 5;
+			
+			var sw:Number = UIBase(_strand).width;
+			var sh:Number = UIBase(_strand).height;
+			trace("Strand's width x height is "+sw+" x "+sh);
+			dayContainer.width = sw;
+			dayContainer.height = sh - (monthLabel.height+5);
+			
+			// the calendar has 7 columns with 6 rows, the first row are the day names
+			for(var i:int=0; i < 7; i++) {
+				var dayName:DateChooserButton = new DateChooserButton();
+				dayName.text = model.dayNames[i];
+				dayName.dayOfMonth = 0;
+				dayContainer.addElement(dayName, false);
+			}
+			
+			_dayButtons = new Array();
+			
+			for(i=0; i < 42; i++) {
+				var date:DateChooserButton = new DateChooserButton();
+				date.text = String(i+1);
+				dayContainer.addElement(date, false);
+				dayButtons.push(date);
+			}
+			
+			IEventDispatcher(dayContainer).dispatchEvent( new Event("itemsCreated") );			
+			IEventDispatcher(_strand).dispatchEvent( new Event("layoutNeeded") );			
+			IEventDispatcher(dayContainer).dispatchEvent( new Event("layoutNeeded") );
+			
+			updateCalendar();
+		}
+		
+		/**
+		 * @private
+		 */
+		private function updateCalendar():void
+		{
+			monthLabel.text = model.monthNames[model.displayedMonth] + " " +
+				String(model.displayedYear);
+			
+			var firstDay:Date = new Date(model.displayedYear,model.displayedMonth,1);
+			
+			// blank out the labels for the first firstDay.day-1 entries.
+			for(var i:int=0; i < firstDay.getDay(); i++) {
+				var dateButton:DateChooserButton = dayButtons[i] as DateChooserButton;
+				dateButton.dayOfMonth = -1;
+				dateButton.text = "";
+			}
+			
+			// renumber to the last day of the month
+			var dayNumber:int = 1;
+			var numDays:Number = numberOfDaysInMonth(model.displayedMonth, model.displayedYear);
+			
+			for(; i < dayButtons.length && dayNumber <= numDays; i++) {
+				dateButton = dayButtons[i] as DateChooserButton;
+				dateButton.dayOfMonth = dayNumber;
+				dateButton.text = String(dayNumber++);
+			}
+			
+			// blank out the rest
+			for(; i < dayButtons.length; i++) {
+				dateButton = dayButtons[i] as DateChooserButton;
+				dateButton.dayOfMonth = -1;
+				dateButton.text = "";
+			}
+		}
+		
+		/**
+		 * @private
+		 */
+		private function numberOfDaysInMonth(month:Number, year:Number):Number
+		{
+			var n:int;
+			
+			if (month == 1) // Feb
+			{
+				if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) // leap year
+					n = 29;
+				else
+					n = 28;
+			}
+				
+			else if (month == 3 || month == 5 || month == 8 || month == 10)
+				n = 30;
+				
+			else
+				n = 31;
+			
+			return n;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function handleModelChange(event:Event):void
+		{
+			updateCalendar();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateFieldView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateFieldView.as
new file mode 100644
index 0000000..2254d6e
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/DateFieldView.as
@@ -0,0 +1,186 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.BeadViewBase;
+	import org.apache.flex.core.IBeadView;
+	import org.apache.flex.core.IDateChooserModel;
+	import org.apache.flex.core.IFormatBead;
+	import org.apache.flex.core.IParent;
+	import org.apache.flex.core.IPopUpHost;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.utils.UIUtils;
+	import org.apache.flex.html.DateChooser;
+	import org.apache.flex.html.TextButton;
+	import org.apache.flex.html.TextInput;
+	
+	/**
+	 * The DateFieldView class is a bead for DateField that creates the
+	 * input and button controls. This class also handles the pop-up 
+	 * mechanics.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DateFieldView extends BeadViewBase implements IBeadView
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DateFieldView()
+		{
+		}
+		
+		private var _textInput:TextInput;
+		private var _button:TextButton;
+		
+		/**
+		 *  The TextButton that triggers the display of the DateChooser pop-up.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get menuButton():TextButton
+		{
+			return _button;
+		}
+		
+		/**
+		 *  The TextInput that displays the date selected.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get textInput():TextInput
+		{
+			return _textInput;
+		}
+		
+		/**
+		 *  @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;
+			
+			_textInput = new TextInput();
+			UIBase(_strand).addElement(_textInput);
+			_textInput.width = 100;
+			_textInput.height = 18;
+			
+			_button = new TextButton();
+			_button.text = "M";
+			UIBase(_strand).addElement(_button);
+			_button.x = _textInput.width;
+			_button.y = _textInput.y;
+			
+			IEventDispatcher(_strand).addEventListener("beadsAdded",handleBeadsAdded);
+		}
+		
+		private function handleBeadsAdded(event:Event):void
+		{
+			var formatter:IFormatBead = _strand.getBeadByType(IFormatBead) as IFormatBead;
+			formatter.addEventListener("formatChanged",handleFormatChanged);
+		}
+		
+		private function handleFormatChanged(event:Event):void
+		{
+			var formatter:IFormatBead = event.target as IFormatBead;
+			_textInput.text = formatter.formattedString;
+		}
+		
+		private var _popUp:DateChooser;
+		
+		/**
+		 *  The pop-up component that holds the selection list.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get popUp():DateChooser
+		{
+			return _popUp;
+		}
+		
+		private var _popUpVisible:Boolean;
+		
+		/**
+		 *  This property is true if the pop-up selection list is currently visible.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get popUpVisible():Boolean
+		{
+			return _popUpVisible;
+		}
+		public function set popUpVisible(value:Boolean):void
+		{
+			if (value != _popUpVisible)
+			{
+				_popUpVisible = value;
+				if (value)
+				{
+					if (!_popUp)
+					{
+						_popUp = new DateChooser();
+						_popUp.width = 210;
+						_popUp.height = 220;
+						_popUp.x = UIBase(_strand).x;
+						_popUp.y = UIBase(_strand).y + 30;
+					}
+					
+					var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
+					_popUp.selectedDate = model.selectedDate;
+					
+					var host:IPopUpHost = UIUtils.findPopUpHost(UIBase(_strand));
+					host.addElement(_popUp);
+				}
+				else
+				{
+					UIUtils.removePopUp(_popUp);
+				}
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableLabelView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableLabelView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableLabelView.as
new file mode 100644
index 0000000..03b6ccd
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableLabelView.as
@@ -0,0 +1,90 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IFormatBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	
+	/**
+	 *  The FormatableLabelView class is a View bead that is capable of working
+	 *  with a format bead to display a formatted value. When the format bead has
+	 *  created a formatted string, it dispatches a formatChanged event that the
+	 *  FormatableLabelView class intercepts and displays in the label.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class FormatableLabelView extends TextFieldView
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function FormatableLabelView()
+		{
+			super();
+		}
+		
+		private var _formatter:IFormatBead;
+		
+		/**
+		 *  @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;
+			IEventDispatcher(value).addEventListener("beadsAdded",handleBeadsAdded);
+		}
+		
+		/**
+		 * @private
+		 */
+		private function handleBeadsAdded(event:Event):void
+		{
+			_formatter = _strand.getBeadByType(IFormatBead) as IFormatBead;
+			_formatter.addEventListener("formatChanged",formatReadyHandler);
+			
+			// process any text set in the label at this moment
+			text = _formatter.formattedString;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function formatReadyHandler(event:Event):void
+		{
+			if (_formatter) {
+				text = _formatter.formattedString;
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableTextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableTextInputView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableTextInputView.as
new file mode 100644
index 0000000..926253c
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/FormatableTextInputView.as
@@ -0,0 +1,91 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IFormatBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+
+	/**
+	 *  The FormatableTextInputView class is a View bead that extends TextInputWithBorderView
+	 *  and is capable of working with a format bead. When a format bead dispatches a
+	 *  formatChanged event, the FormatableTextInputView bead copies the formatted string to
+	 *  to the text field.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class FormatableTextInputView extends TextInputWithBorderView
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function FormatableTextInputView()
+		{
+			super();
+		}
+		
+		private var _formatter:IFormatBead;
+		
+		/**
+		 *  @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;
+			IEventDispatcher(value).addEventListener("beadsAdded",handleBeadsAdded);
+		}
+		
+		/**
+		 * @private
+		 */
+		private function handleBeadsAdded(event:Event):void
+		{
+			_formatter = _strand.getBeadByType(IFormatBead) as IFormatBead;
+			if (_formatter) {
+				_formatter.addEventListener("formatChanged",formatChangedHandler);
+			}
+		}
+		
+		/**
+		 * @private
+		 */
+		private function formatChangedHandler(event:Event):void
+		{
+			this.textField.text = _formatter.formattedString;
+			
+			// move the cursor to the end
+			var l:int = this.textField.text.length;
+			this.textField.setSelection(l,l);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/IDataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/IDataGridView.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/IDataGridView.as
new file mode 100644
index 0000000..8f04d11
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/IDataGridView.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBeadView;
+	
+	/**
+	 *  The IDataGridView interface marks as a component as being the bead that
+	 *  can create the visual pieces for a org.apache.flex.html.DataGrid. 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public interface IDataGridView extends IBeadView
+	{
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
new file mode 100644
index 0000000..8195f70
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
@@ -0,0 +1,108 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IMeasurementBead;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.html.TitleBar;
+	
+	/**
+	 *  The TitleBarMeasurementBead class measures the overall size of a 
+	 *  org.apache.flex.html.TitleBar.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class TitleBarMeasurementBead implements IMeasurementBead
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function TitleBarMeasurementBead()
+		{
+		}
+		
+		/**
+		 *  The overall width of the org.apache.flex.html.TitleBar.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get measuredWidth():Number
+		{
+			var mwidth:Number = 0;
+			var titleBar:TitleBar = _strand as TitleBar;
+			var titleView:TitleBarView = _strand.getBeadByType(TitleBarView) as TitleBarView;
+			var labelMeasure:IMeasurementBead = titleView.titleLabel.measurementBead;
+			mwidth = labelMeasure.measuredWidth;
+			if( titleBar.showCloseButton ) {
+				var buttonMeasure:IMeasurementBead = titleView.closeButton.measurementBead;
+				mwidth += buttonMeasure.measuredWidth;
+			}
+			return mwidth;
+		}
+		
+		/**
+		 *  The overall height of the org.apache.flex.html.TitleBar.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get measuredHeight():Number
+		{
+			var mheight:Number = 0;
+			var titleBar:TitleBar = _strand as TitleBar;
+			var titleView:TitleBarView = _strand.getBeadByType(TitleBarView) as TitleBarView;
+			var labelMeasure:IMeasurementBead = titleView.titleLabel.measurementBead;
+			mheight = labelMeasure.measuredHeight;
+			if( titleBar.showCloseButton ) {
+				var buttonMeasure:IMeasurementBead = titleView.closeButton.measurementBead;
+				mheight = Math.max(mheight,buttonMeasure.measuredHeight);
+			}
+			return mheight;
+		}
+		
+		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;
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarView.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarView.mxml b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarView.mxml
new file mode 100644
index 0000000..22baa23
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/TitleBarView.mxml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<!---
+ The TitleBarView is the view for a Panel's TitleBar written in MXML
+
+ @langversion 3.0
+ @playerversion Flash 10.2
+ @playerversion AIR 2.6
+ @productversion FlexJS 0.0
+-->
+<basic:MXMLBeadViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+                  xmlns:basic="library://ns.apache.org/flexjs/basic" 
+                  xmlns:mx="library://ns.apache.org/flexjs/mx"
+                  >
+    <fx:Script>
+        <![CDATA[
+            import org.apache.flex.html.TitleBar;
+            import org.apache.flex.core.ITitleBarModel;
+            import org.apache.flex.core.UIBase;
+            import org.apache.flex.events.Event;
+            
+            private function clickHandler():void
+            {
+                var newEvent:org.apache.flex.events.Event = new org.apache.flex.events.Event('close',true);
+                UIBase(_strand).dispatchEvent(newEvent)   
+            }
+        ]]>
+    </fx:Script>
+    <basic:beads>
+        <basic:MXMLBeadViewBaseDataBinding />
+        <basic:LayoutChangeNotifier watchedProperty="{ITitleBarModel(model).title}" />
+    </basic:beads>
+
+    <basic:Label id="titleLabel" text="{ITitleBarModel(model).title}" >
+        <basic:style>
+            <basic:SimpleCSSStyles fontWeight="inherit" margin="5" />
+        </basic:style>
+    </basic:Label>
+    <basic:CloseButton id="closeButton" click="clickHandler()"
+                       visible="{ITitleBarModel(model).showCloseButton}"/>
+    
+</basic:MXMLBeadViewBase>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
new file mode 100644
index 0000000..0aaa052
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.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.controllers
+{	
+	import org.apache.flex.html.beads.DateChooserView;
+	import org.apache.flex.html.beads.models.DateChooserModel;
+	import org.apache.flex.html.supportClasses.DateChooserButton;
+	
+	import org.apache.flex.core.IBeadController;
+	import org.apache.flex.core.IBeadModel;
+	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 DateChooserMouseController class is responsible for listening to
+	 *  mouse event related to the DateChooser. Events such as selecting a date
+	 *  or changing the calendar.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DateChooserMouseController implements IBeadController
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DateChooserMouseController()
+		{
+		}
+		
+		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;
+			
+			var view:DateChooserView = value.getBeadByType(IBeadView) as DateChooserView;
+			view.prevMonthButton.addEventListener("click", prevMonthClickHandler);
+			view.nextMonthButton.addEventListener("click", nextMonthClickHandler);
+			
+			var dayButtons:Array = view.dayButtons;
+			for(var i:int=0; i < dayButtons.length; i++) {
+				IEventDispatcher(dayButtons[i]).addEventListener("click", dayButtonClickHandler);
+			}
+		}
+		
+		/**
+		 * @private
+		 */
+		private function prevMonthClickHandler(event:Event):void
+		{
+			var model:DateChooserModel = _strand.getBeadByType(IBeadModel) as DateChooserModel;
+			var month:Number = model.displayedMonth - 1;
+			var year:Number  = model.displayedYear;
+			if (month < 0) {
+				month = 11;
+				year--;
+			}
+			model.displayedMonth = month;
+			model.displayedYear = year;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function nextMonthClickHandler(event:Event):void
+		{
+			var model:DateChooserModel = _strand.getBeadByType(IBeadModel) as DateChooserModel;
+			var month:Number = model.displayedMonth + 1;
+			var year:Number  = model.displayedYear;
+			if (month >= 12) {
+				month = 0;
+				year++;
+			}
+			model.displayedMonth = month;
+			model.displayedYear = year;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function dayButtonClickHandler(event:Event):void
+		{
+			var dateButton:DateChooserButton = event.target as DateChooserButton;
+			if (dateButton.dayOfMonth > 0) {
+				var model:DateChooserModel = _strand.getBeadByType(IBeadModel) as DateChooserModel;
+				var newDate:Date = new Date(model.displayedYear,model.displayedMonth,dateButton.dayOfMonth);
+				model.selectedDate = newDate;
+				IEventDispatcher(_strand).dispatchEvent( new Event("change") );
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
new file mode 100644
index 0000000..d1213cb
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBeadController;
+	import org.apache.flex.core.IDateChooserModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.beads.DateFieldView;
+	
+	/**
+	 * The DateFieldMouseController class is responsible for monitoring
+	 * the mouse events on the elements of the DateField. A click on the
+	 * DateField's menu button triggers the pop-up, for example.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DateFieldMouseController implements IBeadController
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DateFieldMouseController()
+		{
+		}
+		
+		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;
+			
+			var viewBead:DateFieldView = _strand.getBeadByType(DateFieldView) as DateFieldView;			
+			IEventDispatcher(viewBead.menuButton).addEventListener("click", clickHandler);
+		}
+		
+		/**
+		 * @private
+		 */
+		private function clickHandler(event:Event):void
+		{
+			var viewBead:DateFieldView = _strand.getBeadByType(DateFieldView) as DateFieldView;
+			viewBead.popUpVisible = true;
+			UIBase(viewBead.popUp).x = UIBase(_strand).x + UIBase(_strand).width - 20;
+			UIBase(viewBead.popUp).y = UIBase(_strand).y + UIBase(_strand).height;			
+			IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+		}
+		
+		/**
+		 * @private
+		 */
+		private function changeHandler(event:Event):void
+		{
+			var viewBead:DateFieldView = _strand.getBeadByType(DateFieldView) as DateFieldView;
+			
+			var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
+			model.selectedDate = IDateChooserModel(viewBead.popUp.getBeadByType(IDateChooserModel)).selectedDate;
+
+			viewBead.popUpVisible = false;
+			IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DragMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DragMouseController.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DragMouseController.as
new file mode 100644
index 0000000..01351b8
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DragMouseController.as
@@ -0,0 +1,261 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBead;
+	import org.apache.flex.core.IDragInitiator;
+    import org.apache.flex.core.IPopUpHost;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.DragEvent;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.geom.Point;
+	import org.apache.flex.utils.PointUtils;
+    import org.apache.flex.utils.UIUtils;
+	
+    /**
+     *  Indicates that a drag/drop operation is starting.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragStart", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that the mouse is moving during
+     *  a drag/drop operation.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragMove", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that a drag/drop operation is ending.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragEnd", type="org.apache.flex.events.DragEvent")]
+    
+	/**
+	 *  The DragMouseController bead handles mouse events on the 
+	 *  a component, looking for activity that constitutes the start
+     *  of a drag drop operation.
+	 *  
+     *  @flexjsignoreimport org.apache.flex.core.IDragInitiator
+     *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DragMouseController extends EventDispatcher implements IBead
+	{
+        /**
+         *  Whether there is a drag operation
+         *  in progress.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragging:Boolean = false;
+        
+        /**
+         *  The drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImage:IUIBase;
+        
+        /**
+         *  The offset of the drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImageOffsetX:Number = 0;
+        
+        /**
+         *  The offset of the drag image.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var dragImageOffsetY:Number = 0;
+        
+        /**
+         *  The default movement in x and or y that
+         *  means a drag should start
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var defaultThreshold:int = 4;
+        
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DragMouseController()
+		{
+            threshold = defaultThreshold;
+		}
+		
+        /**
+         *  The movement in x and or y that
+         *  means a drag should start
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var threshold:int = 4;
+        
+		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;
+			
+            IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_DOWN, dragMouseDownHandler);
+		}
+		
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+        
+        private var mouseDownX:Number;
+        private var mouseDownY:Number;
+        
+        private var host:IPopUpHost;
+        
+        /**
+         *  @private
+         */
+        private function dragMouseDownHandler(event:MouseEvent):void
+        {
+            trace("dragMouseDown");
+            IUIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_MOVE, dragMouseMoveHandler);
+            IUIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_UP, dragMouseUpHandler);
+            mouseDownX = event.screenX;
+            mouseDownY = event.screenY;
+            event.preventDefault();
+        }
+        
+        private function dragMouseMoveHandler(event:MouseEvent):void
+        {
+            var pt:Point;
+            var dragEvent:DragEvent;
+            trace("dragMouseMove");
+            
+            event.preventDefault();
+            
+            if (!dragging)
+            {
+                trace("not dragging anything else");
+                if (Math.abs(event.screenX - mouseDownX) > threshold ||
+                    Math.abs(event.screenY - mouseDownY) > threshold)
+                {
+                    trace("sending dragStart");
+                    dragEvent = DragEvent.createDragEvent("dragStart", event);
+                    DragEvent.dispatchDragEvent(dragEvent, IEventDispatcher(_strand));
+                    if (DragEvent.dragSource != null)
+                    {
+                        dragging = true;
+                        host = UIUtils.findPopUpHost(_strand as IUIBase);
+                        host.addElement(dragImage);
+                        pt = PointUtils.globalToLocal(new Point(event.clientX, event.clientY), host);
+                        dragImage.x = pt.x + dragImageOffsetX;
+                        dragImage.y = pt.y + dragImageOffsetY;
+                    }
+                }
+            }
+            else
+            {
+                trace("sending dragMove " + event.target.toString());
+                dragEvent = DragEvent.createDragEvent("dragMove", event);
+                trace("client: " + event.clientX.toString() + " " + event.clientY.toString() + " " + event.target.toString());
+                pt = PointUtils.globalToLocal(new Point(event.clientX, event.clientY), host);
+                trace("host: " + pt.x.toString() + " " + pt.y.toString());
+                dragImage.x = pt.x + dragImageOffsetX;
+                dragImage.y = pt.y + dragImageOffsetY;
+                DragEvent.dispatchDragEvent(dragEvent, IEventDispatcher(event.target));
+            }
+        }
+        
+        private function dragMouseUpHandler(event:MouseEvent):void
+        {
+            trace("dragMouseUp");
+            var dragEvent:DragEvent;
+            
+            if (dragging)
+            {
+                trace("sending dragEnd");
+                dragEvent = DragEvent.createDragEvent("dragEnd", event);
+                DragEvent.dispatchDragEvent(dragEvent, IEventDispatcher(event.target));
+                event.preventDefault();
+            }
+            dragging = false;
+            DragEvent.dragSource = null;
+            DragEvent.dragInitiator = null;
+            if (dragImage && host)
+                host.removeElement(dragImage);
+            dragImage = null;
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_MOVE, dragMouseMoveHandler);
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_UP, dragMouseUpHandler);			
+        }
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DropMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DropMouseController.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DropMouseController.as
new file mode 100644
index 0000000..03afba6
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/controllers/DropMouseController.as
@@ -0,0 +1,181 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBead;
+	import org.apache.flex.core.IDragInitiator;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.DragEvent;
+	import org.apache.flex.events.EventDispatcher;
+	import org.apache.flex.events.IEventDispatcher;
+    import org.apache.flex.events.MouseEvent;
+
+    /**
+     *  Indicates that the mouse has entered the component during
+     *  a drag operatino.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragEnter", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that the mouse is moving over a component during
+     *  a drag/drop operation.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragOver", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that the mouse is moving out of a component during
+     *  a drag/drop operation.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragExit", type="org.apache.flex.events.DragEvent")]
+    
+    /**
+     *  Indicates that a drop operation should be executed.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="dragDrop", type="org.apache.flex.events.DragEvent")]
+    
+	/**
+	 *  The DropMouseController bead handles mouse events on the 
+	 *  a component, looking for events from a drag/drop operation.
+	 *  
+     *  @flexjsignoreimport org.apache.flex.core.IDragInitiator
+     * 
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DropMouseController extends EventDispatcher implements IBead
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DropMouseController()
+		{
+		}
+		        
+		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;
+			
+            IEventDispatcher(_strand).addEventListener(DragEvent.DRAG_MOVE, dragMoveHandler);
+		}
+		
+		public function get strand():IStrand
+		{
+			return _strand;
+		}
+        
+        private var inside:Boolean;
+        
+        private var dragSource:Object;
+        private var dragInitiator:IDragInitiator;
+        
+        public function acceptDragDrop(target:IUIBase, type:String):void
+        {
+            // TODO: aharui: switch icons
+        }
+        
+        /**
+         *  @private
+         */
+        private function dragMoveHandler(event:DragEvent):void
+        {
+            trace("dragMove");
+            var dragEvent:DragEvent;
+            if (!inside)
+            {
+                dragEvent = DragEvent.createDragEvent("dragEnter", event);
+                dispatchEvent(dragEvent);
+                inside = true;
+                IUIBase(_strand).topMostEventDispatcher.addEventListener(DragEvent.DRAG_END, dragEndHandler);
+                IUIBase(_strand).addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
+            }
+            else
+            {
+                dragEvent = DragEvent.createDragEvent("dragOver", event);
+                dispatchEvent(dragEvent);
+            }
+        }
+        
+        private function rollOutHandler(event:MouseEvent):void
+        {
+            var dragEvent:DragEvent;
+            
+            if (inside)
+            {
+                dragEvent = DragEvent.createDragEvent("dragExit", event);
+                dispatchEvent(dragEvent);
+                inside = false;
+            }
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(DragEvent.DRAG_END, dragEndHandler);
+            IUIBase(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);			
+        }
+        
+        private function dragEndHandler(event:DragEvent):void
+        {
+            trace("dragEnd");
+            var dragEvent:DragEvent;
+            
+            dragEvent = DragEvent.createDragEvent("dragDrop", event);
+            dispatchEvent(dragEvent);
+            
+            inside = false;
+            IUIBase(_strand).topMostEventDispatcher.removeEventListener(DragEvent.DRAG_END, dragEndHandler);
+            IUIBase(_strand).removeEventListener(MouseEvent.ROLL_OUT, rollOutHandler);			
+        }
+		
+	}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
new file mode 100644
index 0000000..9cf614c
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
@@ -0,0 +1,154 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.IDataGridLayout;
+	import org.apache.flex.core.IDataGridModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	import org.apache.flex.html.supportClasses.DataGridColumn;
+	
+	/**
+	 * DataGridLayout is a class that handles the size and positioning of the
+	 * elements of a DataGrid. This includes the ButtonBar used for the column
+	 * headers and the Lists that are the columns.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class DataGridLayout implements IBeadLayout, IDataGridLayout
+	{
+		/**
+		 *  constructor
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function DataGridLayout()
+		{
+		}
+		
+		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;
+			IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
+			IEventDispatcher(value).addEventListener("elementAdded", changeHandler);
+		}
+		
+		private var _header:UIBase;
+		
+		/**
+		 * The element that is the header for the DataGrid
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get header():IUIBase
+		{
+			return _header;
+		}
+		public function set header(value:IUIBase):void
+		{
+			_header = UIBase(value);
+		}
+		
+		
+		private var _columns:Array;
+		
+		/**
+		 * The array of column elements.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function get columns():Array
+		{
+			return _columns;
+		}
+		public function set columns(value:Array):void
+		{
+			_columns = value;
+		}
+		
+		/**
+		 * @private
+		 */
+		private function changeHandler(event:Event):void
+		{			
+			var sw:Number = UIBase(_strand).width;
+			var sh:Number = UIBase(_strand).height;
+			
+			header.x = 0;
+			header.y = 0;
+			header.width = sw;
+			header.height = 25;
+			
+			var columnHeight:Number = sh - header.height;
+			var columnWidth:Number  = sw / columns.length;
+			
+			var xpos:Number = 0;
+			var ypos:Number = header.height;
+			
+			// TODO: change the layout so that the model's DataGridColumn.columnWidth
+			// isn't used blindly, but is considered in the overall width. In other words,
+			// right now the width could exceed the strand's width.
+			var model:IDataGridModel = _strand.getBeadByType(IDataGridModel) as IDataGridModel;
+			
+			for(var i:int=0; i < columns.length; i++) {
+				var column:UIBase = columns[i] as UIBase;
+				column.x = xpos;
+				column.y = ypos;
+				column.height = columnHeight;
+				
+				var dgc:DataGridColumn = model.columns[i];
+				if (!isNaN(dgc.columnWidth)) column.width = dgc.columnWidth;
+				else column.width  = columnWidth;
+				
+				xpos += column.width;
+			}
+			
+			IEventDispatcher(_strand).dispatchEvent(new Event("layoutComplete"));
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
new file mode 100644
index 0000000..23d2a9d
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -0,0 +1,245 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBeadLayout;
+	import org.apache.flex.core.ILayoutParent;
+	import org.apache.flex.core.IStrand;
+    import org.apache.flex.core.IParent;
+    import org.apache.flex.core.IUIBase;
+	import org.apache.flex.core.UIBase;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+
+    /**
+     *  The FlexibleFirstChildHorizontalLayout class is a simple layout
+     *  bead.  It takes the set of children and lays them out
+     *  horizontally in one row, separating them according to
+     *  CSS layout rules for margin and padding styles. But it
+     *  will size the first child to take up as much or little
+     *  room as possible.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+	public class FlexibleFirstChildHorizontalLayout implements IBeadLayout
+	{
+        /**
+         *  Constructor.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+		public function FlexibleFirstChildHorizontalLayout()
+		{
+		}
+		
+		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;
+            IEventDispatcher(value).addEventListener("layoutNeeded", changeHandler);
+			IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+			IEventDispatcher(value).addEventListener("childrenAdded", changeHandler);
+			IEventDispatcher(value).addEventListener("itemsCreated", changeHandler);
+		}
+	
+		private function changeHandler(event:Event):void
+		{
+			var layoutParent:ILayoutParent = _strand.getBeadByType(ILayoutParent) as ILayoutParent;
+			var contentView:IParent = layoutParent.contentView;
+			
+			var n:int = contentView.numElements;
+			var marginLeft:Object;
+			var marginRight:Object;
+			var marginTop:Object;
+			var marginBottom:Object;
+			var margin:Object;
+			var maxHeight:Number = 0;
+			var verticalMargins:Array = [];
+			
+            var xx:Number = layoutParent.resizableView.width;
+            if (isNaN(xx))
+                return;
+            var padding:Object = determinePadding();
+            // some browsers don't like it when you go all the way to the right edge.
+            xx -= padding.paddingLeft + padding.paddingRight + 1;
+            
+            for (var i:int = n - 1; i >= 0; i--)
+			{
+				var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+				margin = ValuesManager.valuesImpl.getValue(child, "margin");
+				if (margin is Array)
+				{
+					if (margin.length == 1)
+						marginLeft = marginTop = marginRight = marginBottom = margin[0];
+					else if (margin.length <= 3)
+					{
+						marginLeft = marginRight = margin[1];
+						marginTop = marginBottom = margin[0];
+					}
+					else if (margin.length == 4)
+					{
+						marginLeft = margin[3];
+						marginBottom = margin[2];
+						marginRight = margin[1];
+						marginTop = margin[0];					
+					}
+				}
+				else if (margin == null)
+				{
+					marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+					marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+					marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+					marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+				}
+				else
+				{
+					marginLeft = marginTop = marginBottom = marginRight = margin;
+				}
+				var ml:Number;
+				var mr:Number;
+				var mt:Number;
+				var mb:Number;
+				var lastmr:Number;
+				mt = Number(marginTop);
+				if (isNaN(mt))
+					mt = 0;
+				mb = Number(marginBottom);
+				if (isNaN(mb))
+					mb = 0;
+				if (marginLeft == "auto")
+					ml = 0;
+				else
+				{
+					ml = Number(marginLeft);
+					if (isNaN(ml))
+						ml = 0;
+				}
+				if (marginRight == "auto")
+					mr = 0;
+				else
+				{
+					mr = Number(marginRight);
+					if (isNaN(mr))
+						mr = 0;
+				}
+				child.y = mt;
+				maxHeight = Math.max(maxHeight, mt + child.height + mb);
+				if (i == 0)
+                {
+                    child.x = ml;
+                    child.width = xx - mr;
+                }
+				else
+                    child.x = xx - child.width - mr;
+				xx -= child.width + mr + ml;
+				lastmr = mr;
+				var valign:Object = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+				verticalMargins.push({ marginTop: mt, marginBottom: mb, valign: valign });
+			}
+			for (i = 0; i < n; i++)
+			{
+				var obj:Object = verticalMargins[0]
+				child = contentView.getElementAt(i) as IUIBase;
+				if (obj.valign == "middle")
+					child.y = (maxHeight - child.height) / 2;
+				else if (valign == "bottom")
+					child.y = maxHeight - child.height - obj.marginBottom;
+				else
+					child.y = obj.marginTop;
+			}
+            layoutParent.resizableView.height = maxHeight;
+		}
+
+        // TODO (aharui): utility class or base class
+        /**
+         *  Determines the top and left padding values, if any, as set by
+         *  padding style values. This includes "padding" for all padding values
+         *  as well as "padding-left" and "padding-top".
+         * 
+         *  Returns an object with paddingLeft and paddingTop properties.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        protected function determinePadding():Object
+        {
+            var paddingLeft:Object;
+            var paddingTop:Object;
+            var paddingRight:Object;
+            var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
+            if (typeof(padding) == "Array")
+            {
+                if (padding.length == 1)
+                    paddingLeft = paddingTop = paddingRight = padding[0];
+                else if (padding.length <= 3)
+                {
+                    paddingLeft = padding[1];
+                    paddingTop = padding[0];
+                    paddingRight = padding[1];
+                }
+                else if (padding.length == 4)
+                {
+                    paddingLeft = padding[3];
+                    paddingTop = padding[0];					
+                    paddingRight = padding[1];
+                }
+            }
+            else if (padding == null)
+            {
+                paddingLeft = ValuesManager.valuesImpl.getValue(_strand, "padding-left");
+                paddingTop = ValuesManager.valuesImpl.getValue(_strand, "padding-top");
+                paddingRight = ValuesManager.valuesImpl.getValue(_strand, "padding-right");
+            }
+            else
+            {
+                paddingLeft = paddingTop = paddingRight = padding;
+            }
+            var pl:Number = Number(paddingLeft);
+            var pt:Number = Number(paddingTop);
+            var pr:Number = Number(paddingRight);
+            if (isNaN(pl))
+                pl = 0;
+            if (isNaN(pt))
+                pt = 0;
+            if (isNaN(pr))
+                pr = 0;
+            return {paddingLeft:pl, paddingTop:pt, paddingRight:pr};
+        }
+
+    }
+        
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
new file mode 100644
index 0000000..00d328b
--- /dev/null
+++ b/frameworks/projects/HTML/asjs/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.flex.core.IBead;
+    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 LayoutChangeNotifier notifies layouts when a property
+     *  it is watching changes.
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion FlexJS 0.0
+	 */
+	public class LayoutChangeNotifier implements IBead
+	{
+		/**
+		 *  constructor.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function LayoutChangeNotifier()
+		{
+		}
+		
+		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;
+		}
+			
+        private var _value:* = undefined;
+        
+        /**
+         *  The value of the property being watched.  This is usually
+         *  a data binding expression.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function set initialValue(value:Object):void
+        {
+            _value = value;
+        }
+        
+		/**
+		 *  The value of the property being watched.  This is usually
+         *  a data binding expression.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set watchedProperty(value:Object):void
+		{
+			if (_value !== value)
+            {
+                _value = value;
+                if (_strand is IBeadView)
+                    IBeadView(_strand).host.dispatchEvent(new Event("layoutNeeded"));
+                else
+                    IEventDispatcher(_strand).dispatchEvent(new Event("layoutNeeded"));
+            }
+		}
+		
+	}
+}


Mime
View raw message