You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/11/02 15:15:10 UTC
[11/50] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - try to
copy HTML to Basic without losing history
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as
new file mode 100644
index 0000000..15b6587
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.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.supportClasses
+{
+ import org.apache.flex.core.IContentView;
+ import org.apache.flex.core.IItemRenderer;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.ItemAddedEvent;
+ import org.apache.flex.events.ItemClickedEvent;
+ import org.apache.flex.events.ItemRemovedEvent;
+
+ /**
+ * The DataGroup class is the IItemRendererParent used internally
+ * by org.apache.flex.html.List class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGroup extends ContainerContentArea implements IItemRendererParent, IContentView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGroup()
+ {
+ super();
+ }
+
+ /**
+ * @private
+ */
+ override public function addElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ super.addElement(c, dispatchEvent);
+
+ var newEvent:ItemAddedEvent = new ItemAddedEvent("itemAdded");
+ newEvent.item = c;
+
+ var strand:IEventDispatcher = parent as IEventDispatcher;
+ strand.dispatchEvent(newEvent);
+ }
+
+ /**
+ * @private
+ */
+ override public function removeElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ super.removeElement(c, dispatchEvent);
+
+ var newEvent:ItemRemovedEvent = new ItemRemovedEvent("itemRemoved");
+ newEvent.item = c;
+
+ var strand:IEventDispatcher = parent as IEventDispatcher;
+ strand.dispatchEvent(newEvent);
+ }
+
+ /**
+ * @copy org.apache.flex.core.IItemRendererParent#getItemRendererForIndex()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getItemRendererForIndex(index:int):IItemRenderer
+ {
+ if (index < 0 || index >= numElements) return null;
+ return getElementAt(index) as IItemRenderer;
+ }
+
+ /**
+ * Refreshes the itemRenderers. Useful after a size change by the data group.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function updateAllItemRenderers():void
+ {
+ var n:Number = numElements;
+ for (var i:Number = 0; i < n; i++)
+ {
+ var renderer:DataItemRenderer = getItemRendererForIndex(i) as DataItemRenderer;
+ if (renderer) {
+ renderer.setWidth(this.width,true);
+ renderer.adjustSize();
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
new file mode 100644
index 0000000..8b4ad5b
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
@@ -0,0 +1,179 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::SWF
+ {
+ import flash.display.Sprite;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.controllers.ItemRendererMouseController;
+ }
+ import org.apache.flex.core.ValuesManager;
+
+ /**
+ * The DataItemRenderer class is the base class for most itemRenderers. This class
+ * extends org.apache.flex.html.supportClasses.UIItemRendererBase and
+ * includes row and column index values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataItemRenderer extends UIItemRendererBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataItemRenderer()
+ {
+ super();
+ }
+
+ private var _columnIndex:int;
+
+ /**
+ * The index of the column the itemRenderer represents.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columnIndex():int
+ {
+ return _columnIndex;
+ }
+ public function set columnIndex(value:int):void
+ {
+ _columnIndex = value;
+ }
+
+ private var _rowIndex:int;
+
+ /**
+ * The index of the row the itemRenderer represents.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rowIndex():int
+ {
+ return _rowIndex;
+ }
+ public function set rowIndex(value:int):void
+ {
+ _rowIndex = value;
+ }
+
+ private var _dataField:String;
+
+ /**
+ * The name of the field within the data the itemRenderer should use.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataField():String
+ {
+ return _dataField;
+ }
+ public function set dataField(value:String):void
+ {
+ _dataField = value;
+ }
+
+ COMPILE::SWF
+ private var background:Sprite;
+
+ COMPILE::JS
+ private var controller:ItemRendererMouseController;
+
+ /**
+ * @private
+ */
+ COMPILE::SWF
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ background = new Sprite();
+ addChild(background);
+ }
+
+ /**
+ * @private
+ */
+ override public function updateRenderer():void
+ {
+ COMPILE::SWF
+ {
+ super.updateRenderer();
+
+ background.graphics.clear();
+ background.graphics.beginFill(useColor, (down||selected||hovered)?1:0);
+ background.graphics.drawRect(0, 0, width, height);
+ background.graphics.endFill();
+ }
+ COMPILE::JS
+ {
+ if (selected)
+ element.style.backgroundColor = '#9C9C9C';
+ else if (hovered)
+ element.style.backgroundColor = '#ECECEC';
+ else
+ element.style.backgroundColor = null;
+ }
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ *
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ element.flexjs_wrapper = this;
+ className = 'DataItemRenderer';
+
+ controller = new ItemRendererMouseController();
+ controller.strand = this;
+
+ return element;
+ }
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as
new file mode 100644
index 0000000..f493a45
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as
@@ -0,0 +1,67 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.TextButton;
+
+ /**
+ * The DateChooserButton class is used for each button in the DateChooser. The
+ * button holds the day of the month the button is representing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DateChooserButton extends TextButton
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DateChooserButton()
+ {
+ super();
+ className = "DateChooserButton";
+ }
+
+ private var _dayOfMonth:int;
+
+ /**
+ * The day of the month the button represents.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dayOfMonth():int
+ {
+ return _dayOfMonth;
+ }
+ public function set dayOfMonth(value:int):void
+ {
+ _dayOfMonth = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateHeaderButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateHeaderButton.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateHeaderButton.as
new file mode 100644
index 0000000..4fbe70a
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DateHeaderButton.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.TextButton;
+
+ /**
+ * The DateHeaderButton class is used for the buttons in the DateChooser's
+ * heading areas.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DateHeaderButton extends TextButton
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DateHeaderButton()
+ {
+ super();
+ className = "DateHeaderButton";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as
new file mode 100644
index 0000000..6bc1d43
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as
@@ -0,0 +1,63 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IPopUp;
+ import org.apache.flex.html.SimpleList;
+ import org.apache.flex.html.beads.SolidBackgroundBead;
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#change
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The DropDownListList class is the List class used internally
+ * by DropDownList as the dropdown/popup.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListList extends SimpleList implements IPopUp
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListList()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
new file mode 100644
index 0000000..73bd8bd
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
@@ -0,0 +1,316 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ISelectableItemRenderer;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.svg.CompoundGraphic;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.MXMLDataInterpreter;
+
+ /**
+ * The GraphicsItemRenderer provides a base class for itemRenderers that use graphics rather than
+ * components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class GraphicsItemRenderer extends CompoundGraphic implements ISelectableItemRenderer
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function GraphicsItemRenderer()
+ {
+ super();
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ // very common for item renderers to be resized by their containers,
+ addEventListener("widthChanged", sizeChangeHandler);
+ addEventListener("heightChanged", sizeChangeHandler);
+
+ // each MXML file can also have styles in fx:Style block
+ ValuesManager.valuesImpl.init(this);
+
+ MXMLDataInterpreter.generateMXMLProperties(this, mxmlProperties);
+ MXMLDataInterpreter.generateMXMLInstances(this, this, MXMLDescriptor);
+
+ dispatchEvent(new Event("initBindings"));
+ dispatchEvent(new Event("initComplete"));
+
+ }
+
+ private var _labelField:String = "label";
+
+ /**
+ * The name of the field within the data to use as a label. Some itemRenderers use this field to
+ * identify the value they should show while other itemRenderers ignore this if they are showing
+ * complex information.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return _labelField;
+ }
+ public function set labelField(value:String):void
+ {
+ _labelField = value;
+ }
+
+ private var _index:int;
+
+ /**
+ * The position with the dataProvider being shown by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get index():int
+ {
+ return _index;
+ }
+ public function set index(value:int):void
+ {
+ _index = value;
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a selected state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+ updateRenderer();
+ }
+
+ private var _hovered:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a hovered state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get hovered():Boolean
+ {
+ return _hovered;
+ }
+ public function set hovered(value:Boolean):void
+ {
+ _hovered = value;
+ updateRenderer();
+ }
+
+ private var _down:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a down (or pre-selected) state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get down():Boolean
+ {
+ return _down;
+ }
+ public function set down(value:Boolean):void
+ {
+ _down = value;
+ updateRenderer();
+ }
+
+ private var _data:Object;
+
+ [Bindable("__NoChangeEvent__")]
+ /**
+ * The data being represented by this itemRenderer. This can be something simple like a String or
+ * a Number or something very complex.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get data():Object
+ {
+ return _data;
+ }
+ public function set data(value:Object):void
+ {
+ _data = value;
+ }
+
+ private var _listData:Object;
+
+ [Bindable("__NoChangeEvent__")]
+ /**
+ * Additional data about the list structure the itemRenderer may
+ * find useful.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get listData():Object
+ {
+ return _listData;
+ }
+ public function set listData(value:Object):void
+ {
+ _listData = value;
+ }
+
+ private var _dataField:String;
+
+ /**
+ * The name of the field within the data the itemRenderer should use.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataField():String
+ {
+ return _dataField;
+ }
+ public function set dataField(value:String):void
+ {
+ _dataField = value;
+ }
+
+ private var _itemRendererParent:Object;
+
+ /**
+ * The parent container for the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererParent():Object
+ {
+ return _itemRendererParent;
+ }
+ public function set itemRendererParent(value:Object):void
+ {
+ _itemRendererParent = value;
+ }
+
+ /**
+ * @private
+ */
+ public function updateRenderer():void
+ {
+// if (down)
+// backgroundColor = downColor;
+// else if (hovered)
+// backgroundColor = highlightColor;
+// else if (selected)
+// backgroundColor = selectedColor;
+ }
+
+ /**
+ * @copy org.apache.flex.core.ItemRendererClassFactory#mxmlContent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var mxmlContent:Array;
+
+ /**
+ * @private
+ */
+ public function get MXMLDescriptor():Array
+ {
+ return null;
+ }
+
+ private var mxmlProperties:Array ;
+
+ /**
+ * @private
+ */
+ public function generateMXMLAttributes(data:Array):void
+ {
+ mxmlProperties = data;
+ }
+
+ /**
+ * @private
+ */
+ private function sizeChangeHandler(event:Event):void
+ {
+ adjustSize();
+ }
+
+ /**
+ * This function is called whenever the itemRenderer changes size. Sub-classes should override
+ * this method an handle the size change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function adjustSize():void
+ {
+ // handle in subclass
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as
new file mode 100644
index 0000000..0b56925
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/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/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/RadioButtonIcon.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/RadioButtonIcon.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/RadioButtonIcon.as
new file mode 100644
index 0000000..119400f
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/RadioButtonIcon.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.supportClasses
+{
+ COMPILE::JS {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The RadioButton class is a component that displays a selectable Button. RadioButtons
+ * are typically used in groups, identified by the groupName property. RadioButton use
+ * the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, which includes the groupName.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the RadioButton..
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RadioButtonIcon
+ {
+ public function RadioButtonIcon()
+ {
+ COMPILE::JS {
+ createElement();
+ }
+
+ className = 'RadioButtonIcon';
+ }
+
+ COMPILE::JS {
+ public var element:WrappedHTMLElement;
+ public var positioner:WrappedHTMLElement;
+ }
+
+ private var _className:String;
+
+ /**
+ * @private
+ */
+ public function get className():String
+ {
+ return _className;
+ }
+ public function set className(value:String):void
+ {
+ _className = value;
+
+ COMPILE::JS {
+ element.className = value;
+ }
+ }
+
+ private var _id:String;
+
+ /**
+ * @private
+ */
+ public function get id():String
+ {
+ return _id;
+ }
+ public function set id(value:String):void
+ {
+ _id = value;
+
+ COMPILE::JS {
+ element.id = value;
+ }
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion Text
+ */
+ COMPILE::JS
+ protected function createElement():WrappedHTMLElement
+ {
+ var input:HTMLInputElement = document.createElement('input') as HTMLInputElement;
+ input.type = 'radio';
+
+ element = input as WrappedHTMLElement;
+
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ (element as WrappedHTMLElement).flexjs_wrapper = this;
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as
new file mode 100644
index 0000000..0bef2e6
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.UIBase;
+ 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 ScrollBar extends UIBase implements IChrome, IViewportScroller
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ScrollBar()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
new file mode 100644
index 0000000..d7c8d71
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
@@ -0,0 +1,351 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::SWF
+ {
+ import flash.geom.Rectangle;
+ }
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IContentViewHost;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IViewport;
+ import org.apache.flex.core.IViewportModel;
+ COMPILE::SWF
+ {
+ import org.apache.flex.core.IViewportScroller;
+ }
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.geom.Size;
+ import org.apache.flex.html.beads.ScrollBarView;
+ import org.apache.flex.html.beads.models.ScrollBarModel;
+
+ /**
+ * The ScrollingViewport extends the Viewport class by adding horizontal and
+ * vertical scroll bars, if needed, to the content area of a Container. In
+ * addition, the content of the Container is clipped so that items extending
+ * outside the Container are hidden and reachable only by scrolling.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ScrollingViewport extends Viewport implements IBead, IViewport
+ {
+ /**
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ScrollingViewport()
+ {
+ }
+
+ COMPILE::SWF
+ private var _verticalScroller:ScrollBar;
+
+ COMPILE::SWF
+ public function get verticalScroller():IViewportScroller
+ {
+ return _verticalScroller;
+ }
+
+ COMPILE::SWF
+ private var _horizontalScroller:ScrollBar
+
+ COMPILE::SWF
+ public function get horizontalScroller():IViewportScroller
+ {
+ return _horizontalScroller;
+ }
+
+ COMPILE::SWF
+ private var _verticalScrollPosition:Number = 0;
+
+ public function get verticalScrollPosition():Number
+ {
+ COMPILE::SWF
+ {
+ return _verticalScrollPosition;
+ }
+ COMPILE::JS
+ {
+ return this.contentView.positioner.scrollTop;
+ }
+ }
+ public function set verticalScrollPosition(value:Number):void
+ {
+ COMPILE::SWF
+ {
+ _verticalScrollPosition = value;
+ handleVerticalScrollChange();
+ }
+ COMPILE::JS
+ {
+ this.contentView.positioner.scrollTop = value;
+ }
+ }
+
+ COMPILE::SWF
+ private var _horizontalScrollPosition:Number = 0;
+
+ public function get horizontalScrollPosition():Number
+ {
+ COMPILE::SWF
+ {
+ return _horizontalScrollPosition;
+ }
+ COMPILE::JS
+ {
+ return this.contentView.positioner.scrollLeft;
+ }
+ }
+ public function set horizontalScrollPosition(value:Number):void
+ {
+ COMPILE::SWF
+ {
+ _horizontalScrollPosition = value;
+ handleHorizontalScrollChange();
+ }
+ COMPILE::JS
+ {
+ this.contentView.positioner.scrollLeft = value;
+ }
+ }
+
+ COMPILE::JS
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ contentView.element.style.overflow = 'auto';
+ }
+
+ private var viewportWidth:Number;
+ private var viewportHeight:Number;
+
+ /**
+ * @copy org.apache.flex.core.IViewport
+ */
+ override public function layoutViewportBeforeContentLayout(width:Number, height:Number):void
+ {
+ super.layoutViewportBeforeContentLayout(width, height);
+ viewportWidth = width;
+ viewportHeight = height;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IViewport
+ */
+ override public function layoutViewportAfterContentLayout():Size
+ {
+ COMPILE::SWF
+ {
+ var hadV:Boolean = _verticalScroller != null && _verticalScroller.visible;
+ var hadH:Boolean = _horizontalScroller != null && _horizontalScroller.visible;
+ var contentSize:Size;
+ do
+ {
+ contentSize = super.layoutViewportAfterContentLayout();
+ if (isNaN(viewportHeight))
+ viewportHeight = contentSize.height;
+ if (isNaN(viewportWidth))
+ viewportWidth = contentSize.width;
+
+ var host:UIBase = UIBase(_strand);
+ var visibleWidth:Number;
+ var visibleHeight:Number;
+ var needV:Boolean = contentSize.height > viewportHeight;
+ var needH:Boolean = contentSize.width > viewportWidth;
+
+ if (needV)
+ {
+ if (_verticalScroller == null) {
+ _verticalScroller = createVerticalScrollBar();
+ (host as IContentViewHost).strandChildren.addElement(_verticalScroller);
+ }
+ }
+ if (needH)
+ {
+ if (_horizontalScroller == null) {
+ _horizontalScroller = createHorizontalScrollBar();
+ (host as IContentViewHost).strandChildren.addElement(_horizontalScroller);
+ }
+ }
+
+ if (needV)
+ {
+ _verticalScroller.visible = true;
+ _verticalScroller.x = contentArea.x + viewportWidth - _verticalScroller.width;
+ _verticalScroller.y = contentArea.y;
+ _verticalScroller.setHeight(viewportHeight - (needH ? _horizontalScroller.height : 0), true);
+ visibleWidth = _verticalScroller.x;
+ }
+ else if (_verticalScroller)
+ _verticalScroller.visible = false;
+
+ if (needH)
+ {
+ _horizontalScroller.visible = true;
+ _horizontalScroller.x = contentArea.x;
+ _horizontalScroller.y = contentArea.y + viewportHeight - _horizontalScroller.height;
+ _horizontalScroller.setWidth(viewportWidth - (needV ? _verticalScroller.width : 0), true);
+ visibleHeight = _horizontalScroller.y;
+ }
+
+ var needsLayout:Boolean = false;
+ // resize content area if needed to get out from under scrollbars
+ if (!isNaN(visibleWidth) || !isNaN(visibleHeight))
+ {
+ if (!isNaN(visibleWidth))
+ needsLayout = visibleWidth != contentView.width;
+ if (!isNaN(visibleHeight))
+ needsLayout = visibleHeight != contentView.height;
+ if (!isNaN(visibleWidth) && !isNaN(visibleHeight))
+ contentArea.setWidthAndHeight(visibleWidth, visibleHeight, false);
+ else if (!isNaN(visibleWidth))
+ contentArea.setWidth(visibleWidth, false);
+ else if (!isNaN(visibleHeight))
+ contentArea.setHeight(visibleHeight, false);
+ }
+ if (needsLayout)
+ {
+ var layout:IBeadLayout = host.getBeadByType(IBeadLayout) as IBeadLayout;
+ layout.layout();
+ }
+ } while (needsLayout && (needV != hadV || needH == hadH));
+ if (_verticalScroller)
+ {
+ ScrollBarModel(_verticalScroller.model).maximum = contentSize.height;
+ ScrollBarModel(_verticalScroller.model).pageSize = contentArea.height;
+ ScrollBarModel(_verticalScroller.model).pageStepSize = contentArea.height;
+ if (contentSize.height > contentArea.height &&
+ (contentSize.height - contentArea.height) < _verticalScrollPosition)
+ _verticalScrollPosition = contentSize.height - contentArea.height;
+ }
+ if (_horizontalScroller)
+ {
+ ScrollBarModel(_horizontalScroller.model).maximum = contentSize.width;
+ ScrollBarModel(_horizontalScroller.model).pageSize = contentArea.width;
+ ScrollBarModel(_horizontalScroller.model).pageStepSize = contentArea.width;
+ if (contentSize.width > contentArea.width &&
+ (contentSize.width - contentArea.width) < _horizontalScrollPosition)
+ _horizontalScrollPosition = contentSize.width - contentArea.width;
+ }
+
+ var rect:Rectangle = new Rectangle(_horizontalScrollPosition, _verticalScrollPosition,
+ (_verticalScroller != null && _verticalScroller.visible) ?
+ _verticalScroller.x : viewportWidth,
+ (_horizontalScroller != null && _horizontalScroller.visible) ?
+ _horizontalScroller.y : viewportHeight);
+ contentArea.scrollRect = rect;
+ return contentSize;
+
+ }
+ COMPILE::JS
+ {
+ return new Size(contentView.width, contentView.height);
+ }
+
+ }
+
+ COMPILE::SWF
+ private function createVerticalScrollBar():ScrollBar
+ {
+ var vsbm:ScrollBarModel = new ScrollBarModel();
+ vsbm.minimum = 0;
+ vsbm.snapInterval = 1;
+ vsbm.stepSize = 1;
+ vsbm.value = 0;
+
+ var vsb:VScrollBar;
+ vsb = new VScrollBar();
+ vsb.model = vsbm;
+ vsb.visible = false;
+
+ vsb.addEventListener("scroll",handleVerticalScroll);
+ return vsb;
+ }
+
+ COMPILE::SWF
+ private function createHorizontalScrollBar():ScrollBar
+ {
+ var hsbm:ScrollBarModel = new ScrollBarModel();
+ hsbm.minimum = 0;
+ hsbm.snapInterval = 1;
+ hsbm.stepSize = 1;
+ hsbm.value = 0;
+
+ var hsb:HScrollBar;
+ hsb = new HScrollBar();
+ hsb.model = hsbm;
+ hsb.visible = false;
+
+ hsb.addEventListener("scroll",handleHorizontalScroll);
+ return hsb;
+ }
+
+ COMPILE::SWF
+ private function handleVerticalScroll(event:Event):void
+ {
+ var host:UIBase = UIBase(_strand);
+ var vpos:Number = ScrollBarModel(_verticalScroller.model).value;
+ var rect:Rectangle = contentArea.scrollRect;
+ rect.y = vpos;
+ contentArea.scrollRect = rect;
+
+ _verticalScrollPosition = vpos;
+ }
+
+ COMPILE::SWF
+ private function handleHorizontalScroll(event:Event):void
+ {
+ var host:UIBase = UIBase(_strand);
+ var hpos:Number = ScrollBarModel(_horizontalScroller.model).value;
+ var rect:Rectangle = contentArea.scrollRect;
+ rect.x = hpos;
+ contentArea.scrollRect = rect;
+
+ _horizontalScrollPosition = hpos;
+ }
+
+ COMPILE::SWF
+ private function handleVerticalScrollChange():void
+ {
+ if (_verticalScroller) {
+ ScrollBarModel(_verticalScroller.model).value = verticalScrollPosition;
+ }
+ }
+
+ COMPILE::SWF
+ private function handleHorizontalScrollChange():void
+ {
+ if (_horizontalScroller) {
+ ScrollBarModel(_horizontalScroller.model).value = horizontalScrollPosition;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
new file mode 100644
index 0000000..f03b527
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/SpinnerButton.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.TextButton;
+
+ public class SpinnerButton extends TextButton
+ {
+ public function SpinnerButton()
+ {
+ super();
+ className = 'SpinnerButton';
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
new file mode 100644
index 0000000..b897012
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
@@ -0,0 +1,180 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::SWF
+ {
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.CSSTextField;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.controllers.ItemRendererMouseController;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.ITextItemRenderer;
+
+ /**
+ * The StringItemRenderer class displays data in string form using the data's toString()
+ * function.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class StringItemRenderer extends DataItemRenderer implements ITextItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function StringItemRenderer()
+ {
+ super();
+
+ COMPILE::SWF
+ {
+ textField = new CSSTextField();
+ textField.type = TextFieldType.DYNAMIC;
+ textField.autoSize = TextFieldAutoSize.LEFT;
+ textField.selectable = false;
+ textField.parentDrawsBackground = true;
+ }
+ }
+
+ COMPILE::SWF
+ public var textField:CSSTextField;
+
+ /**
+ * @private
+ */
+ COMPILE::SWF
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ addChild(textField);
+
+ adjustSize();
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::SWF
+ override public function adjustSize():void
+ {
+ var cy:Number = height/2;
+
+ textField.x = 0;
+ textField.y = cy - textField.height/2;
+ textField.width = width;
+
+ updateRenderer();
+ }
+
+ /**
+ * The text currently displayed by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ COMPILE::SWF
+ {
+ return textField.text;
+ }
+ COMPILE::JS
+ {
+ return this.element.innerHTML;
+ }
+ }
+
+ public function set text(value:String):void
+ {
+ COMPILE::SWF
+ {
+ textField.text = value;
+ }
+ COMPILE::JS
+ {
+ this.element.innerHTML = value;
+ }
+ }
+
+ /**
+ * Sets the data value and uses the String version of the data for display.
+ *
+ * @param Object data The object being displayed by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set data(value:Object):void
+ {
+ super.data = value;
+ var text:String;
+ if (labelField) text = String(value[labelField]);
+ else if (dataField) text = String(value[dataField]);
+ else text = String(value);
+
+ this.text = text;
+ }
+
+ COMPILE::JS
+ private var controller:ItemRendererMouseController;
+
+ COMPILE::JS
+ private var backgroundView:WrappedHTMLElement;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ element.flexjs_wrapper = this;
+ className = 'StringItemRenderer';
+
+ // itemRenderers should provide something for the background to handle
+ // the selection and highlight
+ backgroundView = element;
+
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
new file mode 100644
index 0000000..5908d73
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
@@ -0,0 +1,560 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flash.text.TextFieldType;
+
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IFlexJSElement;
+ import org.apache.flex.core.IStrand;
+ 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;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.events.utils.MouseEventConverter;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.html.beads.ITextItemRenderer;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The TextFieldItemRenderer class provides a org.apache.flex.html.TextField as an itemRenderer.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextFieldItemRenderer extends CSSTextField implements ITextItemRenderer, IStrand, IUIBase, IFlexJSElement
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextFieldItemRenderer()
+ {
+ super();
+ type = TextFieldType.DYNAMIC;
+ selectable = false;
+
+ MouseEventConverter.setupInstanceConverters(this);
+ }
+
+ public var highlightColor:uint = 0xCEDBEF;
+ public var selectedColor:uint = 0xA8C6EE;
+ public var downColor:uint = 0x808080;
+
+ private var _explicitWidth:Number;
+
+ /**
+ * The explicitly set width (as opposed to measured width
+ * or percentage width).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get explicitWidth():Number
+ {
+ if (isNaN(_explicitWidth))
+ {
+ var value:* = ValuesManager.valuesImpl.getValue(this, "width");
+ if (value !== undefined) {
+ _explicitWidth = Number(value);
+ }
+ }
+
+ return _explicitWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitWidth(value:Number):void
+ {
+ if (_explicitWidth == value)
+ return;
+
+ // width can be pixel or percent not both
+ if (!isNaN(value))
+ _percentWidth = NaN;
+
+ _explicitWidth = value;
+
+ dispatchEvent(new Event("explicitWidthChanged"));
+ }
+
+ private var _explicitHeight:Number;
+
+ /**
+ * The explicitly set width (as opposed to measured width
+ * or percentage width).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get explicitHeight():Number
+ {
+ if (isNaN(_explicitHeight))
+ {
+ var value:* = ValuesManager.valuesImpl.getValue(this, "height");
+ if (value !== undefined) {
+ _explicitHeight = Number(value);
+ }
+ }
+
+ return _explicitHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set explicitHeight(value:Number):void
+ {
+ if (_explicitHeight == value)
+ return;
+
+ // height can be pixel or percent not both
+ if (!isNaN(value))
+ _percentHeight = NaN;
+
+ _explicitHeight = value;
+
+ dispatchEvent(new Event("explicitHeightChanged"));
+ }
+
+ private var _percentWidth:Number;
+
+ /**
+ * The requested percentage width this component
+ * should have in the parent container. Note that
+ * the actual percentage may be different if the
+ * total is more than 100% or if there are other
+ * components with explicitly set widths.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get percentWidth():Number
+ {
+ return _percentWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set percentWidth(value:Number):void
+ {
+ if (_percentWidth == value)
+ return;
+
+ if (!isNaN(value))
+ _explicitWidth = NaN;
+
+ _percentWidth = value;
+
+ dispatchEvent(new Event("percentWidthChanged"));
+ }
+
+ private var _percentHeight:Number;
+
+ /**
+ * The requested percentage height this component
+ * should have in the parent container. Note that
+ * the actual percentage may be different if the
+ * total is more than 100% or if there are other
+ * components with explicitly set heights.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get percentHeight():Number
+ {
+ return _percentHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set percentHeight(value:Number):void
+ {
+ if (_percentHeight == value)
+ return;
+
+ if (!isNaN(value))
+ _explicitHeight = NaN;
+
+ _percentHeight = value;
+
+ dispatchEvent(new Event("percentHeightChanged"));
+ }
+
+ private var _width:Number;
+
+ /**
+ * @private
+ */
+ override public function get width():Number
+ {
+ if (isNaN(explicitWidth))
+ {
+ var w:Number = _width;
+ if (isNaN(w)) w = $width;
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(this);
+ return w + metrics.left + metrics.right;
+ }
+ else
+ return explicitWidth;
+ }
+ override public function set width(value:Number):void
+ {
+ if (explicitWidth != value)
+ {
+ explicitWidth = value;
+ }
+
+ if (value != _width) {
+ _width = value;
+ dispatchEvent( new Event("widthChanged") );
+ }
+ }
+
+ /**
+ * @private
+ */
+ protected function get $width():Number
+ {
+ return super.width;
+ }
+
+ private var _height:Number;
+
+ /**
+ * @private
+ */
+ override public function get height():Number
+ {
+ if (isNaN(explicitHeight))
+ {
+ var h:Number = _height;
+ if (isNaN(h)) h = $height;
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(this);
+ return h + metrics.top + metrics.bottom;
+ }
+ else
+ return explicitHeight;
+ }
+
+ override public function set height(value:Number):void
+ {
+ if (explicitHeight != value)
+ {
+ explicitHeight = value;
+ }
+
+ if (_height != value) {
+ _height = value;
+ dispatchEvent(new Event("heightChanged"));
+ }
+ }
+
+ /**
+ * @private
+ */
+ protected function get $height():Number
+ {
+ return super.height;
+ }
+
+ /**
+ * The String(data) for the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get data():Object
+ {
+ return text;
+ }
+ public function set data(value:Object):void
+ {
+ text = String(value);
+ }
+
+ private var _listData:Object;
+
+ /**
+ * Additional data about the list the itemRenderer may find useful.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get listData():Object
+ {
+ return _listData;
+ }
+ public function set listData(value:Object):void
+ {
+ _listData = value;
+ }
+
+ /**
+ * @private
+ */
+ public function get labelField():String
+ {
+ return null;
+ }
+ public function set labelField(value:String):void
+ {
+ // nothing to do for this
+ }
+
+ private var _index:int;
+
+ /**
+ * An index value for the itemRenderer corresponding the data's position with its dataProvider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get index():int
+ {
+ return _index;
+ }
+ public function set index(value:int):void
+ {
+ _index = value;
+ }
+
+ private var _hovered:Boolean;
+
+ /**
+ * Returns whether or not the itemRenderer is a "hovered" state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get hovered():Boolean
+ {
+ return _hovered;
+ }
+ public function set hovered(value:Boolean):void
+ {
+ _hovered = value;
+ updateRenderer();
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * Whether or not the itemRenderer should be represented in a selected state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+ updateRenderer();
+ }
+
+ private var _down:Boolean;
+
+ /**
+ * Whether or not the itemRenderer should be represented in a down (or pre-selected) state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get down():Boolean
+ {
+ return _down;
+ }
+ public function set down(value:Boolean):void
+ {
+ _down = value;
+ updateRenderer();
+ }
+
+ private var _itemRendererParent:Object;
+
+ /**
+ * The parent component of the itemRenderer instance. This is the container that houses
+ * all of the itemRenderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererParent():Object
+ {
+ return _itemRendererParent;
+ }
+ public function set itemRendererParent(value:Object):void
+ {
+ _itemRendererParent = value;
+ }
+
+ /**
+ * @private
+ */
+ public function updateRenderer():void
+ {
+ background = (down || selected || hovered);
+ if (down)
+ backgroundColor = downColor;
+ else if (hovered)
+ backgroundColor = highlightColor;
+ else if (selected)
+ backgroundColor = selectedColor;
+ }
+
+ /**
+ * @private
+ */
+ public function get element():IFlexJSElement
+ {
+ return this;
+ }
+
+ // beads declared in MXML are added to the strand.
+ // from AS, just call addBead()
+ public var beads:Array;
+
+ private var _beads:Vector.<IBead>;
+
+ /**
+ * @private
+ */
+ public function addBead(bead:IBead):void
+ {
+ if (!_beads)
+ _beads = new Vector.<IBead>;
+ _beads.push(bead);
+ bead.strand = this;
+ }
+
+ /**
+ * @private
+ */
+ public function getBeadByType(classOrInterface:Class):IBead
+ {
+ for each (var bead:IBead in _beads)
+ {
+ if (bead is classOrInterface)
+ return bead;
+ }
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function removeBead(value:IBead):IBead
+ {
+ var n:int = _beads.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var bead:IBead = _beads[i];
+ if (bead == value)
+ {
+ _beads.splice(i, 1);
+ return bead;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @private
+ */
+ public function addedToParent():void
+ {
+ var c:Class;
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ dispatchEvent(new Event("beadsAdded"));
+
+ // renderer has a default model (the 'data' property)
+ // and it is essentially a view of that model, so it
+ // only needs an assignable controller
+
+ if (getBeadByType(IBeadController) == null)
+ {
+ c = ValuesManager.valuesImpl.getValue(this, "iBeadController") as Class;
+ if (c)
+ {
+ var controller:IBeadController = new c as IBeadController;
+ if (controller)
+ addBead(controller);
+ }
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.IUIBase#topMostEventDispatcher
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get topMostEventDispatcher():IEventDispatcher
+ {
+ if (!parent)
+ return null;
+ return IUIBase(parent).topMostEventDispatcher;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeItemRenderer.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeItemRenderer.as
new file mode 100644
index 0000000..7250e82
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeItemRenderer.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ public class TreeItemRenderer extends StringItemRenderer
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TreeItemRenderer()
+ {
+ super();
+ }
+
+ /**
+ * Sets the data for the itemRenderer instance along with the listData
+ * (TreeListData).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set data(value:Object):void
+ {
+ super.data = value;
+
+ var treeData:TreeListData = listData as TreeListData;
+ var indentSpace:String = " ";
+
+ COMPILE::JS {
+ indentSpace = " "
+ }
+
+ var indent:String = treeData.hasChildren ? (treeData.isOpen ? "\u25bc" : "\u25b6") : " ";
+ for (var i:int=0; i < treeData.depth; i++) {
+ indent += indentSpace;
+ }
+
+ this.text = indent + this.text;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeListData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeListData.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeListData.as
new file mode 100644
index 0000000..c6da4d5
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/TreeListData.as
@@ -0,0 +1,76 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ /**
+ * The TreeListData class contains information that Tree item renderers may
+ * find useful when displaying the data for a node in the tree.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignoreimport goog.events.Event
+ */
+ public class TreeListData
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TreeListData()
+ {
+ }
+
+ /**
+ * The depth of the data within the tree with the root being zero.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var depth:Number;
+
+ /**
+ * Whether or not the node for this data is open (and its children
+ * visible).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var isOpen:Boolean;
+
+ /**
+ * Whether or not the node for this data has any children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var hasChildren:Boolean;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
new file mode 100644
index 0000000..f253bd2
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
@@ -0,0 +1,303 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ISelectableItemRenderer;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.MXMLDataInterpreter;
+
+ [DefaultProperty("mxmlContent")]
+
+ /**
+ * The UIItemRendererBase class is the base class for all itemRenderers. An itemRenderer is used to
+ * display a single datum within a collection of data. Components such as a List use itemRenderers to
+ * show their dataProviders.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class UIItemRendererBase extends UIBase implements ISelectableItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function UIItemRendererBase()
+ {
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ // very common for item renderers to be resized by their containers,
+ addEventListener("widthChanged", sizeChangeHandler);
+ addEventListener("heightChanged", sizeChangeHandler);
+ addEventListener("sizeChanged", sizeChangeHandler);
+
+ // each MXML file can also have styles in fx:Style block
+ ValuesManager.valuesImpl.init(this);
+
+ MXMLDataInterpreter.generateMXMLProperties(this, mxmlProperties);
+ MXMLDataInterpreter.generateMXMLInstances(this, this, MXMLDescriptor);
+
+ dispatchEvent(new Event("initBindings"));
+ dispatchEvent(new Event("initComplete"));
+
+ }
+
+ private var _itemRendererParent:Object;
+
+ /**
+ * The parent container for the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererParent():Object
+ {
+ return _itemRendererParent;
+ }
+ public function set itemRendererParent(value:Object):void
+ {
+ _itemRendererParent = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.ItemRendererClassFactory#mxmlContent
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var mxmlContent:Array;
+
+ /**
+ * @private
+ */
+ public function get MXMLDescriptor():Array
+ {
+ return null;
+ }
+
+ private var mxmlProperties:Array ;
+
+ /**
+ * @private
+ */
+ public function generateMXMLAttributes(data:Array):void
+ {
+ mxmlProperties = data;
+ }
+
+ public var backgroundColor:uint = 0xFFFFFF;
+ public var highlightColor:uint = 0xCEDBEF;
+ public var selectedColor:uint = 0xA8C6EE;
+ public var downColor:uint = 0x808080;
+ protected var useColor:uint = backgroundColor;
+
+ private var _data:Object;
+
+ [Bindable("__NoChangeEvent__")]
+ /**
+ * The data being represented by this itemRenderer. This can be something simple like a String or
+ * a Number or something very complex.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get data():Object
+ {
+ return _data;
+ }
+ public function set data(value:Object):void
+ {
+ _data = value;
+ }
+
+ private var _listData:Object;
+
+ [Bindable("__NoChangeEvent__")]
+ /**
+ * Additional data about the list structure the itemRenderer may
+ * find useful.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get listData():Object
+ {
+ return _listData;
+ }
+ public function set listData(value:Object):void
+ {
+ _listData = value;
+ }
+
+ private var _labelField:String = "label";
+
+ /**
+ * The name of the field within the data to use as a label. Some itemRenderers use this field to
+ * identify the value they should show while other itemRenderers ignore this if they are showing
+ * complex information.
+ */
+ public function get labelField():String
+ {
+ return _labelField;
+ }
+ public function set labelField(value:String):void
+ {
+ _labelField = value;
+ }
+
+ private var _index:int;
+
+ /**
+ * The position with the dataProvider being shown by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get index():int
+ {
+ return _index;
+ }
+ public function set index(value:int):void
+ {
+ _index = value;
+ }
+
+ private var _hovered:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a hovered state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get hovered():Boolean
+ {
+ return _hovered;
+ }
+ public function set hovered(value:Boolean):void
+ {
+ _hovered = value;
+ updateRenderer();
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a selected state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+ updateRenderer();
+ }
+
+ private var _down:Boolean;
+
+ /**
+ * Whether or not the itemRenderer is in a down (or pre-selected) state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get down():Boolean
+ {
+ return _down;
+ }
+ public function set down(value:Boolean):void
+ {
+ _down = value;
+ updateRenderer();
+ }
+
+ /**
+ * @private
+ */
+ public function updateRenderer():void
+ {
+ if (down)
+ useColor = downColor;
+ else if (hovered)
+ useColor = highlightColor;
+ else if (selected)
+ useColor = selectedColor;
+ else
+ useColor = backgroundColor;
+ }
+
+ /**
+ * @private
+ */
+ private function sizeChangeHandler(event:Event):void
+ {
+ adjustSize();
+ }
+
+ /**
+ * This function is called whenever the itemRenderer changes size. Sub-classes should override
+ * this method an handle the size change.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function adjustSize():void
+ {
+ // handle in subclass
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d8221452/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as
new file mode 100644
index 0000000..a72c64c
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/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();
+ }
+ }
+}