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/01/11 23:22:50 UTC
[01/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Repository: flex-asjs
Updated Branches:
refs/heads/mavenfolders 9282af811 -> ea6a4819e
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Viewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Viewport.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Viewport.as
new file mode 100644
index 0000000..285282a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Viewport.as
@@ -0,0 +1,151 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IContentView;
+ 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;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.geom.Size;
+ import org.apache.flex.html.beads.models.ScrollBarModel;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * A Viewport is the area of a Container set aside for displaying
+ * content and any scrolling controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Viewport implements IBead, IViewport
+ {
+ /**
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Viewport()
+ {
+ }
+
+ protected var contentArea:UIBase;
+
+ /**
+ * Get the actual parent of the container's content.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get contentView():IUIBase
+ {
+ return contentArea;
+ }
+
+ protected var _strand:IStrand;
+
+ /**
+ * @flexjsignorecoercion Class
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ contentArea = _strand.getBeadByType(IContentView) as UIBase;
+ if (!contentArea)
+ {
+ var c:Class = ValuesManager.valuesImpl.getValue(_strand, 'iContentView') as Class;
+ contentArea = new c() as UIBase;
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.IViewport#setPosition()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function setPosition(x:Number, y:Number):void
+ {
+ contentArea.x = x;
+ contentArea.y = y;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IViewport#layoutViewportBeforeContentLayout()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function layoutViewportBeforeContentLayout(width:Number, height:Number):void
+ {
+ if (!isNaN(width))
+ contentArea.width = width;
+ if (!isNaN(height))
+ contentArea.height = height;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IViewport#layoutViewportAfterContentLayout()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function layoutViewportAfterContentLayout():Size
+ {
+ // pass through all of the children and determine the maxWidth and maxHeight
+ // note: this is not done on the JavaScript side because the browser handles
+ // this automatically.
+ var maxWidth:Number = 0;
+ var maxHeight:Number = 0;
+ var num:Number = contentArea.numElements;
+
+ for (var i:int=0; i < num; i++) {
+ var child:IUIBase = contentArea.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ var childXMax:Number = child.x + child.width;
+ var childYMax:Number = child.y + child.height;
+ maxWidth = Math.max(maxWidth, childXMax);
+ maxHeight = Math.max(maxHeight, childYMax);
+ }
+
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(this._strand);
+ return new Size(maxWidth + padding.right, maxHeight + padding.bottom);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/TextButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/TextButton.as
new file mode 100644
index 0000000..83a2821
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/svg/TextButton.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.svg
+{
+ import org.apache.flex.html.TextButton;
+
+ public class TextButton extends org.apache.flex.html.TextButton
+ {
+ public function TextButton()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/basic-as-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/basic-as-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-as-manifest.xml
new file mode 100644
index 0000000..26b7d42
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/basic-as-manifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<componentPackage>
+
+ <!-- component id="ListViewNoSelectionState" class="org.apache.flex.html.beads.ListViewNoSelectionState"/ -->
+ <!--<component id="MultilineTextFieldView" class="org.apache.flex.html.beads.MultilineTextFieldView"/>-->
+
+ <component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer"/>
+ <component id="HScrollBar" class="org.apache.flex.html.supportClasses.HScrollBar"/>
+ <component id="VScrollBar" class="org.apache.flex.html.supportClasses.VScrollBar"/>
+ <!--
+ <component id="HRuleView" class="org.apache.flex.html.beads.HRuleView" />
+ <component id="VRuleView" class="org.apache.flex.html.beads.VRuleView" />
+ -->
+ <!--
+ <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
+ -->
+</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
new file mode 100644
index 0000000..23dcccc
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<componentPackage>
+
+ <component id="Button" class="org.apache.flex.html.Button"/>
+ <component id="CloseButton" class="org.apache.flex.html.CloseButton"/>
+ <component id="ButtonBar" class="org.apache.flex.html.ButtonBar"/>
+ <component id="DropDownList" class="org.apache.flex.html.DropDownList"/>
+ <component id="DropDownListList" class="org.apache.flex.html.supportClasses.DropDownListList"/>
+ <component id="Image" class="org.apache.flex.html.Image"/>
+ <component id="Label" class="org.apache.flex.html.Label"/>
+ <component id="MultilineLabel" class="org.apache.flex.html.MultilineLabel"/>
+ <component id="ImageAndTextButton" class="org.apache.flex.html.ImageAndTextButton"/>
+ <component id="TextButton" class="org.apache.flex.html.TextButton"/>
+ <component id="ToggleTextButton" class="org.apache.flex.html.ToggleTextButton"/>
+ <component id="TextInput" class="org.apache.flex.html.TextInput"/>
+ <component id="TextArea" class="org.apache.flex.html.TextArea"/>
+ <component id="List" class="org.apache.flex.html.List"/>
+ <component id="SimpleList" class="org.apache.flex.html.SimpleList"/>
+ <component id="CheckBox" class="org.apache.flex.html.CheckBox"/>
+ <component id="RadioButton" class="org.apache.flex.html.RadioButton"/>
+ <component id="ComboBox" class="org.apache.flex.html.ComboBox"/>
+ <component id="Container" class="org.apache.flex.html.Container"/>
+ <component id="HContainer" class="org.apache.flex.html.HContainer"/>
+ <component id="VContainer" class="org.apache.flex.html.VContainer"/>
+ <component id="Panel" class="org.apache.flex.html.Panel"/>
+ <component id="PanelView" class="org.apache.flex.html.beads.PanelView"/>
+ <component id="PanelWithControlBar" class="org.apache.flex.html.PanelWithControlBar"/>
+ <component id="ControlBar" class="org.apache.flex.html.ControlBar"/>
+ <component id="TitleBar" class="org.apache.flex.html.TitleBar"/>
+ <component id="TitleBarModel" class="org.apache.flex.html.beads.models.TitleBarModel"/>
+ <component id="ToolTip" class="org.apache.flex.html.ToolTip"/>
+ <component id="BasicLayout" class="org.apache.flex.html.beads.layouts.BasicLayout"/>
+ <component id="VerticalLayout" class="org.apache.flex.html.beads.layouts.VerticalLayout"/>
+ <component id="HorizontalLayout" class="org.apache.flex.html.beads.layouts.HorizontalLayout"/>
+ <component id="TileLayout" class="org.apache.flex.html.beads.layouts.TileLayout"/>
+ <component id="ListView" class="org.apache.flex.html.beads.ListView"/>
+ <!--<component id="MultilineTextFieldView" class="org.apache.flex.html.beads.MultilineTextFieldView"/>-->
+
+ <component id="SimpleAlert" class="org.apache.flex.html.SimpleAlert"/>
+ <component id="Alert" class="org.apache.flex.html.Alert"/>
+ <component id="Spinner" class="org.apache.flex.html.Spinner"/>
+ <component id="Slider" class="org.apache.flex.html.Slider"/>
+ <component id="NumericStepper" class="org.apache.flex.html.NumericStepper" />
+ <component id="StringItemRenderer" class="org.apache.flex.html.supportClasses.StringItemRenderer"/>
+ <component id="DataItemRenderer" class="org.apache.flex.html.supportClasses.DataItemRenderer"/>
+ <component id="ButtonBarButtonItemRenderer" class="org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer"/>
+ <!--
+ <component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer"/>
+ <component id="HScrollBar" class="org.apache.flex.html.supportClasses.HScrollBar"/>
+ <component id="VScrollBar" class="org.apache.flex.html.supportClasses.VScrollBar"/>
+ <component id="HRuleView" class="org.apache.flex.html.beads.HRuleView" />
+ <component id="VRuleView" class="org.apache.flex.html.beads.VRuleView" />
+ -->
+ <component id="NumericOnlyTextInputBead" class="org.apache.flex.html.accessories.NumericOnlyTextInputBead" />
+ <component id="PasswordInputBead" class="org.apache.flex.html.accessories.PasswordInputBead" />
+ <component id="TextPromptBead" class="org.apache.flex.html.accessories.TextPromptBead" />
+ <component id="HRule" class="org.apache.flex.html.HRule" />
+ <component id="VRule" class="org.apache.flex.html.VRule" />
+ <component id="Spacer" class="org.apache.flex.html.Spacer" />
+ <!--
+ <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
+ -->
+ <component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" />
+
+ <component id="DataGrid" class="org.apache.flex.html.DataGrid"/>
+ <component id="DataProviderChangeNotifier" class="org.apache.flex.html.beads.DataProviderChangeNotifier"/>
+ <component id="DataGridColumn" class="org.apache.flex.html.supportClasses.DataGridColumn"/>
+ <component id="DataGridLinesBead" class="org.apache.flex.html.beads.DataGridLinesBead"/>
+
+ <component id="DateChooser" class="org.apache.flex.html.DateChooser"/>
+ <component id="DateField" class="org.apache.flex.html.DateField"/>
+ <component id="VerticalColumnLayout" class="org.apache.flex.html.beads.layouts.VerticalColumnLayout" />
+
+ <component id="ToolTipBead" class="org.apache.flex.html.accessories.ToolTipBead" />
+
+ <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier"/>
+ <component id="ImageButton" class="org.apache.flex.html.ImageButton"/>
+ <component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout"/>
+ <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout"/>
+ <component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout"/>
+ <component id="MXMLBeadViewBase" class="org.apache.flex.html.MXMLBeadViewBase"/>
+
+ <component id="Border" class="org.apache.flex.html.supportClasses.Border"/>
+
+</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml b/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
new file mode 100644
index 0000000..2139379
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
@@ -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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path>
+ <!-- asjscompc won't 'link' these classes in, but will list their requires
+ if these swcs are on the external-library-path then their requires
+ will not be listed -->
+ <path-element>../../externs/Binding.swc</path-element>
+ <path-element>../../externs/Core.swc</path-element>
+ <path-element>../../externs/Graphics.swc</path-element>
+ <path-element>../../externs/Collections.swc</path-element>
+ </library-path>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <manifest>basic-manifest.xml</manifest>
+ </namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/svg</uri>
+ <manifest>svg-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <source-path>
+ <path-element>as/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ </include-file>
+
+ <include-sources>
+ </include-sources>
+
+ <include-classes>
+ <class>HTMLClasses</class>
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <uri>library://ns.apache.org/flexjs/svg</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/compile-config.xml b/frameworks/projects/HTML/src/main/resources/compile-config.xml
new file mode 100644
index 0000000..7ea999a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/compile-config.xml
@@ -0,0 +1,94 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
+ <path-element>../../libs/Binding.swc</path-element>
+ <path-element>../../libs/Core.swc</path-element>
+ <path-element>../../libs/Graphics.swc</path-element>
+ <path-element>../../libs/Collections.swc</path-element>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path/>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <manifest>basic-manifest.xml</manifest>
+ </namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <manifest>basic-as-manifest.xml</manifest>
+ </namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/svg</uri>
+ <manifest>svg-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <source-path>
+ <path-element>as/src</path-element>
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ <name>defaults.css</name>
+ <path>as/defaults.css</path>
+ </include-file>
+ <include-file>
+ <name>js/out/*</name>
+ <path>js/out/*</path>
+ </include-file>
+
+ <include-classes>
+ <class>HTMLClasses</class>
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <uri>library://ns.apache.org/flexjs/svg</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/defaults.css b/frameworks/projects/HTML/src/main/resources/defaults.css
new file mode 100644
index 0000000..bb8ca6e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/defaults.css
@@ -0,0 +1,623 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+@namespace "library://ns.apache.org/flexjs/basic";
+@namespace svg "library://ns.apache.org/flexjs/svg";
+
+/* Global style declaration */
+*
+{
+ font-family: "Arial";
+ font-size: 12px;
+ border-width: 1px;
+}
+
+.flexjs *, . flexjs *:before, . flexjs *:after {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+Application
+{
+ padding: 0px;
+ margin: 0px;
+}
+
+Button
+{
+ background-color: #f8f8f8;
+ border: 1px solid #808080;
+ border-radius: 2px;
+ padding: 4px;
+ margin: 0px;
+}
+
+Button:hover
+{
+ background-color: #e8e8e8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+Button:active
+{
+ background-color: #d8d8d8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+ButtonBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ButtonBarView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.ButtonBarLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer");
+
+ border-style: none;
+}
+
+ButtonBarButtonItemRenderer
+{
+ width: 80;
+ height: 30;
+}
+
+Container
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.ContainerContentArea");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
+ IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+}
+
+ControlBar
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+
+ background-color: #CECECE;
+ border-style: none;
+ /*border-style: solid;
+ border-color: #000000;
+ border-width: 1px;*/
+}
+
+/* ASJS */
+DataGrid
+{
+ IDataGridPresentationModel: ClassReference("org.apache.flex.html.beads.models.DataGridPresentationModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.DataGridView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #222222;
+ border-width: 1px;
+}
+
+.DataGridColumn {
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayList");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
+ IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+ border-style: none;
+ background-color: #FFFFFF;
+}
+
+.DataGridListArea {
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #333333;
+}
+
+DateChooser {
+ IBeadView: ClassReference("org.apache.flex.html.beads.DateChooserView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateChooserMouseController");
+ width: 280px;
+ height: 240px;
+}
+
+DateField {
+ IBeadView: ClassReference("org.apache.flex.html.beads.DateFieldView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateFieldMouseController");
+ IFormatBead: ClassReference("org.apache.flex.html.accessories.DateFormatMMDDYYYYBead");
+}
+
+HContainer
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.HorizontalLayout");
+}
+
+Image
+{
+ vertical-align: top;
+}
+
+ImageAndTextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageAndTextModel");
+}
+
+ImageButton
+{
+ border-style: none;
+}
+
+ImageButton:hover
+{
+ border-style: none;
+}
+
+ImageButton:active
+{
+ border-style: none;
+}
+
+VContainer
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+}
+
+List
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
+ IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+ border-style: solid;
+ border-color: #222222;
+}
+
+NumericStepper
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+}
+
+Panel
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.PanelView");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ padding: 2px;
+}
+
+PanelWithControlBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.PanelWithControlBarView");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ padding: 2px;
+}
+
+SimpleList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
+ IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+}
+
+Slider
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+}
+
+Spinner
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+}
+
+
+StringItemRenderer
+{
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
+ height: 16;
+}
+
+TextInput
+{
+ border: 1px solid #808080;
+ border-radius: 2px;
+ padding: 4px;
+ margin: 0px;
+}
+
+TextArea
+{
+ border: 1px solid #808080;
+ border-radius: 2px;
+ padding: 4px;
+ resize: none;
+}
+
+TitleBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TitleBarView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TitleBarMeasurementBead");
+ background-color: #E2E2E2;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+.toggleTextButton
+{
+ background-color: #f8f8f8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+.toggleTextButton:hover
+{
+ background-color: #e8e8e8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+.toggleTextButton_Selected
+{
+ background-color: #d8d8d8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+.toggleTextButton_Selected:hover
+{
+ background-color: #e8e8e8;
+ border: 1px solid #808080;
+ padding: 4px;
+}
+
+ToolTip
+{
+ background-color: #FFFFCC;
+}
+
+ViewBase
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
+ IContentView: ClassReference("org.apache.flex.html.supportClasses.ContainerContentArea");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
+ IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
+}
+
+
+/* Global Style Declaration */
+global
+{
+ IStatesImpl: ClassReference("org.apache.flex.core.SimpleStatesImpl");
+ IEffectTimer: ClassReference("org.apache.flex.utils.EffectTimer");
+ effectTimerInterval: 10;
+}
+
+@media -flex-flash
+{
+
+Alert
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.AlertView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+Border
+{
+ border-color: inherit;
+ border-style: inherit;
+ border-radius: inherit;
+ border-width: inherit;
+ border: inherit;
+}
+
+Button
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSButtonView");
+}
+
+CheckBox
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CheckBoxView");
+}
+
+CloseButton
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.CloseButtonView");
+}
+
+ComboBox
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ComboBoxModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ComboBoxView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ComboBoxController");
+ IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+}
+
+Container
+{
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+ControlBar
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.ControlBarMeasurementBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+DropDownList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.DropDownListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DropDownListController");
+ IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
+}
+
+DropDownListList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
+ border-style: solid;
+ border-radius: 4px;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
+}
+
+HRule
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.HRuleView");
+}
+
+Image
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ImageView");
+}
+
+ImageButton
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ImageButtonView");
+}
+
+ImageAndTextButton
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSImageAndTextButtonView");
+}
+
+Label
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextFieldView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextFieldLabelMeasurementBead");
+}
+
+List
+{
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+}
+
+MultilineLabel
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.MultilineTextFieldView");
+}
+
+NumericStepper
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.NumericStepperView");
+
+ padding: 0px;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
+}
+
+Panel
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+PanelWithControlBar
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+RadioButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.RadioButtonView");
+}
+
+VScrollBar
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.VScrollBarView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
+}
+
+HScrollBar
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.HScrollBarLayout");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.HScrollBarView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.HScrollBarMouseController");
+}
+
+SimpleAlert
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.SimpleAlertView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+Slider
+{
+ iBeadView: ClassReference("org.apache.flex.html.beads.SliderView");
+ iBeadController: ClassReference("org.apache.flex.html.beads.controllers.SliderMouseController");
+ iThumbView: ClassReference("org.apache.flex.html.beads.SliderThumbView");
+ iTrackView: ClassReference("org.apache.flex.html.beads.SliderTrackView");
+}
+
+Spinner
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.SpinnerView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.SpinnerMouseController");
+}
+
+TextArea
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextAreaView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
+}
+
+TextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextButtonMeasurementBead");
+}
+
+TextFieldItemRenderer
+{
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
+ height: 16;
+}
+
+TextInput
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextInputWithBorderView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
+}
+
+TitleBar
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+ToggleTextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextToggleButtonView");
+}
+
+ViewBase
+{
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+VRule
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.VRuleView");
+}
+
+/* SVG */
+
+svg|TextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextButtonMeasurementBead");
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/resources/svg-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/svg-manifest.xml b/frameworks/projects/HTML/src/main/resources/svg-manifest.xml
new file mode 100644
index 0000000..a32483e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/resources/svg-manifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<componentPackage>
+ <component id="TextButton" class="org.apache.flex.svg.TextButton"/>
+</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/test/flex/FlexUnitFlexJSApplication.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/test/flex/FlexUnitFlexJSApplication.mxml b/frameworks/projects/HTML/src/test/flex/FlexUnitFlexJSApplication.mxml
new file mode 100644
index 0000000..06ad1d6
--- /dev/null
+++ b/frameworks/projects/HTML/src/test/flex/FlexUnitFlexJSApplication.mxml
@@ -0,0 +1,46 @@
+<?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.
+
+-->
+
+<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ applicationComplete="runTests()"
+ >
+ <fx:Script>
+ <![CDATA[
+ import flexUnitTests.DataGridColumnTesterTest;
+ import flexUnitTests.DataGridColumnTester;
+
+ import org.flexunit.listeners.CIListener;
+ import org.flexunit.runner.FlexUnitCore;
+
+ public function runTests() : void
+ {
+ var core : FlexUnitCore = new FlexUnitCore();
+ core.addListener(new CIListener());
+ core.run(DataGridColumnTester);
+ }
+
+ ]]>
+ </fx:Script>
+ <js:valuesImpl>
+ <js:SimpleValuesImpl />
+ </js:valuesImpl>
+
+</js:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/test/flex/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/test/flex/build.xml b/frameworks/projects/HTML/src/test/flex/build.xml
new file mode 100644
index 0000000..fda6c62
--- /dev/null
+++ b/frameworks/projects/HTML/src/test/flex/build.xml
@@ -0,0 +1,159 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<project name="HTML.test" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../../../../.."/>
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
+ <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+
+ <condition property="browser" value="C:/Program Files/Internet Explorer/iexplore.exe">
+ <os family="windows"/>
+ </condition>
+ <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari">
+ <os family="mac"/>
+ </condition>
+
+ <property name="report.dir" value="${basedir}/out" />
+
+ <available file="${FLEXJS_HOME}/../flex-flexunit"
+ type="dir"
+ property="FLEXUNIT_HOME"
+ value="${FLEXJS_HOME}/../flex-flexunit" />
+
+ <available file="${FLEXJS_HOME}/../flexunit"
+ type="dir"
+ property="FLEXUNIT_HOME"
+ value="${FLEXJS_HOME}/../flexunit" />
+
+ <available file="${env.FLEXUNIT_HOME}"
+ type="dir"
+ property="FLEXUNIT_HOME"
+ value="${env.FLEXUNIT_HOME}"/>
+
+ <available file="${FLEXUNIT_HOME}/FlexUnit4/target"
+ type="dir"
+ property="FLEXUNIT_LIBPATH1"
+ value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4/target/flexunit-4.3.0-20140410-as3_4.12.0.swc" />
+ <property name="FLEXUNIT_LIBPATH1" value="-library-path+=${FLEXUNIT_HOME}/flexunit" />
+
+ <available file="${FLEXUNIT_HOME}/FlexUnit4CIListener/target"
+ type="dir"
+ property="FLEXUNIT_LIBPATH2"
+ value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4CIListener/target" />
+ <property name="FLEXUNIT_LIBPATH2" value="-define=CONFIG::dummy,false" />
+
+ <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target"
+ type="dir"
+ property="FLEXUNIT_CLASSPATH"
+ value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
+ <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
+
+ <target name="main" depends="clean,compile,test" description="Clean test of FlexJSUI.swc">
+ </target>
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset dir="${basedir}">
+ <include name="FlexUnitFlexJSApplication.swf"/>
+ </fileset>
+ </delete>
+ </target>
+
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+
+ <target name="compile" description="Compiles FlexUnitApplication.swf">
+ <echo message="Compiling FlexUnitFlexJSApplication.swf"/>
+ <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+ <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+ <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/>
+ <echo message="playerglobal.version: ${playerglobal.version}"/>
+
+ <!-- Load the <compc> task. We can't do this at the <project> level -->
+ <!-- because targets that run before flexTasks.jar gets built would fail. -->
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ <!--
+ Link in the classes (and their dependencies) for the MXML tags
+ listed in this project's manifest.xml.
+ Also link the additional classes (and their dependencies)
+ listed in FlexJSUIClasses.as,
+ because these aren't referenced by the manifest classes.
+ Keep the standard metadata when compiling.
+ Include the appropriate CSS files and assets in the SWC.
+ Don't include any resources in the SWC.
+ Write a bundle list of referenced resource bundles
+ into the file bundles.properties in this directory.
+ -->
+ <mxmlc fork="true"
+ file="${basedir}/FlexUnitFlexJSApplication.mxml"
+ output="${basedir}/FlexUnitFlexJSApplication.swf">
+ <jvmarg line="${mxmlc.jvm.args}"/>
+ <arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
+ <arg value="-debug" />
+ <arg value="-compiler.mxml.children-as-data" />
+ <arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent" />
+ <arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent" />
+ <arg value="-compiler.binding-value-change-event-type=valueChange" />
+ <arg value="+playerglobal.version=${playerglobal.version}" />
+ <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+ <arg value="-source-path+=${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
+ <arg value="-library-path+=${FLEXJS_HOME}/frameworks/libs" />
+ <arg value="${FLEXUNIT_LIBPATH1}" />
+ <arg value="${FLEXUNIT_LIBPATH2}" />
+ </mxmlc>
+ </target>
+
+ <target name="test">
+ <taskdef resource="flexUnitTasks.tasks">
+ <classpath>
+ <fileset dir="${FLEXUNIT_CLASSPATH}">
+ <include name="flexUnitTasks*.jar" />
+ </fileset>
+ </classpath>
+ </taskdef>
+ <mkdir dir="${report.dir}" />
+ <flexunit
+ swf="${basedir}/FlexUnitFlexJSApplication.swf"
+ workingDir="${basedir}"
+ toDir="${report.dir}"
+ haltonfailure="false"
+ verbose="true"
+ localTrusted="true"
+ timeout="90000">
+ <source dir="${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
+ <library dir="${FLEXJS_HOME}/frameworks/libs" />
+ </flexunit>
+
+ <!-- Generate readable JUnit-style reports -->
+ <junitreport todir="${report.dir}">
+ <fileset dir="${report.dir}">
+ <include name="TEST-*.xml" />
+ </fileset>
+ <report format="frames" todir="${report.dir}/html" />
+ </junitreport>
+
+ </target>
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTester.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTester.as b/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTester.as
new file mode 100644
index 0000000..e060b1f
--- /dev/null
+++ b/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTester.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package flexUnitTests
+{
+ [Suite]
+ [RunWith("org.flexunit.runners.Suite")]
+ public class DataGridColumnTester
+ {
+ public var dataGridColumnTesterTest:DataGridColumnTesterTest;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTesterTest.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTesterTest.as b/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTesterTest.as
new file mode 100644
index 0000000..1a3cc0f
--- /dev/null
+++ b/frameworks/projects/HTML/src/test/flex/flexUnitTests/DataGridColumnTesterTest.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flexUnitTests
+{
+ import flexunit.framework.Assert;
+
+ import org.apache.flex.html.supportClasses.DataGridColumn;
+
+ public class DataGridColumnTesterTest
+ {
+ [Before]
+ public function setUp():void
+ {
+ }
+
+ [After]
+ public function tearDown():void
+ {
+ }
+
+ [BeforeClass]
+ public static function setUpBeforeClass():void
+ {
+ }
+
+ [AfterClass]
+ public static function tearDownAfterClass():void
+ {
+ }
+
+ [Test]
+ public function testLabelProperty():void
+ {
+ var column:DataGridColumn = new DataGridColumn();
+ column.label = "foo";
+ Assert.assertEquals("Error testing DataGridColumn.label", column.label, "foo");
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/svg-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/svg-manifest.xml b/frameworks/projects/HTML/svg-manifest.xml
deleted file mode 100644
index a32483e..0000000
--- a/frameworks/projects/HTML/svg-manifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-
-<componentPackage>
- <component id="TextButton" class="org.apache.flex.svg.TextButton"/>
-</componentPackage>
[12/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HRule.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HRule.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HRule.as
new file mode 100644
index 0000000..7c2fb2f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HRule.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
+{
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The HRule class displays a horizontal line
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HRule extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HRule()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('hr') as WrappedHTMLElement;
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Image.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Image.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Image.as
new file mode 100644
index 0000000..ae81c18
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Image.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IImageModel;
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.models.ImageModel;
+ import org.apache.flex.html.beads.ImageView;
+ }
+
+ /**
+ * The Image class is a component that displays a bitmap. The Image uses
+ * the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the Image, including the source property.
+ * org.apache.flex.core.IBeadView: constructs the visual elements of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Image extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Image()
+ {
+ super();
+ }
+
+ /**
+ * The location of the bitmap, usually a URL.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignorecoercion org.apache.flex.core.IImageModel
+ */
+ public function get source():String
+ {
+ return (model as IImageModel).source;
+ }
+ public function set source(value:String):void
+ {
+ (model as IImageModel).source = value;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('img') as WrappedHTMLElement;
+ element.className = 'Image';
+ typeNames = 'Image';
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ model = new
+ ImageModel();
+
+ addBead(new
+ ImageView());
+
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageAndTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageAndTextButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageAndTextButton.as
new file mode 100644
index 0000000..8bdcc6a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageAndTextButton.as
@@ -0,0 +1,128 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.models.ImageAndTextModel;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The ImageTextButton class implements a basic button that
+ * displays and image and text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageAndTextButton extends TextButton
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageAndTextButton()
+ {
+ super();
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::JS
+ override public function get text():String
+ {
+ return ImageAndTextModel(model).text;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::JS
+ override public function set text(value:String):void
+ {
+ ImageAndTextModel(model).text = value;
+ COMPILE::JS
+ {
+ setInnerHTML();
+ }
+ }
+
+ /**
+ * The URL of an icon to use in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get image():String
+ {
+ return ImageAndTextModel(model).image;
+ }
+
+ /**
+ * @private
+ */
+ public function set image(value:String):void
+ {
+ ImageAndTextModel(model).image = value;
+ COMPILE::JS
+ {
+ setInnerHTML();
+ }
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('button') as WrappedHTMLElement;
+ element.setAttribute('type', 'button');
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ /**
+ */
+ COMPILE::JS
+ protected function setInnerHTML():void
+ {
+ var inner:String = '';
+ if (image != null)
+ inner += "<img src='" + image + "'/>";
+ inner += ' ';
+ inner += text;
+ element.innerHTML = inner;
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
new file mode 100644
index 0000000..de563a1
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ImageButton.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.SimpleCSSStyles;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The ImageButton class presents an image as a button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageButton extends Button
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageButton()
+ {
+ super();
+ typeNames = "ImageButton";
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement("input") as WrappedHTMLElement;
+ positioner = element;
+ element.flexjs_wrapper = this;
+
+ var inputElement:HTMLInputElement = element as HTMLInputElement;
+ inputElement.type = "image";
+
+ return element;
+ }
+
+ /**
+ * Sets the image for the button. This is a URL.
+ * TODO: figure out how to set the source in the style, rather than using
+ * backgroundImage behind the scenes.
+ */
+ public function get source():String
+ {
+ return style.backgroundImage;
+ }
+
+ public function set source(url:String):void
+ {
+ if (!style)
+ style = new SimpleCSSStyles();
+ style.backgroundImage = url;
+
+ COMPILE::JS {
+ var inputElement:HTMLInputElement = element as HTMLInputElement;
+ inputElement.src = url;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as
new file mode 100644
index 0000000..392dcca
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Label.as
@@ -0,0 +1,163 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /*
+ * Label probably should extend TextField directly,
+ * but the player's APIs for TextLine do not allow
+ * direct instantiation, and we might want to allow
+ * Labels to be declared and have their actual
+ * view be swapped out.
+ */
+
+ /**
+ * The Label class implements the basic control for labeling
+ * other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Label extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Label()
+ {
+ super();
+ }
+
+ [Bindable("textChange")]
+ /**
+ * The text to display in the label.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).text;
+ }
+ COMPILE::JS
+ {
+ return element.innerHTML;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).text = value;
+ }
+ COMPILE::JS
+ {
+ this.element.innerHTML = value;
+ this.dispatchEvent('textChange');
+ }
+
+ }
+
+ [Bindable("htmlChange")]
+ /**
+ * The html-formatted text to display in the label.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).html;
+ }
+ COMPILE::JS
+ {
+ return element.innerHTML;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).html = value;
+ }
+ COMPILE::JS
+ {
+ this.element.innerHTML = value;
+ this.dispatchEvent('textChange');
+ }
+ }
+
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+ model.addEventListener("textChange", repeaterListener);
+ model.addEventListener("htmlChange", repeaterListener);
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('span') as WrappedHTMLElement;
+ positioner = element;
+ element.flexjs_wrapper = this;
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as
new file mode 100644
index 0000000..63bcf02
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/List.as
@@ -0,0 +1,311 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ContainerBaseStrandChildren;
+ import org.apache.flex.core.IContentViewHost;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IFactory;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererProvider;
+ import org.apache.flex.core.IListPresentationModel;
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.ListBase;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.ListView;
+ import org.apache.flex.html.supportClasses.DataGroup;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.beads.models.ListPresentationModel;
+
+ /**
+ * Indicates that the initialization of the list is complete.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="initComplete", type="org.apache.flex.events.Event")]
+
+ /**
+ * The change event is dispatched whenever the list's selection changes.
+ *
+ * @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 List class is a component that displays multiple data items. The List uses
+ * the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and
+ * so forth.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the list.
+ * org.apache.flex.core.IBeadController: the bead that handles input and output.
+ * org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of the itemRenderers.
+ * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders.
+ * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class List extends ListBase implements IItemRendererProvider
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function List()
+ {
+ super();
+ }
+
+ /**
+ * The name of field within the data used for display. Each item of the
+ * data should have a property with this name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return ISelectionModel(model).labelField;
+ }
+ public function set labelField(value:String):void
+ {
+ ISelectionModel(model).labelField = value;
+ }
+
+ /**
+ * The data being display by the List.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return ISelectionModel(model).dataProvider;
+ }
+ public function set dataProvider(value:Object):void
+ {
+ ISelectionModel(model).dataProvider = value;
+ }
+
+ /**
+ * The index of the currently selected item. Changing this value
+ * also changes the selectedItem property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return ISelectionModel(model).selectedIndex;
+ }
+ public function set selectedIndex(value:int):void
+ {
+ ISelectionModel(model).selectedIndex = value;
+ }
+
+ /**
+ * The index of the item currently below the pointer.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rollOverIndex():int
+ {
+ return IRollOverModel(model).rollOverIndex;
+ }
+ public function set rollOverIndex(value:int):void
+ {
+ IRollOverModel(model).rollOverIndex = value;
+ }
+
+ /**
+ * The presentation model for the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get presentationModel():IListPresentationModel
+ {
+ var presModel:IListPresentationModel = getBeadByType(IListPresentationModel) as IListPresentationModel;
+ if (presModel == null) {
+ presModel = new ListPresentationModel();
+ addBead(presModel);
+ }
+ return presModel;
+ }
+
+ /**
+ * The default height of each cell in every column
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rowHeight():Number
+ {
+ return presentationModel.rowHeight;
+ }
+ public function set rowHeight(value:Number):void
+ {
+ presentationModel.rowHeight = value;
+ }
+
+ /**
+ * The item currently selected. Changing this value also
+ * changes the selectedIndex property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return ISelectionModel(model).selectedItem;
+ }
+ public function set selectedItem(value:Object):void
+ {
+ ISelectionModel(model).selectedItem = value;
+ }
+
+ private var _itemRenderer:IFactory;
+
+ /**
+ * The class or factory used to display each item.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRenderer():IFactory
+ {
+ return _itemRenderer;
+ }
+ public function set itemRenderer(value:IFactory):void
+ {
+ _itemRenderer = value;
+ }
+
+ /**
+ * Returns whether or not the itemRenderer property has been set.
+ *
+ * @see org.apache.flex.core.IItemRendererProvider
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get hasItemRenderer():Boolean
+ {
+ var result:Boolean = false;
+
+ COMPILE::AS3 {
+ result = _itemRenderer != null;
+ }
+
+ COMPILE::JS {
+ var test:* = _itemRenderer;
+ result = _itemRenderer !== null && test !== undefined;
+ }
+
+ return result;
+ }
+
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ if (getBeadByType(IDataProviderItemRendererMapper) == null)
+ {
+ var mapper:IDataProviderItemRendererMapper = new (ValuesManager.valuesImpl.getValue(this, "iDataProviderItemRendererMapper")) as IDataProviderItemRendererMapper;
+ addBead(mapper);
+ }
+ var itemRendererFactory:IItemRendererClassFactory = getBeadByType(IItemRendererClassFactory) as IItemRendererClassFactory;
+ if (!itemRendererFactory)
+ {
+ itemRendererFactory = new (ValuesManager.valuesImpl.getValue(this, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ addBead(itemRendererFactory);
+ }
+
+ dispatchEvent(new Event("initComplete"));
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+ className = 'List';
+
+ return element;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.html.beads.ListView
+ * @flexjsignorecoercion org.apache.flex.html.supportClasses.DataGroup
+ */
+ COMPILE::JS
+ override public function internalChildren():Array
+ {
+ var listView:ListView = getBeadByType(ListView) as ListView;
+ var dg:DataGroup = listView.dataGroup as DataGroup;
+ var renderers:Array = dg.internalChildren();
+ return renderers;
+ };
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MXMLBeadViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MXMLBeadViewBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MXMLBeadViewBase.as
new file mode 100644
index 0000000..301e430
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MXMLBeadViewBase.as
@@ -0,0 +1,317 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.states.State;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IStatesImpl;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.html.beads.ContainerView;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.ValueChangeEvent;
+ import org.apache.flex.utils.MXMLDataInterpreter;
+
+ [DefaultProperty("mxmlContent")]
+
+ /**
+ * The MXMLBeadViewBase class extends BeadViewBase
+ * and adds support for databinding and specification
+ * of children in MXML.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MXMLBeadViewBase extends ContainerView implements IStrand, ILayoutHost
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function MXMLBeadViewBase()
+ {
+ super();
+ }
+
+ [Bindable("strandChanged")]
+ /**
+ * An MXMLBeadViewBase doesn't create its children until it is added to
+ * the 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;
+ // each MXML file can also have styles in fx:Style block
+ ValuesManager.valuesImpl.init(this);
+
+ dispatchEvent(new Event("strandChanged"));
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+
+ MXMLDataInterpreter.generateMXMLInstances(this, IParent(value), MXMLDescriptor);
+
+ dispatchEvent(new Event("initBindings"))
+ dispatchEvent(new Event("initComplete"))
+ dispatchEvent(new Event("childrenAdded"));
+ }
+
+ [Bindable("__NoChangeEvent__")]
+ /**
+ * The model object.
+ */
+ public function get model():Object
+ {
+ return _strand["model"];
+ }
+
+ /**
+ * @copy org.apache.flex.core.Application#MXMLDescriptor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get MXMLDescriptor():Array
+ {
+ return null;
+ }
+
+ /**
+ * @copy org.apache.flex.core.Application#generateMXMLAttributes()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function generateMXMLAttributes(data:Array):void
+ {
+ MXMLDataInterpreter.generateMXMLProperties(this, data);
+ }
+
+ /**
+ * @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 var _states:Array;
+
+ /**
+ * The array of view states. These should
+ * be instances of org.apache.flex.states.State.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get states():Array
+ {
+ return _states;
+ }
+
+ /**
+ * @private
+ */
+ public function set states(value:Array):void
+ {
+ _states = value;
+ _currentState = _states[0].name;
+
+ try{
+ if (getBeadByType(IStatesImpl) == null)
+ addBead(new (ValuesManager.valuesImpl.getValue(this, "iStatesImpl")) as IBead);
+ }
+ //TODO: Need to handle this case more gracefully
+ catch(e:Error)
+ {
+ COMPILE::AS3
+ {
+ trace(e.message);
+ }
+ }
+
+ }
+
+ /**
+ * <code>true</code> if the array of states
+ * contains a state with this name.
+ *
+ * @param state The state namem.
+ * @return True if state in state array
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function hasState(state:String):Boolean
+ {
+ for each (var s:State in _states)
+ {
+ if (s.name == state)
+ return true;
+ }
+ return false;
+ }
+
+ private var _currentState:String;
+
+ [Bindable("currentStateChange")]
+ /**
+ * The name of the current state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get currentState():String
+ {
+ return _currentState;
+ }
+
+ /**
+ * @private
+ */
+ public function set currentState(value:String):void
+ {
+ var event:ValueChangeEvent = new ValueChangeEvent("currentStateChange", false, false, _currentState, value)
+ _currentState = value;
+ dispatchEvent(event);
+ }
+
+ private var _transitions:Array;
+
+ /**
+ * The array of transitions.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get transitions():Array
+ {
+ return _transitions;
+ }
+
+ /**
+ * @private
+ */
+ public function set transitions(value:Array):void
+ {
+ _transitions = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.Application#beads
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var beads:Array;
+
+ private var _beads:Array;
+
+ /**
+ * @copy org.apache.flex.core.IStrand#addBead()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function addBead(bead:IBead):void
+ {
+ if (!_beads)
+ _beads = [];
+ _beads.push(bead);
+ bead.strand = this;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IStrand#getBeadByType()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getBeadByType(classOrInterface:Class):IBead
+ {
+ for each (var bead:IBead in _beads)
+ {
+ if (bead is classOrInterface)
+ return bead;
+ }
+ return null;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IStrand#removeBead()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ 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;
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MultilineLabel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MultilineLabel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MultilineLabel.as
new file mode 100644
index 0000000..5149237
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/MultilineLabel.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
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /*
+ * Label probably should extend TextField directly,
+ * but the player's APIs for TextLine do not allow
+ * direct instantiation, and we might want to allow
+ * Labels to be declared and have their actual
+ * view be swapped out.
+ */
+
+ /**
+ * The Label class implements the basic control for labeling
+ * other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MultilineLabel extends Label
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function MultilineLabel()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ positioner = element;
+ element.flexjs_wrapper = this;
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
new file mode 100644
index 0000000..02120e7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/NumericStepper.as
@@ -0,0 +1,214 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IRangeModel;
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [Event(name="valueChange", type="org.apache.flex.events.Event")]
+
+ /**
+ * The NumericStepper class is a component that displays a numeric
+ * value and up/down controls (using a org.apache.flex.html.Spinner) to
+ * increase and decrease the value by specific amounts. The NumericStepper uses the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the component of type org.apache.flex.core.IRangeModel.
+ * org.apache.flex.core.IBeadView: constructs the parts of the component.
+ * org.apache.flex.core.IBeadController: handles the input events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class NumericStepper extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function NumericStepper()
+ {
+ super();
+ }
+
+ [Bindable("valueChange")]
+ /**
+ * The current value of the control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Number
+ {
+ return IRangeModel(model).value;
+ }
+ public function set value(newValue:Number):void
+ {
+ IRangeModel(model).value = newValue;
+ }
+
+ /**
+ * The minimum value the control will display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get minimum():Number
+ {
+ return IRangeModel(model).minimum;
+ }
+ public function set minimum(value:Number):void
+ {
+ IRangeModel(model).minimum = value;
+ }
+
+ /**
+ * The maximum value the control will display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maximum():Number
+ {
+ return IRangeModel(model).maximum;
+ }
+ public function set maximum(value:Number):void
+ {
+ IRangeModel(model).maximum = value;
+ }
+
+ /**
+ * The amount to increase or descrease the value. The value
+ * will not exceed the minimum or maximum value. The final
+ * value is affected by the snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get stepSize():Number
+ {
+ return IRangeModel(model).stepSize;
+ }
+ public function set stepSize(value:Number):void
+ {
+ IRangeModel(model).stepSize = value;
+ }
+
+ /**
+ * The modulus for the value. If this property is set,
+ * the value displayed with a muliple of the snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get snapInterval():Number
+ {
+ return IRangeModel(model).snapInterval;
+ }
+ public function set snapInterval(value:Number):void
+ {
+ IRangeModel(model).snapInterval = value;
+ }
+
+ COMPILE::JS
+ private var input:TextInput;
+
+ COMPILE::JS
+ private var spinner:Spinner;
+
+ /**
+ * @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';
+
+ input = new TextInput();
+ addElement(input);
+ input.positioner.style.display = 'inline-block';
+ input.positioner.style.width = '100px';
+
+ spinner = new Spinner();
+ spinner.positioner.style.display = 'inline-block';
+ spinner.positioner.style.height = '24px';
+ spinner.positioner.style.marginLeft = '-1px';
+ spinner.positioner.style.marginTop = '-1px';
+ addElement(spinner);
+
+ /* TODO: ajh move to view and css */
+ spinner.incrementButton.positioner.style.display = 'block';
+ spinner.incrementButton.positioner.style.marginBottom = '-1px';
+ spinner.incrementButton.positioner.style.paddingTop = '1.5px';
+ spinner.incrementButton.positioner.style.paddingBottom = '2px';
+ spinner.incrementButton.positioner.style.fontSize = '7px';
+ spinner.decrementButton.positioner.style.marginTop = '0px';
+ spinner.decrementButton.positioner.style.display = 'block';
+ spinner.decrementButton.positioner.style.paddingTop = '2px';
+ spinner.decrementButton.positioner.style.paddingBottom = '1.5px';
+ spinner.decrementButton.positioner.style.fontSize = '7px';
+ spinner.positioner.style.display = 'inline-block';
+ goog.events.listen(spinner, 'valueChange',
+ spinnerChange);
+
+ element.flexjs_wrapper = this;
+ className = 'NumericStepper';
+
+ input.text = String(spinner.value);
+
+ return element;
+ }
+
+ /**
+ * @param event The input event.
+ */
+ COMPILE::JS
+ private function spinnerChange(event:Event):void
+ {
+ var newValue:Number = spinner.value;
+ value = newValue;
+ input.text = String(spinner.value);
+ dispatchEvent(new Event('valueChange'));
+ };
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Panel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Panel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Panel.as
new file mode 100644
index 0000000..e9c5986
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Panel.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
+{
+ import org.apache.flex.core.IPanelModel;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [Event(name="close", type="org.apache.flex.events.Event")]
+
+ /**
+ * The Panel class is a Container component capable of parenting other
+ * components. The Panel has a TitleBar. If you want to a Panel with
+ * a ControlBar, use PanelWithControlBar which
+ * will instantiate, by default, an ControlBar.
+ * The Panel uses the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the Panel that includes the title and whether
+ * or not to display the close button.
+ * org.apache.flex.core.IBeadView: creates the parts of the Panel.
+ * org.apache.flex.core.IBorderBead: if present, draws a border around the Panel.
+ * org.apache.flex.core.IBackgroundBead: if present, provides a colored background for the Panel.
+ *
+ * @see PanelWithControlBar
+ * @see ControlBar
+ * @see TitleBar
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Panel extends Container
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Panel()
+ {
+ super();
+ }
+
+ /**
+ * The string to display in the org.apache.flex.html.TitleBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return IPanelModel(model).title;
+ }
+ public function set title(value:String):void
+ {
+ IPanelModel(model).title = value;
+ }
+
+ /**
+ * The HTML string to display in the org.apache.flex.html.TitleBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return IPanelModel(model).htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ IPanelModel(model).htmlTitle = value;
+ }
+
+ /**
+ * Whether or not to show a Close button in the org.apache.flex.html.TitleBar.
+ */
+ public function get showCloseButton():Boolean
+ {
+ return IPanelModel(model).showCloseButton;
+ }
+ public function set showCloseButton(value:Boolean):void
+ {
+ IPanelModel(model).showCloseButton = value;
+ }
+
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+ element.className = "Panel";
+ typeNames = "Panel";
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/PanelWithControlBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/PanelWithControlBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/PanelWithControlBar.as
new file mode 100644
index 0000000..7659d9d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/PanelWithControlBar.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
+{
+ import org.apache.flex.core.IPanelModel;
+
+ [Event(name="close", type="org.apache.flex.events.Event")]
+
+ /**
+ * The Panel class is a Container component capable of parenting other
+ * components. The Panel has a TitleBar and an optional org.apache.flex.html.ControlBar.
+ * The Panel uses the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the Panel that includes the title and whether
+ * or not to display the close button.
+ * org.apache.flex.core.IBeadView: creates the parts of the Panel.
+ * org.apache.flex.core.IBorderBead: if present, draws a border around the Panel.
+ * org.apache.flex.core.IBackgroundBead: if present, provides a colored background for the Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class PanelWithControlBar extends Container
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function PanelWithControlBar()
+ {
+ super();
+ }
+
+ /**
+ * The string to display in the org.apache.flex.html.TitleBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return IPanelModel(model).title;
+ }
+ public function set title(value:String):void
+ {
+ IPanelModel(model).title = value;
+ }
+
+ /**
+ * The HTML string to display in the org.apache.flex.html.TitleBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return IPanelModel(model).htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ IPanelModel(model).htmlTitle = value;
+ }
+
+ /**
+ * Whether or not to show a Close button in the org.apache.flex.html.TitleBar.
+ */
+ public function get showCloseButton():Boolean
+ {
+ return IPanelModel(model).showCloseButton;
+ }
+ public function set showCloseButton(value:Boolean):void
+ {
+ IPanelModel(model).showCloseButton = value;
+ }
+
+ /**
+ * The items in the org.apache.flex.html.ControlBar. Setting this property automatically
+ * causes the ControlBar to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get controlBar():Array
+ {
+ return IPanelModel(model).controlBar;
+ }
+ public function set controlBar(value:Array):void
+ {
+ IPanelModel(model).controlBar = value;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/RadioButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/RadioButton.as
new file mode 100644
index 0000000..63f90e9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/RadioButton.as
@@ -0,0 +1,347 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.DisplayObject;
+ import flash.events.MouseEvent;
+ import flash.utils.Dictionary;
+ }
+
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IValueToggleButtonModel;
+ COMPILE::AS3
+ {
+ import org.apache.flex.core.UIButtonBase;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.core.IUIBase;
+
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * 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
+ */
+ COMPILE::AS3
+ public class RadioButton extends UIButtonBase implements IStrand
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RadioButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
+ {
+ super(upState, overState, downState, hitTestState);
+
+ addEventListener(MouseEvent.CLICK, internalMouseHandler);
+ }
+
+ protected static var dict:Dictionary = new Dictionary(true);
+
+ private var _groupName:String;
+
+ /**
+ * The name of the group. Only one RadioButton in a group is selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get groupName() : String
+ {
+ return IValueToggleButtonModel(model).groupName;
+ }
+ public function set groupName(value:String) : void
+ {
+ IValueToggleButtonModel(model).groupName = value;
+ }
+
+ /**
+ * The string used as a label for the RadioButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return IValueToggleButtonModel(model).text;
+ }
+ public function set text(value:String):void
+ {
+ IValueToggleButtonModel(model).text = value;
+ }
+
+ /**
+ * Whether or not the RadioButton instance is selected. Setting this property
+ * causes the currently selected RadioButton in the same group to lose the
+ * selection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return IValueToggleButtonModel(model).selected;
+ }
+ public function set selected(selValue:Boolean):void
+ {
+ IValueToggleButtonModel(model).selected = selValue;
+
+ // if this button is being selected, its value should become
+ // its group's selectedValue
+ if( selValue ) {
+ for each(var rb:RadioButton in dict)
+ {
+ if( rb.groupName == groupName )
+ {
+ rb.selectedValue = value;
+ }
+ }
+ }
+ }
+
+ /**
+ * The value associated with the RadioButton. For example, RadioButtons with labels,
+ * "Red", "Green", and "Blue" might have the values 0, 1, and 2 respectively.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Object
+ {
+ return IValueToggleButtonModel(model).value;
+ }
+ public function set value(newValue:Object):void
+ {
+ IValueToggleButtonModel(model).value = newValue;
+ }
+
+ /**
+ * The group's currently selected value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedValue():Object
+ {
+ return IValueToggleButtonModel(model).selectedValue;
+ }
+ public function set selectedValue(newValue:Object):void
+ {
+ // a radio button is really selected when its value matches that of the group's value
+ IValueToggleButtonModel(model).selected = (newValue == value);
+ IValueToggleButtonModel(model).selectedValue = newValue;
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ // if this instance is selected, set the local selectedValue to
+ // this instance's value
+ if( selected ) selectedValue = value;
+
+ else {
+
+ // make sure this button's selectedValue is set from its group's selectedValue
+ // to keep it in sync with the rest of the buttons in its group.
+ for each(var rb:RadioButton in dict)
+ {
+ if( rb.groupName == groupName )
+ {
+ selectedValue = rb.selectedValue;
+ break;
+ }
+ }
+ }
+
+ dict[this] = this;
+ }
+
+ /**
+ * @private
+ */
+ private function internalMouseHandler(event:Event) : void
+ {
+ // prevent radiobutton from being turned off by a click
+ if( !selected ) {
+ selected = !selected;
+ dispatchEvent(new Event("change"));
+ }
+ }
+ }
+
+ COMPILE::JS
+ public class RadioButton extends UIBase
+ {
+ public static var radioCounter:int = 0;
+
+ private var input:HTMLInputElement;
+ private var labelFor:HTMLLabelElement;
+ private var textNode:Text;
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion HTMLLabelElement
+ * @flexjsignorecoercion Text
+ */
+ override protected function createElement():WrappedHTMLElement
+ {
+ input = document.createElement('input') as HTMLInputElement;
+ input.type = 'radio';
+ input.id = '_radio_' + RadioButton.radioCounter++;
+
+ textNode = document.createTextNode('radio button') as Text;
+
+ labelFor = document.createElement('label') as HTMLLabelElement;
+ labelFor.appendChild(input);
+ labelFor.appendChild(textNode);
+
+ element = labelFor as WrappedHTMLElement;
+ element.className = 'RadioButton';
+ typeNames = 'RadioButton';
+
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ (input as WrappedHTMLElement).flexjs_wrapper = this;
+ (element as WrappedHTMLElement).flexjs_wrapper = this;
+ (textNode as WrappedHTMLElement).flexjs_wrapper = this;
+
+ return element;
+ }
+
+ override public function set id(value:String):void
+ {
+ super.id = value;
+ labelFor.id = value;
+ input.id = value;
+ }
+
+ public function get groupName():String
+ {
+ return input.name as String;
+ }
+ public function set groupName(value:String):void
+ {
+ input.name = value;
+ }
+
+ public function get text():String
+ {
+ return textNode.nodeValue as String;
+ }
+ public function set text(value:String):void
+ {
+ textNode.nodeValue = value;
+ }
+
+ /** @export */
+ public function get selected():Boolean
+ {
+ return input.checked;
+ }
+ public function set selected(value:Boolean):void
+ {
+ input.checked = value;
+ }
+
+ public function get value():Object
+ {
+ return input.value;
+ }
+ public function set value(v:Object):void
+ {
+ input.value = v as String;
+ }
+
+ public function get selectedValue():Object
+ {
+ var buttons:NodeList;
+ var groupName:String;
+ var i:int;
+ var n:int;
+
+ groupName = input.name as String;
+ buttons = document.getElementsByName(groupName);
+ n = buttons.length;
+
+ for (i = 0; i < n; i++) {
+ if (buttons[i].checked) {
+ return buttons[i].value;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @flexjsignorecoercion Array
+ */
+ public function set selectedValue(value:Object):void
+ {
+ var buttons:NodeList;
+ var groupName:String;
+ var i:int;
+ var n:int;
+
+ groupName = input.name as String;
+ buttons = document.getElementsByName(groupName);
+ n = buttons.length;
+ for (i = 0; i < n; i++) {
+ if (buttons[i].value === value) {
+ buttons[i].checked = true;
+ break;
+ }
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleAlert.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleAlert.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleAlert.as
new file mode 100644
index 0000000..676d9e7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleAlert.as
@@ -0,0 +1,140 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IPopUp;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+
+ [Event(name="close", type="org.apache.flex.events.Event")]
+
+ /**
+ * The SimpleAlert class is a component that displays a message and an OK button. The
+ * SimpleAlert converts directly to window.alert() for HTML. SimpleAlert uses
+ * the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, which includes the message.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Alert.
+ * org.apache.flex.core.IBeadController: the bead responsible for handling input events.
+ * org.apache.flex.core.IBorderBead: a bead, if present, that draws a border around the control.
+ * org.apache.flex.core.IBackgroundBead: a bead, if present, that creates a solid-color background.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SimpleAlert extends UIBase implements IPopUp
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SimpleAlert()
+ {
+ super();
+
+ className = "SimpleAlert";
+ }
+
+ /**
+ * The message to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private function get message():String
+ {
+ return IAlertModel(model).message;
+ }
+ private function set message(value:String):void
+ {
+ IAlertModel(model).message = value;
+ }
+
+ /**
+ * The HTML message to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private function get htmlMessage():String
+ {
+ return IAlertModel(model).htmlMessage;
+ }
+ private function set htmlMessage(value:String):void
+ {
+ IAlertModel(model).htmlMessage = value;
+ }
+
+ /**
+ * This function causes the SimpleAlert to appear. The parent is used for ActionScript and
+ * identifies the IPopUpParent that manages the alert.
+ *
+ * @param Object parent The object that hosts the pop-up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function show(parent:Object) : void
+ {
+ parent.addElement(this);
+ }
+
+ /**
+ * A convenience function to compose and display the alert.
+ *
+ * @param String message The content to display in the SimpleAlert.
+ * @param Object parent The object that hosts the pop-up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ static public function show(message:String, parent:Object):SimpleAlert
+ {
+ COMPILE::AS3
+ {
+ var alert:SimpleAlert = new SimpleAlert();
+ alert.message = message;
+ alert.show(parent);
+
+ return alert;
+ }
+ COMPILE::JS
+ {
+ alert(message);
+ return null;
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleList.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleList.as
new file mode 100644
index 0000000..9dcb348
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/SimpleList.as
@@ -0,0 +1,79 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The SimpleList class is a component that displays data in a vertical column. This
+ * component differs from org.apache.flex.html.List in that it displays
+ * only string values and maps to the <select> HTML element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SimpleList extends List
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SimpleList()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('select') as WrappedHTMLElement;
+ (element as HTMLSelectElement).size = 5;
+ goog.events.listen(element, 'change',
+ changeHandler);
+ positioner = element;
+ positioner.style.position = 'relative';
+ className = 'SimpleList';
+
+ return element;
+ }
+
+ /**
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ COMPILE::JS
+ protected function changeHandler(event:Event):void
+ {
+ model.selectedIndex = (element as HTMLSelectElement).selectedIndex;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
new file mode 100644
index 0000000..6944895
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Slider.as
@@ -0,0 +1,233 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IRangeModel;
+ import org.apache.flex.core.UIBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.html.beads.SliderTrackView;
+ import org.apache.flex.html.beads.SliderThumbView;
+ import org.apache.flex.html.beads.controllers.SliderMouseController;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [Event(name="valueChange", type="org.apache.flex.events.Event")]
+
+ /**
+ * The Slider class is a component that displays a range of values using a
+ * track and a thumb control. The Slider uses the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, typically an IRangeModel, that holds the Slider values.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Slider.
+ * org.apache.flex.core.IBeadController: the bead that handles input.
+ * org.apache.flex.core.IThumbValue: the bead responsible for the display of the thumb control.
+ * org.apache.flex.core.ITrackView: the bead responsible for the display of the track.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Slider extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Slider()
+ {
+ super();
+
+ className = "Slider";
+
+ IRangeModel(model).value = 0;
+ IRangeModel(model).minimum = 0;
+ IRangeModel(model).maximum = 100;
+ IRangeModel(model).stepSize = 1;
+ IRangeModel(model).snapInterval = 1;
+ }
+
+ /**
+ * The current value of the Slider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Number
+ {
+ return IRangeModel(model).value;
+ }
+ public function set value(newValue:Number):void
+ {
+ IRangeModel(model).value = newValue;
+ }
+
+ /**
+ * The minimum value of the Slider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get minimum():Number
+ {
+ return IRangeModel(model).minimum;
+ }
+ public function set minimum(value:Number):void
+ {
+ IRangeModel(model).minimum = value;
+ }
+
+ /**
+ * The maximum value of the Slider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maximum():Number
+ {
+ return IRangeModel(model).maximum;
+ }
+ public function set maximum(value:Number):void
+ {
+ IRangeModel(model).maximum = value;
+ }
+
+ /**
+ * The modulus of the Slider value. The thumb will be positioned
+ * at the nearest multiple of this value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get snapInterval():Number
+ {
+ return IRangeModel(model).snapInterval;
+ }
+ public function set snapInterval(value:Number):void
+ {
+ IRangeModel(model).snapInterval = value;
+ }
+
+ /**
+ * The amount to move the thumb when the track is selected. This value is
+ * adjusted to fit the nearest snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get stepSize():Number
+ {
+ return IRangeModel(model).stepSize;
+ }
+ public function set stepSize(value:Number):void
+ {
+ IRangeModel(model).stepSize = value;
+ }
+
+ COMPILE::JS
+ private var track:SliderTrackView;
+
+ COMPILE::JS
+ private var thumb:SliderThumbView;
+
+ COMPILE::JS
+ private var controller:SliderMouseController;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.style.width = '200px';
+ element.style.height = '30px';
+
+ track = new SliderTrackView();
+ addBead(track);
+
+ thumb = new SliderThumbView();
+ addBead(thumb);
+
+ controller = new SliderMouseController();
+ addBead(controller);
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ className = 'Slider';
+
+ return element;
+ }
+
+ /**
+ */
+ COMPILE::JS
+ public function snap(value:Number):Number
+ {
+ var si:Number = snapInterval;
+ var n:Number = Math.round((value - minimum) / si) *
+ si + minimum;
+ if (value > 0)
+ {
+ if (value - n < n + si - value)
+ return n;
+ return n + si;
+ }
+ if (value - n > n + si - value)
+ return n + si;
+ return n;
+ }
+
+
+ /**
+ * @param {number} value The value used to calculate new position of the thumb.
+ * @return {void} Moves the thumb to the corresponding position.
+ */
+ COMPILE::JS
+ public function setThumbFromValue(value:Number):void
+ {
+ var min:Number = model.minimum;
+ var max:Number = model.maximum;
+ var p:Number = (value - min) / (max - min);
+ var xloc:Number = p * (parseInt(track.element.style.width, 10) -
+ parseInt(thumb.element.style.width, 10));
+
+ thumb.element.style.left = String(xloc) + 'px';
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spacer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spacer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spacer.as
new file mode 100644
index 0000000..d7ab050
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spacer.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
+{
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The Spacer class takes up space in the UI layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Spacer extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Spacer()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ this.element = document.createElement('div') as WrappedHTMLElement;
+ this.positioner = this.element;
+ this.element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ }
+}
[07/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RightArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RightArrowButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RightArrowButtonView.as
new file mode 100644
index 0000000..225c37c
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RightArrowButtonView.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The RightArrowButtonView class is the view for
+ * the right arrow button in a ScrollBar and other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RightArrowButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RightArrowButtonView()
+ {
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.lineStyle(1, 0x808080);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
+ g.endFill();
+ g.lineStyle(0);
+ g.beginFill(0);
+ g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
+ g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.HalfSize);
+ g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
+ g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+
+ SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ScrollBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ScrollBarView.as
new file mode 100644
index 0000000..e3f8c50
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ScrollBarView.as
@@ -0,0 +1,216 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+ /**
+ * The ScrollBarView class is the default view for
+ * the org.apache.flex.html.supportClasses.ScrollBar class.
+ * It implements the classic desktop-like ScrollBar.
+ * A different view would implement more modern scrollbars that hide themselves
+ * until hovered over with the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
+ {
+ public static const FullSize:int = 12;
+ public static const ThreeQuarterSize:int = 9;
+ public static const HalfSize:int = 6;
+ public static const ThirdSize:int = 4;
+ public static const QuarterSize:int = 3;
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ScrollBarView()
+ {
+ }
+
+ protected var sbModel:IScrollBarModel;
+
+ protected var _strand:IStrand;
+
+ /**
+ * The layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var layout:IBeadLayout;
+
+ /**
+ * The host component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get host():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel.addEventListener("maximumChange", changeHandler);
+ sbModel.addEventListener("minimumChange", changeHandler);
+ sbModel.addEventListener("snapIntervalChange", changeHandler);
+ sbModel.addEventListener("stepSizeChange", changeHandler);
+ sbModel.addEventListener("pageSizeChange", changeHandler);
+ sbModel.addEventListener("valueChange", changeHandler);
+
+ if( _strand.getBeadByType(IBeadLayout) == null ) {
+ layout = new (ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout")) as IBeadLayout;
+ _strand.addBead(layout);
+ }
+ }
+
+ protected function changeHandler(event:Event):void
+ {
+ layout.layout();
+ }
+
+ protected var _decrement:DisplayObject;
+ protected var _increment:DisplayObject;
+ protected var _track:DisplayObject;
+ protected var _thumb:DisplayObject;
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#decrement
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get decrement():DisplayObject
+ {
+ return _decrement;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#increment
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get increment():DisplayObject
+ {
+ return _increment;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#track
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get track():DisplayObject
+ {
+ return _track;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#thumb
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get thumb():DisplayObject
+ {
+ return _thumb;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewHeight():Number
+ {
+ // don't want to put $height in an interface
+ return _strand["$height"];
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewWidth():Number
+ {
+ // don't want to put $width in an interface
+ return _strand["$width"];
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SimpleAlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SimpleAlertView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SimpleAlertView.as
new file mode 100644
index 0000000..949f9c9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SimpleAlertView.as
@@ -0,0 +1,149 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IAlertModel;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IParent;
+ 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.geom.Rectangle;
+ import org.apache.flex.html.Label;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The SimpleAlertView class creates the visual elements of the
+ * org.apache.flex.html.SimpleAlert component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SimpleAlertView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SimpleAlertView()
+ {
+ }
+
+ private var messageLabel:Label;
+ private var okButton:TextButton;
+
+ /**
+ * @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;
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+ if (backgroundColor != null || backgroundImage != null)
+ {
+ if (value.getBeadByType(IBackgroundBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
+ }
+
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+ if (borderStyles is Array)
+ {
+ borderStyle = borderStyles[1];
+ }
+ if (borderStyle == null)
+ {
+ borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+ }
+ if (borderStyle != null && borderStyle != "none")
+ {
+ if (value.getBeadByType(IBorderBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+ }
+
+ var model:IAlertModel = _strand.getBeadByType(IAlertModel) as IAlertModel;
+ model.addEventListener("messageChange",handleMessageChange);
+ model.addEventListener("htmlMessageChange",handleMessageChange);
+
+ messageLabel = new Label();
+ messageLabel.text = model.message;
+ messageLabel.html = model.htmlMessage;
+ IParent(_strand).addElement(messageLabel);
+
+ okButton = new TextButton();
+ okButton.text = model.okLabel;
+ IParent(_strand).addElement(okButton);
+ okButton.addEventListener("click",handleOK);
+
+ handleMessageChange(null);
+ }
+
+ /**
+ * @private
+ */
+ private function handleMessageChange(event:Event):void
+ {
+ var ruler:IMeasurementBead = messageLabel.getBeadByType(IMeasurementBead) as IMeasurementBead;
+ if( ruler == null ) {
+ messageLabel.addBead(ruler = new (ValuesManager.valuesImpl.getValue(messageLabel, "iMeasurementBead")) as IMeasurementBead);
+ }
+ var maxWidth:Number = Math.max(UIBase(_strand).width,ruler.measuredWidth);
+
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
+
+ messageLabel.x = metrics.left;
+ messageLabel.y = metrics.top;
+ messageLabel.width = maxWidth;
+
+ okButton.x = (maxWidth - okButton.width)/2;
+ okButton.y = messageLabel.y + messageLabel.height + 20;
+
+ UIBase(_strand).width = maxWidth + metrics.left + metrics.right;
+ UIBase(_strand).height = okButton.y + okButton.height + metrics.bottom;
+ }
+
+ /**
+ * @private
+ */
+ private function handleOK(event:Event):void
+ {
+ var newEvent:Event = new Event("close");
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SingleLineBorderBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SingleLineBorderBead.as
new file mode 100644
index 0000000..49f3608
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SingleLineBorderBead.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 flash.display.Graphics;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStatesObject;
+ 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.CSSBorderUtils;
+
+ /**
+ * The SingleLineBorderBead class draws a single line solid border.
+ * The color and thickness can be specified in CSS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SingleLineBorderBead implements IBead, IBorderBead, IGraphicsDrawing
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SingleLineBorderBead()
+ {
+ }
+
+ 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("heightChanged", changeHandler);
+ IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+ IEventDispatcher(value).addEventListener("sizeChanged", changeHandler);
+ changeHandler(null);
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var host:UIBase = UIBase(_strand);
+ var g:Graphics = host.graphics;
+ var w:Number = host.width;
+ var h:Number = host.height;
+ var state:String;
+ if (host is IStatesObject)
+ state = IStatesObject(host).currentState;
+
+ var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
+ if( this == gd ) g.clear();
+
+ CSSBorderUtils.draw(g, w, h, host, state, false, false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderThumbView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderThumbView.as
new file mode 100644
index 0000000..c20c781
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderThumbView.as
@@ -0,0 +1,156 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ }
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The SliderThumbView class creates the draggable input element for the
+ * org.apache.flex.html.Slider component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SliderThumbView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SliderThumbView()
+ {
+ COMPILE::AS3
+ {
+ hitArea = new Shape();
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.clear();
+ g.lineStyle(1,0x000000);
+ g.beginFill(bgColor);
+ g.drawCircle(SimpleButton(_strand).width/2, SimpleButton(_strand).height/2, 10);
+ g.endFill();
+ }
+
+ COMPILE::AS3
+ private var hitArea:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignoreimport org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ COMPILE::AS3
+ {
+ drawView(hitArea.graphics, 0xDD0000);
+ drawView(upView.graphics, 0xFFFFFF);
+ drawView(downView.graphics, 0x999999);
+ drawView(overView.graphics, 0xDDDDDD);
+
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = hitArea;
+
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+ }
+ COMPILE::JS
+ {
+
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.className = 'SliderThumb';
+ element.id = 'thumb';
+ element.style.backgroundColor = '#949494';
+ element.style.border = 'thin solid #747474';
+ element.style.position = 'relative';
+ element.style.height = '30px';
+ element.style.width = '10px';
+ element.style.zIndex = '2';
+ element.style.top = '-10px';
+ element.style.left = '20px';
+
+ host.element.appendChild(element);
+
+ element.flexjs_wrapper = this;
+
+ }
+ }
+
+ COMPILE::AS3
+ private var upView:Shape;
+ COMPILE::AS3
+ private var downView:Shape;
+ COMPILE::AS3
+ private var overView:Shape;
+
+ COMPILE::JS
+ public var element:WrappedHTMLElement;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function sizeChangeHandler( event:Event ) : void
+ {
+ drawView(hitArea.graphics, 0xDD0000);
+ drawView(upView.graphics, 0xFFFFFF);
+ drawView(downView.graphics, 0x999999);
+ drawView(overView.graphics, 0xDDDDDD);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderTrackView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderTrackView.as
new file mode 100644
index 0000000..6752347
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderTrackView.as
@@ -0,0 +1,153 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ }
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The SliderTrackView class creates the track area for the org.apache.flex.html.Slider
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SliderTrackView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SliderTrackView()
+ {
+ COMPILE::AS3
+ {
+ hitArea = new Shape();
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.clear();
+ g.lineStyle(1,0x000000);
+ g.beginFill(bgColor);
+ g.drawRect(0, 0, SimpleButton(_strand).width, SimpleButton(_strand).height);
+ g.endFill();
+ }
+
+ COMPILE::AS3
+ private var hitArea:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ COMPILE::AS3
+ {
+ drawView(hitArea.graphics, 0xDD0000);
+ drawView(upView.graphics, 0xCCCCCC);
+ drawView(downView.graphics, 0x808080);
+ drawView(overView.graphics, 0xEEEEEE);
+
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = hitArea;
+
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+ }
+ COMPILE::JS
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.className = 'SliderTrack';
+ element.id = 'track';
+ element.style.backgroundColor = '#E4E4E4';
+ element.style.height = '10px';
+ element.style.width = '200px';
+ element.style.border = 'thin solid #C4C4C4';
+ element.style.position = 'relative';
+ element.style.left = '0px';
+ element.style.top = '10px';
+ element.style.zIndex = '1';
+
+ var host:UIBase = value as UIBase;
+ host.element.appendChild(element);
+ }
+ }
+
+ COMPILE::JS
+ public var element:WrappedHTMLElement;
+
+ COMPILE::AS3
+ private var upView:Shape;
+ COMPILE::AS3
+ private var downView:Shape;
+ COMPILE::AS3
+ private var overView:Shape;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function sizeChangeHandler( event:Event ) : void
+ {
+ drawView(hitArea.graphics, 0xDD0000);
+ drawView(upView.graphics, 0xCCCCCC);
+ drawView(downView.graphics, 0x808080);
+ drawView(overView.graphics, 0xEEEEEE);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderView.as
new file mode 100644
index 0000000..071dd8d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SliderView.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.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Sprite;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IRangeModel;
+ 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.Button;
+
+ /**
+ * The SliderView class creates the visual elements of the org.apache.flex.html.Slider
+ * component. The Slider has a track and a thumb control which are also created with view beads.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SliderView extends BeadViewBase implements ISliderView, IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SliderView()
+ {
+ }
+
+ private var rangeModel:IRangeModel;
+
+ /**
+ * @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;
+
+ _track = new Button();
+ Button(_track).addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iTrackView")) as IBead);
+
+ _thumb = new Button();
+ Button(_thumb).addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iThumbView")) as IBead);
+
+ UIBase(_strand).addChild(_track);
+ UIBase(_strand).addChild(_thumb);
+
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+
+ rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
+
+ // listen for changes to the model and adjust the UI accordingly.
+ IEventDispatcher(rangeModel).addEventListener("valueChange",modelChangeHandler);
+ IEventDispatcher(rangeModel).addEventListener("minimumChange",modelChangeHandler);
+ IEventDispatcher(rangeModel).addEventListener("maximumChange",modelChangeHandler);
+ IEventDispatcher(rangeModel).addEventListener("stepSizeChange",modelChangeHandler);
+ IEventDispatcher(rangeModel).addEventListener("snapIntervalChange",modelChangeHandler);
+
+ // set a minimum size to trigger the size change handler
+ var needsSizing:Boolean = true;
+ if( UIBase(_strand).width < 100 ) {
+ UIBase(_strand).width = 100;
+ needsSizing = false;
+ }
+ if( UIBase(_strand).height < 30 ) {
+ UIBase(_strand).height = 30;
+ needsSizing = false;
+ }
+
+ if( needsSizing ) sizeChangeHandler(null);
+ }
+
+ private var _track:DisplayObject;
+ private var _thumb:DisplayObject;
+
+ /**
+ * The track component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get track():DisplayObject
+ {
+ return _track;
+ }
+
+ /**
+ * The thumb component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get thumb():DisplayObject
+ {
+ return _thumb;
+ }
+
+ /**
+ * @private
+ */
+ private function sizeChangeHandler( event:Event ) : void
+ {
+ var w:Number = UIBase(_strand).width;
+ var h:Number = UIBase(_strand).height;
+
+ _thumb.width = 20;
+ _thumb.height = UIBase(_strand).height;
+
+ _thumb.x = 10;
+ _thumb.y = 0;
+
+ // the track is inset 1/2 of the thumbwidth so the thumb can
+ // overlay the track on either end with the thumb center being
+ // on the track's edge
+ _track.width = UIBase(_strand).width - _thumb.width;
+ _track.height = 5;
+ _track.x = _thumb.width/2;
+ _track.y = (UIBase(_strand).height - _track.height)/2;
+ }
+
+ /**
+ * @private
+ */
+ private function modelChangeHandler( event:Event ) : void
+ {
+ setThumbPositionFromValue(rangeModel.value);
+ }
+
+ /**
+ * @private
+ */
+ private function setThumbPositionFromValue( value:Number ) : void
+ {
+ var p:Number = (value-rangeModel.minimum)/(rangeModel.maximum-rangeModel.minimum);
+ var xloc:Number = p*(UIBase(_strand).width - _thumb.width);
+
+ _thumb.x = xloc;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
new file mode 100644
index 0000000..a42a23d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SolidBackgroundBead.as
@@ -0,0 +1,191 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Sprite;
+ import flash.display.Graphics;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The SolidBackgroundBead class draws a solid filled background.
+ * The color and opacity can be specified in CSS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SolidBackgroundBead implements IBead, IBackgroundBead, IGraphicsDrawing
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SolidBackgroundBead()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ private var host:IUIBase;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ if (value is IUIBase)
+ host = IUIBase(value);
+ else if (value is IBeadView)
+ host = IUIBase(IBeadView(value).host);
+
+ IEventDispatcher(host).addEventListener("heightChanged", changeHandler);
+ IEventDispatcher(host).addEventListener("widthChanged", changeHandler);
+ IEventDispatcher(host).addEventListener("sizeChanged", changeHandler);
+ IEventDispatcher(host).addEventListener("initComplete", changeHandler);
+
+ var bgColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");
+ if( bgColor != null ) {
+ backgroundColor = ValuesManager.valuesImpl.convertColor(bgColor);
+ }
+
+ var bgAlpha:Object = ValuesManager.valuesImpl.getValue(host, "opacity");
+ if( bgAlpha != null ) {
+ opacity = Number(bgAlpha);
+ }
+
+ var corner:Object = ValuesManager.valuesImpl.getValue(host, "border-radius");
+ if( corner != null ) {
+ borderRadius = Number(corner);
+ }
+
+ changeHandler(null);
+ }
+
+ private var _backgroundColor:uint;
+
+ /**
+ * The background color
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get backgroundColor():uint
+ {
+ return _backgroundColor;
+ }
+
+ /**
+ * @private
+ */
+ public function set backgroundColor(value:uint):void
+ {
+ _backgroundColor = value;
+ if (_strand)
+ changeHandler(null);
+ }
+
+ private var _opacity:Number = 1.0;
+
+ /**
+ * The opacity (alpha).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get opacity():Number
+ {
+ return _opacity;
+ }
+
+ /**
+ * @private
+ */
+ public function set opacity(value:Number):void
+ {
+ _opacity = value;
+ if( _strand )
+ changeHandler(null);
+ }
+
+ private var _borderRadius:Number;
+
+ /**
+ * The opacity (alpha).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get borderRadius():Number
+ {
+ return _borderRadius;
+ }
+
+ /**
+ * @private
+ */
+ public function set borderRadius(value:Number):void
+ {
+ _borderRadius = value;
+ if( _strand )
+ changeHandler(null);
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var g:Graphics = Sprite(host).graphics;
+ var w:Number = host.width;
+ var h:Number = host.height;
+
+ var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
+ if( this == gd ) g.clear();
+
+ g.beginFill(backgroundColor,opacity);
+ if (isNaN(borderRadius))
+ g.drawRect(0, 0, w, h);
+ else
+ g.drawRoundRect(0, 0, w, h, borderRadius * 2);
+ g.endFill();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
new file mode 100644
index 0000000..44d3da8
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/SpinnerView.as
@@ -0,0 +1,135 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IRangeModel;
+ 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.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+ /**
+ * The SpinnerView class creates the visual elements of the org.apache.flex.html.Spinner
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SpinnerView extends BeadViewBase implements ISpinnerView, IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SpinnerView()
+ {
+ }
+
+ private var rangeModel:IRangeModel;
+
+ /**
+ * @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;
+
+ _increment = new Button();
+ Button(_increment).addBead(new UpArrowButtonView());
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).addBead(new DownArrowButtonView());
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+
+ Button(_increment).x = 0;
+ Button(_increment).y = 0;
+ Button(_decrement).x = 0;
+ Button(_decrement).y = Button(_increment).height;
+
+ UIBase(_strand).addChild(_decrement);
+ UIBase(_strand).addChild(_increment);
+ rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
+
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private var _decrement:DisplayObject;
+ private var _increment:DisplayObject;
+
+ /**
+ * The component for decrementing the org.apache.flex.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get decrement():DisplayObject
+ {
+ return _decrement;
+ }
+
+ /**
+ * The component for incrementing the org.apache.flex.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get increment():DisplayObject
+ {
+ return _increment;
+ }
+
+ /**
+ * @private
+ */
+ private function sizeChangeHandler( event:Event ) : void
+ {
+ var w:Number = UIBase(_strand).width;
+ var h:Number = UIBase(_strand).height / 2;
+ _increment.width = w;
+ _increment.height = h;
+ _increment.y = 0;
+ _decrement.width = w;
+ _decrement.height = h;
+ _decrement.y = h;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextAreaView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
new file mode 100644
index 0000000..ef25539
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextAreaView.as
@@ -0,0 +1,263 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.IEventDispatcher;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.html.beads.models.ScrollBarModel;
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.html.supportClasses.VScrollBar;
+
+ /**
+ * The TextAreaView class is the default view for
+ * the org.apache.flex.html.TextArea class.
+ * It implements the classic desktop-like TextArea with
+ * a border and scrollbars. It does not support right-to-left text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextAreaView extends TextFieldViewBase implements IStrand
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextAreaView()
+ {
+ super();
+
+ textField.selectable = true;
+ textField.type = TextFieldType.INPUT;
+ textField.mouseEnabled = true;
+ textField.multiline = true;
+ textField.wordWrap = true;
+ }
+
+ private var _border:Border;
+
+ /**
+ * The border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get border():Border
+ {
+ return _border;
+ }
+
+ private var _vScrollBar:VScrollBar;
+
+ /**
+ * The vertical ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get vScrollBar():VScrollBar
+ {
+ if (!_vScrollBar)
+ _vScrollBar = createScrollBar();
+ return _vScrollBar;
+ }
+
+ /**
+ * @private
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ // add a border to this
+ _border = new Border();
+ _border.model = new (ValuesManager.valuesImpl.getValue(value, "iBorderModel")) as IBeadModel;
+ _border.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+ IParent(host).addElement(border);
+
+ var vb:VScrollBar = vScrollBar;
+
+ // Default size
+ var ww:Number = DisplayObject(host).width;
+ if( isNaN(ww) || ww == 0 ) DisplayObject(host).width = 100;
+ var hh:Number = DisplayObject(host).height;
+ if( isNaN(hh) || hh == 0 ) DisplayObject(host).height = 42;
+
+ // for input, listen for changes to the _textField and update
+ // the model
+ textField.addEventListener(Event.SCROLL, textScrollHandler);
+
+ IEventDispatcher(host).addEventListener("widthChanged", sizeChangedHandler);
+ IEventDispatcher(host).addEventListener("heightChanged", sizeChangedHandler);
+ sizeChangedHandler(null);
+ }
+
+ private function createScrollBar():VScrollBar
+ {
+ var vsb:VScrollBar;
+ vsb = new VScrollBar();
+ var vsbm:ScrollBarModel = new ScrollBarModel();
+ vsbm.maximum = 100;
+ vsbm.minimum = 0;
+ vsbm.pageSize = 10;
+ vsbm.pageStepSize = 10;
+ vsbm.snapInterval = 1;
+ vsbm.stepSize = 1;
+ vsbm.value = 0;
+ vsb.model = vsbm;
+ IParent(host).addElement(vsb);
+
+ vsb.addEventListener("scroll", scrollHandler);
+
+ return vsb;
+ }
+
+ private function textScrollHandler(event:Event):void
+ {
+ var visibleLines:int = textField.bottomScrollV - textField.scrollV + 1;
+ var scrollableLines:int = textField.numLines - visibleLines + 1;
+ var vsbm:ScrollBarModel = ScrollBarModel(vScrollBar.model);
+ vsbm.minimum = 0;
+ vsbm.maximum = textField.numLines+1;
+ vsbm.value = textField.scrollV;
+ vsbm.pageSize = visibleLines;
+ vsbm.pageStepSize = visibleLines;
+ }
+
+ private function sizeChangedHandler(event:Event):void
+ {
+ var ww:Number = DisplayObject(host).width;
+ if( !isNaN(ww) && ww > 0 )
+ _border.width = ww;
+
+ ww -= DisplayObject(vScrollBar).width;
+ if( !isNaN(ww) && ww > 0 )
+ textField.width = ww;
+
+ var hh:Number = DisplayObject(host).height;
+ if( !isNaN(hh) && hh > 0 )
+ {
+ textField.height = hh;
+ _border.height = hh;
+ }
+
+ var sb:DisplayObject = DisplayObject(vScrollBar);
+ sb.y = 1;
+ sb.x = textField.width - 1;
+ sb.height = textField.height;
+ }
+
+ private function scrollHandler(event:Event):void
+ {
+ var vpos:Number = IScrollBarModel(vScrollBar.model).value;
+ textField.scrollV = vpos;
+ }
+
+ /**
+ * @copy org.apache.flex.core.UIBase#beads
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var beads:Array;
+
+ private var _beads:Vector.<IBead>;
+
+ /**
+ * @copy org.apache.flex.core.UIBase#addBead()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function addBead(bead:IBead):void
+ {
+ if (!_beads)
+ _beads = new Vector.<IBead>;
+ _beads.push(bead);
+ bead.strand = this;
+ }
+
+ /**
+ * @copy org.apache.flex.core.UIBase#getBeadByType()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function getBeadByType(classOrInterface:Class):IBead
+ {
+ for each (var bead:IBead in _beads)
+ {
+ if (bead is classOrInterface)
+ return bead;
+ }
+ return null;
+ }
+
+ /**
+ * @copy org.apache.flex.core.UIBase#removeBead()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ 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;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonMeasurementBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonMeasurementBead.as
new file mode 100644
index 0000000..1341389
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonMeasurementBead.as
@@ -0,0 +1,86 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+
+ /**
+ * The TextButtonMeasurementBead class helps measure a org.apache.flex.html.TextButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextButtonMeasurementBead implements IMeasurementBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextButtonMeasurementBead()
+ {
+ }
+
+ /**
+ * The overall width of the org.apache.flex.html.TextButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredWidth():Number
+ {
+ var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
+ if( view ) return Math.max(view.upTextField.textWidth,view.downTextField.textWidth,view.overTextField.textWidth);
+ else return 0;
+ }
+
+ /**
+ * The overall height of the org.apache.flex.html.TextButton
+ */
+ public function get measuredHeight():Number
+ {
+ var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
+ if( view ) return Math.max(view.upTextField.textHeight,view.downTextField.textHeight,view.overTextField.textHeight);
+ else return 0;
+ }
+
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonView.as
new file mode 100644
index 0000000..b1ab648
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextButtonView.as
@@ -0,0 +1,217 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The TextButtonView class is the default view for
+ * the org.apache.flex.html.TextButton class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextButtonView()
+ {
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upTextField.border = true;
+ downTextField.border = true;
+ overTextField.border = true;
+ upTextField.background = true;
+ downTextField.background = true;
+ overTextField.background = true;
+ upTextField.borderColor = 0;
+ downTextField.borderColor = 0;
+ overTextField.borderColor = 0;
+ upTextField.backgroundColor = 0xCCCCCC;
+ downTextField.backgroundColor = 0x808080;
+ overTextField.backgroundColor = 0xFFCCCC;
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ upTextField.autoSize = "left";
+ downTextField.autoSize = "left";
+ overTextField.autoSize = "left";
+
+ }
+
+ private var textModel:ITextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ textModel = value.getBeadByType(ITextModel) as ITextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upTextField;
+ SimpleButton(value).downState = downTextField;
+ SimpleButton(value).overState = overTextField;
+ SimpleButton(value).hitTestState = shape;
+ upTextField.styleParent = value;
+ downTextField.styleParent = value;
+ overTextField.styleParent = value;
+ if (textModel.text !== null)
+ text = textModel.text;
+ if (textModel.html !== null)
+ html = textModel.html;
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ upTextField.width = downTextField.width = overTextField.width = DisplayObject(_strand).width;
+ upTextField.height= downTextField.height= overTextField.height= DisplayObject(_strand).height;
+ }
+
+ /**
+ * The CSSTextField in the up state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var upTextField:CSSTextField;
+
+ /**
+ * The CSSTextField in the down state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var downTextField:CSSTextField;
+
+ /**
+ * The CSSTextField in the over state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var overTextField:CSSTextField;
+
+ /**
+ * @copy org.apache.flex.html.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upTextField.textWidth, upTextField.textHeight);
+ shape.graphics.endFill();
+
+ }
+
+ /**
+ * @copy org.apache.flex.html.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return upTextField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ upTextField.htmlText = value;
+ downTextField.htmlText = value;
+ overTextField.htmlText = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
new file mode 100644
index 0000000..ca38a0b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
@@ -0,0 +1,92 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+
+ /**
+ * The TextFieldLabelMeasurementBead class helps to measure org.apache.flex.html.Label
+ * components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextFieldLabelMeasurementBead implements IMeasurementBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextFieldLabelMeasurementBead()
+ {
+ }
+
+ /**
+ * The overall width of the org.apache.flex.html.Label.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredWidth():Number
+ {
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.textWidth;
+ else return 0;
+ }
+
+ /**
+ * The overall height of the org.apache.flex.html.Label.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredHeight():Number
+ {
+ var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
+ if( view ) return view.textField.textHeight;
+ else return 0;
+ }
+
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldView.as
new file mode 100644
index 0000000..61b6edb
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldView.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.text.TextFieldType;
+
+ /**
+ * The TextFieldView class is the default view for
+ * the org.apache.flex.html.Label class.
+ * It displays text using a TextField, so there is no
+ * right-to-left text support in this view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextFieldView extends TextFieldViewBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextFieldView()
+ {
+ super();
+
+ textField.selectable = false;
+ textField.type = TextFieldType.DYNAMIC;
+ textField.mouseEnabled = false;
+ textField.autoSize = "left";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as
new file mode 100644
index 0000000..3ab2874
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextFieldViewBase.as
@@ -0,0 +1,404 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.text.StyleSheet;
+
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ 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 TextFieldViewBase class is the base class for
+ * the components that display text.
+ * It displays text using a TextField, so there is no
+ * right-to-left text support in this view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextFieldViewBase implements IBeadView, ITextFieldView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextFieldViewBase()
+ {
+ _textField = new CSSTextField();
+ }
+
+ private var _textField:CSSTextField;
+
+ /**
+ * @copy org.apache.flex.core.ITextModel#textField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get textField() : CSSTextField
+ {
+ return _textField;
+ }
+
+ private var _textModel:ITextModel;
+
+ protected 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;
+ _textModel = value.getBeadByType(ITextModel) as ITextModel;
+ _textModel.addEventListener("textChange", textChangeHandler);
+ _textModel.addEventListener("htmlChange", htmlChangeHandler);
+ IEventDispatcher(_strand).addEventListener("widthChanged", widthChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged", heightChangeHandler);
+ IEventDispatcher(_strand).addEventListener("sizeChanged", sizeChangeHandler);
+ DisplayObjectContainer(value).addChild(_textField);
+ if (_textModel.text !== null)
+ text = _textModel.text;
+ if (_textModel.html !== null)
+ html = _textModel.html;
+
+ var ilc:ILayoutChild = host as ILayoutChild;
+ autoHeight = ilc.isHeightSizedToContent();
+ autoWidth = ilc.isWidthSizedToContent();
+ if (!autoWidth && !isNaN(ilc.explicitWidth))
+ {
+ widthChangeHandler(null);
+ }
+ if (!autoHeight && !isNaN(ilc.explicitHeight))
+ {
+ heightChangeHandler(null);
+ }
+
+ // textfield's collapse to height==4 if no text
+ if (autoHeight && _textModel.text === null)
+ {
+ var fontHeight:Number = ValuesManager.valuesImpl.getValue(_strand, "fontSize") + 4;
+ if (textField.height != fontHeight)
+ {
+ textField.autoSize = "none";
+ textField.height = fontHeight;
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function get host() : IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @copy org.apache.flex.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return _textField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ if (value == null)
+ value = "";
+ _textField.text = value;
+ autoSizeIfNeeded();
+ }
+
+ /**
+ * Handle autosizing. The built-in player algorithm
+ * doesn't work the way we would like, especially
+ * when it collapses Textfields with empty strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function autoSizeIfNeeded():void
+ {
+ var host:UIBase = UIBase(_strand);
+ if (autoHeight)
+ {
+ if (textField.text != "")
+ {
+ if (textField.height != textField.textHeight + 4)
+ {
+ textField.height = textField.textHeight + 4;
+ inHeightChange = true;
+ host.dispatchEvent(new Event("heightChanged"));
+ inHeightChange = false;
+ }
+ }
+ else
+ {
+ var fontHeight:Number = ValuesManager.valuesImpl.getValue(_strand, "fontSize") + 4;
+ if (textField.height != fontHeight)
+ {
+ textField.height = fontHeight;
+ inHeightChange = true;
+ host.dispatchEvent(new Event("heightChanged"));
+ inHeightChange = false;
+ }
+ }
+ }
+ if (autoWidth)
+ {
+ if (textField.width != textField.textWidth + 4)
+ {
+ textField.width = textField.textWidth + 4;
+ inWidthChange = true;
+ host.dispatchEvent(new Event("widthChanged"));
+ inWidthChange = false;
+ }
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.ITextModel#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return _textField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ convertToTextFieldHTML(value);
+ autoSizeIfNeeded();
+ }
+
+ private function convertToTextFieldHTML(input:String):void
+ {
+ var classCount:int = 0;
+ var ss:StyleSheet;
+ var c:int = input.indexOf("<span");
+ while (c != -1)
+ {
+ var c1:int = input.indexOf(">", c);
+ if (c1 == -1)
+ {
+ trace("did not parse span correctly");
+ return;
+ }
+ var tag:String = input.substring(c, c1 + 1);
+ var c2:int = tag.indexOf("style=");
+ if (c2 != -1)
+ {
+ var quote:String = tag.charAt(c2 + 6);
+ var c3:int = tag.indexOf(quote, c2 + 7);
+ if (c3 != -1)
+ {
+ var styles:String = tag.substring(c2 + 7, c3);
+ if (!ss)
+ ss = new StyleSheet();
+ var styleObject:Object = {};
+ var list:Array = styles.split(";");
+ for each (var pair:String in list)
+ {
+ var parts:Array = pair.split(":");
+ var name:String = parts[0];
+ var c4:int = name.indexOf("-");
+ if (c4 != -1)
+ {
+ var firstChar:String = name.charAt(c4 + 1);
+ firstChar = firstChar.toUpperCase();
+ var tail:String = name.substring(c4 + 2);
+ name = name.substring(0, c4) + firstChar + tail;
+ }
+ styleObject[name] = parts[1];
+ }
+ var className:String = "css" + classCount++;
+ ss.setStyle("." + className, styleObject);
+ var newTag:String = "<span class='" + className + "'>";
+ input = input.replace(tag, newTag);
+ c1 += newTag.length - tag.length;
+ }
+ }
+ c = input.indexOf("<span", c1);
+ }
+ _textField.styleSheet = ss;
+ _textField.htmlText = input;
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = _textModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = _textModel.html;
+ }
+
+ /**
+ * Whether we are autosizing the height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var autoHeight:Boolean;
+
+ /**
+ * Whether we are autosizing the width.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var autoWidth:Boolean;
+
+ /**
+ * A flag to prevent looping.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var inHeightChange:Boolean = false;
+
+ /**
+ * A flag to prevent looping.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var inWidthChange:Boolean = false;
+
+ /**
+ * Determine the width of the TextField.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function widthChangeHandler(event:Event):void
+ {
+ if (!inWidthChange)
+ {
+ textField.autoSize = "none";
+ autoWidth = false;
+ textField.width = host.width;
+ if (autoHeight)
+ autoSizeIfNeeded()
+ else
+ textField.height = host.height;
+ }
+ }
+
+ /**
+ * Determine the height of the TextField.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function heightChangeHandler(event:Event):void
+ {
+ if (!inHeightChange)
+ {
+ textField.autoSize = "none";
+ autoHeight = false;
+ textField.height = host.height;
+ if (autoWidth)
+ autoSizeIfNeeded();
+ else
+ textField.width = host.width;
+ }
+ }
+
+ /**
+ * Determine the size of the TextField.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function sizeChangeHandler(event:Event):void
+ {
+ var ilc:ILayoutChild = host as ILayoutChild;
+ autoHeight = ilc.isHeightSizedToContent();
+ if (!autoHeight)
+ {
+ textField.autoSize = "none";
+ textField.height = host.height;
+ }
+
+ autoWidth = ilc.isWidthSizedToContent();
+ if (!autoWidth)
+ {
+ textField.autoSize = "none";
+ textField.width = host.width;
+ }
+ }
+ }
+}
[23/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
deleted file mode 100644
index 8790830..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
+++ /dev/null
@@ -1,199 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.accessories
-{
- COMPILE::JS
- {
- import goog.events.BrowserEvent;
- }
- COMPILE::AS3
- {
- import flash.events.TextEvent;
-
- import org.apache.flex.core.CSSTextField;
- }
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.ITextFieldView;
- }
-
- /**
- * The NumericOnlyTextInputBead class is a specialty bead that can be used with
- * any TextInput control. The bead prevents non-numeric entry into the text input
- * area.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class NumericOnlyTextInputBead implements IBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function NumericOnlyTextInputBead()
- {
- }
-
- 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;
-
- COMPILE::AS3
- {
- IEventDispatcher(value).addEventListener("viewChanged",viewChangeHandler);
- }
- COMPILE::JS
- {
- IEventDispatcher(value).addEventListener("keypress",validateInput);
- }
- }
-
- private var _decimalSeparator:String = ".";
-
- /**
- * The character used to separate the integer and fraction parts of numbers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get decimalSeparator():String
- {
- return _decimalSeparator;
- }
- public function set decimalSeparator(value:String):void
- {
- if (_decimalSeparator != value) {
- _decimalSeparator = value;
- }
- }
-
- private var _maxChars:int = 0;
-
- /**
- * The character used to separate the integer and fraction parts of numbers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxChars():int
- {
- return _maxChars;
- }
- public function set maxChars(value:int):void
- {
- if (_maxChars != value) {
- _maxChars = value;
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function viewChangeHandler(event:Event):void
- {
- // get the ITextFieldView bead, which is required for this bead to work
- var textView:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
- if (textView) {
- var textField:CSSTextField = textView.textField;
- textField.restrict = "0-9" + decimalSeparator;
- textField.maxChars = maxChars;
- // listen for changes to this textField and prevent non-numeric values, such
- // as 34.09.94
- textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput);
- }
- else {
- throw new Error("NumericOnlyTextInputBead requires strand to have an ITextFieldView bead");
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function handleTextInput(event:TextEvent):void
- {
- var insert:String = event.text;
- var caretIndex:int = (event.target as CSSTextField).caretIndex;
- var current:String = (event.target as CSSTextField).text;
- var value:String = current.substring(0,caretIndex) + insert + current.substr(caretIndex);
- var n:Number = Number(value);
- if (isNaN(n)) event.preventDefault();
- }
-
- COMPILE::JS
- private function validateInput(event:BrowserEvent):void
- {
- var code:int = event.charCode;
-
- // backspace or delete
- if (event.keyCode == 8 || event.keyCode == 46) return;
-
- // tab or return/enter
- if (event.keyCode == 9 || event.keyCode == 13) return;
-
- // left or right cursor arrow
- if (event.keyCode == 37 || event.keyCode == 39) return;
-
- var key:String = String.fromCharCode(code);
-
- var regex:RegExp = /[0-9]|\./;
- if (!regex.test(key)) {
- event["returnValue"] = false;
- if (event.preventDefault) event.preventDefault();
- return;
- }
- var cursorStart:int = event.target.selectionStart;
- var cursorEnd:int = event.target.selectionEnd;
- var left:String = event.target.value.substring(0, cursorStart);
- var right:String = event.target.value.substr(cursorEnd);
- var complete:String = left + key + right;
- if (isNaN(parseFloat(complete))) {
- event["returnValue"] = false;
- if (event.preventDefault) event.preventDefault();
- }
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/PasswordInputBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/PasswordInputBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/PasswordInputBead.as
deleted file mode 100644
index 191339b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/PasswordInputBead.as
+++ /dev/null
@@ -1,102 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.accessories
-{
- COMPILE::AS3
- {
- import org.apache.flex.core.CSSTextField;
- }
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.ITextFieldView;
- }
-
- /**
- * The PasswordInput class is a specialty bead that can be used with
- * any TextInput control. The bead secures the text input area by masking
- * the input as it is typed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class PasswordInputBead implements IBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function PasswordInputBead()
- {
- }
-
- 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;
-
- COMPILE::AS3
- {
- IEventDispatcher(value).addEventListener("viewChanged",viewChangeHandler);
- }
- COMPILE::JS
- {
- var host:UIBase = value as UIBase;
- var e:HTMLInputElement = host.element as HTMLInputElement;
- e.type = 'password';
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function viewChangeHandler(event:Event):void
- {
- // get the ITextFieldView bead, which is required for this bead to work
- var textView:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
- if (textView) {
- var textField:CSSTextField = textView.textField;
- textField.displayAsPassword = true;
- }
- else {
- throw new Error("PasswordInputBead requires strand to have a TextInputView bead");
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/TextPromptBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/TextPromptBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/TextPromptBead.as
deleted file mode 100644
index 5447da6..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/TextPromptBead.as
+++ /dev/null
@@ -1,148 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.accessories
-{
- COMPILE::AS3
- {
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.CSSTextField;
- }
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The TextPromptBead class is a specialty bead that can be used with
- * any TextInput control. The bead places a string into the input field
- * when there is no value associated with the text property.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextPromptBead implements IBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextPromptBead()
- {
- }
-
- private var _prompt:String;
-
- /**
- * The string to use as the placeholder prompt.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get prompt():String
- {
- return _prompt;
- }
- public function set prompt(value:String):void
- {
- _prompt = value;
- }
-
- 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
- * @flexjsignorecoercion HTMLInputElement
- * @flexjsignorecoercion org.apache.flex.core.UIBase;
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
-
- COMPILE::AS3
- {
- // listen for changes in text to hide or show the prompt
- var model:Object = UIBase(_strand).model;
- if (!model.hasOwnProperty("text")) {
- throw new Error("Model requires a text property when used with TextPromptBead");
- }
- IEventDispatcher(model).addEventListener("textChange", handleTextChange);
-
- // create a TextField that displays the prompt - it shows
- // and hides based on the model's content
- promptField = new CSSTextField();
- promptField.selectable = false;
- promptField.type = TextFieldType.DYNAMIC;
- promptField.mouseEnabled = false;
- promptField.multiline = false;
- promptField.wordWrap = false;
- promptField.textColor = 0xBBBBBB;
-
- // trigger the event handler to display if needed
- handleTextChange(null);
- }
- COMPILE::JS
- {
- var host:UIBase = value as UIBase;
- var e:HTMLInputElement = host.element as HTMLInputElement;
- e.placeholder = prompt;
- }
- }
-
- COMPILE::AS3
- private var promptField:CSSTextField;
- private var promptAdded:Boolean;
-
- /**
- * @private
- */
- COMPILE::AS3
- private function handleTextChange( event:Event ):void
- {
- // see what the model currently has to determine if the prompt should be
- // displayed or not.
- var model:Object = UIBase(_strand).model;
-
- if (model.text != null && model.text.length > 0 ) {
- if (promptAdded) UIBase(_strand).removeChild(promptField);
- promptAdded = false;
- }
- else {
- if (!promptAdded) UIBase(_strand).addChild(promptField);
- promptField.text = prompt;
- promptAdded = true;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/ToolTipBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/ToolTipBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/ToolTipBead.as
deleted file mode 100644
index 64d04bf..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/accessories/ToolTipBead.as
+++ /dev/null
@@ -1,141 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.accessories
-{
-
- import org.apache.flex.core.IBead;
- 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.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.events.utils.MouseUtils;
- import org.apache.flex.geom.Point;
- import org.apache.flex.html.ToolTip;
- import org.apache.flex.utils.PointUtils;
- import org.apache.flex.utils.UIUtils;
-
- /**
- * The ToolTipBead class is a specialty bead that can be used with
- * any control. The bead floats a string over a control if
- * the user hovers over the control with a mouse.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ToolTipBead implements IBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ToolTipBead()
- {
- }
-
- private var _toolTip:String;
-
- /**
- * The string to use as the toolTip.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get toolTip():String
- {
- return _toolTip;
- }
- public function set toolTip(value:String):void
- {
- _toolTip = value;
- }
-
- 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_OVER, rollOverHandler, false);
- }
-
- private var tt:ToolTip;
- private var host:IPopUpHost;
-
- /**
- * @private
- */
- protected function rollOverHandler( event:MouseEvent ):void
- {
- IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_OUT, rollOutHandler, false);
-
- var comp:IUIBase = _strand as IUIBase
- host = UIUtils.findPopUpHost(comp);
- if (tt) host.removeElement(tt);
-
- tt = new ToolTip();
- tt.text = toolTip;
- var pt:Point = determinePosition(event, event.target);
- tt.x = pt.x;
- tt.y = pt.y;
- host.addElement(tt, false); // don't trigger a layout
- }
-
- /**
- * @private
- * Determines the position of the toolTip.
- */
- protected function determinePosition(event:MouseEvent, base:Object):Point
- {
- var comp:IUIBase = _strand as IUIBase;
- var pt:Point = new Point(comp.width, comp.height);
- pt = PointUtils.localToGlobal(pt, comp);
- return pt;
- }
-
- /**
- * @private
- */
- private function rollOutHandler( event:MouseEvent ):void
- {
- if (tt) {
- host.removeElement(tt);
- }
- tt = null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertMeasurementBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertMeasurementBead.as
deleted file mode 100644
index dbe6c05..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertMeasurementBead.as
+++ /dev/null
@@ -1,88 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
-
- /**
- * The AlertMeasureBead class provides boundary measurements for an
- * org.apache.flex.html.Alert component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class AlertMeasurementBead implements IMeasurementBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function AlertMeasurementBead()
- {
- }
-
- /**
- * Returns the overall width of the org.apache.flex.html.Alert component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredWidth():Number
- {
- return 0;
- }
-
- /**
- * Returns the overall height of the org.apache.flex.html.Alert component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredHeight():Number
- {
- return 0;
- }
-
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertView.as
deleted file mode 100644
index 5788d47..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/AlertView.as
+++ /dev/null
@@ -1,226 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IParent;
- 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.geom.Rectangle;
- import org.apache.flex.html.Alert;
- import org.apache.flex.html.ControlBar;
- import org.apache.flex.html.Label;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.html.TitleBar;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The AlertView class creates the visual elements of the org.apache.flex.html.Alert
- * component. The job of the view bead is to put together the parts of the Alert, such as the
- * title bar, message, and various buttons, within the space of the Alert component strand.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class AlertView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function AlertView()
- {
- }
-
- private var _titleBar:TitleBar;
- private var _controlBar:ControlBar;
- private var _label:Label;
- private var _okButton:TextButton;
- private var _cancelButton:TextButton;
- private var _yesButton:TextButton;
- private var _noButton:TextButton;
-
- /**
- * @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;
-
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
- if (backgroundColor != null || backgroundImage != null)
- {
- if (value.getBeadByType(IBackgroundBead) == null)
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
- }
-
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
- if (borderStyles is Array)
- {
- borderStyle = borderStyles[1];
- }
- if (borderStyle == null)
- {
- borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
- }
- if (borderStyle != null && borderStyle != "none")
- {
- if (value.getBeadByType(IBorderBead) == null)
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
- }
-
- var flags:uint = IAlertModel(UIBase(_strand).model).flags;
- if( flags & Alert.OK ) {
- _okButton = new TextButton();
- _okButton.text = IAlertModel(UIBase(_strand).model).okLabel;
- _okButton.addEventListener("click",handleOK);
- }
- if( flags & Alert.CANCEL ) {
- _cancelButton = new TextButton();
- _cancelButton.text = IAlertModel(UIBase(_strand).model).cancelLabel;
- _cancelButton.addEventListener("click",handleCancel);
- }
- if( flags & Alert.YES ) {
- _yesButton = new TextButton();
- _yesButton.text = IAlertModel(UIBase(_strand).model).yesLabel;
- _yesButton.addEventListener("click",handleYes);
- }
- if( flags & Alert.NO ) {
- _noButton = new TextButton();
- _noButton.text = IAlertModel(UIBase(_strand).model).noLabel;
- _noButton.addEventListener("click",handleNo);
- }
-
- _titleBar = new TitleBar();
- _titleBar.title = IAlertModel(UIBase(_strand).model).title;
-
- _label = new Label();
- _label.text = IAlertModel(UIBase(_strand).model).message;
-
- _controlBar = new ControlBar();
- if( _okButton ) _controlBar.addElement(_okButton);
- if( _cancelButton ) _controlBar.addElement(_cancelButton);
- if( _yesButton ) _controlBar.addElement(_yesButton);
- if( _noButton ) _controlBar.addElement(_noButton);
-
- IParent(_strand).addElement(_titleBar);
- IParent(_strand).addElement(_controlBar);
- IParent(_strand).addElement(_label);
-
- sizeHandler(null);
- }
-
- /**
- * @private
- */
- private function sizeHandler(event:Event):void
- {
- var labelMeasure:IMeasurementBead = _label.measurementBead;
- var titleMeasure:IMeasurementBead = _titleBar.measurementBead;
- var ctrlMeasure:IMeasurementBead = _controlBar.measurementBead;
- var maxWidth:Number = Math.max(titleMeasure.measuredWidth, ctrlMeasure.measuredWidth, labelMeasure.measuredWidth);
-
- var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
-
- _titleBar.x = 0;
- _titleBar.y = 0;
- _titleBar.width = maxWidth;
- _titleBar.height = 25;
- _titleBar.dispatchEvent(new Event("layoutNeeded"));
-
- // content placement here
- _label.x = metrics.left;
- _label.y = _titleBar.y + _titleBar.height + metrics.top;
- _label.width = maxWidth - metrics.left - metrics.right;
-
- _controlBar.x = 0;
- _controlBar.y = _titleBar.height + _label.y + _label.height + metrics.bottom;
- _controlBar.width = maxWidth;
- _controlBar.height = 25;
- _controlBar.dispatchEvent(new Event("layoutNeeded"));
-
- UIBase(_strand).width = maxWidth;
- UIBase(_strand).height = _titleBar.height + _label.height + _controlBar.height + metrics.top + metrics.bottom;
- }
-
- /**
- * @private
- */
- private function handleOK(event:Event):void
- {
- // create some custom event where the detail value
- // is the OK button flag. Do same for other event handlers
- dispatchCloseEvent(Alert.OK);
- }
-
- /**
- * @private
- */
- private function handleCancel(event:Event):void
- {
- dispatchCloseEvent(Alert.CANCEL);
- }
-
- /**
- * @private
- */
- private function handleYes(event:Event):void
- {
- dispatchCloseEvent(Alert.YES);
- }
-
- /**
- * @private
- */
- private function handleNo(event:Event):void
- {
- dispatchCloseEvent(Alert.NO);
- }
-
- /**
- * @private
- */
- public function dispatchCloseEvent(buttonFlag:uint):void
- {
- // TO DO: buttonFlag should be part of the event
- var newEvent:Event = new Event("close",true);
- IEventDispatcher(_strand).dispatchEvent(newEvent);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/BackgroundImageBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/BackgroundImageBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/BackgroundImageBead.as
deleted file mode 100644
index bee07e9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/BackgroundImageBead.as
+++ /dev/null
@@ -1,112 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Bitmap;
- import flash.display.Loader;
- import flash.display.LoaderInfo;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.IOErrorEvent;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
-
- /**
- * The BackgroundImageBead is used to render an image as the background to any component
- * that supports it, such as Container.
- *
- * Note that this bead is for ActionScript only since CSS/HTML allows this just by specifying
- * a background image in the style selector. To use this bead, place a ClassReference to it
- * within @media -flex-flash { } group in the CSS declarations.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class BackgroundImageBead implements IBead, IBackgroundBead
- {
- /**
- * Constructor
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function BackgroundImageBead()
- {
- backgroundSprite = new Sprite();
- }
-
- private var _strand:IStrand;
- private var backgroundSprite:Sprite;
- private var bitmap:Bitmap;
- private var loader:Loader;
-
- public function set strand(value:IStrand):void
- {
- _strand = value;
-
- setupBackground(backgroundSprite);
- }
-
- /**
- * @private
- */
- private function setupBackground(sprite:Sprite, state:String = null):void
- {
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
- if (backgroundImage)
- {
- loader = new Loader();
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
- trace(e);
- e.preventDefault();
- });
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- var host:UIBase = UIBase(_strand);
- if (bitmap) {
- host.removeChild(bitmap);
- }
-
- bitmap = Bitmap(LoaderInfo(e.target).content);
-
- host.addChildAt(bitmap,0);
-
- if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
- host.setWidth(loader.content.width);
- else
- bitmap.width = UIBase(_strand).width;
-
- if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
- host.setHeight(loader.content.height);
- else
- bitmap.height = UIBase(_strand).height;
- });
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
deleted file mode 100644
index cbe0a3e..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ButtonBarView.as
+++ /dev/null
@@ -1,69 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.supportClasses.Border;
-
- /**
- * The ButtonBarView class creates the visual elements of the org.apache.flex.html.ButtonBar
- * component. A ButtonBar is a type of List and ButtonBarView extends the ListView bead, adding a border.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ButtonBarView extends ListView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ButtonBarView()
- {
- super();
- }
-
- /**
- * @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
- {
- _strand = value;
- super.strand = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
deleted file mode 100644
index fcd14cc..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ /dev/null
@@ -1,167 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.CSSBorderUtils;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.StringTrimmer;
-
- /**
- * The CSSButtonView class is the default view for
- * the org.apache.flex.html.Button class.
- * It allows the look of the button to be expressed
- * in CSS via the background-image style. This view
- * does not display text. Use CSSTextButtonView and
- * TextButton instead.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSButtonView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- }
-
- private var textModel:ITextModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
-
- setupBackground(overSprite, "hover");
- setupBackground(downSprite, "active");
- setupBackground(upSprite);
-
- IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private function sizeChangeHandler(event:org.apache.flex.events.Event):void
- {
- setupSkins();
- }
-
- protected function setupSkins():void
- {
- setupSkin(overSprite, "hover");
- setupSkin(downSprite, "active");
- setupSkin(upSprite);
- updateHitArea();
- }
-
- private function setupSkin(sprite:Sprite, state:String = null):void
- {
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
- var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
- var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
- var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
- var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
- var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
-
- CSSBorderUtils.draw(sprite.graphics,
- DisplayObject(_strand).width + pl + pr,
- DisplayObject(_strand).height + pt + pb,
- _strand as DisplayObject,
- state, true);
- }
-
- private function setupBackground(sprite:Sprite, state:String = null):void
- {
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- setupSkin(sprite, state);
- updateHitArea();
- });
- }
- else {
- setupSkin(sprite, state);
- updateHitArea();
- }
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
-
- private function updateHitArea():void
- {
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
- shape.graphics.endFill();
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSImageAndTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
deleted file mode 100644
index 12ac07d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
+++ /dev/null
@@ -1,367 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
- import flash.text.TextField;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.html.beads.models.ImageAndTextModel;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.SolidBorderUtil;
- import org.apache.flex.utils.StringTrimmer;
-
- /**
- * The CSSTextButtonView class is the default view for
- * the org.apache.flex.html.TextButton class.
- * It allows the look of the button to be expressed
- * in CSS via the background-image style and displays
- * a text label. This view does not support right-to-left
- * text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSImageAndTextButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSImageAndTextButtonView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- upTextField = new CSSTextField();
- downTextField = new CSSTextField();
- overTextField = new CSSTextField();
- upTextField.selectable = false;
- upTextField.type = TextFieldType.DYNAMIC;
- downTextField.selectable = false;
- downTextField.type = TextFieldType.DYNAMIC;
- overTextField.selectable = false;
- overTextField.type = TextFieldType.DYNAMIC;
- upTextField.autoSize = "left";
- downTextField.autoSize = "left";
- overTextField.autoSize = "left";
- upSprite.addChild(upTextField);
- downSprite.addChild(downTextField);
- overSprite.addChild(overTextField);
- }
-
- private var textModel:ImageAndTextModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- _strand = value;
- textModel = value.getBeadByType(ImageAndTextModel) as ImageAndTextModel;
- textModel.addEventListener("textChange", textChangeHandler);
- textModel.addEventListener("htmlChange", htmlChangeHandler);
- textModel.addEventListener("imageChange", imageChangeHandler);
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- upTextField.styleParent = _strand;
- downTextField.styleParent = _strand;
- overTextField.styleParent = _strand;
- upTextField.parentDrawsBackground = true;
- downTextField.parentDrawsBackground = true;
- overTextField.parentDrawsBackground = true;
- upTextField.parentHandlesPadding = true;
- downTextField.parentHandlesPadding = true;
- overTextField.parentHandlesPadding = true;
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
- if (textModel.text !== null)
- text = textModel.text;
- if (textModel.html !== null)
- html = textModel.html;
-
- setupSkins();
-
- IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
- }
-
- protected function setupSkins():void
- {
- setupSkin(overSprite, overTextField, "hover");
- setupSkin(downSprite, downTextField, "active");
- setupSkin(upSprite, upTextField);
- updateHitArea();
- }
-
- private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
- {
- var sw:uint = DisplayObject(_strand).width;
- var sh:uint = DisplayObject(_strand).height;
-
- textField.defaultTextFormat.leftMargin = 0;
- textField.defaultTextFormat.rightMargin = 0;
- // set it again so it gets noticed
- textField.defaultTextFormat = textField.defaultTextFormat;
-
- var borderColor:uint;
- var borderThickness:uint;
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
- if (borderStyles is Array)
- {
- borderColor = CSSUtils.toColor(borderStyles[2]);
- borderStyle = borderStyles[1];
- borderThickness = borderStyles[0];
- }
- else if (borderStyles is String)
- borderStyle = borderStyles as String;
- var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
- if (value != null)
- borderStyle = value as String;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
- if (value != null)
- borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
- if (value != null)
- borderThickness = value as uint;
- if (borderStyle == "none")
- {
- borderStyle = "solid";
- borderThickness = 0;
- }
-
- var borderRadius:String;
- var borderEllipseWidth:Number = NaN;
- var borderEllipseHeight:Number = NaN;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
- if (value != null)
- {
- if (value is Number)
- borderEllipseWidth = 2 * (value as Number);
- else
- {
- borderRadius = value as String;
- var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
- if (arr.length > 1)
- borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
- }
- }
-
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
- var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
- var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
- var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
- var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
- var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
-
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
- var bgColor:uint;
- var bgAlpha:Number = 1;
- if (backgroundColor != null)
- {
- bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
- if (bgColor & 0xFF000000)
- {
- bgAlpha = bgColor >>> 24 / 255;
- bgColor = bgColor & 0xFFFFFF;
- }
- }
- if (borderStyle == "solid")
- {
- var useWidth:Number = Math.max(sw,textField.textWidth);
- var useHeight:Number = Math.max(sh,textField.textHeight);
-
- if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
- useWidth = textField.textWidth+pl+pr+2*borderThickness;
- if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
- useHeight = textField.textHeight+pt+pb+2*borderThickness;
-
- sprite.graphics.clear();
- SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, useWidth, useHeight,
- borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
- borderEllipseWidth, borderEllipseHeight);
- textField.y = ((useHeight - textField.textHeight) / 2) - 2;
- textField.x = ((useWidth - textField.textWidth) / 2) - 2;
- }
- var backgroundImage:Object = image;
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- sprite.addChild(textField);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- updateHitArea();
- loader.x = pl;
- textField.x = loader.width + pl;
- textField.y = pt;
- loader.y = (textField.height + pt + pb - loader.height) / 2;
- sprite.graphics.clear();
- SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, textField.x + textField.width + pr + borderThickness,
- textField.y + textField.height + pb + borderThickness,
- borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
- borderEllipseWidth, borderEllipseHeight);
- });
- }
- var textColor:Object = ValuesManager.valuesImpl.getValue(_strand, "color", state);
- if (textColor) {
- textField.textColor = Number(textColor);
- }
- }
-
- private function textChangeHandler(event:org.apache.flex.events.Event):void
- {
- text = textModel.text;
- }
-
- private function htmlChangeHandler(event:org.apache.flex.events.Event):void
- {
- html = textModel.html;
- }
-
- private function sizeChangeHandler(event:org.apache.flex.events.Event):void
- {
- setupSkins();
- }
-
- private var upTextField:CSSTextField;
- private var downTextField:CSSTextField;
- private var overTextField:CSSTextField;
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
-
- /**
- * The URL of an icon to use in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get image():String
- {
- return textModel.image;
- }
-
- private function imageChangeHandler(event:org.apache.flex.events.Event):void
- {
- setupSkins();
- }
-
- /**
- * The text to be displayed in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return upTextField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- upTextField.text = value;
- downTextField.text = value;
- overTextField.text = value;
- updateHitArea();
- }
-
- private function updateHitArea():void
- {
- var useWidth:uint = Math.max(DisplayObject(_strand).width, upTextField.textWidth);
- var useHeight:uint = Math.max(DisplayObject(_strand).height, upTextField.textHeight);
-
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, useWidth, useHeight);
- shape.graphics.endFill();
-
- }
-
- /**
- * The html-formatted text to be displayed in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return upTextField.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- upTextField.htmlText = value;
- downTextField.htmlText = value;
- overTextField.htmlText = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
deleted file mode 100644
index cc285b7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ /dev/null
@@ -1,347 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
- import flash.text.TextField;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.SolidBorderUtil;
- import org.apache.flex.utils.StringTrimmer;
-
- /**
- * The CSSTextButtonView class is the default view for
- * the org.apache.flex.html.TextButton class.
- * It allows the look of the button to be expressed
- * in CSS via the background-image style and displays
- * a text label. This view does not support right-to-left
- * text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSTextButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSTextButtonView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- upTextField = new CSSTextField();
- downTextField = new CSSTextField();
- overTextField = new CSSTextField();
- upTextField.selectable = false;
- upTextField.type = TextFieldType.DYNAMIC;
- downTextField.selectable = false;
- downTextField.type = TextFieldType.DYNAMIC;
- overTextField.selectable = false;
- overTextField.type = TextFieldType.DYNAMIC;
- upTextField.autoSize = "left";
- downTextField.autoSize = "left";
- overTextField.autoSize = "left";
- upSprite.addChild(upTextField);
- downSprite.addChild(downTextField);
- overSprite.addChild(overTextField);
- }
-
- private var textModel:ITextModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- _strand = value;
- textModel = value.getBeadByType(ITextModel) as ITextModel;
- textModel.addEventListener("textChange", textChangeHandler);
- textModel.addEventListener("htmlChange", htmlChangeHandler);
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- upTextField.styleParent = _strand;
- downTextField.styleParent = _strand;
- overTextField.styleParent = _strand;
- upTextField.parentDrawsBackground = true;
- downTextField.parentDrawsBackground = true;
- overTextField.parentDrawsBackground = true;
- upTextField.parentHandlesPadding = true;
- downTextField.parentHandlesPadding = true;
- overTextField.parentHandlesPadding = true;
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
- if (textModel.text !== null)
- text = textModel.text;
- if (textModel.html !== null)
- html = textModel.html;
-
- setupSkins();
-
- IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
- }
-
- protected function setupSkins():void
- {
- setupSkin(overSprite, overTextField, "hover");
- setupSkin(downSprite, downTextField, "active");
- setupSkin(upSprite, upTextField);
- updateHitArea();
- }
-
- private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
- {
- var sw:uint = DisplayObject(_strand).width;
- var sh:uint = DisplayObject(_strand).height;
-
- textField.defaultTextFormat.leftMargin = 0;
- textField.defaultTextFormat.rightMargin = 0;
- // set it again so it gets noticed
- textField.defaultTextFormat = textField.defaultTextFormat;
-
- var borderColor:uint;
- var borderThickness:uint;
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
- if (borderStyles is Array)
- {
- borderColor = CSSUtils.toColor(borderStyles[2]);
- borderStyle = borderStyles[1];
- borderThickness = borderStyles[0];
- }
- else if (borderStyles is String)
- borderStyle = borderStyles as String;
- var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
- if (value != null)
- borderStyle = value as String;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
- if (value != null)
- borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
- if (value != null)
- borderThickness = value as uint;
- if (borderStyle == "none")
- {
- borderStyle = "solid";
- borderThickness = 0;
- }
-
- var borderRadius:String;
- var borderEllipseWidth:Number = NaN;
- var borderEllipseHeight:Number = NaN;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
- if (value != null)
- {
- if (value is Number)
- borderEllipseWidth = 2 * (value as Number);
- else
- {
- borderRadius = value as String;
- var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
- if (arr.length > 1)
- borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
- }
- }
-
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
- var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
- var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
- var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
- var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
- var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
-
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
- var bgColor:uint;
- var bgAlpha:Number = 1;
- if (backgroundColor != null)
- {
- bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
- if (bgColor & 0xFF000000)
- {
- bgAlpha = bgColor >>> 24 / 255;
- bgColor = bgColor & 0xFFFFFF;
- }
- }
- if (borderStyle == "solid")
- {
- var useWidth:Number = Math.max(sw,textField.textWidth);
- var useHeight:Number = Math.max(sh,textField.textHeight);
-
- if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
- useWidth = textField.textWidth+pl+pr+2*borderThickness;
- if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
- useHeight = textField.textHeight+pt+pb+2*borderThickness;
-
- sprite.graphics.clear();
- SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, useWidth, useHeight,
- borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
- borderEllipseWidth, borderEllipseHeight);
- textField.y = ((useHeight - textField.textHeight) / 2) - 2;
- textField.x = ((useWidth - textField.textWidth) / 2) - 2;
- }
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- var useWidth:Number = Math.max(sw,textField.textWidth);
- var useHeight:Number = Math.max(sh,textField.textHeight);
-
- if ((useWidth-2*Number(padding)-2*borderThickness) < textField.textWidth)
- useWidth = textField.textWidth+2*Number(padding)+2*borderThickness;
- if ((useHeight-2*Number(padding)-2*borderThickness) < textField.textHeight)
- useHeight = textField.textHeight+2*Number(padding)+2*borderThickness;
-
- textField.y = (useHeight - textField.height) / 2;
- textField.x = (useWidth - textField.width) / 2;
- updateHitArea();
- });
- }
- var textColor:Object = ValuesManager.valuesImpl.getValue(_strand, "color", state);
- if (textColor) {
- textField.textColor = Number(textColor);
- }
- }
-
- private function textChangeHandler(event:org.apache.flex.events.Event):void
- {
- text = textModel.text;
- }
-
- private function htmlChangeHandler(event:org.apache.flex.events.Event):void
- {
- html = textModel.html;
- }
-
- private function sizeChangeHandler(event:org.apache.flex.events.Event):void
- {
- setupSkins();
- }
-
- private var upTextField:CSSTextField;
- private var downTextField:CSSTextField;
- private var overTextField:CSSTextField;
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
-
- /**
- * The text to be displayed in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return upTextField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- upTextField.text = value;
- downTextField.text = value;
- overTextField.text = value;
- updateHitArea();
- }
-
- private function updateHitArea():void
- {
- var useWidth:uint = Math.max(DisplayObject(_strand).width, upTextField.textWidth);
- var useHeight:uint = Math.max(DisplayObject(_strand).height, upTextField.textHeight);
-
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, useWidth, useHeight);
- shape.graphics.endFill();
-
- }
-
- /**
- * The html-formatted text to be displayed in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return upTextField.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- upTextField.htmlText = value;
- downTextField.htmlText = value;
- overTextField.htmlText = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextToggleButtonView.as
deleted file mode 100644
index 7de01ef..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextToggleButtonView.as
+++ /dev/null
@@ -1,105 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IStyleableObject;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The CSSTextToggleButtonView class is the default view for
- * the org.apache.flex.html.TextToggleButton class.
- * It allows the look of the button to be expressed
- * in CSS via the background-image style and displays
- * a text label. This view does not support right-to-left
- * text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSTextToggleButtonView extends CSSTextButtonView
- {
- /**
- * The suffix appended to the className when selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static const SELECTED:String = "_Selected";
-
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSTextToggleButtonView()
- {
- }
-
- private var toggleButtonModel:IToggleButtonModel;
-
- private var _selected:Boolean;
-
- /**
- * @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;
-
- toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
- toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
- }
-
- private function selectedChangeHandler(event:org.apache.flex.events.Event):void
- {
- var className:String = IStyleableObject(_strand).className;
- if (toggleButtonModel.selected)
- {
- if (className.indexOf(SELECTED) == className.length - SELECTED.length)
- IStyleableObject(_strand).className = className.substring(0, className.length - SELECTED.length);
- setupSkins();
- }
- else
- {
- if (className.indexOf(SELECTED) == -1)
- IStyleableObject(_strand).className += SELECTED;
- setupSkins();
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
deleted file mode 100644
index a04f2bf..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
+++ /dev/null
@@ -1,296 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.events.Event;
-
- /**
- * The CheckBoxView class is the default view for
- * the org.apache.flex.html.CheckBox class.
- * It displays a simple checkbox with an 'x' if checked,
- * and a label on the right. There are no styles or
- * properties to configure the look of the 'x' or the
- * position of the label relative to the checkbox as
- * there are no equivalents in the standard HTML checkbox.
- *
- * A more complex CheckBox could implement more view
- * configuration.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CheckBoxView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CheckBoxView()
- {
- sprites = [ upSprite = new Sprite(),
- downSprite = new Sprite(),
- overSprite = new Sprite(),
- upAndSelectedSprite = new Sprite(),
- downAndSelectedSprite = new Sprite(),
- overAndSelectedSprite = new Sprite() ];
-
- for each( var s:Sprite in sprites )
- {
- var tf:CSSTextField = new CSSTextField();
- tf.type = TextFieldType.DYNAMIC;
- tf.autoSize = TextFieldAutoSize.LEFT;
- tf.name = "textField";
- var icon:Shape = new Shape();
- icon.name = "icon";
- s.addChild(icon);
- s.addChild(tf);
- }
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var upAndSelectedSprite:Sprite;
- private var downAndSelectedSprite:Sprite;
- private var overAndSelectedSprite:Sprite;
-
- private var sprites:Array;
-
- private var _toggleButtonModel:IToggleButtonModel;
-
- // TODO: Can we remove this?
- private function get toggleButtonModel() : IToggleButtonModel
- {
- return _toggleButtonModel;
- }
-
- /**
- * @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;
-
- _toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
- _toggleButtonModel.addEventListener("textChange", textChangeHandler);
- _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
- _toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
- if (_toggleButtonModel.text !== null)
- text = _toggleButtonModel.text;
-
- layoutControl();
-
- var hitArea:Shape = new Shape();
- hitArea.graphics.beginFill(0x000000);
- hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
- hitArea.graphics.endFill();
-
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = hitArea;
-
- if (toggleButtonModel.text !== null)
- text = toggleButtonModel.text;
- if (toggleButtonModel.html !== null)
- html = toggleButtonModel.html;
- }
-
- /**
- * @copy org.apache.flex.html.Label#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- for each( var s:Sprite in sprites )
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.text = value;
- }
-
- layoutControl();
- }
-
- /**
- * @copy org.apache.flex.html.Label#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- for each(var s:Sprite in sprites)
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.htmlText = value;
- }
-
- layoutControl();
- }
-
- private function textChangeHandler(event:Event):void
- {
- text = toggleButtonModel.text;
- }
-
- private function htmlChangeHandler(event:Event):void
- {
- html = toggleButtonModel.html;
- }
-
- private var _selected:Boolean;
-
- /**
- * @copy org.apache.flex.core.IToggleButtonModel#selected
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selected():Boolean
- {
- return _selected;
- }
-
- /**
- * @private
- */
- public function set selected(value:Boolean):void
- {
- _selected = value;
-
- layoutControl();
-
- if( value ) {
- SimpleButton(_strand).upState = upAndSelectedSprite;
- SimpleButton(_strand).downState = downAndSelectedSprite;
- SimpleButton(_strand).overState = overAndSelectedSprite;
-
- } else {
- SimpleButton(_strand).upState = upSprite;
- SimpleButton(_strand).downState = downSprite;
- SimpleButton(_strand).overState = overSprite;
- }
- }
-
- private function selectedChangeHandler(event:Event):void
- {
- selected = toggleButtonModel.selected;
- }
-
- /**
- * Display the icon and text label
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function layoutControl() : void
- {
- for each(var s:Sprite in sprites)
- {
- var icon:Shape = s.getChildByName("icon") as Shape;
- var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
-
- drawCheckBox(icon);
-
- var mh:Number = Math.max(icon.height,tf.height);
-
- icon.x = 0;
- icon.y = (mh - icon.height)/2;
-
- tf.x = icon.x + icon.width + 1;
- tf.y = (mh - tf.height)/2;
- }
-
- }
-
- /**
- * Draw the checkbox
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function drawCheckBox(icon:Shape) : void
- {
- icon.graphics.clear();
- icon.graphics.beginFill(0xf8f8f8);
- icon.graphics.lineStyle(1,0x808080);
- icon.graphics.drawRect(0,0,10,10);
- icon.graphics.endFill();
-
- if( _toggleButtonModel.selected ) {
- icon.graphics.lineStyle(2,0);
- icon.graphics.moveTo(3,4);
- icon.graphics.lineTo(5,7);
- icon.graphics.lineTo(9,0);
- }
- }
- }
-}
[15/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageAndTextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageAndTextModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageAndTextModel.as
deleted file mode 100644
index 01dd3e9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageAndTextModel.as
+++ /dev/null
@@ -1,77 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The ImageAndTextModel class is associates and image
- * with some text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageAndTextModel extends TextModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageAndTextModel()
- {
- }
-
-
- private var _image:String;
-
- /**
- * The URL of an icon to use in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get image():String
- {
- return _image;
- }
-
- /**
- * @private
- */
- public function set image(value:String):void
- {
- _image = value;
- dispatchEvent(new Event("imageChange"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageModel.as
deleted file mode 100644
index 7742c2b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ImageModel.as
+++ /dev/null
@@ -1,89 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IImageModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The ImageModel class bead defines the data associated with an org.apache.flex.html.Image
- * component, namely the source of the image.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageModel extends EventDispatcher implements IImageModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageModel()
- {
- super();
- }
-
- 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 _source:String;
-
- /**
- * The source of the image.
- *
- * @copy org.apache.flex.core.IImageModel#source
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get source():String
- {
- return _source;
- }
- public function set source(value:String):void
- {
- if (value != _source) {
- _source = value;
- dispatchEvent( new Event("urlChanged") );
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ListPresentationModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ListPresentationModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ListPresentationModel.as
deleted file mode 100644
index 897d8d6..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ListPresentationModel.as
+++ /dev/null
@@ -1,107 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IListPresentationModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The ListPresentationModel holds values used by list controls for presenting
- * their user interfaces.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ListPresentationModel extends EventDispatcher implements IListPresentationModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ListPresentationModel()
- {
- super();
- }
-
- private var _rowHeight:Number = 30;
-
- /**
- * The height of each row.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rowHeight():Number
- {
- return _rowHeight;
- }
-
- public function set rowHeight(value:Number):void
- {
- _rowHeight = value;
- dispatchEvent(new Event("rowHeightChanged"));
- }
-
- private var _separatorThickness:Number = 0;
-
- /**
- * The distance between rows.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get separatorThickness():Number
- {
- return _separatorThickness;
- }
-
- public function set separatorThickness(value:Number):void
- {
- _separatorThickness = value;
- dispatchEvent(new Event("separatorThicknessChanged"));
- }
-
- 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;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/PanelModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/PanelModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/PanelModel.as
deleted file mode 100644
index 5741fdd..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/PanelModel.as
+++ /dev/null
@@ -1,158 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IPanelModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The PanelModel bead class holds the values for a org.apache.flex.html.Panel, such as its
- * title.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class PanelModel extends EventDispatcher implements IBead, IPanelModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function PanelModel()
- {
- super();
- }
-
- 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 _controlBar:Array;
-
- /**
- * The items in the org.apache.flex.html.ControlBar. Setting this property automatically
- * causes the ControlBar to display if you are using a View bead that supports it.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get controlBar():Array
- {
- return _controlBar;
- }
- public function set controlBar(value:Array):void
- {
- _controlBar = value;
- }
-
- private var _title:String;
-
- /**
- * The title string for the org.apache.flex.html.Panel.
- *
- * @copy org.apache.flex.core.ITitleBarModel#title
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return _title;
- }
- public function set title(value:String):void
- {
- if( value != _title ) {
- _title = value;
- dispatchEvent( new Event('titleChange') );
- }
- }
-
- private var _htmlTitle:String;
-
- /**
- * The HTML string for the title.
- *
- * @copy org.apache.flex.core.ITitleBarModel#htmlTitle
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return _htmlTitle;
- }
- public function set htmlTitle(value:String):void
- {
- if( value != _htmlTitle ) {
- _htmlTitle = value;
- dispatchEvent( new Event('htmlTitleChange') );
- }
- }
-
- private var _showCloseButton:Boolean = false;
-
- /**
- * Indicates whether or not there is a Close button for the org.apache.flex.html.Panel.
- *
- * @copy org.apache.flex.core.ITitleBarModel#showCloseButton
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get showCloseButton():Boolean
- {
- return _showCloseButton;
- }
- public function set showCloseButton(value:Boolean):void
- {
- if( value != _showCloseButton ) {
- _showCloseButton = value;
- dispatchEvent( new Event('showCloseButtonChange') );
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/RangeModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/RangeModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/RangeModel.as
deleted file mode 100644
index 5e46e41..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/RangeModel.as
+++ /dev/null
@@ -1,222 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IRangeModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The RangeModel class bead defines a set of for a numeric range of values
- * which includes a minimum, maximum, and current value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class RangeModel extends EventDispatcher implements IBead, IRangeModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function RangeModel()
- {
- }
-
- 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 _maximum:Number = 100;
-
- /**
- * The maximum value for the range (defaults to 100).
- *
- * @copy org.apache.flex.core.IRangeModel#maximum
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maximum():Number
- {
- return _maximum;
- }
-
- public function set maximum(value:Number):void
- {
- if (value != _maximum)
- {
- _maximum = value;
- dispatchEvent(new Event("maximumChange"));
- }
- }
-
- private var _minimum:Number = 0;
-
- /**
- * The minimum value for the range (defaults to 0).
- *
- * @copy org.apache.flex.core.IRangeModel#minimum
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get minimum():Number
- {
- return _minimum;
- }
-
- public function set minimum(value:Number):void
- {
- if (value != _minimum)
- {
- _minimum = value;
- dispatchEvent(new Event("minimumChange"));
- }
- }
-
- private var _snapInterval:Number = 1;
-
- /**
- * The modulus value for the range.
- *
- * @copy org.apache.flex.core.IRangeModel#snapInterval
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get snapInterval():Number
- {
- return _snapInterval;
- }
-
- public function set snapInterval(value:Number):void
- {
- if (value != _snapInterval)
- {
- _snapInterval = value;
- dispatchEvent(new Event("snapIntervalChange"));
- }
- }
-
- private var _stepSize:Number = 1;
-
- /**
- * The amount to adjust the value either up or down toward the edge of the range.
- *
- * @copy org.apache.flex.core.IRangeModel#stepSize
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get stepSize():Number
- {
- return _stepSize;
- }
-
- public function set stepSize(value:Number):void
- {
- if (value != _stepSize)
- {
- _stepSize = value;
- dispatchEvent(new Event("stepSizeChange"));
- }
- }
-
- private var _value:Number = 0;
-
- /**
- * The current value of the range, between the minimum and maximum values. Attempting
- * to set the value outside of the minimum-maximum range changes the value to still be
- * within the range. Note that the value is adjusted by the stepSize.
- *
- * @copy org.apache.flex.core.IRangeModel#value
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Number
- {
- return _value;
- }
-
- public function set value(newValue:Number):void
- {
- if (newValue != _value)
- {
- // value must lie within the boundaries of minimum & maximum
- // and be on a step interval, so the value is adjusted to
- // what is coming in.
- newValue = Math.max(minimum, newValue - stepSize);
- newValue = Math.min(maximum, newValue + stepSize);
- _value = snap(newValue);
- dispatchEvent(new Event("valueChange"));
- }
- }
-
- /**
- * @private
- */
- protected function snap(value:Number):Number
- {
- var si:Number = snapInterval;
- var n:Number = Math.round((value - minimum) / si) * si + minimum;
- if (value > 0)
- {
- if (value - n < n + si - value)
- return n;
- return n + si;
-
- }
- if (value - n > n + si - value)
- return n + si;
- return n;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ScrollBarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ScrollBarModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ScrollBarModel.as
deleted file mode 100644
index 582df91..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ScrollBarModel.as
+++ /dev/null
@@ -1,98 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
-
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.events.Event;
-
- /**
- * The ScrollBarModel class bead extends the org.apache.flex.html.beads.models.RangeModel
- * and adds page size and page step sizes.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ScrollBarModel extends RangeModel implements IScrollBarModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ScrollBarModel()
- {
- }
-
- private var _pageSize:Number;
-
- /**
- * The amount represented by the thumb control of the org.apache.flex.html.ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get pageSize():Number
- {
- return _pageSize;
- }
-
- public function set pageSize(value:Number):void
- {
- if (value != _pageSize)
- {
- _pageSize = value;
- dispatchEvent(new Event("pageSizeChange"));
- }
- }
-
- private var _pageStepSize:Number;
-
- /**
- * The amount to adjust the org.apache.flex.html.ScrollBar if the scroll bar's
- * track area is selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get pageStepSize():Number
- {
- return _pageStepSize;
- }
-
- public function set pageStepSize(value:Number):void
- {
- if (value != _pageStepSize)
- {
- _pageStepSize = value;
- dispatchEvent(new Event("pageStepSizeChange"));
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/SingleLineBorderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/SingleLineBorderModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/SingleLineBorderModel.as
deleted file mode 100644
index 99c3a0d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/SingleLineBorderModel.as
+++ /dev/null
@@ -1,85 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import flash.geom.Rectangle;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBorderModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The SingleLineBorderModel class is a data model for
- * a single line border. This model is very simple,
- * it only stores the offsets from the edges of the
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SingleLineBorderModel extends EventDispatcher implements IBead, IBorderModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SingleLineBorderModel()
- {
- }
-
- 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;
- }
-
- static private var rect:Rectangle = new Rectangle(1, 1, 1, 1);
-
- /**
- * The offsets of the border from the edges of the
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get offsets():Rectangle
- {
- return rect;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/StringSelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/StringSelectionModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/StringSelectionModel.as
deleted file mode 100644
index be3d7c8..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/StringSelectionModel.as
+++ /dev/null
@@ -1,221 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
-
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The StringSelectionModel class is a selection model for
- * selecting a single string from a vector of strings.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class StringSelectionModel extends EventDispatcher implements ISelectionModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function StringSelectionModel()
- {
- }
-
- 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 _strings:Vector.<String>;
-
- /**
- * The vector of strings. This is the same
- * as the dataProvider property but is
- * strongly typed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get strings():Vector.<String>
- {
- return _strings;
- }
-
- /**
- * @private
- */
- public function set strings(value:Vector.<String>):void
- {
- _strings = value;
- dispatchEvent(new Event("dataProviderChanged"));
- }
-
- /**
- * The dataProvider, which is a
- * Vector.<String>.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return _strings;
- }
-
- /**
- * @private
- */
- public function set dataProvider(value:Object):void
- {
- _strings = value as Vector.<String>;
- dispatchEvent(new Event("dataProviderChanged"));
- }
-
- private var _selectedIndex:int = -1;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return _selectedIndex;
- }
-
- /**
- * @private
- */
- public function set selectedIndex(value:int):void
- {
- _selectedIndex = value;
- _selectedString = (value == -1) ? null : (value < _strings.length) ? _strings[value] : null;
- dispatchEvent(new Event("selectedIndexChanged"));
- }
- private var _selectedString:String;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedItem
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return _selectedString;
- }
-
- /**
- * @private
- */
- public function set selectedItem(value:Object):void
- {
- selectedString = String(value);
- }
-
- /**
- * The selected string. This is the same as the
- * selectedItem, but is strongly-typed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedString():String
- {
- return _selectedString;
- }
-
- /**
- * @private
- */
- public function set selectedString(value:String):void
- {
- _selectedString = value;
- var n:int = _strings.length;
- for (var i:int = 0; i < n; i++)
- {
- if (_strings[i] == value)
- {
- _selectedIndex = i;
- break;
- }
- }
- dispatchEvent(new Event("selectedItemChanged"));
- }
-
-
- private var _labelField:String;
-
- /**
- * The labelField, which is not used in this
- * implementation.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get labelField():String
- {
- return _labelField;
- }
-
- /**
- * @private
- */
- public function set labelField(value:String):void
- {
- if (value != _labelField) {
- _labelField = value;
- dispatchEvent(new Event("labelFieldChanged"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TextModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TextModel.as
deleted file mode 100644
index eaf2cf4..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TextModel.as
+++ /dev/null
@@ -1,125 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The TextModel class is most basic data model for a
- * component that displays text. All FlexJS components
- * that display text should also support HTML, although
- * the Flash Player implementations may only support
- * a subset of HTML.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextModel extends EventDispatcher implements IBead, ITextModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextModel()
- {
- }
-
- 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 _text:String;
-
- /**
- * @copy org.apache.flex.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return _text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- if (value == null)
- value = "";
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
- }
-
- private var _html:String;
-
- /**
- * @copy org.apache.flex.core.ITextModel#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return _html;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- if (value != _html)
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TitleBarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TitleBarModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TitleBarModel.as
deleted file mode 100644
index d9f6ff2..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/TitleBarModel.as
+++ /dev/null
@@ -1,136 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITitleBarModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The TitleBarModel class bead holds the values for the org.apache.flex.html.TitleBar's
- * properties.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TitleBarModel extends EventDispatcher implements IBead, ITitleBarModel
- {
- public function TitleBarModel()
- {
- super();
- }
-
- 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 _title:String;
-
- [Bindable("titleChange")]
- /**
- * The string title for the org.apache.flex.html.TitleBar.
- *
- * @copy org.apache.flex.core.ITitleBarModel#title
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return _title;
- }
-
- public function set title(value:String):void
- {
- if( value != _title ) {
- _title = value;
- dispatchEvent( new Event('titleChange') );
- }
- }
-
- private var _htmlTitle:String;
-
- [Bindable("htmlTitleChange")]
- /**
- * The HTML string for the title.
- *
- * @copy org.apache.flex.core.ITitleBarModel#htmlTitle
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return _htmlTitle;
- }
-
- public function set htmlTitle(value:String):void
- {
- if( value != _htmlTitle ) {
- _htmlTitle = value;
- dispatchEvent( new Event('htmlTitleChange') );
- }
- }
-
- private var _showCloseButton:Boolean = false;
-
- [Bindable("showCloseButtonChange")]
- /**
- * Whether or not to show a close button.
- *
- * @copy org.apache.flex.core.ITitleBarModel#showCloseButton
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get showCloseButton():Boolean
- {
- return _showCloseButton;
- }
-
- public function set showCloseButton(value:Boolean):void
- {
- if( value != _showCloseButton ) {
- _showCloseButton = value;
- dispatchEvent( new Event('showCloseButtonChange') );
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ToggleButtonModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ToggleButtonModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ToggleButtonModel.as
deleted file mode 100644
index a4c1a91..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ToggleButtonModel.as
+++ /dev/null
@@ -1,145 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The ToggleButtonModel class bead holds values for org.apache.flex.html.Buttons
- * that have a state.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ToggleButtonModel extends EventDispatcher implements IBead, IToggleButtonModel, ITextModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ToggleButtonModel()
- {
- super();
- }
-
- 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 _text:String;
-
- /**
- * The text string for the org.apache.flex.html.Button's label.
- *
- * @copy org.apache.flex.core.IToggleButtonModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return _text;
- }
-
- public function set text(value:String):void
- {
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
- }
-
- private var _html:String;
-
- /**
- * The HTML string for the Button's label.
- *
- * @copy org.apache.flex.core.IToggleButtonModel#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return _html;
- }
-
- public function set html(value:String):void
- {
- if( value != html )
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
- }
-
- private var _selected:Boolean;
-
- /**
- * Whether or not the org.apache.flex.html.Button is selected.
- *
- * @copy org.apache.flex.core.IToggleButtonModel#selected
- *
- * @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
- {
- if( value != _selected )
- {
- _selected = value;
- dispatchEvent(new Event("selectedChange"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ValueToggleButtonModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
deleted file mode 100644
index 27b0a95..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
+++ /dev/null
@@ -1,123 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
-
- import org.apache.flex.core.IValueToggleButtonModel;
- import org.apache.flex.events.Event;
-
- /**
- * The ValueToggleButtonModel class bead extends the
- * org.apache.flex.html.beads.models.ToggleButtonModel and adds
- * value intended to represent a collection of similar org.apache.flex.html.Buttons
- * such as org.apache.flex.html.RadioButtons.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ValueToggleButtonModel extends ToggleButtonModel implements IValueToggleButtonModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ValueToggleButtonModel()
- {
- super();
- }
-
- private var _value:Object;
-
- /**
- * The current value of the button collection.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Object
- {
- return _value;
- }
-
- public function set value(newValue:Object):void
- {
- if( newValue != _value )
- {
- _value = newValue;
- dispatchEvent(new Event("valueChange"));
- }
- }
-
- private var _groupName:String;
-
- /**
- * The name of the collection has shared by all of the buttons in the collection.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get groupName():String
- {
- return _groupName;
- }
-
- public function set groupName(value:String):void
- {
- if( value != _groupName )
- {
- _groupName = value;
- dispatchEvent(new Event("groupNameChange"));
- }
- }
-
- private var _selectedValue:Object;
-
- /**
- * The value that is currently selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedValue():Object
- {
- return _selectedValue;
- }
-
- public function set selectedValue(newValue:Object):void
- {
- if( _selectedValue != newValue )
- {
- _selectedValue = newValue;
- dispatchEvent(new Event("selectedValueChange"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ViewportModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ViewportModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ViewportModel.as
deleted file mode 100644
index c15c5d8..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ViewportModel.as
+++ /dev/null
@@ -1,72 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.IViewportModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.geom.Rectangle;
-
- /**
- * @copy org.apache.flex.core.IViewportModel
- */
- public class ViewportModel extends EventDispatcher implements IViewportModel
- {
- public function ViewportModel()
- {
- super();
- }
-
- private var _borderMetrics:Rectangle;
- private var _chromeMetrics:Rectangle;
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.IViewportModel
- */
- public function get borderMetrics():Rectangle
- {
- return _borderMetrics;
- }
- public function set borderMetrics(value:Rectangle):void
- {
- _borderMetrics = value;
- }
-
- /**
- * @copy org.apache.flex.core.IViewportModel
- */
- public function get chromeMetrics():Rectangle
- {
- return _chromeMetrics;
- }
- public function set chromeMetrics(value:Rectangle):void
- {
- _chromeMetrics = value;
- }
-
- public function set strand(value:IStrand):void
- {
- _strand = value;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Border.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Border.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Border.as
deleted file mode 100644
index f7277d0..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Border.as
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.UIBase;
-
- /**
- * The Border class is a class used internally by many
- * controls to draw a border. The border actually drawn
- * is dictated by the IBeadView in the CSS.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Border extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Border()
- {
- super();
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
deleted file mode 100644
index 64a9e43..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
+++ /dev/null
@@ -1,137 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.IItemRenderer;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.html.beads.ITextItemRenderer;
-
- /**
- * The ButtonBarButtonItemRenderer class handles the display of each item for the
- * org.apache.flex.html.ButtonBar component. This class uses a
- * org.apache.flex.html.Button to represent the data.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ButtonBarButtonItemRenderer extends UIItemRendererBase implements ITextItemRenderer
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ButtonBarButtonItemRenderer()
- {
- super();
- }
-
- private var textButton:TextButton;
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
- }
-
- /**
- * @private
- */
- private function handleClickEvent(event:Event):void
- {
- var parent:Object = itemRendererParent;
- (parent as UIBase).dispatchEvent(new Event("selected", this));
- }
-
- /**
- * The string version of the data associated with the instance of the itemRenderer.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return data as String;
- }
- public function set text(value:String):void
- {
- data = value;
- }
-
- /**
- * The data to be displayed by the itemRenderer instance. For ButtonBarItemRenderer, the
- * data's string version is used as the label for the Button.
- *
- * @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 added:Boolean = false;
- if (textButton == null) {
- textButton = new TextButton();
- textButton.addEventListener('click',handleClickEvent);
- added = true;
- }
-
- var valueAsString:String;
-
- if (value is String) {
- valueAsString = value as String;
- }
- else if (value.hasOwnProperty("label")) {
- valueAsString = String(value["label"]);
- }
- else if (value.hasOwnProperty("title")) {
- valueAsString = String(value["title"]);
- }
-
- if (valueAsString) textButton.text = valueAsString;
-
- if (added) addElement(textButton);
- }
-
- /**
- * @private
- */
- override public function adjustSize():void
- {
- textButton.width = this.width;
- textButton.height = this.height;
-
- updateRenderer();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
deleted file mode 100644
index bd0c016..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ContainerContentArea.as
+++ /dev/null
@@ -1,80 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.IContentView;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
-
- /**
- * The ContainerContentArea class implements the contentView for
- * a Container. Container's don't always parent their children directly as
- * that makes it harder to handle scrolling.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ContainerContentArea extends UIBase implements IContentView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ContainerContentArea()
- {
- super();
- addEventListener("layoutNeeded", forwardEventHandler);
- }
-
- private function forwardEventHandler(event:Event):void
- {
- if (parent)
- parent.dispatchEvent(event);
- }
-
- /**
- * @copy org.apache.flex.core.IItemRendererParent#removeAllElements()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function removeAllElements():void
- {
- COMPILE::AS3
- {
- removeChildren(0);
- }
- COMPILE::JS
- {
- while (element.hasChildNodes())
- {
- element.removeChild(element.lastChild);
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
deleted file mode 100644
index 24e16fd..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGridColumn.as
+++ /dev/null
@@ -1,127 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.IFactory;
-
- /**
- * The DataGridColumn class is the collection of properties that describe
- * a column of the org.apache.flex.html.DataGrid: which renderer
- * to use for each cell in the column, the width of the column, the label for the
- * column, and the name of the field in the data containing the value to display
- * in the column.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridColumn
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridColumn()
- {
- }
-
- private var _itemRenderer:IFactory;
-
- /**
- * The itemRenderer class or factory to use to make instances of itemRenderers for
- * display of data.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRenderer():IFactory
- {
- return _itemRenderer;
- }
- public function set itemRenderer(value:IFactory):void
- {
- _itemRenderer = value;
- }
-
- private var _columnWidth:Number = Number.NaN;
-
- /**
- * The width of the column (default is 100 pixels).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get columnWidth():Number
- {
- return _columnWidth;
- }
- public function set columnWidth(value:Number):void
- {
- _columnWidth = value;
- }
-
- private var _label:String;
-
- /**
- * The label for the column (appears in the header area).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get label():String
- {
- return _label;
- }
- public function set label(value:String):void
- {
- _label = value;
- }
-
- private var _dataField:String;
-
- /**
- * The name of the field containing the data value presented by the column. This value is used
- * by the itemRenderer is select the property from the data.
- *
- * @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;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGroup.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGroup.as
deleted file mode 100644
index c156a6f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataGroup.as
+++ /dev/null
@@ -1,151 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.Event;
-
- /**
- * 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 dispatcher:IEventDispatcher = c as IEventDispatcher;
- dispatcher.addEventListener("itemRendererRollOver", handleRollOver);
- dispatcher.addEventListener("itemRendererRollOut", handleRollOut);
- }
-
- /**
- * @private
- */
- override public function removeElement(c:Object, dispatchEvent:Boolean = true):void
- {
- var dispatcher:IEventDispatcher = c as IEventDispatcher;
- dispatcher.removeEventListener("itemRendererRollOver", handleRollOver);
- dispatcher.removeEventListener("itemRendererRollOut", handleRollOut);
-
- super.removeElement(c, dispatchEvent);
- }
-
- /**
- * @private
- */
- private function handleRollOver(event:Event):void
- {
- var strand:IStrand = parent as IStrand;
- var rollModel:IRollOverModel = strand.getBeadByType(IRollOverModel) as IRollOverModel;
- if (rollModel) {
- var n:int = numElements;
- for (var i:int=0; i < n; i++) {
- var renderer:Object = getElementAt(i);
- if (renderer == event.currentTarget) {
- rollModel.rollOverIndex = i;
- break;
- }
- }
- }
- }
-
- /**
- * @private
- */
- private function handleRollOut(event:Event):void
- {
- var strand:IStrand = parent as IStrand;
- var rollModel:IRollOverModel = strand.getBeadByType(IRollOverModel) as IRollOverModel;
- if (rollModel) {
- var n:int = numElements;
- for (var i:int=0; i < n; i++) {
- var renderer:Object = getElementAt(i);
- if (renderer == event.currentTarget) {
- rollModel.rollOverIndex = -1;
- break;
- }
- }
- }
- }
-
- /**
- * @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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataItemRenderer.as
deleted file mode 100644
index ac15dcf..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DataItemRenderer.as
+++ /dev/null
@@ -1,178 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- COMPILE::AS3
- {
- import flash.display.Sprite;
- }
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.html.beads.controllers.ItemRendererMouseController;
- }
-
- /**
- * 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::AS3
- private var background:Sprite;
-
- COMPILE::JS
- private var controller:ItemRendererMouseController;
-
- /**
- * @private
- */
- COMPILE::AS3
- override public function addedToParent():void
- {
- super.addedToParent();
-
- background = new Sprite();
- addChild(background);
- }
-
- /**
- * @private
- */
- override public function updateRenderer():void
- {
- COMPILE::AS3
- {
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
deleted file mode 100644
index 2d80b2f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DateChooserButton.as
+++ /dev/null
@@ -1,67 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
deleted file mode 100644
index 6bc1d43..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
+++ /dev/null
@@ -1,63 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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();
- }
- }
-}
[21/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateFieldView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateFieldView.as
deleted file mode 100644
index f709a1f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateFieldView.as
+++ /dev/null
@@ -1,192 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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.utils.PointUtils;
- import org.apache.flex.geom.Point;
- 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;
- }
-
- var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
- _popUp.selectedDate = model.selectedDate;
-
- var host:IPopUpHost = UIUtils.findPopUpHost(UIBase(_strand));
- var point:Point = new Point(_button.x, _button.y+_button.height);
- var p2:Point = PointUtils.localToGlobal(point, _strand);
- var p3:Point = PointUtils.globalToLocal(p2, host);
- _popUp.x = p3.x;
- _popUp.y = p3.y;
-
- host.addElement(_popUp);
- }
- else
- {
- UIUtils.removePopUp(_popUp);
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
deleted file mode 100644
index c68a633..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
+++ /dev/null
@@ -1,111 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.events.Event;
-
- /**
- * The DownArrowButtonView class is the view for
- * the down arrow button in a ScrollBar and other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DownArrowButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DownArrowButtonView()
- {
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.lineStyle(1);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
- g.endFill();
- g.lineStyle(0);
- g.beginFill(0);
- g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
- g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.QuarterSize);
- g.lineTo(ScrollBarView.HalfSize, ScrollBarView.ThreeQuarterSize);
- g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
-
- SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
- SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- private function sizeChangeHandler(event:Event):void
- {
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
deleted file mode 100644
index 1334227..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
+++ /dev/null
@@ -1,300 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.DisplayObjectContainer;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IPopUpHost;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.SolidBorderUtil;
-
- /**
- * The DropDownListView class is the default view for
- * the org.apache.flex.html.DropDownList class.
- * It displays a simple text label with what appears to be a
- * down arrow button on the right, but really, the entire
- * view is the button that will display or dismiss the dropdown.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DropDownListView extends BeadViewBase implements IDropDownListView, IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DropDownListView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- upTextField = new CSSTextField();
- downTextField = new CSSTextField();
- overTextField = new CSSTextField();
- upSprite.addChild(upTextField);
- overSprite.addChild(overTextField);
- downSprite.addChild(downTextField);
- upTextField.parentDrawsBackground = true;
- downTextField.parentDrawsBackground = true;
- overTextField.parentDrawsBackground = true;
- upTextField.selectable = false;
- upTextField.type = TextFieldType.DYNAMIC;
- downTextField.selectable = false;
- downTextField.type = TextFieldType.DYNAMIC;
- overTextField.selectable = false;
- overTextField.type = TextFieldType.DYNAMIC;
- // auto-size collapses if no text
- //upTextField.autoSize = "left";
- //downTextField.autoSize = "left";
- //overTextField.autoSize = "left";
-
- upArrows = new Shape();
- overArrows = new Shape();
- downArrows = new Shape();
- upSprite.addChild(upArrows);
- overSprite.addChild(overArrows);
- downSprite.addChild(downArrows);
- drawArrows(upArrows);
- drawArrows(overArrows);
- drawArrows(downArrows);
-
- }
-
-
- private var selectionModel:ISelectionModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;;
- selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
- selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
- selectionModel.addEventListener("dataProviderChanged", selectionChangeHandler);
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
- if (selectionModel.selectedIndex !== -1)
- text = selectionModel.selectedItem.toString();
- else
- text = "^W_";
- upTextField.height = upTextField.textHeight + 4;
- downTextField.height = downTextField.textHeight + 4;
- overTextField.height = overTextField.textHeight + 4;
- if (selectionModel.selectedIndex == -1)
- text = "";
-
- IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
- IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
- changeHandler(null);
- }
-
- private function selectionChangeHandler(event:Event):void
- {
- if (selectionModel.selectedItem == null)
- text = "";
- else if (selectionModel.labelField != null)
- text = selectionModel.selectedItem[selectionModel.labelField].toString();
- else
- text = selectionModel.selectedItem.toString();
- }
-
- private function changeHandler(event:Event):void
- {
- var ww:Number = DisplayObject(_strand).width;
- var hh:Number = DisplayObject(_strand).height;
-
- upArrows.x = ww - upArrows.width - 6;
- overArrows.x = ww - overArrows.width - 6;
- downArrows.x = ww - downArrows.width - 6;
- upArrows.y = (hh - upArrows.height) / 2;
- overArrows.y = (hh - overArrows.height) / 2;
- downArrows.y = (hh - downArrows.height) / 2;
-
- upTextField.width = upArrows.x;
- downTextField.width = downArrows.x;
- overTextField.width = overArrows.x;
- upTextField.height = hh;
- downTextField.height = hh;
- overTextField.height = hh;
-
- drawBorder(upSprite, 0xf8f8f8, ww, hh);
- drawBorder(overSprite, 0xe8e8e8, ww, hh);
- drawBorder(downSprite, 0xd8d8d8, ww, hh);
-
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ww, hh);
- shape.graphics.endFill();
- }
-
- private var upTextField:CSSTextField;
- private var downTextField:CSSTextField;
- private var overTextField:CSSTextField;
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var upArrows:Shape;
- private var downArrows:Shape;
- private var overArrows:Shape;
-
- private function drawBorder(sprite:Sprite, color:uint, ww:Number, hh:Number):void
- {
- SolidBorderUtil.drawBorder(sprite.graphics, 0, 0,
- ww, hh,
- 0x808080, color, 1, 1, 4);
- }
-
- private function drawArrows(shape:Shape):void
- {
- var g:Graphics = shape.graphics;
- g.beginFill(0);
- g.moveTo(8, 0);
- g.lineTo(12, 4);
- g.lineTo(4, 4);
- g.lineTo(8, 0);
- g.endFill();
- g.beginFill(0);
- g.moveTo(8, 10);
- g.lineTo(12, 6);
- g.lineTo(4, 6);
- g.lineTo(8, 10);
- g.endFill();
- }
-
- /**
- * The text that is displayed in the view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return upTextField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- var ww:Number = DisplayObject(_strand).width;
- var hh:Number = DisplayObject(_strand).height;
- upTextField.text = value;
- downTextField.text = value;
- overTextField.text = value;
- }
-
- private var _popUp:IStrand;
-
- /**
- * The dropdown/popup that displays the set of choices.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get popUp():IStrand
- {
- if (!_popUp)
- {
- var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
- _popUp = new popUpClass() as IStrand;
- }
- return _popUp;
- }
-
- private var _popUpVisible:Boolean;
-
- /**
- * A flag that indicates whether the dropdown/popup is
- * visible.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get popUpVisible():Boolean
- {
- return _popUpVisible;
- }
-
- /**
- * @private
- */
- public function set popUpVisible(value:Boolean):void
- {
- if (value != _popUpVisible)
- {
- _popUpVisible = value;
- if (value)
- {
- var root:Object = DisplayObject(_strand).root;
- var host:DisplayObjectContainer = DisplayObject(_strand).parent;
- while (host && !(host is IPopUpHost))
- host = host.parent;
- if (host)
- IPopUpHost(host).addElement(popUp);
- }
- else
- {
- DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
- }
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HRuleView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HRuleView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HRuleView.as
deleted file mode 100644
index 3c7e092..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HRuleView.as
+++ /dev/null
@@ -1,87 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Bitmap;
- import flash.display.Loader;
- import flash.display.LoaderInfo;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IImageModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HRuleView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HRuleView()
- {
- }
-
- /**
- * @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(_strand).addEventListener("widthChanged",handleSizeChange);
- IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
- IEventDispatcher(_strand).addEventListener("sizeChanged",handleSizeChange);
-
- handleSizeChange(null);
- }
-
- /**
- * @private
- */
- private function handleSizeChange(event:Object):void
- {
- var ui:UIBase = _strand as UIBase;
- ui.graphics.clear();
- ui.graphics.beginFill(0);
- ui.graphics.drawRect(0, 0, ui.width, 1);
- ui.graphics.endFill();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
deleted file mode 100644
index 05a41b6..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarThumbView.as
+++ /dev/null
@@ -1,120 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.supportClasses.ScrollBar;
-
- /**
- * The HScrollBarThumbView class is the view for
- * the thumb button in a Horizontal ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HScrollBarThumbView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HScrollBarThumbView()
- {
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- var ww:Number = DisplayObject(_strand).width;
- g.clear();
- g.lineStyle(1);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ww, ScrollBarView.FullSize, ScrollBarView.HalfSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xc8c8c8);
- drawView(downView.graphics, 0xc8c8c8);
- drawView(overView.graphics, 0xb8b8b8);
-
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
- IEventDispatcher(_strand).addEventListener("widthChanged", widthChangedHandler);
- }
-
- private function widthChangedHandler(event:Event):void
- {
- DisplayObject(_strand).scaleY = 1.0;
- DisplayObject(_strand).scaleX = 1.0;
-
- var ww:Number = DisplayObject(_strand).width;
- drawView(upView.graphics, 0xc8c8c8);
- drawView(downView.graphics, 0xc8c8c8);
- drawView(overView.graphics, 0xb8b8b8);
-
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ww, ScrollBarView.FullSize);
- shape.graphics.endFill();
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
deleted file mode 100644
index de6a3af..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarTrackView.as
+++ /dev/null
@@ -1,118 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The HScrollBarTrackView class is the view for
- * the track in a Horizontal ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HScrollBarTrackView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HScrollBarTrackView()
- {
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- var w:Number = SimpleButton(_strand).width;
-
- g.clear();
- g.lineStyle(1, 0x808080);
- g.beginFill(bgColor);
- g.drawRect(0, 0, w, ScrollBarView.FullSize);
- g.endFill();
- g.lineStyle(0);
- }
-
- private function widthChangeHandler(event:Event):void
- {
- DisplayObject(_strand).scaleY = 1.0;
- DisplayObject(_strand).scaleX = 1.0;
-
- var w:Number = SimpleButton(_strand).width;
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, w);
- shape.graphics.endFill();
-
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
-
- SimpleButton(value).addEventListener("widthChanged", widthChangeHandler);
- shape = new Shape();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as
deleted file mode 100644
index 68fe11f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/HScrollBarView.as
+++ /dev/null
@@ -1,99 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.Strand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-
- /**
- * The HScrollBarView class is the default view for
- * the org.apache.flex.html.supportClasses.HScrollBar class.
- * It implements the classic desktop-like HScrollBar.
- * A different view would implement more modern scrollbars that hide themselves
- * until hovered over with the mouse.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HScrollBarView extends ScrollBarView implements IBeadView, IStrand, IScrollBarView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HScrollBarView()
- {
- }
-
- /**
- * @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;
-
- UIBase(value).setHeight(ScrollBarView.FullSize, true);
-
- // TODO: (aharui) put in values impl
- _increment = new Button();
- Button(_increment).addBead(new RightArrowButtonView());
- Button(_increment).addBead(new ButtonAutoRepeatController());
- _decrement = new Button();
- Button(_decrement).addBead(new LeftArrowButtonView());
- Button(_decrement).addBead(new ButtonAutoRepeatController());
- _track = new Button();
- Button(_track).addBead(new HScrollBarTrackView());
- _thumb = new Button();
- Button(_thumb).addBead(new HScrollBarThumbView());
-
- UIBase(value).addChild(_decrement);
- UIBase(value).addChild(_increment);
- UIBase(value).addChild(_track);
- UIBase(value).addChild(_thumb);
-
- IEventDispatcher(_strand).addEventListener("widthChanged", changeHandler);
-
- layout.layout();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBackgroundBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBackgroundBead.as
deleted file mode 100644
index 2590a9a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBackgroundBead.as
+++ /dev/null
@@ -1,35 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
-
- /**
- * The IBackgroundBead interface is a marker interface for beads
- * that draw backgrounds.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IBackgroundBead extends IBead
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBorderBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBorderBead.as
deleted file mode 100644
index 3e4fc39..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IBorderBead.as
+++ /dev/null
@@ -1,35 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
-
- /**
- * The IBackgroundBead interface is a marker interface for beads
- * that draw backgrounds.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IBorderBead extends IBead
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IComboBoxView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IComboBoxView.as
deleted file mode 100644
index 650d300..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IComboBoxView.as
+++ /dev/null
@@ -1,78 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
-
- /**
- * The IComboBoxView interface provides the protocol for any bead that
- * creates the visual parts for a org.apache.flex.html.ComboBox control.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IComboBoxView extends IBeadView
- {
- /**
- * The string appearing in the input area for the ComboBox.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get text():String;
- function set text(value:String):void;
-
- /**
- * The HTML string appearing in the input area for the ComboBox.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get html():String;
- function set html(value:String):void;
-
- /**
- * The component housing the selection list.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get popUp():IStrand;
-
- /**
- * Determines whether or not the pop-up with the selection list is visible or not.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get popUpVisible():Boolean;
- function set popUpVisible(value:Boolean):void;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDataGridView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDataGridView.as
deleted file mode 100644
index 8f04d11..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDataGridView.as
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDropDownListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDropDownListView.as
deleted file mode 100644
index 688bcc5..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IDropDownListView.as
+++ /dev/null
@@ -1,57 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
-
- /**
- * The IDropDownListView interface is the interface for views for
- * the org.apache.flex.html.DropDownList.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IDropDownListView extends IBeadView
- {
-
- /**
- * @copy org.apache.flex.html.beads.DropDownListView#popup
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get popUp():IStrand;
-
- /**
- * @copy org.apache.flex.html.beads.DropDownListView#popupVisible
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get popUpVisible():Boolean;
- function set popUpVisible(value:Boolean):void;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IGraphicsDrawing.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IGraphicsDrawing.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IGraphicsDrawing.as
deleted file mode 100644
index 91d1838..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IGraphicsDrawing.as
+++ /dev/null
@@ -1,36 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- /**
- * The IGraphicsDrawing interface is a marker interface for beads
- * that draw into the graphics layer. This helps a bead determine
- * if it is the first of many graphics drawing beads so it can
- * know whether or not to clear the graphics layer before drawing.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IGraphicsDrawing
- {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IListView.as
deleted file mode 100644
index f9159ce..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IListView.as
+++ /dev/null
@@ -1,48 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IStrand;
-
- /**
- * The IListView interface provides the protocol for any bead that
- * creates the visual parts for a org.apache.flex.html.List control.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IListView extends IBeadView
- {
- /**
- * The component which parents all of the itemRenderers for each
- * datum being displayed by the List component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get dataGroup():IItemRendererParent;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IScrollBarView.as
deleted file mode 100644
index c42daa7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/IScrollBarView.as
+++ /dev/null
@@ -1,80 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
-
- /**
- * The IScrollBarView interface is the interface for views for
- * the org.apache.flex.html.supportClasses.ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IScrollBarView
- {
- /**
- * The down arrow button in a vertical ScrollBar or right arrow
- * button in a horizontal ScrollBar
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get increment():DisplayObject;
-
- /**
- * The up arrow button in a vertical ScrollBar or left arrow
- * button in a horizontal ScrollBar
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get decrement():DisplayObject;
-
- /**
- * The track in a ScrollBar
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get track():DisplayObject;
-
- /**
- * The thumb in a ScrollBar
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get thumb():DisplayObject;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISliderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISliderView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISliderView.as
deleted file mode 100644
index 3ad1743..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISliderView.as
+++ /dev/null
@@ -1,60 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- COMPILE::AS3
- {
- import flash.display.DisplayObject;
- }
- import org.apache.flex.core.IBead;
-
- /**
- * The ISliderView interface provides the protocol for any bead that
- * creates the visual parts for a org.apache.flex.html.Slider control.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface ISliderView extends IBead
- {
- /**
- * The component used for the track area of the org.apache.flex.html.Slider.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- function get track():DisplayObject;
-
- /**
- * The component used for the thumb button of the org.apache.flex.html.Slider.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- function get thumb():DisplayObject;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISpinnerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISpinnerView.as
deleted file mode 100644
index eb6adaa..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ISpinnerView.as
+++ /dev/null
@@ -1,61 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- COMPILE::AS3
- {
- import flash.display.DisplayObject;
- }
-
- import org.apache.flex.core.IBead;
-
- /**
- * The ISpinnerView interface provides the protocol for any bead that
- * creates the visual parts for a org.apache.flex.html.Spinner control.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface ISpinnerView extends IBead
- {
- /**
- * The component used to increment the org.apache.flex.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- function get increment():DisplayObject;
-
- /**
- * The component used to decrement the org.apache.flex.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- function get decrement():DisplayObject;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextFieldView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextFieldView.as
deleted file mode 100644
index e94ee34..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextFieldView.as
+++ /dev/null
@@ -1,44 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.CSSTextField;
-
- /**
- * The ITextFieldView interface is the interface for views for
- * the use a CSSTextField to display text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface ITextFieldView
- {
- /**
- * The org.apache.flex.core.CSSTextField used to display text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get textField():CSSTextField;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextItemRenderer.as
deleted file mode 100644
index 0877b05..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ITextItemRenderer.as
+++ /dev/null
@@ -1,45 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.ISelectableItemRenderer;
-
- /**
- * The ITextItemRenderer interface is the interface for
- * for org.apache.flex.core.IItemRenderer that display text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface ITextItemRenderer extends ISelectableItemRenderer
- {
- /**
- * The text to be displayed in the item renderer.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get text():String;
- function set text(value:String):void;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageAndTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageAndTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageAndTextButtonView.as
deleted file mode 100644
index b0ee998..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageAndTextButtonView.as
+++ /dev/null
@@ -1,276 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
- import flash.text.TextField;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IStrandWithModel;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.html.beads.models.ImageAndTextModel;
- import org.apache.flex.utils.SolidBorderUtil;
-
- /**
- * The ImageButtonView class provides an image-only view
- * for the standard Button. Unlike the CSSButtonView, this
- * class does not support background and border; only images
- * for the up, over, and active states.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageAndTextButtonView extends BeadViewBase implements IBeadView, IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageAndTextButtonView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- upTextField = new CSSTextField();
- downTextField = new CSSTextField();
- overTextField = new CSSTextField();
- upTextField.selectable = false;
- upTextField.type = TextFieldType.DYNAMIC;
- downTextField.selectable = false;
- downTextField.type = TextFieldType.DYNAMIC;
- overTextField.selectable = false;
- overTextField.type = TextFieldType.DYNAMIC;
- upTextField.autoSize = "left";
- downTextField.autoSize = "left";
- overTextField.autoSize = "left";
- }
-
- /**
- * @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;
- textModel = IStrandWithModel(value).model as ImageAndTextModel;
- textModel.addEventListener("textChange", textChangeHandler);
- textModel.addEventListener("htmlChange", htmlChangeHandler);
- textModel.addEventListener("imageChange", imageChangeHandler);
-
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
-
- setupBackground(upSprite, upTextField, 0xCCCCCC);
- setupBackground(overSprite, overTextField, 0xFFCCCC, "hover");
- setupBackground(downSprite, downTextField, 0x808080, "active");
- upTextField.styleParent = value;
- downTextField.styleParent = value;
- overTextField.styleParent = value;
-
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var shape:Shape;
-
- private var textModel:ImageAndTextModel;
-
- /**
- * The URL of an icon to use in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get image():String
- {
- return textModel.image;
- }
-
- /**
- * @private
- */
- private function setupBackground(sprite:Sprite, textField:CSSTextField, color:uint, state:String = null):void
- {
- var backgroundImage:Object = image;
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- sprite.addChild(textField);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- var padding:int = 2;
- var borderWidth:int = 1;
- updateHitArea();
- loader.x = padding;
- textField.x = loader.width + padding;
- textField.y = padding;
- loader.y = (textField.height + padding + padding - loader.height) / 2;
- sprite.graphics.clear();
- sprite.graphics.beginFill(color);
- sprite.graphics.drawRect(0, 0, sprite.width, sprite.height);
- sprite.graphics.endFill();
- SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, textField.x + textField.width + padding, textField.height + padding + padding,
- 0x000000, color, borderWidth);
- });
- }
- }
-
- private function textChangeHandler(event:Event):void
- {
- text = textModel.text;
- }
-
- private function htmlChangeHandler(event:Event):void
- {
- html = textModel.html;
- }
-
- private function imageChangeHandler(event:Event):void
- {
- setupBackground(upSprite, upTextField, 0xCCCCCC);
- setupBackground(overSprite, overTextField, 0xFFCCCC, "hover");
- setupBackground(downSprite, downTextField, 0x808080, "active");
- }
-
- /**
- * The CSSTextField in the up state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var upTextField:CSSTextField;
-
- /**
- * The CSSTextField in the down state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var downTextField:CSSTextField;
-
- /**
- * The CSSTextField in the over state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var overTextField:CSSTextField;
-
- /**
- * @copy org.apache.flex.html.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return upTextField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- upTextField.text = value;
- downTextField.text = value;
- overTextField.text = value;
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
- shape.graphics.endFill();
-
- }
-
- /**
- * @copy org.apache.flex.html.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return upTextField.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- upTextField.htmlText = value;
- downTextField.htmlText = value;
- overTextField.htmlText = value;
- }
-
- /**
- * @private
- */
- private function updateHitArea():void
- {
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
- shape.graphics.endFill();
-
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
deleted file mode 100644
index 7e81263..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageButtonView.as
+++ /dev/null
@@ -1,158 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
-COMPILE::AS3 {
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.events.IOErrorEvent;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.UIButtonBase;
-}
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
-
- /**
- * The ImageButtonView class provides an image-only view
- * for the standard Button. Unlike the CSSButtonView, this
- * class does not support background and border; only images
- * for the up, over, and active states.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageButtonView extends BeadViewBase implements IBeadView, IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageButtonView()
- {
- COMPILE::AS3 {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- }
- }
-
- /**
- * @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;
-
- COMPILE::AS3 {
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
-
- setupBackground(upSprite);
- setupBackground(overSprite, "hover");
- setupBackground(downSprite, "active");
- }
- }
-
- COMPILE::AS3 {
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var shape:Shape;
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function setupBackground(sprite:Sprite, state:String = null):void
- {
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
- trace(e);
- e.preventDefault();
- });
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- var host:UIButtonBase = UIButtonBase(_strand);
- if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
- {
- host.setWidth(loader.content.width);
- if (host.parent)
- host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
- }
- else
- loader.content.width = host.width;
-
- if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
- {
- host.setHeight(loader.content.height);
- if (host.parent)
- host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
- }
- else
- loader.content.height = host.height;
- updateHitArea();
- });
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function updateHitArea():void
- {
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
- shape.graphics.endFill();
- }
- }
-}
[24/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/NumericStepper.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/NumericStepper.as
deleted file mode 100644
index 02120e7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/NumericStepper.as
+++ /dev/null
@@ -1,214 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IRangeModel;
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- [Event(name="valueChange", type="org.apache.flex.events.Event")]
-
- /**
- * The NumericStepper class is a component that displays a numeric
- * value and up/down controls (using a org.apache.flex.html.Spinner) to
- * increase and decrease the value by specific amounts. The NumericStepper uses the following beads:
- *
- * org.apache.flex.core.IBeadModel: the data model for the component of type org.apache.flex.core.IRangeModel.
- * org.apache.flex.core.IBeadView: constructs the parts of the component.
- * org.apache.flex.core.IBeadController: handles the input events.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class NumericStepper extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function NumericStepper()
- {
- super();
- }
-
- [Bindable("valueChange")]
- /**
- * The current value of the control.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Number
- {
- return IRangeModel(model).value;
- }
- public function set value(newValue:Number):void
- {
- IRangeModel(model).value = newValue;
- }
-
- /**
- * The minimum value the control will display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get minimum():Number
- {
- return IRangeModel(model).minimum;
- }
- public function set minimum(value:Number):void
- {
- IRangeModel(model).minimum = value;
- }
-
- /**
- * The maximum value the control will display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maximum():Number
- {
- return IRangeModel(model).maximum;
- }
- public function set maximum(value:Number):void
- {
- IRangeModel(model).maximum = value;
- }
-
- /**
- * The amount to increase or descrease the value. The value
- * will not exceed the minimum or maximum value. The final
- * value is affected by the snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get stepSize():Number
- {
- return IRangeModel(model).stepSize;
- }
- public function set stepSize(value:Number):void
- {
- IRangeModel(model).stepSize = value;
- }
-
- /**
- * The modulus for the value. If this property is set,
- * the value displayed with a muliple of the snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get snapInterval():Number
- {
- return IRangeModel(model).snapInterval;
- }
- public function set snapInterval(value:Number):void
- {
- IRangeModel(model).snapInterval = value;
- }
-
- COMPILE::JS
- private var input:TextInput;
-
- COMPILE::JS
- private var spinner:Spinner;
-
- /**
- * @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';
-
- input = new TextInput();
- addElement(input);
- input.positioner.style.display = 'inline-block';
- input.positioner.style.width = '100px';
-
- spinner = new Spinner();
- spinner.positioner.style.display = 'inline-block';
- spinner.positioner.style.height = '24px';
- spinner.positioner.style.marginLeft = '-1px';
- spinner.positioner.style.marginTop = '-1px';
- addElement(spinner);
-
- /* TODO: ajh move to view and css */
- spinner.incrementButton.positioner.style.display = 'block';
- spinner.incrementButton.positioner.style.marginBottom = '-1px';
- spinner.incrementButton.positioner.style.paddingTop = '1.5px';
- spinner.incrementButton.positioner.style.paddingBottom = '2px';
- spinner.incrementButton.positioner.style.fontSize = '7px';
- spinner.decrementButton.positioner.style.marginTop = '0px';
- spinner.decrementButton.positioner.style.display = 'block';
- spinner.decrementButton.positioner.style.paddingTop = '2px';
- spinner.decrementButton.positioner.style.paddingBottom = '1.5px';
- spinner.decrementButton.positioner.style.fontSize = '7px';
- spinner.positioner.style.display = 'inline-block';
- goog.events.listen(spinner, 'valueChange',
- spinnerChange);
-
- element.flexjs_wrapper = this;
- className = 'NumericStepper';
-
- input.text = String(spinner.value);
-
- return element;
- }
-
- /**
- * @param event The input event.
- */
- COMPILE::JS
- private function spinnerChange(event:Event):void
- {
- var newValue:Number = spinner.value;
- value = newValue;
- input.text = String(spinner.value);
- dispatchEvent(new Event('valueChange'));
- };
-
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Panel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Panel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Panel.as
deleted file mode 100644
index e9c5986..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Panel.as
+++ /dev/null
@@ -1,121 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IPanelModel;
-
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- [Event(name="close", type="org.apache.flex.events.Event")]
-
- /**
- * The Panel class is a Container component capable of parenting other
- * components. The Panel has a TitleBar. If you want to a Panel with
- * a ControlBar, use PanelWithControlBar which
- * will instantiate, by default, an ControlBar.
- * The Panel uses the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model for the Panel that includes the title and whether
- * or not to display the close button.
- * org.apache.flex.core.IBeadView: creates the parts of the Panel.
- * org.apache.flex.core.IBorderBead: if present, draws a border around the Panel.
- * org.apache.flex.core.IBackgroundBead: if present, provides a colored background for the Panel.
- *
- * @see PanelWithControlBar
- * @see ControlBar
- * @see TitleBar
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Panel extends Container
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Panel()
- {
- super();
- }
-
- /**
- * The string to display in the org.apache.flex.html.TitleBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return IPanelModel(model).title;
- }
- public function set title(value:String):void
- {
- IPanelModel(model).title = value;
- }
-
- /**
- * The HTML string to display in the org.apache.flex.html.TitleBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return IPanelModel(model).htmlTitle;
- }
- public function set htmlTitle(value:String):void
- {
- IPanelModel(model).htmlTitle = value;
- }
-
- /**
- * Whether or not to show a Close button in the org.apache.flex.html.TitleBar.
- */
- public function get showCloseButton():Boolean
- {
- return IPanelModel(model).showCloseButton;
- }
- public function set showCloseButton(value:Boolean):void
- {
- IPanelModel(model).showCloseButton = value;
- }
-
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- super.createElement();
- element.className = "Panel";
- typeNames = "Panel";
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/PanelWithControlBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/PanelWithControlBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/PanelWithControlBar.as
deleted file mode 100644
index 7659d9d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/PanelWithControlBar.as
+++ /dev/null
@@ -1,121 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IPanelModel;
-
- [Event(name="close", type="org.apache.flex.events.Event")]
-
- /**
- * The Panel class is a Container component capable of parenting other
- * components. The Panel has a TitleBar and an optional org.apache.flex.html.ControlBar.
- * The Panel uses the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model for the Panel that includes the title and whether
- * or not to display the close button.
- * org.apache.flex.core.IBeadView: creates the parts of the Panel.
- * org.apache.flex.core.IBorderBead: if present, draws a border around the Panel.
- * org.apache.flex.core.IBackgroundBead: if present, provides a colored background for the Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class PanelWithControlBar extends Container
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function PanelWithControlBar()
- {
- super();
- }
-
- /**
- * The string to display in the org.apache.flex.html.TitleBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return IPanelModel(model).title;
- }
- public function set title(value:String):void
- {
- IPanelModel(model).title = value;
- }
-
- /**
- * The HTML string to display in the org.apache.flex.html.TitleBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return IPanelModel(model).htmlTitle;
- }
- public function set htmlTitle(value:String):void
- {
- IPanelModel(model).htmlTitle = value;
- }
-
- /**
- * Whether or not to show a Close button in the org.apache.flex.html.TitleBar.
- */
- public function get showCloseButton():Boolean
- {
- return IPanelModel(model).showCloseButton;
- }
- public function set showCloseButton(value:Boolean):void
- {
- IPanelModel(model).showCloseButton = value;
- }
-
- /**
- * The items in the org.apache.flex.html.ControlBar. Setting this property automatically
- * causes the ControlBar to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get controlBar():Array
- {
- return IPanelModel(model).controlBar;
- }
- public function set controlBar(value:Array):void
- {
- IPanelModel(model).controlBar = value;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/RadioButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/RadioButton.as
deleted file mode 100644
index 63f90e9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/RadioButton.as
+++ /dev/null
@@ -1,347 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- COMPILE::AS3
- {
- import flash.display.DisplayObject;
- import flash.events.MouseEvent;
- import flash.utils.Dictionary;
- }
-
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IValueToggleButtonModel;
- COMPILE::AS3
- {
- import org.apache.flex.core.UIButtonBase;
- }
- COMPILE::JS
- {
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.core.IUIBase;
-
- [Event(name="change", type="org.apache.flex.events.Event")]
-
- /**
- * 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
- */
- COMPILE::AS3
- public class RadioButton extends UIButtonBase implements IStrand
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function RadioButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null)
- {
- super(upState, overState, downState, hitTestState);
-
- addEventListener(MouseEvent.CLICK, internalMouseHandler);
- }
-
- protected static var dict:Dictionary = new Dictionary(true);
-
- private var _groupName:String;
-
- /**
- * The name of the group. Only one RadioButton in a group is selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get groupName() : String
- {
- return IValueToggleButtonModel(model).groupName;
- }
- public function set groupName(value:String) : void
- {
- IValueToggleButtonModel(model).groupName = value;
- }
-
- /**
- * The string used as a label for the RadioButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return IValueToggleButtonModel(model).text;
- }
- public function set text(value:String):void
- {
- IValueToggleButtonModel(model).text = value;
- }
-
- /**
- * Whether or not the RadioButton instance is selected. Setting this property
- * causes the currently selected RadioButton in the same group to lose the
- * selection.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selected():Boolean
- {
- return IValueToggleButtonModel(model).selected;
- }
- public function set selected(selValue:Boolean):void
- {
- IValueToggleButtonModel(model).selected = selValue;
-
- // if this button is being selected, its value should become
- // its group's selectedValue
- if( selValue ) {
- for each(var rb:RadioButton in dict)
- {
- if( rb.groupName == groupName )
- {
- rb.selectedValue = value;
- }
- }
- }
- }
-
- /**
- * The value associated with the RadioButton. For example, RadioButtons with labels,
- * "Red", "Green", and "Blue" might have the values 0, 1, and 2 respectively.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Object
- {
- return IValueToggleButtonModel(model).value;
- }
- public function set value(newValue:Object):void
- {
- IValueToggleButtonModel(model).value = newValue;
- }
-
- /**
- * The group's currently selected value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedValue():Object
- {
- return IValueToggleButtonModel(model).selectedValue;
- }
- public function set selectedValue(newValue:Object):void
- {
- // a radio button is really selected when its value matches that of the group's value
- IValueToggleButtonModel(model).selected = (newValue == value);
- IValueToggleButtonModel(model).selectedValue = newValue;
- }
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- // if this instance is selected, set the local selectedValue to
- // this instance's value
- if( selected ) selectedValue = value;
-
- else {
-
- // make sure this button's selectedValue is set from its group's selectedValue
- // to keep it in sync with the rest of the buttons in its group.
- for each(var rb:RadioButton in dict)
- {
- if( rb.groupName == groupName )
- {
- selectedValue = rb.selectedValue;
- break;
- }
- }
- }
-
- dict[this] = this;
- }
-
- /**
- * @private
- */
- private function internalMouseHandler(event:Event) : void
- {
- // prevent radiobutton from being turned off by a click
- if( !selected ) {
- selected = !selected;
- dispatchEvent(new Event("change"));
- }
- }
- }
-
- COMPILE::JS
- public class RadioButton extends UIBase
- {
- public static var radioCounter:int = 0;
-
- private var input:HTMLInputElement;
- private var labelFor:HTMLLabelElement;
- private var textNode:Text;
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- * @flexjsignorecoercion HTMLInputElement
- * @flexjsignorecoercion HTMLLabelElement
- * @flexjsignorecoercion Text
- */
- override protected function createElement():WrappedHTMLElement
- {
- input = document.createElement('input') as HTMLInputElement;
- input.type = 'radio';
- input.id = '_radio_' + RadioButton.radioCounter++;
-
- textNode = document.createTextNode('radio button') as Text;
-
- labelFor = document.createElement('label') as HTMLLabelElement;
- labelFor.appendChild(input);
- labelFor.appendChild(textNode);
-
- element = labelFor as WrappedHTMLElement;
- element.className = 'RadioButton';
- typeNames = 'RadioButton';
-
- positioner = element;
- positioner.style.position = 'relative';
-
- (input as WrappedHTMLElement).flexjs_wrapper = this;
- (element as WrappedHTMLElement).flexjs_wrapper = this;
- (textNode as WrappedHTMLElement).flexjs_wrapper = this;
-
- return element;
- }
-
- override public function set id(value:String):void
- {
- super.id = value;
- labelFor.id = value;
- input.id = value;
- }
-
- public function get groupName():String
- {
- return input.name as String;
- }
- public function set groupName(value:String):void
- {
- input.name = value;
- }
-
- public function get text():String
- {
- return textNode.nodeValue as String;
- }
- public function set text(value:String):void
- {
- textNode.nodeValue = value;
- }
-
- /** @export */
- public function get selected():Boolean
- {
- return input.checked;
- }
- public function set selected(value:Boolean):void
- {
- input.checked = value;
- }
-
- public function get value():Object
- {
- return input.value;
- }
- public function set value(v:Object):void
- {
- input.value = v as String;
- }
-
- public function get selectedValue():Object
- {
- var buttons:NodeList;
- var groupName:String;
- var i:int;
- var n:int;
-
- groupName = input.name as String;
- buttons = document.getElementsByName(groupName);
- n = buttons.length;
-
- for (i = 0; i < n; i++) {
- if (buttons[i].checked) {
- return buttons[i].value;
- }
- }
- return null;
- }
-
- /**
- * @flexjsignorecoercion Array
- */
- public function set selectedValue(value:Object):void
- {
- var buttons:NodeList;
- var groupName:String;
- var i:int;
- var n:int;
-
- groupName = input.name as String;
- buttons = document.getElementsByName(groupName);
- n = buttons.length;
- for (i = 0; i < n; i++) {
- if (buttons[i].value === value) {
- buttons[i].checked = true;
- break;
- }
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleAlert.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleAlert.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleAlert.as
deleted file mode 100644
index 676d9e7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleAlert.as
+++ /dev/null
@@ -1,140 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IPopUp;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
-
- [Event(name="close", type="org.apache.flex.events.Event")]
-
- /**
- * The SimpleAlert class is a component that displays a message and an OK button. The
- * SimpleAlert converts directly to window.alert() for HTML. SimpleAlert uses
- * the following beads:
- *
- * org.apache.flex.core.IBeadModel: the data model, which includes the message.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Alert.
- * org.apache.flex.core.IBeadController: the bead responsible for handling input events.
- * org.apache.flex.core.IBorderBead: a bead, if present, that draws a border around the control.
- * org.apache.flex.core.IBackgroundBead: a bead, if present, that creates a solid-color background.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleAlert extends UIBase implements IPopUp
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleAlert()
- {
- super();
-
- className = "SimpleAlert";
- }
-
- /**
- * The message to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private function get message():String
- {
- return IAlertModel(model).message;
- }
- private function set message(value:String):void
- {
- IAlertModel(model).message = value;
- }
-
- /**
- * The HTML message to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private function get htmlMessage():String
- {
- return IAlertModel(model).htmlMessage;
- }
- private function set htmlMessage(value:String):void
- {
- IAlertModel(model).htmlMessage = value;
- }
-
- /**
- * This function causes the SimpleAlert to appear. The parent is used for ActionScript and
- * identifies the IPopUpParent that manages the alert.
- *
- * @param Object parent The object that hosts the pop-up.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function show(parent:Object) : void
- {
- parent.addElement(this);
- }
-
- /**
- * A convenience function to compose and display the alert.
- *
- * @param String message The content to display in the SimpleAlert.
- * @param Object parent The object that hosts the pop-up.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- static public function show(message:String, parent:Object):SimpleAlert
- {
- COMPILE::AS3
- {
- var alert:SimpleAlert = new SimpleAlert();
- alert.message = message;
- alert.show(parent);
-
- return alert;
- }
- COMPILE::JS
- {
- alert(message);
- return null;
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleList.as
deleted file mode 100644
index 9dcb348..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/SimpleList.as
+++ /dev/null
@@ -1,79 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The SimpleList class is a component that displays data in a vertical column. This
- * component differs from org.apache.flex.html.List in that it displays
- * only string values and maps to the <select> HTML element.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleList extends List
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleList()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- * @flexjsignorecoercion HTMLSelectElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('select') as WrappedHTMLElement;
- (element as HTMLSelectElement).size = 5;
- goog.events.listen(element, 'change',
- changeHandler);
- positioner = element;
- positioner.style.position = 'relative';
- className = 'SimpleList';
-
- return element;
- }
-
- /**
- * @flexjsignorecoercion HTMLSelectElement
- */
- COMPILE::JS
- protected function changeHandler(event:Event):void
- {
- model.selectedIndex = (element as HTMLSelectElement).selectedIndex;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Slider.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Slider.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Slider.as
deleted file mode 100644
index 6944895..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Slider.as
+++ /dev/null
@@ -1,233 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IRangeModel;
- import org.apache.flex.core.UIBase;
-
- COMPILE::JS
- {
- import org.apache.flex.html.beads.SliderTrackView;
- import org.apache.flex.html.beads.SliderThumbView;
- import org.apache.flex.html.beads.controllers.SliderMouseController;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- [Event(name="valueChange", type="org.apache.flex.events.Event")]
-
- /**
- * The Slider class is a component that displays a range of values using a
- * track and a thumb control. The Slider uses the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model, typically an IRangeModel, that holds the Slider values.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Slider.
- * org.apache.flex.core.IBeadController: the bead that handles input.
- * org.apache.flex.core.IThumbValue: the bead responsible for the display of the thumb control.
- * org.apache.flex.core.ITrackView: the bead responsible for the display of the track.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Slider extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Slider()
- {
- super();
-
- className = "Slider";
-
- IRangeModel(model).value = 0;
- IRangeModel(model).minimum = 0;
- IRangeModel(model).maximum = 100;
- IRangeModel(model).stepSize = 1;
- IRangeModel(model).snapInterval = 1;
- }
-
- /**
- * The current value of the Slider.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Number
- {
- return IRangeModel(model).value;
- }
- public function set value(newValue:Number):void
- {
- IRangeModel(model).value = newValue;
- }
-
- /**
- * The minimum value of the Slider.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get minimum():Number
- {
- return IRangeModel(model).minimum;
- }
- public function set minimum(value:Number):void
- {
- IRangeModel(model).minimum = value;
- }
-
- /**
- * The maximum value of the Slider.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maximum():Number
- {
- return IRangeModel(model).maximum;
- }
- public function set maximum(value:Number):void
- {
- IRangeModel(model).maximum = value;
- }
-
- /**
- * The modulus of the Slider value. The thumb will be positioned
- * at the nearest multiple of this value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get snapInterval():Number
- {
- return IRangeModel(model).snapInterval;
- }
- public function set snapInterval(value:Number):void
- {
- IRangeModel(model).snapInterval = value;
- }
-
- /**
- * The amount to move the thumb when the track is selected. This value is
- * adjusted to fit the nearest snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get stepSize():Number
- {
- return IRangeModel(model).stepSize;
- }
- public function set stepSize(value:Number):void
- {
- IRangeModel(model).stepSize = value;
- }
-
- COMPILE::JS
- private var track:SliderTrackView;
-
- COMPILE::JS
- private var thumb:SliderThumbView;
-
- COMPILE::JS
- private var controller:SliderMouseController;
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
- element.style.width = '200px';
- element.style.height = '30px';
-
- track = new SliderTrackView();
- addBead(track);
-
- thumb = new SliderThumbView();
- addBead(thumb);
-
- controller = new SliderMouseController();
- addBead(controller);
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- className = 'Slider';
-
- return element;
- }
-
- /**
- */
- COMPILE::JS
- public function snap(value:Number):Number
- {
- var si:Number = snapInterval;
- var n:Number = Math.round((value - minimum) / si) *
- si + minimum;
- if (value > 0)
- {
- if (value - n < n + si - value)
- return n;
- return n + si;
- }
- if (value - n > n + si - value)
- return n + si;
- return n;
- }
-
-
- /**
- * @param {number} value The value used to calculate new position of the thumb.
- * @return {void} Moves the thumb to the corresponding position.
- */
- COMPILE::JS
- public function setThumbFromValue(value:Number):void
- {
- var min:Number = model.minimum;
- var max:Number = model.maximum;
- var p:Number = (value - min) / (max - min);
- var xloc:Number = p * (parseInt(track.element.style.width, 10) -
- parseInt(thumb.element.style.width, 10));
-
- thumb.element.style.left = String(xloc) + 'px';
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Spacer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Spacer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Spacer.as
deleted file mode 100644
index d7ab050..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Spacer.as
+++ /dev/null
@@ -1,64 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The Spacer class takes up space in the UI layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Spacer extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Spacer()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- this.element = document.createElement('div') as WrappedHTMLElement;
- this.positioner = this.element;
- this.element.flexjs_wrapper = this;
-
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Spinner.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Spinner.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Spinner.as
deleted file mode 100644
index c6ef625..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Spinner.as
+++ /dev/null
@@ -1,187 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IRangeModel;
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.html.beads.controllers.SpinnerMouseController;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- [Event(name="valueChange", type="org.apache.flex.events.Event")]
-
- /**
- * The Spinner class is a component that displays a control for incrementing a value
- * and a control for decrementing a value. The org.apache.flex.html.NumericStepper
- * uses a Spinner as part of the component. Spinner uses the following beads:
- *
- * org.apache.flex.core.IBeadModel: an IRangeModel to hold the properties.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Spinner.
- * org.apache.flex.core.IBeadController: a bead that handles the input events.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Spinner extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Spinner()
- {
- super();
-
- className = "Spinner";
- }
-
- /**
- * The current value of the Spinner.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get value():Number
- {
- return IRangeModel(model).value;
- }
- public function set value(newValue:Number):void
- {
- IRangeModel(model).value = newValue;
- }
-
- /**
- * The minimum value of the Spinner.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get minimum():Number
- {
- return IRangeModel(model).minimum;
- }
- public function set minimum(value:Number):void
- {
- IRangeModel(model).minimum = value;
- }
-
- /**
- * The maximum value of the Spinner.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maximum():Number
- {
- return IRangeModel(model).maximum;
- }
- public function set maximum(value:Number):void
- {
- IRangeModel(model).maximum = value;
- }
-
- /**
- * The modulus for the value. If this property is set,
- * the value displayed with a muliple of the snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get snapInterval():Number
- {
- return IRangeModel(model).snapInterval;
- }
- public function set snapInterval(value:Number):void
- {
- IRangeModel(model).snapInterval = value;
- }
-
- /**
- * The amount to increase or descrease the value. The value
- * will not exceed the minimum or maximum value. The final
- * value is affected by the snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get stepSize():Number
- {
- return IRangeModel(model).stepSize;
- }
- public function set stepSize(value:Number):void
- {
- IRangeModel(model).stepSize = value;
- }
-
- COMPILE::JS
- public var incrementButton:TextButton;
-
- COMPILE::JS
- public var decrementButton:TextButton;
-
- COMPILE::JS
- private var controller:SpinnerMouseController;
-
- /**
- * @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.style.verticalAlign = 'middle';
-
- incrementButton = new TextButton();
- incrementButton.text = '\u25B2';
- addElement(incrementButton);
-
- decrementButton = new TextButton();
- decrementButton.text = '\u25BC';
- addElement(decrementButton);
-
- controller = new SpinnerMouseController();
- addBead(controller);
-
- element.flexjs_wrapper = this;
-
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/TextArea.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextArea.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/TextArea.as
deleted file mode 100644
index 57bc3c3..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextArea.as
+++ /dev/null
@@ -1,126 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The TextArea class implements the basic control for
- * multi-line text input.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextArea extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextArea()
- {
- super();
- }
-
- /**
- * @copy org.apache.flex.html.Label#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion HTMLInputElement
- */
- public function get text():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).text;
- }
- COMPILE::JS
- {
- return (element as HTMLInputElement).value;
- }
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLInputElement
- */
- public function set text(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).text = value;
- }
- COMPILE::JS
- {
- (element as HTMLInputElement).value = value;
- }
- }
-
- /**
- * @copy org.apache.flex.html.Label#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return ITextModel(model).html;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- ITextModel(model).html = value;
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('textarea') as WrappedHTMLElement;
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
- element.className = 'TextArea';
- typeNames = 'TextArea';
-
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/TextButton.as
deleted file mode 100644
index ca1bbcd..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextButton.as
+++ /dev/null
@@ -1,120 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
-
- /**
- * The TextButton class implements a basic button that
- * displays text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextButton extends Button
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextButton()
- {
- super();
- }
-
- /**
- * @copy org.apache.flex.html.Label#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).text;
- }
- COMPILE::JS
- {
- return element.innerHTML;
- }
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).text = value;
- }
- COMPILE::JS
- {
- this.element.innerHTML = value;
- this.dispatchEvent('textChange');
- }
- }
-
- /**
- * @copy org.apache.flex.html.Label#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).html;
- }
- COMPILE::JS
- {
- return element.innerHTML;
- }
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).html = value;
- }
- COMPILE::JS
- {
- this.element.innerHTML = value;
- this.dispatchEvent('textChange');
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/TextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextInput.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/TextInput.as
deleted file mode 100644
index 1861405..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/TextInput.as
+++ /dev/null
@@ -1,185 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * Dispatched when the user changes the text.
- *
- * @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 TextInput class implements the basic control for
- * single-line text input.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextInput extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextInput()
- {
- super();
-
- COMPILE::AS3
- {
- model.addEventListener("textChange", textChangeHandler);
- }
- }
-
- /**
- * @copy org.apache.flex.html.Label#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion HTMLInputElement
- */
- public function get text():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).text;
- }
- COMPILE::JS
- {
- return (element as HTMLInputElement).value;
- }
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLInputElement
- */
- public function set text(value:String):void
- {
- COMPILE::AS3
- {
- inSetter = true;
- ITextModel(model).text = value;
- inSetter = false;
- }
- COMPILE::JS
- {
- (element as HTMLInputElement).value = value;
- dispatchEvent(new Event('textChange'));
- }
- }
-
- /**
- * @copy org.apache.flex.html.Label#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion HTMLInputElement
- */
- public function get html():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).html;
- }
- COMPILE::JS
- {
- return (element as HTMLInputElement).value;
- }
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLInputElement
- */
- public function set html(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).html = value;
- }
- COMPILE::JS
- {
- (element as HTMLInputElement).value = value;
- dispatchEvent(new Event('textChange'));
- }
- }
-
- private var inSetter:Boolean;
-
- /**
- * dispatch change event in response to a textChange event
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function textChangeHandler(event:Event):void
- {
- if (!inSetter)
- dispatchEvent(new Event(Event.CHANGE));
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('input') as WrappedHTMLElement;
- element.setAttribute('type', 'input');
- element.className = 'TextInput';
- typeNames = 'TextInput';
-
- //attach input handler to dispatch flexjs change event when user write in textinput
- //goog.events.listen(element, 'change', killChangeHandler);
- goog.events.listen(element, 'input', textChangeHandler);
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/TitleBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/TitleBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/TitleBar.as
deleted file mode 100644
index 3902330..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/TitleBar.as
+++ /dev/null
@@ -1,146 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.ITitleBarModel;
- import org.apache.flex.core.ValuesManager;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.html.Label;
-
- /**
- * The TitleBar class is a Container component that displays a title and an
- * optional close button. The TitleBar uses the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model, which includes the title and showCloseButton values.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the component.
- * org.apache.flex.core.IBeadLayout: the bead that handles size and position of the component parts
- * (org.apache.flex.html.Label and org.apache.flex.html.Button).
- * org.apache.flex.core.IMeasurementBead: a bead that helps determine the size of the
- * org.apache.flex.html.TitleBar for layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TitleBar extends Container implements IChrome
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TitleBar()
- {
- super();
-
- className = "TitleBar";
- }
-
- /**
- * The title string to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return ITitleBarModel(model).title;
- }
- public function set title(value:String):void
- {
- ITitleBarModel(model).title = value;
- }
-
- /**
- * The HTML title to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return ITitleBarModel(model).htmlTitle;
- }
- public function set htmlTitle(value:String):void
- {
- ITitleBarModel(model).htmlTitle = value;
- }
-
- /**
- * Whether or not to show a org.apache.flex.html.Button that indicates the component
- * may be closed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get showCloseButton():Boolean
- {
- return ITitleBarModel(model).showCloseButton;
- }
- public function set showCloseButton(value:Boolean):void
- {
- ITitleBarModel(model).showCloseButton = value;
- }
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- if( getBeadByType(IBeadLayout) == null )
- addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadLayout")) as IBead);
- }
-
- /**
- * @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 = 'TitleBar';
-
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ToggleTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ToggleTextButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ToggleTextButton.as
deleted file mode 100644
index ea9b0f9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ToggleTextButton.as
+++ /dev/null
@@ -1,170 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
-
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- //--------------------------------------
- // Events
- //--------------------------------------
-
- /**
- * Dispatched when the user clicks on a button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- [Event(name="click", type="org.apache.flex.events.Event")]
-
- /**
- * The ToggleButton class is a TextButton that supports
- * a selected property.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ToggleTextButton extends TextButton implements IStrand, IEventDispatcher, IUIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ToggleTextButton()
- {
- super();
- COMPILE::JS
- {
- this.typeNames = 'toggleTextButton';
- }
- }
-
- COMPILE::JS
- private var _selected:Boolean;
-
- COMPILE::JS
- private var SELECTED:String = "selected";
-
- /**
- * <code>true</code> if the Button is selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selected():Boolean
- {
- COMPILE::AS3
- {
- return IToggleButtonModel(model).selected;
- }
- COMPILE::JS
- {
- return _selected;
- }
- }
-
- /**
- * @private
- */
- public function set selected(value:Boolean):void
- {
- COMPILE::AS3
- {
- IToggleButtonModel(model).selected = value;
- }
- COMPILE::JS
- {
- if (_selected != value)
- {
- _selected = value;
-
- var className:String = this.className;
- var typeNames:String = this.typeNames;
- if (value) {
- if (typeNames.indexOf(SELECTED) == -1) {
- typeNames = typeNames + SELECTED;
- if (className)
- element.className = typeNames + ' ' + className;
- else
- element.className = typeNames;
- }
- }
- else {
- if (typeNames.indexOf(SELECTED) == typeNames.length - SELECTED.length) {
- typeNames = typeNames.substring(0, typeNames.length - SELECTED.length);
- if (className)
- element.className = typeNames + ' ' + className;
- else
- element.className = typeNames;
- }
- }
- }
- }
- }
-
- /**
- * @private
- * add another class selector
- */
- override public function get className():String
- {
- // we don't have a model yet so just pass through otherwise you will loop
- if (!parent)
- return super.className;
-
- var name:String = super.className;
- if (selected)
- return "toggleTextButton_Selected" + (name ? " " + name : "");
- else
- return "toggleTextButton" + (name ? " " + name : "");
- }
-
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- super.createElement();
- element.addEventListener("click", clickHandler, false);
- return element;
- }
-
- COMPILE::JS
- private function clickHandler(event:Event):void
- {
- selected = !selected;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ToolTip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ToolTip.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ToolTip.as
deleted file mode 100644
index 4093b09..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ToolTip.as
+++ /dev/null
@@ -1,60 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /*
- * Label probably should extend TextField directly,
- * but the player's APIs for TextLine do not allow
- * direct instantiation, and we might want to allow
- * Labels to be declared and have their actual
- * view be swapped out.
- */
-
- /**
- * The Label class implements the basic control for labeling
- * other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ToolTip extends Label
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ToolTip()
- {
- super();
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/VContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/VContainer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/VContainer.as
deleted file mode 100644
index 92ebdca..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/VContainer.as
+++ /dev/null
@@ -1,62 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.events.Event;
-
- [DefaultProperty("mxmlContent")]
-
- /**
- * A Container that has a VerticalLayout.
- *
- * This is effectively the same as the pattern
- * <code>
- * <basic:Container xmlns:basic="library://ns.apache.org/flexjs/basic">
- * <basic:layout>
- * <basic:VerticalLayout />
- * </basic:layout>
- * </basic:Container>
- * </code>
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VContainer extends Container implements IContainer
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VContainer()
- {
- super();
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/VRule.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/VRule.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/VRule.as
deleted file mode 100644
index d727f2a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/VRule.as
+++ /dev/null
@@ -1,68 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The VRule class displays a vertical line
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VRule extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VRule()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
- element.style.borderLeftStyle = 'solid';
- element.style.borderLeftWidth = '1px';
- element.style.borderTop = 'none';
- element.style.borderBottom = 'none';
- element.style.borderRight = 'none';
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
- return element;
- }
- }
-}
[28/29] git commit: [flex-asjs] [refs/heads/mavenfolders] - update
files after folder rename/refactor
Posted by ah...@apache.org.
update files after folder rename/refactor
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/980ee4da
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/980ee4da
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/980ee4da
Branch: refs/heads/mavenfolders
Commit: 980ee4da92683bf590a9be02a66e6a731c7c6ab7
Parents: 35cbbe9
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 11 14:22:15 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 11 14:22:15 2016 -0800
----------------------------------------------------------------------
frameworks/projects/HTML/build.xml | 67 ++++++++++----------
.../src/main/resources/compile-asjs-config.xml | 10 +--
.../HTML/src/main/resources/compile-config.xml | 14 ++--
.../projects/HTML/src/test/flex/build.xml | 14 ++--
4 files changed, 57 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/980ee4da/frameworks/projects/HTML/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/build.xml b/frameworks/projects/HTML/build.xml
index 517681c..df29536 100644
--- a/frameworks/projects/HTML/build.xml
+++ b/frameworks/projects/HTML/build.xml
@@ -28,15 +28,14 @@
<property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
<property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="target.name" value="HTML-${release.version}.swc" />
+ <property name="target.name.no.version" value="HTML.swc" />
<target name="main" depends="clean,compile-asjs,compile-extern-swc,copy-js,compile,test" description="Full build of HTML.swc">
</target>
<target name="test" unless="is.jenkins">
- <!-- no tests yet
- <ant dir="as/tests" />
- -->
- <ant dir="as/tests" />
+ <ant dir="src/test/flex"/>
</target>
<target name="test-js" unless="is.jenkins">
@@ -48,11 +47,11 @@
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="HTML.swc"/>
+ <include name="${target.name.no.version}"/>
</fileset>
</delete>
<delete failonerror="false">
- <fileset dir="${basedir}/js/out">
+ <fileset dir="${basedir}/target">
<include name="**/**"/>
</fileset>
</delete>
@@ -63,40 +62,41 @@
</path>
<target name="compile" description="Compiles .as files into .swc">
- <echo message="Compiling libs/HTML.swc"/>
+ <echo message="Compiling target/${target.name}"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
- <mkdir dir="${basedir}/js/out" />
-
+ <mkdir dir="${basedir}/target/generated-sources/flexjs"/>
+
<!-- Load the <compc> task. We can't do this at the <project> level -->
<!-- because targets that run before flexTasks.jar gets built would fail. -->
<taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
<!--
- Link in the classes (and their dependencies) for the MXML tags
- listed in this project's manifest.xml.
- Also link the additional classes (and their dependencies)
- listed in HTMLClasses.as,
- because these aren't referenced by the manifest classes.
- Keep the standard metadata when compiling.
- Include the appropriate CSS files and assets in the SWC.
- Don't include any resources in the SWC.
- Write a bundle list of referenced resource bundles
- into the file bundles.properties in this directory.
- -->
+ Link in the classes (and their dependencies) for the MXML tags
+ listed in this project's manifest.xml.
+ Also link the additional classes (and their dependencies)
+ listed in CoreClasses.as,
+ because these aren't referenced by the manifest classes.
+ Keep the standard metadata when compiling.
+ Include the appropriate CSS files and assets in the SWC.
+ Don't include any resources in the SWC.
+ Write a bundle list of referenced resource bundles
+ into the file bundles.properties in this directory.
+ -->
<compc fork="true"
- output="${FLEXJS_HOME}/frameworks/libs/HTML.swc">
+ output="${basedir}/target/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
- <load-config filename="compile-config.xml" />
+ <load-config filename="${basedir}/src/main/resources/compile-config.xml" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.AIR_HOME=${env.AIR_HOME}" />
<arg value="-define=COMPILE::AS3,true" />
<arg value="-define=COMPILE::JS,false" />
</compc>
+ <copy file="${basedir}/target/${target.name}" tofile="${FLEXJS_HOME}/frameworks/libs/${target.name.no.version}" />
</target>
- <target name="compile-asjs" >
- <echo message="Cross-compiling HTML/asjs"/>
+ <target name="compile-asjs">
+ <echo message="Cross-compiling ${target.name}"/>
<echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
<java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" >
<jvmarg value="-Xmx384m" />
@@ -106,8 +106,8 @@
<arg value="+flexlib=${FLEX_HOME}/frameworks" />
<arg value="-js-output-type=FLEXJS" />
<arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion annotations -->
- <arg value="-output=${basedir}/js/out" />
- <arg value="-load-config=${basedir}/compile-asjs-config.xml" />
+ <arg value="-output=${basedir}/target/generated-sources/flexjs" />
+ <arg value="-load-config=${basedir}/src/main/resources/compile-asjs-config.xml" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
<arg value="+env.AIR_HOME=${env.AIR_HOME}" />
@@ -120,11 +120,12 @@
</target>
<target name="compile-extern-swc" description="Compiles .as files into .swc used for cross-compiling other projects">
- <echo message="Compiling externs/HTML.swc"/>
+ <echo message="Compiling target/externs/${target.name}"/>
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCON_HOME: ${FALCON_HOME}"/>
<!-- make JS output folder now so include-file doesn't error -->
<mkdir dir="${FLEXJS_HOME}/frameworks/externs"/>
+ <mkdir dir="${basedir}/target/externs"/>
<!-- Load the <compc> task. We can't do this at the <project> level -->
<!-- because targets that run before flexTasks.jar gets built would fail. -->
@@ -142,9 +143,9 @@
into the file bundles.properties in this directory.
-->
<compc fork="true"
- output="${FLEXJS_HOME}/frameworks/externs/HTML.swc">
+ output="${basedir}/target/externs/${target.name}">
<jvmarg line="${compc.jvm.args}"/>
- <load-config filename="compile-asjs-config.xml" />
+ <load-config filename="src/main/resources/compile-asjs-config.xml" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.AIR_HOME=${env.AIR_HOME}" />
<arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc" />
@@ -153,14 +154,16 @@
<arg value="-define=COMPILE::AS3,false" />
<arg value="-define=COMPILE::JS,true" />
</compc>
+ <copy file="${basedir}/target/externs/${target.name}" tofile="${FLEXJS_HOME}/frameworks/externs/${target.name.no.version}" />
</target>
- <target name="copy-js" >
+ <target name="copy-js">
<copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
- <fileset dir="${basedir}/js/out">
- <include name="**/**" />
+ <fileset dir="${basedir}/target/generated-sources/flexjs">
+ <include name="**/**"/>
</fileset>
</copy>
</target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/980ee4da/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml b/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
index 2139379..b578f84 100644
--- a/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
+++ b/frameworks/projects/HTML/src/main/resources/compile-asjs-config.xml
@@ -45,10 +45,10 @@
<!-- asjscompc won't 'link' these classes in, but will list their requires
if these swcs are on the external-library-path then their requires
will not be listed -->
- <path-element>../../externs/Binding.swc</path-element>
- <path-element>../../externs/Core.swc</path-element>
- <path-element>../../externs/Graphics.swc</path-element>
- <path-element>../../externs/Collections.swc</path-element>
+ <path-element>../../../../../externs/Binding.swc</path-element>
+ <path-element>../../../../../externs/Core.swc</path-element>
+ <path-element>../../../../../externs/Graphics.swc</path-element>
+ <path-element>../../../../../externs/Collections.swc</path-element>
</library-path>
<namespaces>
@@ -63,7 +63,7 @@
</namespaces>
<source-path>
- <path-element>as/src</path-element>
+ <path-element>../flex</path-element>
</source-path>
<warn-no-constructor>false</warn-no-constructor>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/980ee4da/frameworks/projects/HTML/src/main/resources/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/resources/compile-config.xml b/frameworks/projects/HTML/src/main/resources/compile-config.xml
index 7ea999a..7f2b812 100644
--- a/frameworks/projects/HTML/src/main/resources/compile-config.xml
+++ b/frameworks/projects/HTML/src/main/resources/compile-config.xml
@@ -23,10 +23,10 @@
<external-library-path>
<path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
- <path-element>../../libs/Binding.swc</path-element>
- <path-element>../../libs/Core.swc</path-element>
- <path-element>../../libs/Graphics.swc</path-element>
- <path-element>../../libs/Collections.swc</path-element>
+ <path-element>../../../../../libs/Binding.swc</path-element>
+ <path-element>../../../../../libs/Core.swc</path-element>
+ <path-element>../../../../../libs/Graphics.swc</path-element>
+ <path-element>../../../../../libs/Collections.swc</path-element>
</external-library-path>
<mxml>
@@ -64,7 +64,7 @@
</namespaces>
<source-path>
- <path-element>as/src</path-element>
+ <path-element>../flex</path-element>
</source-path>
<warn-no-constructor>false</warn-no-constructor>
@@ -72,11 +72,11 @@
<include-file>
<name>defaults.css</name>
- <path>as/defaults.css</path>
+ <path>defaults.css</path>
</include-file>
<include-file>
<name>js/out/*</name>
- <path>js/out/*</path>
+ <path>../../../target/generated-sources/flexjs/*</path>
</include-file>
<include-classes>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/980ee4da/frameworks/projects/HTML/src/test/flex/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/test/flex/build.xml b/frameworks/projects/HTML/src/test/flex/build.xml
index fda6c62..599d96d 100644
--- a/frameworks/projects/HTML/src/test/flex/build.xml
+++ b/frameworks/projects/HTML/src/test/flex/build.xml
@@ -20,13 +20,14 @@
<project name="HTML.test" default="main" basedir=".">
- <property name="FLEXJS_HOME" location="../../../../.."/>
+ <property name="FLEXJS_HOME" location="../../../../../.."/>
<property file="${FLEXJS_HOME}/env.properties"/>
<property environment="env"/>
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
<property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="target.name" value="Core-${release.version}.swc" />
<condition property="browser" value="C:/Program Files/Internet Explorer/iexplore.exe">
<os family="windows"/>
@@ -70,7 +71,7 @@
value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
<property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
- <target name="main" depends="clean,compile,test" description="Clean test of FlexJSUI.swc">
+ <target name="main" depends="clean,compile,test" description="Clean test of ${target.name}">
</target>
<target name="clean">
@@ -79,6 +80,11 @@
<include name="FlexUnitFlexJSApplication.swf"/>
</fileset>
</delete>
+ <delete failonerror="false">
+ <fileset dir="${basedir}/bin">
+ <include name="**/**"/>
+ </fileset>
+ </delete>
</target>
<path id="lib.path">
@@ -119,7 +125,7 @@
<arg value="-compiler.binding-value-change-event-type=valueChange" />
<arg value="+playerglobal.version=${playerglobal.version}" />
<arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
- <arg value="-source-path+=${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
+ <arg value="-source-path+=${FLEXJS_HOME}/frameworks/projects/HTML/src/main/flex" />
<arg value="-library-path+=${FLEXJS_HOME}/frameworks/libs" />
<arg value="${FLEXUNIT_LIBPATH1}" />
<arg value="${FLEXUNIT_LIBPATH2}" />
@@ -143,7 +149,7 @@
verbose="true"
localTrusted="true"
timeout="90000">
- <source dir="${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
+ <source dir="${FLEXJS_HOME}/frameworks/projects/HTML/src/main/flex" />
<library dir="${FLEXJS_HOME}/frameworks/libs" />
</flexunit>
[27/29] git commit: [flex-asjs] [refs/heads/mavenfolders] - template
output
Posted by ah...@apache.org.
template output
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/35cbbe97
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/35cbbe97
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/35cbbe97
Branch: refs/heads/mavenfolders
Commit: 35cbbe9744df30c4eefcd4bd117cb29c72ee89eb
Parents: 7853ef1
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 11 14:21:25 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 11 14:21:25 2016 -0800
----------------------------------------------------------------------
frameworks/projects/Core/build.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/35cbbe97/frameworks/projects/Core/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/build.xml b/frameworks/projects/Core/build.xml
index 8e92f15..d7e5137 100644
--- a/frameworks/projects/Core/build.xml
+++ b/frameworks/projects/Core/build.xml
@@ -47,7 +47,7 @@
<target name="clean">
<delete failonerror="false">
<fileset dir="${FLEXJS_HOME}/frameworks/libs">
- <include name="Core.swc"/>
+ <include name="${target.name.no.version}"/>
</fileset>
</delete>
<delete failonerror="false">
[18/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VRuleView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VRuleView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VRuleView.as
deleted file mode 100644
index 5eb6c4c..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VRuleView.as
+++ /dev/null
@@ -1,87 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Bitmap;
- import flash.display.Loader;
- import flash.display.LoaderInfo;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IImageModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VRuleView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VRuleView()
- {
- }
-
- /**
- * @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(_strand).addEventListener("widthChanged",handleSizeChange);
- IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
- IEventDispatcher(_strand).addEventListener("sizeChanged",handleSizeChange);
-
- handleSizeChange(null);
- }
-
- /**
- * @private
- */
- private function handleSizeChange(event:Object):void
- {
- var ui:UIBase = _strand as UIBase;
- ui.graphics.clear();
- ui.graphics.beginFill(0);
- ui.graphics.drawRect(0, 0, 1, ui.height);
- ui.graphics.endFill();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
deleted file mode 100644
index 0f70b37..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
+++ /dev/null
@@ -1,119 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The VScrollBarThumbView class is the view for
- * the thumb button in a Vertical ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBarThumbView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBarThumbView()
- {
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- var hh:Number = DisplayObject(_strand).height;
- g.clear();
- g.lineStyle(1);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ScrollBarView.FullSize, hh, ScrollBarView.HalfSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xc8c8c8);
- drawView(downView.graphics, 0xc8c8c8);
- drawView(overView.graphics, 0xb8b8b8);
-
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
- IEventDispatcher(_strand).addEventListener("heightChanged", heightChangedHandler);
- }
-
- private function heightChangedHandler(event:Event):void
- {
- DisplayObject(_strand).scaleY = 1.0;
- DisplayObject(_strand).scaleX = 1.0;
-
- var hh:Number = DisplayObject(_strand).height;
- drawView(upView.graphics, 0xc8c8c8);
- drawView(downView.graphics, 0xc8c8c8);
- drawView(overView.graphics, 0xb8b8b8);
-
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, hh);
- shape.graphics.endFill();
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
deleted file mode 100644
index 3510251..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
+++ /dev/null
@@ -1,118 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The VScrollBarTrackView class is the view for
- * the track in a Vertical ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBarTrackView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBarTrackView()
- {
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- var h:Number = SimpleButton(_strand).height;
-
- g.clear();
- g.lineStyle(1, 0x808080);
- g.beginFill(bgColor);
- g.drawRect(0, 0, ScrollBarView.FullSize, h);
- g.endFill();
- g.lineStyle(0);
- }
-
- private function heightChangeHandler(event:Event):void
- {
- DisplayObject(_strand).scaleY = 1.0;
- DisplayObject(_strand).scaleX = 1.0;
-
- var h:Number = SimpleButton(_strand).height;
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, h);
- shape.graphics.endFill();
-
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
-
- SimpleButton(value).addEventListener("heightChanged", heightChangeHandler);
- shape = new Shape();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as
deleted file mode 100644
index 840f7bf..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarView.as
+++ /dev/null
@@ -1,99 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.Strand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-
- /**
- * The ScrollBarView class is the default view for
- * the org.apache.flex.html.supportClasses.VScrollBar class.
- * It implements the classic desktop-like VScrollBar.
- * A different view would implement more modern scrollbars that hide themselves
- * until hovered over with the mouse.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBarView extends ScrollBarView implements IBeadView, IStrand, IScrollBarView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBarView()
- {
- }
-
- /**
- * @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;
-
- UIBase(value).setWidth(ScrollBarView.FullSize, true);
-
- // TODO: (aharui) put in values impl
- _increment = new Button();
- Button(_increment).addBead(new DownArrowButtonView());
- Button(_increment).addBead(new ButtonAutoRepeatController());
- _decrement = new Button();
- Button(_decrement).addBead(new UpArrowButtonView());
- Button(_decrement).addBead(new ButtonAutoRepeatController());
- _track = new Button();
- Button(_track).addBead(new VScrollBarTrackView());
- _thumb = new Button();
- Button(_thumb).addBead(new VScrollBarThumbView());
-
- UIBase(value).addChild(_decrement);
- UIBase(value).addChild(_increment);
- UIBase(value).addChild(_track);
- UIBase(value).addChild(_thumb);
-
- IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
-
- layout.layout();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/AlertController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/AlertController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/AlertController.as
deleted file mode 100644
index 3982d0f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/AlertController.as
+++ /dev/null
@@ -1,88 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The AlertControler class bead handles the close event on the org.apache.flex.html.Alert
- * by removing the org.apache.flex.html.Alert from the display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class AlertController implements IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function AlertController()
- {
- }
-
- 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 get strand():IStrand
- {
- return _strand;
- }
-
- /**
- * @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("close",handleAlertClose);
- }
-
- /**
- * @private
- */
- private function handleAlertClose(event:Event):void
- {
- DisplayObject(_strand).parent.removeChild(DisplayObject(_strand));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
deleted file mode 100644
index 4100a28..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
+++ /dev/null
@@ -1,147 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.utils.clearInterval;
- import flash.utils.clearTimeout;
- import flash.utils.setInterval;
- import flash.utils.setTimeout;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The ButtonAutoRepeatController class adds autorepeat
- * functionality to a button. This version is simply waits
- * a specified amount of time (default is 250ms), then repeats the button
- * event at a specified interval, which defaults to
- * 125 milliseconds. Alternate implementations could
- * have non-linear repeat timing, look for keyboard modifiers to choose
- * different rates, etc.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ButtonAutoRepeatController implements IBead, IBeadController
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ButtonAutoRepeatController()
- {
- }
-
- 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(MouseEvent.MOUSE_DOWN, mouseDownHandler);
- }
-
- /**
- * The number of milliseconds to wait before repeating the event
- * for the first time.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var delay:int = 250;
-
- /**
- * The number of milliseconds to wait before repeating the event
- * after the first time. This value is not checked for
- * changes after the events start repeating.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var interval:int = 100;
-
- private var timeout:uint;
- private var repeater:uint;
-
- private function mouseDownHandler(event:MouseEvent):void
- {
- event.target.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
- event.target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
- timeout = setTimeout(sendFirstRepeat, delay);
- }
-
- private function mouseOutHandler(event:MouseEvent):void
- {
- event.target.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
- event.target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
- if (repeater > 0)
- clearInterval(repeater);
- repeater = 0;
- if (timeout > 0)
- clearTimeout(timeout);
- timeout = 0;
- }
-
- private function mouseUpHandler(event:MouseEvent):void
- {
- event.target.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
- event.target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
- if (repeater > 0)
- clearInterval(repeater);
- repeater = 0;
- if (timeout > 0)
- clearTimeout(timeout);
- timeout = 0;
- }
-
- private function sendFirstRepeat():void
- {
- clearTimeout(timeout);
- timeout = 0;
- repeater = setInterval(sendRepeats, interval);
- IEventDispatcher(_strand).dispatchEvent(new Event("buttonRepeat"));
- }
-
- private function sendRepeats():void
- {
- IEventDispatcher(_strand).dispatchEvent(new Event("buttonRepeat"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ComboBoxController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ComboBoxController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ComboBoxController.as
deleted file mode 100644
index 12fb59c..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ComboBoxController.as
+++ /dev/null
@@ -1,104 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.html.beads.IComboBoxView;
-
- /**
- * The ComboBoxController class bead handles mouse events on the elements of
- * the org.apache.flex.html.ComboBox. This includes selecting the
- * button to display the selection list pop-up as well as selecting an item from the
- * pop-up list.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ComboBoxController implements IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ComboBoxController()
- {
- }
-
- 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(MouseEvent.CLICK, clickHandler);
- }
-
- /**
- * @private
- */
- private function clickHandler(event:MouseEvent):void
- {
- var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
- viewBead.popUpVisible = true;
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
- popUpModel.dataProvider = selectionModel.dataProvider;
- popUpModel.selectedIndex = selectionModel.selectedIndex;
- DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
- DisplayObject(viewBead.popUp).height = 200;
- DisplayObject(viewBead.popUp).x = DisplayObject(_strand).x;
- DisplayObject(viewBead.popUp).y = DisplayObject(_strand).y;
- IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
- }
-
- /**
- * @private
- */
- private function changeHandler(event:Event):void
- {
- var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
- viewBead.popUpVisible = false;
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
- selectionModel.selectedIndex = popUpModel.selectedIndex;
- IEventDispatcher(_strand).dispatchEvent(new Event("change"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
deleted file mode 100644
index 0aaa052..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
+++ /dev/null
@@ -1,126 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
deleted file mode 100644
index 05b852d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
+++ /dev/null
@@ -1,95 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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;
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
deleted file mode 100644
index 29f58e1..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
+++ /dev/null
@@ -1,116 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.display.DisplayObject;
- import flash.geom.Point;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.ISelectionModel;
- 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.beads.IDropDownListView;
-
- /**
- * The DropDownListController class is the controller for
- * org.apache.flex.html.DropDownList. Controllers
- * watch for events from the interactive portions of a View and
- * update the data model or dispatch a semantic event.
- * This controller watches for the click event and displays the
- * dropdown/popup, and watches the dropdown/popup for change events
- * and updates the selection model accordingly.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DropDownListController implements IBead, IBeadController
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DropDownListController()
- {
- }
-
- 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("click", clickHandler);
- }
-
- private function clickHandler(event:Event):void
- {
- var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- var popUpModel:ISelectionModel = UIBase(viewBead.popUp).model as ISelectionModel;
- DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
- popUpModel.dataProvider = selectionModel.dataProvider;
- popUpModel.labelField = selectionModel.labelField;
- viewBead.popUpVisible = true; // adds to display list as well
- popUpModel.selectedIndex = selectionModel.selectedIndex;
- var pt:Point = new Point(DisplayObject(_strand).x, DisplayObject(_strand).y + DisplayObject(_strand).height);
- pt = DisplayObject(_strand).parent.localToGlobal(pt);
- DisplayObject(viewBead.popUp).x = pt.x;
- DisplayObject(viewBead.popUp).y = pt.y;
- IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
- IUIBase(_strand).topMostEventDispatcher.addEventListener("click", dismissHandler);
- }
-
- private function dismissHandler(event:Event):void
- {
- if (event.target == _strand) return;
-
- IUIBase(_strand).topMostEventDispatcher.removeEventListener("click", dismissHandler);
- var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
- viewBead.popUpVisible = false;
- }
-
- private function changeHandler(event:Event):void
- {
- var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
- viewBead.popUpVisible = false;
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- var popUpModel:ISelectionModel = UIBase(viewBead.popUp).model as ISelectionModel;
- selectionModel.selectedIndex = popUpModel.selectedIndex;
- IEventDispatcher(_strand).dispatchEvent(new Event("change"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
deleted file mode 100644
index 4a8115f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
+++ /dev/null
@@ -1,86 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.html.beads.ITextFieldView;
-
- /**
- * The EditableTextKeyboardController class bead intercepts keyboard events on the
- * component's text field and emits change events.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class EditableTextKeyboardController implements IBead, IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function EditableTextKeyboardController()
- {
- }
-
- private var model:ITextModel;
- private var textField:CSSTextField;
-
- 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;
-
- model = UIBase(_strand).model as ITextModel;
-
- var viewBead:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
- textField = viewBead.textField;
- textField.addEventListener("change", inputChangeHandler);
- }
-
- /**
- * @private
- */
- private function inputChangeHandler( event:Object ) : void
- {
- // this will otherwise bubble an event of flash.events.Event
- event.stopImmediatePropagation();
- model.text = textField.text;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
deleted file mode 100644
index 4abaffe..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
+++ /dev/null
@@ -1,101 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.events.Event;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The HScrollBarMouseController class is the controller for
- * org.apache.flex.html.supportClasses.HScrollBar
- * that acts as the Horizontal ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HScrollBarMouseController extends ScrollBarMouseControllerBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HScrollBarMouseController()
- {
- }
-
- /**
- * @private
- */
- override protected function trackClickHandler(event:MouseEvent):void
- {
- if (sbView.thumb.visible)
- {
- if (event.localX < sbView.thumb.x)
- {
- sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.pageStepSize));
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
- else
- {
- sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.pageStepSize));
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
- }
- }
-
- private var thumbDownX:Number;
- private var lastThumbX:Number;
-
- /**
- * @private
- */
- override protected function thumbMouseDownHandler(event:MouseEvent):void
- {
- sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
- sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
- thumbDownX = event.screenX;
- lastThumbX = sbView.thumb.x;
- }
-
- private function thumbMouseMoveHandler(event:MouseEvent):void
- {
- var thumb:DisplayObject = sbView.thumb;
- var track:DisplayObject = sbView.track;
- thumb.x = Math.max(track.x, Math.min(lastThumbX + (event.screenX - thumbDownX), track.x + track.width - thumb.width));
- var newValue:Number = snap((thumb.x - track.x) / (track.width - thumb.width) * (sbModel.maximum - sbModel.minimum - sbModel.pageSize));
- sbModel.value = newValue;
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
-
- private function thumbMouseUpHandler(event:MouseEvent):void
- {
- sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
- sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
deleted file mode 100644
index ca06c77..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
+++ /dev/null
@@ -1,203 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.IStrand;
-COMPILE::AS3 {
- import org.apache.flex.events.Event;
- import org.apache.flex.events.MouseEvent;
-}
-COMPILE::JS {
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.events.BrowserEvent;
- import goog.events.Event;
- import goog.events.EventType;
- import goog.events;
-}
-
- /**
- * The ItemRendererMouseController class bead handles mouse events in itemRenderers. This
- * includes roll-overs, mouse down, and mouse up. These platform-specific events are then
- * re-dispatched as FlexJS events.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignoreimport goog.events.Event
- */
- public class ItemRendererMouseController implements IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ItemRendererMouseController()
- {
- }
-
- private var renderer:ISelectableItemRenderer;
- 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;
- renderer = value as ISelectableItemRenderer;
-
- COMPILE::AS3 {
- renderer.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
- renderer.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
- renderer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
- }
-
- COMPILE::JS {
- var element:WrappedHTMLElement = (_strand as UIBase).element;
-
- goog.events.listen(element, goog.events.EventType.MOUSEOVER, this.handleMouseOver);
- goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
- goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
- goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- protected function rollOverHandler(event:MouseEvent):void
- {
- var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
- if (target)
- {
- target.hovered = true;
- target.dispatchEvent(new Event("itemRendererRollOver",true));
- }
- }
-
- COMPILE::JS
- protected function handleMouseOver(event:BrowserEvent):void
- {
- var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
- if (target) {
- target.hovered = true;
- target.dispatchEvent(new Event("itemRendererRollOver",true));
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- protected function rollOutHandler(event:MouseEvent):void
- {
- var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
- if (target)
- {
- target.hovered = false;
- target.down = false;
- target.dispatchEvent(new Event("itemRendererRollOut",true));
- }
- }
-
- COMPILE::JS
- protected function handleMouseOut(event:BrowserEvent):void
- {
- var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
- if (target)
- {
- target.hovered = false;
- target.down = false;
- target.dispatchEvent(new Event("itemRendererRollOut",true));
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- protected function mouseDownHandler(event:MouseEvent):void
- {
- var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
- if (target)
- {
- target.down = true;
- target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
- }
- }
-
- /**
- * @private
- */
- COMPILE::JS
- protected function handleMouseDown(event:BrowserEvent):void
- {
- var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
- if (target)
- {
- target.down = true;
- target.hovered = false;
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- protected function mouseUpHandler(event:MouseEvent):void
- {
- var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
- if (target)
- {
- target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
- target.selected = true;
- target.dispatchEvent(new Event("selected"));
- }
- }
-
- /**
- * @private
- */
- COMPILE::JS
- protected function handleMouseUp(event:BrowserEvent):void
- {
- var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
- if (target)
- {
- target.selected = true;
- target.dispatchEvent(new Event("selected"));
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
deleted file mode 100644
index 9760591..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
+++ /dev/null
@@ -1,127 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IRollOverModel;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.html.beads.IListView;
-
- /**
- * The ListSingleSelectionMouseController class is a controller for
- * org.apache.flex.html.List. Controllers
- * watch for events from the interactive portions of a View and
- * update the data model or dispatch a semantic event.
- * This controller watches for events from the item renderers
- * and updates an ISelectionModel (which only supports single
- * selection). Other controller/model pairs would support
- * various kinds of multiple selection.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ListSingleSelectionMouseController implements IBeadController
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ListSingleSelectionMouseController()
- {
- }
-
- /**
- * The model.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var listModel:ISelectionModel;
-
- /**
- * The view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var listView:IListView;
-
- /**
- * The parent of the item renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- 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;
- listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
- listView = value.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- dataGroup.addEventListener("selected", selectedHandler, true);
- IEventDispatcher(_strand).addEventListener(MouseEvent.ROLL_OVER, rolloverHandler);
- }
-
- private function selectedHandler(event:Event):void
- {
- listModel.selectedIndex = ISelectableItemRenderer(event.target).index;
- listView.host.dispatchEvent(new Event("change"));
- }
-
- private function rolloverHandler(event:Event):void
- {
- var renderer:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
- if (renderer) {
- //trace("ListSingleSelectionMouseController.ROLL_OVER");
- IRollOverModel(listModel).rollOverIndex = renderer.index;
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
deleted file mode 100644
index 8d9d27b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
+++ /dev/null
@@ -1,184 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.html.beads.IScrollBarView;
-
- /**
- * The ScrollBarMouseControllerBase class is the base class
- * for ScrollBarMouseControllers such as VScrollBarMouseController.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ScrollBarMouseControllerBase implements IBeadController
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ScrollBarMouseControllerBase()
- {
- }
-
- /**
- * The data model
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var sbModel:IScrollBarModel;
-
- /**
- * The view
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var sbView:IScrollBarView;
-
- private var _strand:IStrand;
-
- /**
- * @private
- */
- public function get strand():IStrand
- {
- return _strand;
- }
-
- /**
- * @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;
- sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
- sbView = value.getBeadByType(IScrollBarView) as IScrollBarView;
- sbView.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
- sbView.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
- sbView.decrement.addEventListener("buttonRepeat", decrementClickHandler);
- sbView.increment.addEventListener("buttonRepeat", incrementClickHandler);
- sbView.track.addEventListener(MouseEvent.CLICK, trackClickHandler);
- sbView.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbMouseDownHandler);
- }
-
- /**
- * Force the input number to be "snapped" to the snapInterval.
- *
- * @param value The input number.
- * @return The input number "snapped" to the snapInterval.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function snap(value:Number):Number
- {
- var si:Number = sbModel.snapInterval;
- var n:Number = Math.round((value - sbModel.minimum) / si) * si + sbModel.minimum;
- if (value > 0)
- {
- if (value - n < n + si - value)
- return n;
- return n + si;
-
- }
- if (value - n > n + si - value)
- return n + si;
- return n;
- }
-
- /**
- * Updates the model when the decrement button is clicked.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function decrementClickHandler(event:Event):void
- {
- sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.stepSize));
- IEventDispatcher(_strand).dispatchEvent(new Event("scroll"));
- }
-
- /**
- * Updates the model when the increment button is clicked.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function incrementClickHandler(event:Event):void
- {
- sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.stepSize));
- IEventDispatcher(_strand).dispatchEvent(new Event("scroll"));
- }
-
- /**
- * Handles a click in the track. Must be overridden.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function trackClickHandler(event:MouseEvent):void
- {
- }
-
- /**
- * Handles a mouse down on the thumb. Must be overridden.
- * Subclasses process the mouseMove and mouseUp events.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function thumbMouseDownHandler(event:MouseEvent):void
- {
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SliderMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
deleted file mode 100644
index 6469fd0..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SliderMouseController.as
+++ /dev/null
@@ -1,286 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IRangeModel;
- 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.events.MouseEvent;
- import org.apache.flex.geom.Point;
- import org.apache.flex.html.beads.ISliderView;
- import org.apache.flex.html.beads.SliderTrackView;
-
- COMPILE::JS
- {
- import goog.events;
- import goog.events.EventType;
- import org.apache.flex.events.BrowserEvent;
- import org.apache.flex.html.Slider;
- import org.apache.flex.html.beads.SliderThumbView;
- import org.apache.flex.html.beads.SliderTrackView;
- }
-
- /**
- * The SliderMouseController class bead handles mouse events on the
- * org.apache.flex.html.Slider's component parts (thumb and track) and
- * dispatches change events on behalf of the Slider (as well as co-ordinating visual
- * changes (such as moving the thumb when the track has been tapped or clicked).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SliderMouseController implements IBead, IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SliderMouseController()
- {
- }
-
- private var rangeModel:IRangeModel;
-
- 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;
-
- rangeModel = UIBase(value).model as IRangeModel;
-
- COMPILE::AS3
- {
- var sliderView:ISliderView = value.getBeadByType(ISliderView) as ISliderView;
- sliderView.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDownHandler);
-
- // add handler to detect click on track
- sliderView.track.addEventListener(MouseEvent.CLICK, trackClickHandler, false, 99999);
-
- }
- COMPILE::JS
- {
- track = value.getBeadByType(
- SliderTrackView) as SliderTrackView;
- thumb = value.getBeadByType(
- SliderThumbView) as SliderThumbView;
-
- goog.events.listen(track.element, goog.events.EventType.CLICK,
- handleTrackClick, false, this);
-
- goog.events.listen(thumb.element, goog.events.EventType.MOUSEDOWN,
- handleThumbDown, false, this);
-
- }
- }
-
- COMPILE::JS
- private var track:SliderTrackView;
-
- COMPILE::JS
- private var thumb:SliderThumbView;
-
- /**
- * @private
- */
- COMPILE::AS3
- private function thumbDownHandler( event:MouseEvent ) : void
- {
- UIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_MOVE, thumbMoveHandler);
- UIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_UP, thumbUpHandler);
-
- var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
-
- origin = new Point(event.screenX, event.screenY);
- thumb = new Point(sliderView.thumb.x,sliderView.thumb.y);
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function thumbUpHandler( event:MouseEvent ) : void
- {
- UIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMoveHandler);
- UIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_UP, thumbUpHandler);
-
- IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
- }
-
- COMPILE::AS3
- private var origin:Point;
- COMPILE::AS3
- private var thumb:Point;
-
- /**
- * @private
- */
- COMPILE::AS3
- private function thumbMoveHandler( event:MouseEvent ) : void
- {
- var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
-
- var deltaX:Number = event.screenX - origin.x;
- var thumbW:Number = sliderView.thumb.width/2;
- var newX:Number = thumb.x + deltaX;
-
- var p:Number = newX/UIBase(_strand).width;
- var n:Number = p*(rangeModel.maximum - rangeModel.minimum) + rangeModel.minimum;
-
- rangeModel.value = n;
-
- IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function trackClickHandler( event:MouseEvent ) : void
- {
- event.stopImmediatePropagation();
-
- var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
-
- var xloc:Number = event.localX;
- var p:Number = xloc/UIBase(_strand).width;
- var n:Number = p*(rangeModel.maximum - rangeModel.minimum) + rangeModel.minimum;
-
- rangeModel.value = n;
-
- IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
- }
-
- /**
- */
- COMPILE::JS
- private function handleTrackClick(event:BrowserEvent):void
- {
- var host:Slider = _strand as Slider;
- var xloc:Number = event.clientX;
- var p:Number = Math.min(1, xloc / parseInt(track.element.style.width, 10));
- var n:Number = p * (host.maximum - host.minimum) +
- host.minimum;
-
- host.value = n;
-
- origin = parseInt(thumb.element.style.left, 10);
- position = parseInt(thumb.element.style.left, 10);
-
- calcValFromMousePosition(event, true);
-
- host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
- }
-
-
- /**
- */
- COMPILE::JS
- private function handleThumbDown(event:BrowserEvent):void
- {
- var host:Slider = _strand as Slider;
- goog.events.listen(host.element, goog.events.EventType.MOUSEUP,
- handleThumbUp, false, this);
- goog.events.listen(host.element, goog.events.EventType.MOUSEMOVE,
- handleThumbMove, false, this);
-
- origin = event.clientX;
- position = parseInt(thumb.element.style.left, 10);
- }
-
- COMPILE::JS
- private var origin:Number;
- COMPILE::JS
- private var position:int;
-
- /**
- */
- COMPILE::JS
- private function handleThumbUp(event:BrowserEvent):void
- {
- var host:Slider = _strand as Slider;
- goog.events.unlisten(host.element, goog.events.EventType.MOUSEUP,
- handleThumbUp, false, this);
- goog.events.unlisten(host.element, goog.events.EventType.MOUSEMOVE,
- handleThumbMove, false, this);
-
- calcValFromMousePosition(event, false);
-
- host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
- }
-
-
- /**
- */
- COMPILE::JS
- private function handleThumbMove(event:BrowserEvent):void
- {
- var host:Slider = _strand as Slider;
- calcValFromMousePosition(event, false);
-
- host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
- }
-
-
- /**
- */
- COMPILE::JS
- private function calcValFromMousePosition(event:BrowserEvent, useOffset:Boolean):void
- {
- var host:Slider = _strand as Slider;
- var deltaX:Number = (useOffset ? event.offsetX : event.clientX) - origin;
- var thumbW:int = parseInt(thumb.element.style.width, 10) / 2;
- var newX:Number = position + deltaX;
-
- var p:Number = newX / parseInt(track.element.style.width, 10);
- var n:Number = p * (host.maximum - host.minimum) +
- host.minimum;
- n = host.snap(n);
- if (n < host.minimum) n = host.minimum;
- else if (n > host.maximum) n = host.maximum;
-
- p = (n - host.minimum) / (host.maximum -
- host.minimum);
- newX = p * parseInt(track.element.style.width, 10);
-
- thumb.element.style.left = String(newX -
- parseInt(thumb.element.style.width, 10) / 2) + 'px';
-
- host.value = n;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
deleted file mode 100644
index 53309df..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
+++ /dev/null
@@ -1,125 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import org.apache.flex.core.IBeadController;
- import org.apache.flex.core.IRangeModel;
- 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.events.MouseEvent;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.html.beads.ISpinnerView;
- COMPILE::JS
- {
- import org.apache.flex.html.Spinner;
- import goog.events;
- import goog.events.EventType;
- }
-
- /**
- * The SpinnerMouseController class bead handles mouse events on the
- * org.apache.flex.html.Spinner's component buttons, changing the
- * value of the Spinner.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SpinnerMouseController implements IBeadController
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SpinnerMouseController()
- {
- }
-
- private var rangeModel:IRangeModel;
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @flexjsignorecoercion org.apache.flex.html.Spinner
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
-
- rangeModel = UIBase(value).model as IRangeModel;
-
- COMPILE::AS3
- {
- var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
- spinnerBead.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
- spinnerBead.decrement.addEventListener("buttonRepeat", decrementClickHandler);
- spinnerBead.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
- spinnerBead.increment.addEventListener("buttonRepeat", incrementClickHandler);
- }
-
- COMPILE::JS
- {
- var host:Spinner = value as Spinner;
- incrementButton = host.incrementButton;
- decrementButton = host.decrementButton;
-
- goog.events.listen(incrementButton.element, goog.events.EventType.CLICK,
- incrementClickHandler);
-
- goog.events.listen(decrementButton.element, goog.events.EventType.CLICK,
- decrementClickHandler);
-
- }
- }
-
- private var incrementButton:TextButton;
- private var decrementButton:TextButton;
-
- /**
- * @private
- */
- private function decrementClickHandler( event:Event ) : void
- {
- rangeModel.value = Math.max(rangeModel.minimum, rangeModel.value - rangeModel.stepSize);
- IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
- }
-
- /**
- * @private
- */
- private function incrementClickHandler( event:Event ) : void
- {
- rangeModel.value = Math.min(rangeModel.maximum, rangeModel.value + rangeModel.stepSize);
- IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
- }
- }
-}
[13/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/compile-asjs-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/compile-asjs-config.xml b/frameworks/projects/HTML/compile-asjs-config.xml
deleted file mode 100644
index 2139379..0000000
--- a/frameworks/projects/HTML/compile-asjs-config.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<flex-config>
-
- <compiler>
- <accessible>false</accessible>
-
- <external-library-path>
- </external-library-path>
-
- <mxml>
- <children-as-data>true</children-as-data>
- </mxml>
- <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
- <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
- <binding-value-change-event-type>valueChange</binding-value-change-event-type>
-
- <keep-as3-metadata>
- <name>Bindable</name>
- <name>Managed</name>
- <name>ChangeEvent</name>
- <name>NonCommittingChangeEvent</name>
- <name>Transient</name>
- </keep-as3-metadata>
-
- <locale/>
-
- <library-path>
- <!-- asjscompc won't 'link' these classes in, but will list their requires
- if these swcs are on the external-library-path then their requires
- will not be listed -->
- <path-element>../../externs/Binding.swc</path-element>
- <path-element>../../externs/Core.swc</path-element>
- <path-element>../../externs/Graphics.swc</path-element>
- <path-element>../../externs/Collections.swc</path-element>
- </library-path>
-
- <namespaces>
- <namespace>
- <uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>basic-manifest.xml</manifest>
- </namespace>
- <namespace>
- <uri>library://ns.apache.org/flexjs/svg</uri>
- <manifest>svg-manifest.xml</manifest>
- </namespace>
- </namespaces>
-
- <source-path>
- <path-element>as/src</path-element>
- </source-path>
-
- <warn-no-constructor>false</warn-no-constructor>
- </compiler>
-
- <include-file>
- </include-file>
-
- <include-sources>
- </include-sources>
-
- <include-classes>
- <class>HTMLClasses</class>
- </include-classes>
-
- <include-namespaces>
- <uri>library://ns.apache.org/flexjs/basic</uri>
- <uri>library://ns.apache.org/flexjs/svg</uri>
- </include-namespaces>
-
- <target-player>${playerglobal.version}</target-player>
-
-
-</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/compile-config.xml b/frameworks/projects/HTML/compile-config.xml
deleted file mode 100644
index 7ea999a..0000000
--- a/frameworks/projects/HTML/compile-config.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<flex-config>
-
- <compiler>
- <accessible>false</accessible>
-
- <external-library-path>
- <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
- <path-element>../../libs/Binding.swc</path-element>
- <path-element>../../libs/Core.swc</path-element>
- <path-element>../../libs/Graphics.swc</path-element>
- <path-element>../../libs/Collections.swc</path-element>
- </external-library-path>
-
- <mxml>
- <children-as-data>true</children-as-data>
- </mxml>
- <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
- <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
- <binding-value-change-event-type>valueChange</binding-value-change-event-type>
-
- <keep-as3-metadata>
- <name>Bindable</name>
- <name>Managed</name>
- <name>ChangeEvent</name>
- <name>NonCommittingChangeEvent</name>
- <name>Transient</name>
- </keep-as3-metadata>
-
- <locale/>
-
- <library-path/>
-
- <namespaces>
- <namespace>
- <uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>basic-manifest.xml</manifest>
- </namespace>
- <namespace>
- <uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>basic-as-manifest.xml</manifest>
- </namespace>
- <namespace>
- <uri>library://ns.apache.org/flexjs/svg</uri>
- <manifest>svg-manifest.xml</manifest>
- </namespace>
- </namespaces>
-
- <source-path>
- <path-element>as/src</path-element>
- </source-path>
-
- <warn-no-constructor>false</warn-no-constructor>
- </compiler>
-
- <include-file>
- <name>defaults.css</name>
- <path>as/defaults.css</path>
- </include-file>
- <include-file>
- <name>js/out/*</name>
- <path>js/out/*</path>
- </include-file>
-
- <include-classes>
- <class>HTMLClasses</class>
- </include-classes>
-
- <include-namespaces>
- <uri>library://ns.apache.org/flexjs/basic</uri>
- <uri>library://ns.apache.org/flexjs/svg</uri>
- </include-namespaces>
-
- <target-player>${playerglobal.version}</target-player>
-
-
-</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/HTMLClasses.as b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
new file mode 100644
index 0000000..052ab95
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/HTMLClasses.as
@@ -0,0 +1,176 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+/**
+ * @private
+ * This class is used to link additional classes into rpc.swc
+ * beyond those that are found by dependecy analysis starting
+ * from the classes specified in manifest.xml.
+ */
+internal class HTMLClasses
+{
+
+ import org.apache.flex.html.ToolTip; ToolTip;
+ import org.apache.flex.html.accessories.NumericOnlyTextInputBead; NumericOnlyTextInputBead;
+ import org.apache.flex.html.accessories.PasswordInputBead; PasswordInputBead;
+ import org.apache.flex.html.accessories.TextPromptBead; TextPromptBead;
+ import org.apache.flex.html.beads.AlertView; AlertView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.BackgroundImageBead; BackgroundImageBead;
+ }
+ import org.apache.flex.html.beads.ButtonBarView; ButtonBarView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.CheckBoxView; CheckBoxView;
+ import org.apache.flex.html.beads.ComboBoxView; ComboBoxView;
+ }
+ import org.apache.flex.html.beads.ContainerView; ContainerView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.ControlBarMeasurementBead; ControlBarMeasurementBead;
+ import org.apache.flex.html.beads.CSSButtonView; CSSButtonView;
+ import org.apache.flex.html.beads.CSSImageAndTextButtonView; CSSImageAndTextButtonView;
+ import org.apache.flex.html.beads.CSSTextButtonView; CSSTextButtonView;
+ import org.apache.flex.html.beads.CSSTextToggleButtonView; CSSTextToggleButtonView;
+ import org.apache.flex.html.beads.DropDownListView; DropDownListView;
+ import org.apache.flex.html.beads.CloseButtonView; CloseButtonView;
+ import org.apache.flex.html.beads.ImageAndTextButtonView; ImageAndTextButtonView;
+ import org.apache.flex.html.beads.ImageView; ImageView;
+ }
+ import org.apache.flex.html.beads.ImageButtonView; ImageButtonView;
+ import org.apache.flex.html.beads.ListView; ListView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.NumericStepperView; NumericStepperView;
+ }
+ import org.apache.flex.html.beads.PanelView; PanelView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.PanelWithControlBarView; PanelWithControlBarView;
+ import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
+ import org.apache.flex.html.beads.VScrollBarView; VScrollBarView;
+ import org.apache.flex.html.beads.HScrollBarView; HScrollBarView;
+ import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
+ import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
+ import org.apache.flex.html.beads.SingleLineBorderBead; SingleLineBorderBead;
+ import org.apache.flex.html.beads.SliderView; SliderView;
+ }
+ import org.apache.flex.html.beads.SliderThumbView; SliderThumbView;
+ import org.apache.flex.html.beads.SliderTrackView; SliderTrackView;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.SolidBackgroundBead; SolidBackgroundBead;
+ import org.apache.flex.html.beads.SpinnerView; SpinnerView;
+ import org.apache.flex.html.beads.TextButtonMeasurementBead; TextButtonMeasurementBead;
+ import org.apache.flex.html.beads.TextFieldLabelMeasurementBead; TextFieldLabelMeasurementBead;
+ import org.apache.flex.html.beads.TextAreaView; TextAreaView;
+ import org.apache.flex.html.beads.TextButtonView; TextButtonView;
+ import org.apache.flex.html.beads.TextFieldView; TextFieldView;
+ import org.apache.flex.html.beads.TextInputView; TextInputView;
+ import org.apache.flex.html.beads.TextInputWithBorderView; TextInputWithBorderView;
+ import org.apache.flex.html.beads.models.AlertModel; AlertModel;
+ }
+ import org.apache.flex.html.beads.models.ArraySelectionModel; ArraySelectionModel;
+ import org.apache.flex.html.beads.models.RangeModel; RangeModel;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.models.ComboBoxModel; ComboBoxModel;
+ }
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.models.ImageModel; ImageModel;
+ import org.apache.flex.html.beads.models.ImageAndTextModel; ImageAndTextModel;
+ }
+ import org.apache.flex.html.beads.models.PanelModel; PanelModel;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.models.SingleLineBorderModel; SingleLineBorderModel;
+ }
+ import org.apache.flex.html.beads.models.TextModel; TextModel;
+ import org.apache.flex.html.beads.models.TitleBarModel; TitleBarModel;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.models.ToggleButtonModel; ToggleButtonModel;
+ import org.apache.flex.html.beads.models.ValueToggleButtonModel; ValueToggleButtonModel;
+ }
+ import org.apache.flex.html.beads.models.ViewportModel; ViewportModel;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.controllers.AlertController; AlertController;
+ import org.apache.flex.html.beads.controllers.ComboBoxController; ComboBoxController;
+ import org.apache.flex.html.beads.controllers.DropDownListController; DropDownListController;
+ import org.apache.flex.html.beads.controllers.EditableTextKeyboardController; EditableTextKeyboardController;
+ }
+ import org.apache.flex.html.beads.controllers.ItemRendererMouseController; ItemRendererMouseController;
+ import org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController; ListSingleSelectionMouseController;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.controllers.SliderMouseController; SliderMouseController;
+ import org.apache.flex.html.beads.controllers.SpinnerMouseController; SpinnerMouseController;
+ import org.apache.flex.html.beads.controllers.VScrollBarMouseController; VScrollBarMouseController;
+ import org.apache.flex.html.beads.controllers.HScrollBarMouseController; HScrollBarMouseController;
+ }
+ import org.apache.flex.html.beads.layouts.ButtonBarLayout; ButtonBarLayout;
+ import org.apache.flex.html.beads.layouts.VerticalLayout; VerticalLayout;
+ import org.apache.flex.html.beads.layouts.HorizontalLayout; HorizontalLayout;
+ import org.apache.flex.html.beads.layouts.BasicLayout; BasicLayout;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.layouts.HScrollBarLayout; HScrollBarLayout;
+ import org.apache.flex.html.beads.layouts.VScrollBarLayout; VScrollBarLayout;
+ }
+ import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
+ import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
+ import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
+ import org.apache.flex.html.beads.DataItemRendererFactoryForArrayList; DataItemRendererFactoryForArrayList;
+ import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
+ import org.apache.flex.html.supportClasses.Viewport; Viewport;
+ import org.apache.flex.html.supportClasses.ScrollingViewport; ScrollingViewport;
+
+ import org.apache.flex.html.beads.DataGridColumnView; DataGridColumnView;
+ import org.apache.flex.html.beads.DataGridView; DataGridView;
+ import org.apache.flex.html.beads.DateChooserView; DateChooserView;
+ import org.apache.flex.html.beads.DateFieldView; DateFieldView;
+ import org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout; FlexibleFirstChildHorizontalLayout;
+ import org.apache.flex.html.beads.models.DataGridModel; DataGridModel;
+ import org.apache.flex.html.beads.models.DateChooserModel; DateChooserModel;
+ import org.apache.flex.html.beads.models.DataGridPresentationModel; DataGridPresentationModel;
+ import org.apache.flex.html.beads.controllers.DateChooserMouseController; DateChooserMouseController;
+ import org.apache.flex.html.beads.controllers.DateFieldMouseController; DateFieldMouseController;
+ import org.apache.flex.html.supportClasses.DataGridColumn; DataGridColumn;
+ import org.apache.flex.html.supportClasses.DateChooserButton; DateChooserButton;
+ import org.apache.flex.html.supportClasses.GraphicsItemRenderer; GraphicsItemRenderer;
+
+ import org.apache.flex.html.MXMLBeadViewBase; MXMLBeadViewBase;
+ import org.apache.flex.html.beads.TitleBarView; TitleBarView;
+ import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
+
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.HRuleView; HRuleView;
+ import org.apache.flex.html.beads.VRuleView; VRuleView;
+ import org.apache.flex.html.beads.MultilineTextFieldView; MultilineTextFieldView;
+ }
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/IScrollingLayoutParent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/IScrollingLayoutParent.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/IScrollingLayoutParent.as
new file mode 100644
index 0000000..5e9768e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/IScrollingLayoutParent.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core
+{
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.html.supportClasses.ScrollBar;
+
+ /**
+ * The IScrollingLayoutParent interface is an ILayoutParent
+ * that has traditional scrollbars. The layout implementation
+ * often needs to know certain things about other objects in
+ * the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IScrollingLayoutParent
+ {
+ /**
+ * The border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get border():Border;
+
+ /**
+ * The vertical ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get vScrollBar():ScrollBar;
+
+ /**
+ * The horizontal ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get hScrollBar():ScrollBar;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
new file mode 100644
index 0000000..b7f50dc
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Alert.as
@@ -0,0 +1,287 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IPopUp;
+ import org.apache.flex.core.UIBase;
+
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.events.Event;
+ }
+
+ /**
+ * The Alert class is a component that displays a message and one or more buttons
+ * in a view that pops up over all other controls and views. The Alert component
+ * uses the AlertView bead to display a modal dialog with a title and a variety
+ * of buttons configured through the flag property of its show() static function.
+ * The Alert component uses the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the Alert.
+ * org.apache.flex.core.IBeadView: the bead used to create the parts of the Alert.
+ * org.apache.flex.core.IBeadController: the bead used to handle input events.
+ * org.apache.flex.core.IBorderBead: if present, draws a border around the Alert.
+ * org.apache.flex.core.IBackgroundBead: if present, places a solid color background below the Alert.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Alert extends UIBase implements IPopUp
+ {
+ /**
+ * The bitmask button flag to show the YES button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const YES:uint = 0x000001;
+
+ /**
+ * The bitmask button flag to show the NO button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const NO:uint = 0x000002;
+
+ /**
+ * The bitmask button flag to show the OK button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const OK:uint = 0x000004;
+
+ /**
+ * The bitmask button flag to show the Cancel button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const CANCEL:uint = 0x000008;
+
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Alert()
+ {
+ super();
+
+ className = "Alert";
+ }
+
+ COMPILE::JS
+ private var titleBar:TitleBar;
+
+ COMPILE::JS
+ private var label:Label;
+
+ COMPILE::JS
+ private var buttonArea:Container;
+
+ /**
+ * @override
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+
+ element.className = 'Alert';
+
+ // add in a title bar
+ titleBar = new TitleBar();
+ addElement(titleBar);
+ titleBar.element.id = 'titleBar';
+
+ label = new Label();
+ addElement(label);
+ label.element.id = 'message';
+
+ // add a place for the buttons
+ buttonArea = new Container();
+ addElement(buttonArea);
+ buttonArea.element.id = 'buttonArea';
+
+ return element;
+ };
+
+ // note: only passing parent to this function as I don't see a way to identify
+ // the 'application' or top level view without supplying a place to start to
+ // look for it.
+ /**
+ * This static method is a convenience function to quickly create and display an Alert. The
+ * text and parent paramters are required, the others will default.
+ *
+ * @param String text The message content of the Alert.
+ * @param Object parent The object that hosts the pop-up.
+ * @param String title An optional title for the Alert.
+ * @param uint flags Identifies which buttons to display in the alert.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ static public function show( text:String, parent:Object, title:String="", flags:uint=Alert.OK ) : void
+ {
+ var alert:Alert = new Alert();
+ alert.message = text;
+ alert.title = title;
+ alert.flags = flags;
+
+ alert.show(parent);
+
+ COMPILE::JS
+ {
+ alert.positioner.style.position = 'relative';
+ alert.positioner.style.width = '200px';
+ alert.positioner.style.margin = 'auto';
+ alert.positioner.style.top = '100px';
+ }
+ }
+
+ /**
+ * Shows the Alert anchored to the given parent object which is usally a root component such
+ * as a UIView..
+ *
+ * @param Object parent The object that hosts the pop-up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function show(parent:Object) : void
+ {
+ parent.addElement(this);
+ }
+
+ /**
+ * The tile of the Alert.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return IAlertModel(model).title;
+ }
+ public function set title(value:String):void
+ {
+ IAlertModel(model).title = value;
+ }
+
+ /**
+ * The message to display in the Alert body.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get message():String
+ {
+ return IAlertModel(model).message;
+ }
+ public function set message(value:String):void
+ {
+ IAlertModel(model).message = value;
+ }
+
+ /**
+ * The buttons to display on the Alert as bit-mask values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get flags():uint
+ {
+ return IAlertModel(model).flags;
+ }
+ public function set flags(value:uint):void
+ {
+ IAlertModel(model).flags = value;
+
+ COMPILE::JS
+ {
+ // add buttons based on flags
+ if (flags & Alert.OK) {
+ var ok:TextButton = new TextButton();
+ buttonArea.addElement(ok);
+ ok.text = 'OK';
+ goog.events.listen(ok.element, 'click', dismissAlert);
+ }
+ if (flags & Alert.CANCEL) {
+ var cancel:TextButton = new TextButton();
+ buttonArea.addElement(cancel);
+ cancel.text = 'Cancel';
+ goog.events.listen(cancel.element, 'click', dismissAlert);
+ }
+ if (flags & Alert.YES) {
+ var yes:TextButton = new TextButton();
+ buttonArea.addElement(yes);
+ yes.text = 'YES';
+ goog.events.listen(yes.element, 'click', dismissAlert);
+ }
+ if (flags & Alert.NO) {
+ var nob:TextButton = new TextButton();
+ buttonArea.addElement(nob);
+ nob.text = 'NO';
+ goog.events.listen(nob.element, 'click', dismissAlert);
+ }
+
+ }
+ }
+
+ /**
+ * @param event The event object.
+ * @flexjsignorecoercion HTMLElement
+ */
+ COMPILE::JS
+ private function dismissAlert(event:Event):void
+ {
+ var htmlElement:HTMLElement = element as HTMLElement;
+ htmlElement.parentElement.removeChild(element);
+ };
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Button.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Button.as
new file mode 100644
index 0000000..d4c2001
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Button.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ COMPILE::AS3
+ {
+ import org.apache.flex.core.UIButtonBase;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * Dispatched when the user clicks on a button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="click", type="org.apache.flex.events.Event")]
+
+ /**
+ * The Button class is a simple button. Use TextButton for
+ * buttons that should show text. This is the lightest weight
+ * button used for non-text buttons like the arrow buttons
+ * in a Scrollbar or NumericStepper.
+ *
+ * The most common view for this button is CSSButtonView that
+ * allows you to specify a backgroundImage in CSS that defines
+ * the look of the button.
+ *
+ * However, when used in ScrollBar and when composed in many
+ * other components, it is more common to assign a custom view
+ * to the button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ public class Button extends UIButtonBase implements IStrand, IEventDispatcher, IUIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Button()
+ {
+ super();
+ }
+ }
+
+ COMPILE::JS
+ public class Button extends UIBase implements IStrand, IEventDispatcher, IUIBase
+ {
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('button') as WrappedHTMLElement;
+ element.setAttribute('type', 'button');
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ /* AJH comment out until we figure out why it is needed
+ if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) {
+ var impl:Object = org.apache.flex.core.ValuesManager.valuesImpl.
+ getValue(this, 'iStatesImpl');
+ }*/
+
+ return element;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ButtonBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ButtonBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ButtonBar.as
new file mode 100644
index 0000000..e4c58e7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ButtonBar.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
+{
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The ButtonBar class is a component that displays a set of Buttons. The ButtonBar
+ * is actually a List with a default horizontal layout and an itemRenderer that
+ * produces Buttons. The ButtonBar uses the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the ButtonBar, including the dataProvider.
+ * org.apache.flex.core.IBeadView: constructs the parts of the component.
+ * org.apache.flex.core.IBeadController: handles input events.
+ * org.apache.flex.core.IBeadLayout: sizes and positions the component parts.
+ * org.apache.flex.core.IDataProviderItemRendererMapper: produces itemRenderers.
+ * org.apache.flex.core.IItemRenderer: the class or class factory to use.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ButtonBar extends List
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ButtonBar()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.style.overflow = 'auto';
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ className = 'ButtonBar';
+
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CheckBox.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CheckBox.as
new file mode 100644
index 0000000..6405ab5
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CheckBox.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
+{
+ COMPILE::AS3
+ {
+ import flash.events.MouseEvent;
+ }
+
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.core.IUIBase;
+ COMPILE::AS3
+ {
+ import org.apache.flex.core.UIButtonBase;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * Dispatched when the user checks or un-checks the CheckBox.
+ *
+ * @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 CheckBox class implements the common user interface
+ * control. The CheckBox includes its text label.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ public class CheckBox extends UIButtonBase implements IStrand
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CheckBox()
+ {
+ super();
+
+ addEventListener(MouseEvent.CLICK, internalMouseHandler);
+ }
+
+ /**
+ * The text label for the CheckBox.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return IToggleButtonModel(model).text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ IToggleButtonModel(model).text = value;
+ }
+
+ [Bindable("change")]
+ /**
+ * <code>true</code> if the check mark is displayed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return IToggleButtonModel(model).selected;
+ }
+
+ /**
+ * @private
+ */
+ public function set selected(value:Boolean):void
+ {
+ IToggleButtonModel(model).selected = value;
+ }
+
+ private function internalMouseHandler(event:Event) : void
+ {
+ selected = !selected;
+ dispatchEvent(new Event("change"));
+ }
+ }
+
+ COMPILE::JS
+ public class CheckBox extends UIBase
+ {
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ override protected function createElement():WrappedHTMLElement
+ {
+ var cb:HTMLInputElement;
+
+ element = document.createElement('label') as WrappedHTMLElement;
+
+ cb = document.createElement('input') as HTMLInputElement;
+ cb.type = 'checkbox';
+ element.appendChild(cb);
+ element.appendChild(document.createTextNode(''));
+
+ element.className = 'CheckBox';
+ typeNames = 'CheckBox';
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ (cb as WrappedHTMLElement).flexjs_wrapper = this;
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ public function get text():String
+ {
+ return element.childNodes.item(1).nodeValue;
+ }
+
+ public function set text(value:String):void
+ {
+ element.childNodes.item(1).nodeValue = value;
+ }
+
+ public function get selected():Boolean
+ {
+ return (element.childNodes.item(0) as HTMLInputElement).checked;
+ }
+
+ public function set selected(value:Boolean):void
+ {
+ (element.childNodes.item(0) as HTMLInputElement).checked = value;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CloseButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CloseButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CloseButton.as
new file mode 100644
index 0000000..8306915
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/CloseButton.as
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The CloseButton class is Button that displays an X
+ * and is commonly used in a Panel's TitleBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CloseButton extends Button
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CloseButton()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+ element.innerHTML = 'x';
+
+ element.style.padding = 0;
+ height = 11;
+ width = 11;
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ComboBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ComboBox.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ComboBox.as
new file mode 100644
index 0000000..fa91fec
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ComboBox.as
@@ -0,0 +1,277 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The ComboBox class is a component that displays an input field and
+ * pop-up List with selections. Selecting an item from the pop-up List
+ * places that item into the input field of the ComboBox. The ComboBox
+ * uses the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and
+ * so forth.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the component.
+ * org.apache.flex.core.IBeadController: the bead that handles input and output.
+ * org.apache.flex.core.IPopUp: the bead responsible for displaying the selection list.
+ * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders.
+ * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ComboBox extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ComboBox()
+ {
+ super();
+ }
+
+ /**
+ * The data for display by the ComboBox.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return IComboBoxModel(model).dataProvider;
+ }
+ public function set dataProvider(value:Object):void
+ {
+ IComboBoxModel(model).dataProvider = value;
+ }
+
+ /**
+ * The index of the currently selected item. Changing this item changes
+ * the selectedItem value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return IComboBoxModel(model).selectedIndex;
+ }
+ public function set selectedIndex(value:int):void
+ {
+ IComboBoxModel(model).selectedIndex = value;
+ }
+
+ /**
+ * The item that is currently selected. Changing this item changes
+ * the selectedIndex.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return IComboBoxModel(model).selectedItem;
+ }
+ public function set selectedItem(value:Object):void
+ {
+ IComboBoxModel(model).selectedItem = value;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ var button:WrappedHTMLElement;
+ var input:WrappedHTMLElement;
+
+ element = document.createElement('div') as WrappedHTMLElement;
+
+ input = document.createElement('input') as WrappedHTMLElement;
+ input.style.position = 'absolute';
+ input.style.width = '80px';
+ element.appendChild(input);
+
+ button = document.createElement('div') as WrappedHTMLElement;
+ button.style.position = 'absolute';
+ button.style.top = '0px';
+ button.style.right = '0px';
+ button.style.background = '#bbb';
+ button.style.width = '16px';
+ button.style.height = '20px';
+ button.style.margin = '0';
+ button.style.border = 'solid #609 1px';
+ goog.events.listen(button, 'click', buttonClicked);
+ element.appendChild(button);
+
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ // add a click handler so that a click outside of the combo box can
+ // dismiss the pop-up should it be visible.
+ goog.events.listen(document, 'click',
+ dismissPopup);
+
+ input.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ COMPILE::JS
+ private var popup:HTMLElement;
+
+ /**
+ * @param event The event.
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ COMPILE::JS
+ private function selectChanged(event:Event):void
+ {
+ var select:HTMLSelectElement;
+
+ select = event.currentTarget as HTMLSelectElement;
+
+ selectedItem = select.options[select.selectedIndex].value;
+
+ popup.parentNode.removeChild(popup);
+ popup = null;
+
+ dispatchEvent(event);
+ }
+
+
+ /**
+ * @param event The event.
+ */
+ COMPILE::JS
+ private function dismissPopup(event:Event):void
+ {
+ // remove the popup if it already exists
+ if (popup) {
+ popup.parentNode.removeChild(popup);
+ popup = null;
+ }
+ }
+
+
+ /**
+ * @export
+ * @param {Object} event The event.
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion HTMLElement
+ * @flexjsignorecoercion HTMLSelectElement
+ * @flexjsignorecoercion HTMLOptionElement
+ * @flexjsignorecoercion Array
+ */
+ COMPILE::JS
+ private function buttonClicked(event:Event):void
+ {
+ var dp:Array;
+ var i:int;
+ var input:HTMLInputElement;
+ var left:Number;
+ var n:int;
+ var opt:HTMLOptionElement;
+ var pn:HTMLElement;
+ var popup:HTMLElement;
+ var select:HTMLSelectElement;
+ var si:int;
+ var top:Number;
+ var width:Number;
+
+ event.stopPropagation();
+
+ if (popup) {
+ dismissPopup(null);
+
+ return;
+ }
+
+ input = element.childNodes.item(0) as HTMLInputElement;
+
+ pn = element;
+ top = pn.offsetTop + input.offsetHeight;
+ left = pn.offsetLeft;
+ width = pn.offsetWidth;
+
+ popup = document.createElement('div') as HTMLElement;
+ popup.className = 'popup';
+ popup.id = 'test';
+ popup.style.position = 'absolute';
+ popup.style.top = top.toString() + 'px';
+ popup.style.left = left.toString() + 'px';
+ popup.style.width = width.toString() + 'px';
+ popup.style.margin = '0px auto';
+ popup.style.padding = '0px';
+ popup.style.zIndex = '10000';
+
+ select = document.createElement('select') as HTMLSelectElement;
+ select.style.width = width.toString() + 'px';
+ goog.events.listen(select, 'change', selectChanged);
+
+ dp = dataProvider as Array;
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('option') as HTMLOptionElement;
+ opt.text = dp[i];
+ select.add(opt, null);
+ }
+
+ select.size = n;
+
+ si = selectedIndex;
+ if (si < 0) {
+ select.value = null;
+ } else {
+ select.value = dp[si];
+ }
+
+ this.popup = popup;
+
+ popup.appendChild(select);
+ document.body.appendChild(popup);
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Container.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Container.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Container.as
new file mode 100644
index 0000000..ee30b7f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Container.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
+{
+ import org.apache.flex.core.ContainerBase;
+ import org.apache.flex.core.IChrome;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.IUIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+
+ [DefaultProperty("mxmlContent")]
+
+ /**
+ * The Container class implements a basic container for
+ * other controls and containers. The position and size
+ * of the children are determined by a layout while the size of
+ * a Container can either be determined by its children or by
+ * specifying an exact size in pixels or as a percentage of the
+ * parent element.
+ *
+ * This Container does not have a built-in scroll bar or clipping of
+ * its content should the content exceed the Container's boundaries. To
+ * have scroll bars and clipping, add the ScrollingView bead.
+ *
+ * While the container is relatively lightweight, it should
+ * generally not be used as the base class for other controls,
+ * even if those controls are composed of children. That's
+ * because the fundamental API of Container is to support
+ * an arbitrary set of children, and most controls only
+ * support a specific set of children.
+ *
+ * And that's one of the advantages of beads: that functionality
+ * used in a Container can also be used in a Control as long
+ * as that bead doesn't assume that its strand is a Container.
+ *
+ * For example, even though you can use a Panel to create the
+ * equivalent of an Alert control, the Alert is a
+ * control and not a Container because the Alert does not
+ * support an arbitrary set of children.
+ *
+ * @see org.apache.flex.html.beads.layout
+ * @see org.apache.flex.html.supportClasses.ScrollingViewport
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Container extends ContainerBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Container()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+
+ positioner = element;
+
+ // absolute positioned children need a non-null
+ // position value in the parent. It might
+ // get set to 'absolute' if the container is
+ // also absolutely positioned
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ /*addEventListener('childrenAdded',
+ runLayoutHandler);
+ addEventListener('elementRemoved',
+ runLayoutHandler);*/
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ControlBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ControlBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ControlBar.as
new file mode 100644
index 0000000..da65539
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ControlBar.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IChrome;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.ValuesManager;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The ControlBar class is used within a Panel as a place to position
+ * additional controls. The ControlBar appears at the bottom of the
+ * org.apache.flex.html.Panel
+ * and is not part of the Panel's scrollable content area. The ControlBar
+ * is a Container and implements the org.apache.flex.core.IChrome interface, indicating that is
+ * outside of the Container's content area. The ControlBar uses the following
+ * beads:
+ *
+ * org.apache.flex.core.IBeadModel: the data model for the component.
+ * org.apache.flex.core.IMeasurementBead: helps determine the overlay size of the ControlBar for layout.
+ * org.apache.flex.core.IBorderBead: if present, displays a border around the component.
+ * org.apache.flex.core.IBackgroundBead: if present, displays a solid background below the ControlBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ControlBar extends Container implements IContainer, IChrome
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ControlBar()
+ {
+ super();
+
+ className = "ControlBar";
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ if( getBeadByType(IBeadLayout) == null ) {
+ var layout:IBeadLayout = new (ValuesManager.valuesImpl.getValue(this, "iBeadLayout")) as IBeadLayout;
+ addBead(layout);
+ }
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.className = 'ControlBar';
+ element.style.display = 'inline';
+ typeNames = 'ControlBar';
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataGrid.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataGrid.as
new file mode 100644
index 0000000..8cba078
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DataGrid.as
@@ -0,0 +1,164 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IDataGridModel;
+ import org.apache.flex.core.IDataGridPresentationModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.html.beads.models.DataGridPresentationModel;
+
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The DataGrid class displays a collection of data using columns and rows. Each
+ * column represents a specific field in the data set; each row represents a specific
+ * datum. The DataGrid is a composite component built with a org.apache.flex.html.ButtonBar
+ * for the column headers and a org.apache.flex.html.List for each column. The DataGrid's
+ * view bead (usually org.apache.flex.html.beads.DataGridView) constructs these parts while
+ * itemRenderer factories contruct the elements to display the data in each cell.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGrid extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGrid()
+ {
+ super();
+ }
+
+ /**
+ * The array of org.apache.flex.html.supportClasses.DataGridColumns used to
+ * describe each column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columns():Array
+ {
+ return IDataGridModel(model).columns;
+ }
+ public function set columns(value:Array):void
+ {
+ IDataGridModel(model).columns = value;
+ }
+
+ /**
+ * The object used to provide data to the org.apache.flex.html.DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return IDataGridModel(model).dataProvider;
+ }
+ public function set dataProvider(value:Object):void
+ {
+ IDataGridModel(model).dataProvider = value;
+ }
+
+ /**
+ * The currently selected row.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return IDataGridModel(model).selectedIndex;
+ }
+
+ /**
+ * The DataGrid's presentation model
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get presentationModel():IDataGridPresentationModel
+ {
+ var beadMod:IBead = getBeadByType(IDataGridPresentationModel);
+ var presModel:IDataGridPresentationModel;
+
+ if (beadMod == null) {
+ presModel = new DataGridPresentationModel();
+ addBead(presModel);
+ } else {
+ presModel = beadMod as IDataGridPresentationModel;
+ }
+ return presModel;
+ }
+
+ /**
+ * The default height of each cell in every column
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rowHeight():Number
+ {
+ return presentationModel.rowHeight;
+ }
+ public function set rowHeight(value:Number):void
+ {
+ presentationModel.rowHeight = value;
+ }
+
+ /**
+ * @private
+ * The DataGrid needs to know whenever its size is being changed so the columns can be
+ * be aligned properly, so the noEvent value must always be false.
+ */
+ override public function setWidth(value:Number, noEvent:Boolean=false):void
+ {
+ super.setWidth(value,false);
+ }
+
+ /**
+ * @private
+ * The DataGrid needs to know whenever its size is being changed so the columns can be
+ * be aligned properly, so the noEvent value must always be false.
+ */
+ override public function setHeight(value:Number, noEvent:Boolean=false):void
+ {
+ super.setHeight(value,false);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateChooser.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateChooser.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateChooser.as
new file mode 100644
index 0000000..33615ea
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateChooser.as
@@ -0,0 +1,74 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IDateChooserModel;
+ import org.apache.flex.core.UIBase;
+
+ /**
+ * The change event is dispatched when the selectedDate is changed.
+ */
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The DateChooser class is a component that displays a calendar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DateChooser extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DateChooser()
+ {
+ super();
+ className = "DateChooser";
+
+ // fix the DateChooser's size
+// width = 280;
+// height = 240;
+ }
+
+ /**
+ * The currently selected date (or null if no date has been selected).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedDate():Date
+ {
+ return IDateChooserModel(model).selectedDate;
+ }
+ public function set selectedDate(value:Date):void
+ {
+ IDateChooserModel(model).selectedDate = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
new file mode 100644
index 0000000..f46e453
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DateField.as
@@ -0,0 +1,95 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IDateChooserModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+
+ /**
+ * The change event is dispatched when the selectedDate is changed.
+ */
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The DateField class provides an input field where a date can be entered
+ * and a pop-up calendar control for picking a date as an alternative to
+ * the text field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DateField extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DateField()
+ {
+ super();
+
+ className = "DateField";
+ }
+
+ /**
+ * The method called when added to a parent. The DateField class uses
+ * this opportunity to install additional beads.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function addedToParent():void
+ {
+ var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead");
+ var bead:IBead = new klass() as IBead;
+ if (bead) {
+ addBead(bead);
+ }
+
+ super.addedToParent();
+ }
+
+ /**
+ * The currently selected date (or null if no date has been selected).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedDate():Date
+ {
+ return IDateChooserModel(model).selectedDate;
+ }
+ public function set selectedDate(value:Date):void
+ {
+ IDateChooserModel(model).selectedDate = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DropDownList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DropDownList.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DropDownList.as
new file mode 100644
index 0000000..dd069b2
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/DropDownList.as
@@ -0,0 +1,235 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ISelectionModel;
+
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.models.ArraySelectionModel;
+ }
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * Dispatched when the user selects an item.
+ *
+ * @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 DropDownList class implements the basic equivalent of
+ * the <code><select></code> tag in HTML.
+ * The default implementation only lets the user see and
+ * choose from an array of strings. More complex controls
+ * would display icons as well as strings, or colors instead
+ * of strings or just about anything.
+ *
+ * The default behavior only lets the user choose one and
+ * only one item. More complex controls would allow
+ * mutiple selection by not dismissing the dropdown as soon
+ * as a selection is made.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownList extends Button
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownList()
+ {
+ COMPILE::JS
+ {
+ model = new ArraySelectionModel();
+ }
+ }
+
+ /**
+ * The data set to be displayed. Usually a simple
+ * array of strings. A more complex component
+ * would allow more complex data and data sets.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return ISelectionModel(model).dataProvider;
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLOptionElement
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ public function set dataProvider(value:Object):void
+ {
+ ISelectionModel(model).dataProvider = value;
+ COMPILE::JS
+ {
+ var dp:HTMLOptionsCollection;
+ var i:int;
+ var n:int;
+ var opt:HTMLOptionElement;
+ var dd:HTMLSelectElement = element as HTMLSelectElement;
+
+ model.dataProvider = value;
+ dp = dd.options;
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ dd.remove(0);
+ }
+
+ var lf:String = labelField;
+ n = value.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('option') as HTMLOptionElement;
+ if (lf)
+ opt.text = value[i][lf];
+ else
+ opt.text = value[i];
+ dd.add(opt, null);
+ }
+
+ }
+ }
+
+ [Bindable("change")]
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return ISelectionModel(model).selectedIndex;
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ public function set selectedIndex(value:int):void
+ {
+ ISelectionModel(model).selectedIndex = value;
+ COMPILE::JS
+ {
+ (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex;
+ }
+ }
+
+
+ [Bindable("change")]
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedItem
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return ISelectionModel(model).selectedItem;
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ public function set selectedItem(value:Object):void
+ {
+ ISelectionModel(model).selectedItem = value;
+ COMPILE::JS
+ {
+ (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex;
+ }
+ }
+
+ /**
+ * The name of field within the data used for display. Each item of the
+ * data should have a property with this name.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return ISelectionModel(model).labelField;
+ }
+ public function set labelField(value:String):void
+ {
+ ISelectionModel(model).labelField = value;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('select') as WrappedHTMLElement;
+ (element as HTMLSelectElement).size = 1;
+ goog.events.listen(element, 'change',
+ changeHandler);
+
+ positioner = element;
+ positioner.style.position = 'relative';
+
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ /**
+ * @flexjsignorecoercion HTMLSelectElement
+ */
+ COMPILE::JS
+ protected function changeHandler(event:Event):void
+ {
+ model.selectedIndex = (element as HTMLSelectElement).selectedIndex;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HContainer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HContainer.as
new file mode 100644
index 0000000..9f38883
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/HContainer.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ContainerBase;
+ import org.apache.flex.core.IChrome;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.events.Event;
+
+ [DefaultProperty("mxmlContent")]
+
+ /**
+ * A Container that has a HorizontalLayout.
+ *
+ * This is effectively the same as the pattern
+ * <code>
+ * <basic:Container xmlns:basic="library://ns.apache.org/flexjs/basic">
+ * <basic:layout>
+ * <basic:HorizontalLayout />
+ * </basic:layout>
+ * </basic:Container>
+ * </code>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HContainer extends Container implements IContainer
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HContainer()
+ {
+ super();
+ }
+ }
+}
[06/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputView.as
new file mode 100644
index 0000000..a6f1438
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputView.as
@@ -0,0 +1,135 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The TextInputView class is the view for
+ * the org.apache.flex.html.TextInput in
+ * a ComboBox and other controls
+ * because it does not display a border.
+ * It displays text using a TextField, so there is no
+ * right-to-left text support in this view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextInputView extends TextFieldViewBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextInputView()
+ {
+ super();
+
+ textField.selectable = true;
+ textField.type = TextFieldType.INPUT;
+ textField.mouseEnabled = true;
+ textField.multiline = false;
+ textField.wordWrap = false;
+ }
+
+ /**
+ * @private
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ autoWidth = autoHeight = false;
+
+ var w:Number;
+ var h:Number;
+ var uiMetrics:Rectangle;
+ var ilc:ILayoutChild = host as ILayoutChild;
+ if (ilc.isWidthSizedToContent())
+ {
+ uiMetrics = CSSContainerUtils.getBorderAndPaddingMetrics(host);
+ // use default width of 20
+ var s:String = textField.text;
+ textField.text = "0";
+ w = textField.textWidth * 20;
+ h = textField.textHeight;
+ textField.text = s;
+ ilc.setWidth(w + uiMetrics.left + uiMetrics.right, true);
+ }
+ if (ilc.isHeightSizedToContent())
+ {
+ if (!uiMetrics)
+ uiMetrics = CSSContainerUtils.getBorderAndPaddingMetrics(host);
+ if (isNaN(h))
+ {
+ s = textField.text;
+ textField.text = "0";
+ h = textField.textHeight;
+ textField.text = s;
+ }
+ ilc.setHeight(h + uiMetrics.top + uiMetrics.bottom, true);
+ }
+
+ heightChangeHandler(null);
+ }
+
+ /**
+ * @private
+ */
+ override protected function heightChangeHandler(event:Event):void
+ {
+ var hh:Number = host.height;
+ if( !isNaN(hh) && hh > 0 )
+ {
+ textField.height = textField.textHeight + 5;
+ }
+
+ textField.y = ((hh - textField.height) / 2);
+ }
+
+ /**
+ * @private
+ */
+ override protected function sizeChangeHandler(event:Event):void
+ {
+ var ww:Number = host.width;
+ if( !isNaN(ww) && ww > 0 ) textField.width = ww;
+
+ var hh:Number = host.height;
+ if( !isNaN(hh) && hh > 0 )
+ {
+ textField.height = textField.textHeight + 5;
+ textField.y = ((hh - textField.height) / 2);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputWithBorderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputWithBorderView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputWithBorderView.as
new file mode 100644
index 0000000..fbab13e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextInputWithBorderView.as
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The TextInputWithBorderView class is the default view for
+ * the org.apache.flex.html.TextInput.
+ * It displays text using a TextField, so there is no
+ * right-to-left text support in this view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextInputWithBorderView extends TextInputView
+ {
+ public function TextInputWithBorderView()
+ {
+ super();
+ textField.parentDrawsBackground = true;
+ textField.parentHandlesPadding = true;
+ }
+
+ /**
+ * @private
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+ }
+
+ /**
+ * Determine the width of the TextField.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override protected function widthChangeHandler(event:Event):void
+ {
+ if (!inWidthChange)
+ {
+ textField.autoSize = "none";
+ autoWidth = false;
+ var uiMetrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(host);
+ textField.width = host.width - uiMetrics.left - uiMetrics.right;
+ textField.x = uiMetrics.left;
+ }
+ }
+
+ /**
+ * Determine the size of the TextField.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override protected function sizeChangeHandler(event:Event):void
+ {
+ super.sizeChangeHandler(event);
+ widthChangeHandler(event);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
new file mode 100644
index 0000000..f500094
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
@@ -0,0 +1,144 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The TextItemRendererFactoryForArrayData class is the
+ * IDataProviderItemRendererMapper for creating
+ * ITextItemRenderers and assigning them data from an array.
+ * Other IDataProviderItemRendererMapper implementations
+ * assign specific array or vector types to item
+ * renderers expecting those types.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextItemRendererFactoryForArrayData()
+ {
+ }
+
+ private var selectionModel:ISelectionModel;
+
+ 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;
+ selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ var listView:IListView = value.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+
+ if (!itemRendererFactory)
+ {
+ _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ _strand.addBead(_itemRendererFactory);
+ }
+
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * An IItemRendererClassFactory that should generate ITextItemRenderers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory
+ }
+
+ /**
+ * @private
+ */
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The IItemRendererParent that should parent the ITextItemRenderers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:Array = selectionModel.dataProvider as Array;
+ if (!dp)
+ return;
+
+ dataGroup.removeAllElements();
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
+ tf.index = i;
+ dataGroup.addElement(tf);
+ if (selectionModel.labelField)
+ tf.text = dp[i][selectionModel.labelField];
+ else
+ tf.text = dp[i];
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
new file mode 100644
index 0000000..5c034d9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
@@ -0,0 +1,128 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The TextItemRendererFactoryForStringVectorData class is the
+ * IDataProviderItemRendererMapper for creating
+ * ITextItemRenderers and assigning them data from an vector
+ * of Strings. Other IDataProviderItemRendererMapper implementations
+ * assign specific array or vector types to item
+ * renderers expecting those types.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextItemRendererFactoryForStringVectorData implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextItemRendererFactoryForStringVectorData()
+ {
+ }
+
+ private var selectionModel:ISelectionModel;
+
+ 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;
+ selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ var listView:IListView = value.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChange", dataProviderChangeHandler);
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * An IItemRendererClassFactory that should generate ITextItemRenderers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory
+ }
+
+ /**
+ * @private
+ */
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The IItemRendererParent that should parent the ITextItemRenderers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:Vector.<String> = selectionModel.dataProvider as Vector.<String>;
+
+ dataGroup.removeAllElements();
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
+ tf.index = i;
+ dataGroup.addElement(tf);
+ tf.text = dp[i];
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarMeasurementBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarMeasurementBead.as
new file mode 100644
index 0000000..8195f70
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarView.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarView.mxml b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarView.mxml
new file mode 100644
index 0000000..cebd24b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/TitleBarView.mxml
@@ -0,0 +1,58 @@
+<?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
+-->
+<js:MXMLBeadViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/basic">
+
+ <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>
+ <js:beads>
+ <js:MXMLBeadViewBaseDataBinding />
+ <js:LayoutChangeNotifier watchedProperty="{titleLabel.text}" />
+ </js:beads>
+
+ <js:Label id="titleLabel" text="{ITitleBarModel(model).title}" >
+ <js:style>
+ <js:SimpleCSSStyles fontWeight="inherit" margin="5" />
+ </js:style>
+ </js:Label>
+ <js:CloseButton id="closeButton" click="clickHandler()"
+ visible="{ITitleBarModel(model).showCloseButton}"/>
+
+</js:MXMLBeadViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/UpArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/UpArrowButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/UpArrowButtonView.as
new file mode 100644
index 0000000..8e6ff4a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/UpArrowButtonView.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The UpArrowButtonView class is the view for
+ * the up arrow button in a ScrollBar and other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class UpArrowButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function UpArrowButtonView()
+ {
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.lineStyle(1);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
+ g.endFill();
+ g.lineStyle(0);
+ g.beginFill(0);
+ g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
+ g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.ThreeQuarterSize);
+ g.lineTo(ScrollBarView.HalfSize, ScrollBarView.QuarterSize);
+ g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+
+ SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VRuleView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VRuleView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VRuleView.as
new file mode 100644
index 0000000..5eb6c4c
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VRuleView.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Bitmap;
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IImageModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VRuleView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VRuleView()
+ {
+ }
+
+ /**
+ * @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(_strand).addEventListener("widthChanged",handleSizeChange);
+ IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
+ IEventDispatcher(_strand).addEventListener("sizeChanged",handleSizeChange);
+
+ handleSizeChange(null);
+ }
+
+ /**
+ * @private
+ */
+ private function handleSizeChange(event:Object):void
+ {
+ var ui:UIBase = _strand as UIBase;
+ ui.graphics.clear();
+ ui.graphics.beginFill(0);
+ ui.graphics.drawRect(0, 0, 1, ui.height);
+ ui.graphics.endFill();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarThumbView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarThumbView.as
new file mode 100644
index 0000000..0f70b37
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarThumbView.as
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The VScrollBarThumbView class is the view for
+ * the thumb button in a Vertical ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VScrollBarThumbView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VScrollBarThumbView()
+ {
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ var hh:Number = DisplayObject(_strand).height;
+ g.clear();
+ g.lineStyle(1);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ScrollBarView.FullSize, hh, ScrollBarView.HalfSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xc8c8c8);
+ drawView(downView.graphics, 0xc8c8c8);
+ drawView(overView.graphics, 0xb8b8b8);
+
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+ IEventDispatcher(_strand).addEventListener("heightChanged", heightChangedHandler);
+ }
+
+ private function heightChangedHandler(event:Event):void
+ {
+ DisplayObject(_strand).scaleY = 1.0;
+ DisplayObject(_strand).scaleX = 1.0;
+
+ var hh:Number = DisplayObject(_strand).height;
+ drawView(upView.graphics, 0xc8c8c8);
+ drawView(downView.graphics, 0xc8c8c8);
+ drawView(overView.graphics, 0xb8b8b8);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, hh);
+ shape.graphics.endFill();
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarTrackView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarTrackView.as
new file mode 100644
index 0000000..3510251
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarTrackView.as
@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The VScrollBarTrackView class is the view for
+ * the track in a Vertical ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VScrollBarTrackView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VScrollBarTrackView()
+ {
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ var h:Number = SimpleButton(_strand).height;
+
+ g.clear();
+ g.lineStyle(1, 0x808080);
+ g.beginFill(bgColor);
+ g.drawRect(0, 0, ScrollBarView.FullSize, h);
+ g.endFill();
+ g.lineStyle(0);
+ }
+
+ private function heightChangeHandler(event:Event):void
+ {
+ DisplayObject(_strand).scaleY = 1.0;
+ DisplayObject(_strand).scaleX = 1.0;
+
+ var h:Number = SimpleButton(_strand).height;
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, h);
+ shape.graphics.endFill();
+
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+
+ SimpleButton(value).addEventListener("heightChanged", heightChangeHandler);
+ shape = new Shape();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarView.as
new file mode 100644
index 0000000..840f7bf
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/VScrollBarView.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+ /**
+ * The ScrollBarView class is the default view for
+ * the org.apache.flex.html.supportClasses.VScrollBar class.
+ * It implements the classic desktop-like VScrollBar.
+ * A different view would implement more modern scrollbars that hide themselves
+ * until hovered over with the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VScrollBarView extends ScrollBarView implements IBeadView, IStrand, IScrollBarView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VScrollBarView()
+ {
+ }
+
+ /**
+ * @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;
+
+ UIBase(value).setWidth(ScrollBarView.FullSize, true);
+
+ // TODO: (aharui) put in values impl
+ _increment = new Button();
+ Button(_increment).addBead(new DownArrowButtonView());
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).addBead(new UpArrowButtonView());
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+ _track = new Button();
+ Button(_track).addBead(new VScrollBarTrackView());
+ _thumb = new Button();
+ Button(_thumb).addBead(new VScrollBarThumbView());
+
+ UIBase(value).addChild(_decrement);
+ UIBase(value).addChild(_increment);
+ UIBase(value).addChild(_track);
+ UIBase(value).addChild(_thumb);
+
+ IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
+
+ layout.layout();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/AlertController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/AlertController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/AlertController.as
new file mode 100644
index 0000000..3982d0f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/AlertController.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The AlertControler class bead handles the close event on the org.apache.flex.html.Alert
+ * by removing the org.apache.flex.html.Alert from the display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class AlertController implements IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function AlertController()
+ {
+ }
+
+ 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 get strand():IStrand
+ {
+ return _strand;
+ }
+
+ /**
+ * @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("close",handleAlertClose);
+ }
+
+ /**
+ * @private
+ */
+ private function handleAlertClose(event:Event):void
+ {
+ DisplayObject(_strand).parent.removeChild(DisplayObject(_strand));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
new file mode 100644
index 0000000..4100a28
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ButtonAutoRepeatController.as
@@ -0,0 +1,147 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.utils.clearInterval;
+ import flash.utils.clearTimeout;
+ import flash.utils.setInterval;
+ import flash.utils.setTimeout;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The ButtonAutoRepeatController class adds autorepeat
+ * functionality to a button. This version is simply waits
+ * a specified amount of time (default is 250ms), then repeats the button
+ * event at a specified interval, which defaults to
+ * 125 milliseconds. Alternate implementations could
+ * have non-linear repeat timing, look for keyboard modifiers to choose
+ * different rates, etc.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ButtonAutoRepeatController implements IBead, IBeadController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ButtonAutoRepeatController()
+ {
+ }
+
+ 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(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+ }
+
+ /**
+ * The number of milliseconds to wait before repeating the event
+ * for the first time.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var delay:int = 250;
+
+ /**
+ * The number of milliseconds to wait before repeating the event
+ * after the first time. This value is not checked for
+ * changes after the events start repeating.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var interval:int = 100;
+
+ private var timeout:uint;
+ private var repeater:uint;
+
+ private function mouseDownHandler(event:MouseEvent):void
+ {
+ event.target.addEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
+ event.target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ timeout = setTimeout(sendFirstRepeat, delay);
+ }
+
+ private function mouseOutHandler(event:MouseEvent):void
+ {
+ event.target.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
+ event.target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ if (repeater > 0)
+ clearInterval(repeater);
+ repeater = 0;
+ if (timeout > 0)
+ clearTimeout(timeout);
+ timeout = 0;
+ }
+
+ private function mouseUpHandler(event:MouseEvent):void
+ {
+ event.target.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
+ event.target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ if (repeater > 0)
+ clearInterval(repeater);
+ repeater = 0;
+ if (timeout > 0)
+ clearTimeout(timeout);
+ timeout = 0;
+ }
+
+ private function sendFirstRepeat():void
+ {
+ clearTimeout(timeout);
+ timeout = 0;
+ repeater = setInterval(sendRepeats, interval);
+ IEventDispatcher(_strand).dispatchEvent(new Event("buttonRepeat"));
+ }
+
+ private function sendRepeats():void
+ {
+ IEventDispatcher(_strand).dispatchEvent(new Event("buttonRepeat"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ComboBoxController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ComboBoxController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ComboBoxController.as
new file mode 100644
index 0000000..12fb59c
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ComboBoxController.as
@@ -0,0 +1,104 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.html.beads.IComboBoxView;
+
+ /**
+ * The ComboBoxController class bead handles mouse events on the elements of
+ * the org.apache.flex.html.ComboBox. This includes selecting the
+ * button to display the selection list pop-up as well as selecting an item from the
+ * pop-up list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ComboBoxController implements IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ComboBoxController()
+ {
+ }
+
+ 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(MouseEvent.CLICK, clickHandler);
+ }
+
+ /**
+ * @private
+ */
+ private function clickHandler(event:MouseEvent):void
+ {
+ var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
+ viewBead.popUpVisible = true;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
+ popUpModel.dataProvider = selectionModel.dataProvider;
+ popUpModel.selectedIndex = selectionModel.selectedIndex;
+ DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
+ DisplayObject(viewBead.popUp).height = 200;
+ DisplayObject(viewBead.popUp).x = DisplayObject(_strand).x;
+ DisplayObject(viewBead.popUp).y = DisplayObject(_strand).y;
+ IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+ }
+
+ /**
+ * @private
+ */
+ private function changeHandler(event:Event):void
+ {
+ var viewBead:IComboBoxView = _strand.getBeadByType(IComboBoxView) as IComboBoxView;
+ viewBead.popUpVisible = false;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.selectedIndex = popUpModel.selectedIndex;
+ IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateChooserMouseController.as
new file mode 100644
index 0000000..0aaa052
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateFieldMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
new file mode 100644
index 0000000..05b852d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DateFieldMouseController.as
@@ -0,0 +1,95 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DropDownListController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DropDownListController.as
new file mode 100644
index 0000000..29f58e1
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/DropDownListController.as
@@ -0,0 +1,116 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.display.DisplayObject;
+ import flash.geom.Point;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.ISelectionModel;
+ 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.beads.IDropDownListView;
+
+ /**
+ * The DropDownListController class is the controller for
+ * org.apache.flex.html.DropDownList. Controllers
+ * watch for events from the interactive portions of a View and
+ * update the data model or dispatch a semantic event.
+ * This controller watches for the click event and displays the
+ * dropdown/popup, and watches the dropdown/popup for change events
+ * and updates the selection model accordingly.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListController implements IBead, IBeadController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListController()
+ {
+ }
+
+ 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("click", clickHandler);
+ }
+
+ private function clickHandler(event:Event):void
+ {
+ var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = UIBase(viewBead.popUp).model as ISelectionModel;
+ DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
+ popUpModel.dataProvider = selectionModel.dataProvider;
+ popUpModel.labelField = selectionModel.labelField;
+ viewBead.popUpVisible = true; // adds to display list as well
+ popUpModel.selectedIndex = selectionModel.selectedIndex;
+ var pt:Point = new Point(DisplayObject(_strand).x, DisplayObject(_strand).y + DisplayObject(_strand).height);
+ pt = DisplayObject(_strand).parent.localToGlobal(pt);
+ DisplayObject(viewBead.popUp).x = pt.x;
+ DisplayObject(viewBead.popUp).y = pt.y;
+ IEventDispatcher(viewBead.popUp).addEventListener("change", changeHandler);
+ IUIBase(_strand).topMostEventDispatcher.addEventListener("click", dismissHandler);
+ }
+
+ private function dismissHandler(event:Event):void
+ {
+ if (event.target == _strand) return;
+
+ IUIBase(_strand).topMostEventDispatcher.removeEventListener("click", dismissHandler);
+ var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
+ viewBead.popUpVisible = false;
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var viewBead:IDropDownListView = _strand.getBeadByType(IDropDownListView) as IDropDownListView;
+ viewBead.popUpVisible = false;
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var popUpModel:ISelectionModel = UIBase(viewBead.popUp).model as ISelectionModel;
+ selectionModel.selectedIndex = popUpModel.selectedIndex;
+ IEventDispatcher(_strand).dispatchEvent(new Event("change"));
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
new file mode 100644
index 0000000..4a8115f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/EditableTextKeyboardController.as
@@ -0,0 +1,86 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.CSSTextField;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadController;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.html.beads.ITextFieldView;
+
+ /**
+ * The EditableTextKeyboardController class bead intercepts keyboard events on the
+ * component's text field and emits change events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class EditableTextKeyboardController implements IBead, IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function EditableTextKeyboardController()
+ {
+ }
+
+ private var model:ITextModel;
+ private var textField:CSSTextField;
+
+ 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;
+
+ model = UIBase(_strand).model as ITextModel;
+
+ var viewBead:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
+ textField = viewBead.textField;
+ textField.addEventListener("change", inputChangeHandler);
+ }
+
+ /**
+ * @private
+ */
+ private function inputChangeHandler( event:Object ) : void
+ {
+ // this will otherwise bubble an event of flash.events.Event
+ event.stopImmediatePropagation();
+ model.text = textField.text;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
new file mode 100644
index 0000000..4abaffe
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/HScrollBarMouseController.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The HScrollBarMouseController class is the controller for
+ * org.apache.flex.html.supportClasses.HScrollBar
+ * that acts as the Horizontal ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HScrollBarMouseController extends ScrollBarMouseControllerBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HScrollBarMouseController()
+ {
+ }
+
+ /**
+ * @private
+ */
+ override protected function trackClickHandler(event:MouseEvent):void
+ {
+ if (sbView.thumb.visible)
+ {
+ if (event.localX < sbView.thumb.x)
+ {
+ sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.pageStepSize));
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+ else
+ {
+ sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.pageStepSize));
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+ }
+ }
+
+ private var thumbDownX:Number;
+ private var lastThumbX:Number;
+
+ /**
+ * @private
+ */
+ override protected function thumbMouseDownHandler(event:MouseEvent):void
+ {
+ sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
+ sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
+ thumbDownX = event.screenX;
+ lastThumbX = sbView.thumb.x;
+ }
+
+ private function thumbMouseMoveHandler(event:MouseEvent):void
+ {
+ var thumb:DisplayObject = sbView.thumb;
+ var track:DisplayObject = sbView.track;
+ thumb.x = Math.max(track.x, Math.min(lastThumbX + (event.screenX - thumbDownX), track.x + track.width - thumb.width));
+ var newValue:Number = snap((thumb.x - track.x) / (track.width - thumb.width) * (sbModel.maximum - sbModel.minimum - sbModel.pageSize));
+ sbModel.value = newValue;
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+
+ private function thumbMouseUpHandler(event:MouseEvent):void
+ {
+ sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
+ sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
+ }
+ }
+}
[11/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
new file mode 100644
index 0000000..c6ef625
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Spinner.as
@@ -0,0 +1,187 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IRangeModel;
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.html.beads.controllers.SpinnerMouseController;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ [Event(name="valueChange", type="org.apache.flex.events.Event")]
+
+ /**
+ * The Spinner class is a component that displays a control for incrementing a value
+ * and a control for decrementing a value. The org.apache.flex.html.NumericStepper
+ * uses a Spinner as part of the component. Spinner uses the following beads:
+ *
+ * org.apache.flex.core.IBeadModel: an IRangeModel to hold the properties.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the Spinner.
+ * org.apache.flex.core.IBeadController: a bead that handles the input events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Spinner extends UIBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Spinner()
+ {
+ super();
+
+ className = "Spinner";
+ }
+
+ /**
+ * The current value of the Spinner.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Number
+ {
+ return IRangeModel(model).value;
+ }
+ public function set value(newValue:Number):void
+ {
+ IRangeModel(model).value = newValue;
+ }
+
+ /**
+ * The minimum value of the Spinner.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get minimum():Number
+ {
+ return IRangeModel(model).minimum;
+ }
+ public function set minimum(value:Number):void
+ {
+ IRangeModel(model).minimum = value;
+ }
+
+ /**
+ * The maximum value of the Spinner.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maximum():Number
+ {
+ return IRangeModel(model).maximum;
+ }
+ public function set maximum(value:Number):void
+ {
+ IRangeModel(model).maximum = value;
+ }
+
+ /**
+ * The modulus for the value. If this property is set,
+ * the value displayed with a muliple of the snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get snapInterval():Number
+ {
+ return IRangeModel(model).snapInterval;
+ }
+ public function set snapInterval(value:Number):void
+ {
+ IRangeModel(model).snapInterval = value;
+ }
+
+ /**
+ * The amount to increase or descrease the value. The value
+ * will not exceed the minimum or maximum value. The final
+ * value is affected by the snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get stepSize():Number
+ {
+ return IRangeModel(model).stepSize;
+ }
+ public function set stepSize(value:Number):void
+ {
+ IRangeModel(model).stepSize = value;
+ }
+
+ COMPILE::JS
+ public var incrementButton:TextButton;
+
+ COMPILE::JS
+ public var decrementButton:TextButton;
+
+ COMPILE::JS
+ private var controller:SpinnerMouseController;
+
+ /**
+ * @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.style.verticalAlign = 'middle';
+
+ incrementButton = new TextButton();
+ incrementButton.text = '\u25B2';
+ addElement(incrementButton);
+
+ decrementButton = new TextButton();
+ decrementButton.text = '\u25BC';
+ addElement(decrementButton);
+
+ controller = new SpinnerMouseController();
+ addBead(controller);
+
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextArea.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextArea.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextArea.as
new file mode 100644
index 0000000..57bc3c3
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextArea.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
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The TextArea class implements the basic control for
+ * multi-line text input.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextArea extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextArea()
+ {
+ super();
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function get text():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).text;
+ }
+ COMPILE::JS
+ {
+ return (element as HTMLInputElement).value;
+ }
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function set text(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).text = value;
+ }
+ COMPILE::JS
+ {
+ (element as HTMLInputElement).value = value;
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return ITextModel(model).html;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ ITextModel(model).html = value;
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('textarea') as WrappedHTMLElement;
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+ element.className = 'TextArea';
+ typeNames = 'TextArea';
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextButton.as
new file mode 100644
index 0000000..ca1bbcd
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextButton.as
@@ -0,0 +1,120 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ITextModel;
+
+ /**
+ * The TextButton class implements a basic button that
+ * displays text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextButton extends Button
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextButton()
+ {
+ super();
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).text;
+ }
+ COMPILE::JS
+ {
+ return element.innerHTML;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).text = value;
+ }
+ COMPILE::JS
+ {
+ this.element.innerHTML = value;
+ this.dispatchEvent('textChange');
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).html;
+ }
+ COMPILE::JS
+ {
+ return element.innerHTML;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).html = value;
+ }
+ COMPILE::JS
+ {
+ this.element.innerHTML = value;
+ this.dispatchEvent('textChange');
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextInput.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextInput.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextInput.as
new file mode 100644
index 0000000..1861405
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TextInput.as
@@ -0,0 +1,185 @@
+//
+// 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
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ COMPILE::JS
+ {
+ import goog.events;
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * Dispatched when the user changes the text.
+ *
+ * @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 TextInput class implements the basic control for
+ * single-line text input.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextInput extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextInput()
+ {
+ super();
+
+ COMPILE::AS3
+ {
+ model.addEventListener("textChange", textChangeHandler);
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function get text():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).text;
+ }
+ COMPILE::JS
+ {
+ return (element as HTMLInputElement).value;
+ }
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function set text(value:String):void
+ {
+ COMPILE::AS3
+ {
+ inSetter = true;
+ ITextModel(model).text = value;
+ inSetter = false;
+ }
+ COMPILE::JS
+ {
+ (element as HTMLInputElement).value = value;
+ dispatchEvent(new Event('textChange'));
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function get html():String
+ {
+ COMPILE::AS3
+ {
+ return ITextModel(model).html;
+ }
+ COMPILE::JS
+ {
+ return (element as HTMLInputElement).value;
+ }
+ }
+
+ /**
+ * @private
+ * @flexjsignorecoercion HTMLInputElement
+ */
+ public function set html(value:String):void
+ {
+ COMPILE::AS3
+ {
+ ITextModel(model).html = value;
+ }
+ COMPILE::JS
+ {
+ (element as HTMLInputElement).value = value;
+ dispatchEvent(new Event('textChange'));
+ }
+ }
+
+ private var inSetter:Boolean;
+
+ /**
+ * dispatch change event in response to a textChange event
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function textChangeHandler(event:Event):void
+ {
+ if (!inSetter)
+ dispatchEvent(new Event(Event.CHANGE));
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('input') as WrappedHTMLElement;
+ element.setAttribute('type', 'input');
+ element.className = 'TextInput';
+ typeNames = 'TextInput';
+
+ //attach input handler to dispatch flexjs change event when user write in textinput
+ //goog.events.listen(element, 'change', killChangeHandler);
+ goog.events.listen(element, 'input', textChangeHandler);
+
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TitleBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TitleBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TitleBar.as
new file mode 100644
index 0000000..3902330
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/TitleBar.as
@@ -0,0 +1,146 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IChrome;
+ import org.apache.flex.core.ITitleBarModel;
+ import org.apache.flex.core.ValuesManager;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Label;
+
+ /**
+ * The TitleBar class is a Container component that displays a title and an
+ * optional close button. The TitleBar uses the following bead types:
+ *
+ * org.apache.flex.core.IBeadModel: the data model, which includes the title and showCloseButton values.
+ * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the component.
+ * org.apache.flex.core.IBeadLayout: the bead that handles size and position of the component parts
+ * (org.apache.flex.html.Label and org.apache.flex.html.Button).
+ * org.apache.flex.core.IMeasurementBead: a bead that helps determine the size of the
+ * org.apache.flex.html.TitleBar for layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TitleBar extends Container implements IChrome
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TitleBar()
+ {
+ super();
+
+ className = "TitleBar";
+ }
+
+ /**
+ * The title string to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return ITitleBarModel(model).title;
+ }
+ public function set title(value:String):void
+ {
+ ITitleBarModel(model).title = value;
+ }
+
+ /**
+ * The HTML title to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return ITitleBarModel(model).htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ ITitleBarModel(model).htmlTitle = value;
+ }
+
+ /**
+ * Whether or not to show a org.apache.flex.html.Button that indicates the component
+ * may be closed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get showCloseButton():Boolean
+ {
+ return ITitleBarModel(model).showCloseButton;
+ }
+ public function set showCloseButton(value:Boolean):void
+ {
+ ITitleBarModel(model).showCloseButton = value;
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ if( getBeadByType(IBeadLayout) == null )
+ addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadLayout")) as IBead);
+ }
+
+ /**
+ * @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 = 'TitleBar';
+
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToggleTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToggleTextButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToggleTextButton.as
new file mode 100644
index 0000000..ea9b0f9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToggleTextButton.as
@@ -0,0 +1,170 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * Dispatched when the user clicks on a button.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="click", type="org.apache.flex.events.Event")]
+
+ /**
+ * The ToggleButton class is a TextButton that supports
+ * a selected property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ToggleTextButton extends TextButton implements IStrand, IEventDispatcher, IUIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ToggleTextButton()
+ {
+ super();
+ COMPILE::JS
+ {
+ this.typeNames = 'toggleTextButton';
+ }
+ }
+
+ COMPILE::JS
+ private var _selected:Boolean;
+
+ COMPILE::JS
+ private var SELECTED:String = "selected";
+
+ /**
+ * <code>true</code> if the Button is selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ COMPILE::AS3
+ {
+ return IToggleButtonModel(model).selected;
+ }
+ COMPILE::JS
+ {
+ return _selected;
+ }
+ }
+
+ /**
+ * @private
+ */
+ public function set selected(value:Boolean):void
+ {
+ COMPILE::AS3
+ {
+ IToggleButtonModel(model).selected = value;
+ }
+ COMPILE::JS
+ {
+ if (_selected != value)
+ {
+ _selected = value;
+
+ var className:String = this.className;
+ var typeNames:String = this.typeNames;
+ if (value) {
+ if (typeNames.indexOf(SELECTED) == -1) {
+ typeNames = typeNames + SELECTED;
+ if (className)
+ element.className = typeNames + ' ' + className;
+ else
+ element.className = typeNames;
+ }
+ }
+ else {
+ if (typeNames.indexOf(SELECTED) == typeNames.length - SELECTED.length) {
+ typeNames = typeNames.substring(0, typeNames.length - SELECTED.length);
+ if (className)
+ element.className = typeNames + ' ' + className;
+ else
+ element.className = typeNames;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ * add another class selector
+ */
+ override public function get className():String
+ {
+ // we don't have a model yet so just pass through otherwise you will loop
+ if (!parent)
+ return super.className;
+
+ var name:String = super.className;
+ if (selected)
+ return "toggleTextButton_Selected" + (name ? " " + name : "");
+ else
+ return "toggleTextButton" + (name ? " " + name : "");
+ }
+
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ super.createElement();
+ element.addEventListener("click", clickHandler, false);
+ return element;
+ }
+
+ COMPILE::JS
+ private function clickHandler(event:Event):void
+ {
+ selected = !selected;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToolTip.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToolTip.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToolTip.as
new file mode 100644
index 0000000..4093b09
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/ToolTip.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /*
+ * Label probably should extend TextField directly,
+ * but the player's APIs for TextLine do not allow
+ * direct instantiation, and we might want to allow
+ * Labels to be declared and have their actual
+ * view be swapped out.
+ */
+
+ /**
+ * The Label class implements the basic control for labeling
+ * other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ToolTip extends Label
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ToolTip()
+ {
+ super();
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VContainer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VContainer.as
new file mode 100644
index 0000000..92ebdca
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VContainer.as
@@ -0,0 +1,62 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ContainerBase;
+ import org.apache.flex.core.IChrome;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.events.Event;
+
+ [DefaultProperty("mxmlContent")]
+
+ /**
+ * A Container that has a VerticalLayout.
+ *
+ * This is effectively the same as the pattern
+ * <code>
+ * <basic:Container xmlns:basic="library://ns.apache.org/flexjs/basic">
+ * <basic:layout>
+ * <basic:VerticalLayout />
+ * </basic:layout>
+ * </basic:Container>
+ * </code>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VContainer extends Container implements IContainer
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VContainer()
+ {
+ super();
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VRule.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VRule.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VRule.as
new file mode 100644
index 0000000..d727f2a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/VRule.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.UIBase;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The VRule class displays a vertical line
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VRule extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VRule()
+ {
+ super();
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('div') as WrappedHTMLElement;
+ element.style.borderLeftStyle = 'solid';
+ element.style.borderLeftWidth = '1px';
+ element.style.borderTop = 'none';
+ element.style.borderBottom = 'none';
+ element.style.borderRight = 'none';
+ positioner = element;
+ positioner.style.position = 'relative';
+ element.flexjs_wrapper = this;
+ return element;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
new file mode 100644
index 0000000..8790830
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/NumericOnlyTextInputBead.as
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.accessories
+{
+ COMPILE::JS
+ {
+ import goog.events.BrowserEvent;
+ }
+ COMPILE::AS3
+ {
+ import flash.events.TextEvent;
+
+ import org.apache.flex.core.CSSTextField;
+ }
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.ITextFieldView;
+ }
+
+ /**
+ * The NumericOnlyTextInputBead class is a specialty bead that can be used with
+ * any TextInput control. The bead prevents non-numeric entry into the text input
+ * area.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class NumericOnlyTextInputBead implements IBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function NumericOnlyTextInputBead()
+ {
+ }
+
+ 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;
+
+ COMPILE::AS3
+ {
+ IEventDispatcher(value).addEventListener("viewChanged",viewChangeHandler);
+ }
+ COMPILE::JS
+ {
+ IEventDispatcher(value).addEventListener("keypress",validateInput);
+ }
+ }
+
+ private var _decimalSeparator:String = ".";
+
+ /**
+ * The character used to separate the integer and fraction parts of numbers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get decimalSeparator():String
+ {
+ return _decimalSeparator;
+ }
+ public function set decimalSeparator(value:String):void
+ {
+ if (_decimalSeparator != value) {
+ _decimalSeparator = value;
+ }
+ }
+
+ private var _maxChars:int = 0;
+
+ /**
+ * The character used to separate the integer and fraction parts of numbers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxChars():int
+ {
+ return _maxChars;
+ }
+ public function set maxChars(value:int):void
+ {
+ if (_maxChars != value) {
+ _maxChars = value;
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function viewChangeHandler(event:Event):void
+ {
+ // get the ITextFieldView bead, which is required for this bead to work
+ var textView:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
+ if (textView) {
+ var textField:CSSTextField = textView.textField;
+ textField.restrict = "0-9" + decimalSeparator;
+ textField.maxChars = maxChars;
+ // listen for changes to this textField and prevent non-numeric values, such
+ // as 34.09.94
+ textField.addEventListener(TextEvent.TEXT_INPUT, handleTextInput);
+ }
+ else {
+ throw new Error("NumericOnlyTextInputBead requires strand to have an ITextFieldView bead");
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function handleTextInput(event:TextEvent):void
+ {
+ var insert:String = event.text;
+ var caretIndex:int = (event.target as CSSTextField).caretIndex;
+ var current:String = (event.target as CSSTextField).text;
+ var value:String = current.substring(0,caretIndex) + insert + current.substr(caretIndex);
+ var n:Number = Number(value);
+ if (isNaN(n)) event.preventDefault();
+ }
+
+ COMPILE::JS
+ private function validateInput(event:BrowserEvent):void
+ {
+ var code:int = event.charCode;
+
+ // backspace or delete
+ if (event.keyCode == 8 || event.keyCode == 46) return;
+
+ // tab or return/enter
+ if (event.keyCode == 9 || event.keyCode == 13) return;
+
+ // left or right cursor arrow
+ if (event.keyCode == 37 || event.keyCode == 39) return;
+
+ var key:String = String.fromCharCode(code);
+
+ var regex:RegExp = /[0-9]|\./;
+ if (!regex.test(key)) {
+ event["returnValue"] = false;
+ if (event.preventDefault) event.preventDefault();
+ return;
+ }
+ var cursorStart:int = event.target.selectionStart;
+ var cursorEnd:int = event.target.selectionEnd;
+ var left:String = event.target.value.substring(0, cursorStart);
+ var right:String = event.target.value.substr(cursorEnd);
+ var complete:String = left + key + right;
+ if (isNaN(parseFloat(complete))) {
+ event["returnValue"] = false;
+ if (event.preventDefault) event.preventDefault();
+ }
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as
new file mode 100644
index 0000000..191339b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/PasswordInputBead.as
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.accessories
+{
+ COMPILE::AS3
+ {
+ import org.apache.flex.core.CSSTextField;
+ }
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ COMPILE::AS3
+ {
+ import org.apache.flex.html.beads.ITextFieldView;
+ }
+
+ /**
+ * The PasswordInput class is a specialty bead that can be used with
+ * any TextInput control. The bead secures the text input area by masking
+ * the input as it is typed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class PasswordInputBead implements IBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function PasswordInputBead()
+ {
+ }
+
+ 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;
+
+ COMPILE::AS3
+ {
+ IEventDispatcher(value).addEventListener("viewChanged",viewChangeHandler);
+ }
+ COMPILE::JS
+ {
+ var host:UIBase = value as UIBase;
+ var e:HTMLInputElement = host.element as HTMLInputElement;
+ e.type = 'password';
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function viewChangeHandler(event:Event):void
+ {
+ // get the ITextFieldView bead, which is required for this bead to work
+ var textView:ITextFieldView = _strand.getBeadByType(ITextFieldView) as ITextFieldView;
+ if (textView) {
+ var textField:CSSTextField = textView.textField;
+ textField.displayAsPassword = true;
+ }
+ else {
+ throw new Error("PasswordInputBead requires strand to have a TextInputView bead");
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/TextPromptBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/TextPromptBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/TextPromptBead.as
new file mode 100644
index 0000000..5447da6
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/TextPromptBead.as
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.accessories
+{
+ COMPILE::AS3
+ {
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.CSSTextField;
+ }
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The TextPromptBead class is a specialty bead that can be used with
+ * any TextInput control. The bead places a string into the input field
+ * when there is no value associated with the text property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextPromptBead implements IBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextPromptBead()
+ {
+ }
+
+ private var _prompt:String;
+
+ /**
+ * The string to use as the placeholder prompt.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get prompt():String
+ {
+ return _prompt;
+ }
+ public function set prompt(value:String):void
+ {
+ _prompt = value;
+ }
+
+ 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
+ * @flexjsignorecoercion HTMLInputElement
+ * @flexjsignorecoercion org.apache.flex.core.UIBase;
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ COMPILE::AS3
+ {
+ // listen for changes in text to hide or show the prompt
+ var model:Object = UIBase(_strand).model;
+ if (!model.hasOwnProperty("text")) {
+ throw new Error("Model requires a text property when used with TextPromptBead");
+ }
+ IEventDispatcher(model).addEventListener("textChange", handleTextChange);
+
+ // create a TextField that displays the prompt - it shows
+ // and hides based on the model's content
+ promptField = new CSSTextField();
+ promptField.selectable = false;
+ promptField.type = TextFieldType.DYNAMIC;
+ promptField.mouseEnabled = false;
+ promptField.multiline = false;
+ promptField.wordWrap = false;
+ promptField.textColor = 0xBBBBBB;
+
+ // trigger the event handler to display if needed
+ handleTextChange(null);
+ }
+ COMPILE::JS
+ {
+ var host:UIBase = value as UIBase;
+ var e:HTMLInputElement = host.element as HTMLInputElement;
+ e.placeholder = prompt;
+ }
+ }
+
+ COMPILE::AS3
+ private var promptField:CSSTextField;
+ private var promptAdded:Boolean;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function handleTextChange( event:Event ):void
+ {
+ // see what the model currently has to determine if the prompt should be
+ // displayed or not.
+ var model:Object = UIBase(_strand).model;
+
+ if (model.text != null && model.text.length > 0 ) {
+ if (promptAdded) UIBase(_strand).removeChild(promptField);
+ promptAdded = false;
+ }
+ else {
+ if (!promptAdded) UIBase(_strand).addChild(promptField);
+ promptField.text = prompt;
+ promptAdded = true;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/ToolTipBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/ToolTipBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/ToolTipBead.as
new file mode 100644
index 0000000..64d04bf
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/accessories/ToolTipBead.as
@@ -0,0 +1,141 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.accessories
+{
+
+ import org.apache.flex.core.IBead;
+ 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.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.events.utils.MouseUtils;
+ import org.apache.flex.geom.Point;
+ import org.apache.flex.html.ToolTip;
+ import org.apache.flex.utils.PointUtils;
+ import org.apache.flex.utils.UIUtils;
+
+ /**
+ * The ToolTipBead class is a specialty bead that can be used with
+ * any control. The bead floats a string over a control if
+ * the user hovers over the control with a mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ToolTipBead implements IBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ToolTipBead()
+ {
+ }
+
+ private var _toolTip:String;
+
+ /**
+ * The string to use as the toolTip.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get toolTip():String
+ {
+ return _toolTip;
+ }
+ public function set toolTip(value:String):void
+ {
+ _toolTip = value;
+ }
+
+ 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_OVER, rollOverHandler, false);
+ }
+
+ private var tt:ToolTip;
+ private var host:IPopUpHost;
+
+ /**
+ * @private
+ */
+ protected function rollOverHandler( event:MouseEvent ):void
+ {
+ IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_OUT, rollOutHandler, false);
+
+ var comp:IUIBase = _strand as IUIBase
+ host = UIUtils.findPopUpHost(comp);
+ if (tt) host.removeElement(tt);
+
+ tt = new ToolTip();
+ tt.text = toolTip;
+ var pt:Point = determinePosition(event, event.target);
+ tt.x = pt.x;
+ tt.y = pt.y;
+ host.addElement(tt, false); // don't trigger a layout
+ }
+
+ /**
+ * @private
+ * Determines the position of the toolTip.
+ */
+ protected function determinePosition(event:MouseEvent, base:Object):Point
+ {
+ var comp:IUIBase = _strand as IUIBase;
+ var pt:Point = new Point(comp.width, comp.height);
+ pt = PointUtils.localToGlobal(pt, comp);
+ return pt;
+ }
+
+ /**
+ * @private
+ */
+ private function rollOutHandler( event:MouseEvent ):void
+ {
+ if (tt) {
+ host.removeElement(tt);
+ }
+ tt = null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertMeasurementBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertMeasurementBead.as
new file mode 100644
index 0000000..dbe6c05
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertMeasurementBead.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+
+ /**
+ * The AlertMeasureBead class provides boundary measurements for an
+ * org.apache.flex.html.Alert component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class AlertMeasurementBead implements IMeasurementBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function AlertMeasurementBead()
+ {
+ }
+
+ /**
+ * Returns the overall width of the org.apache.flex.html.Alert component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredWidth():Number
+ {
+ return 0;
+ }
+
+ /**
+ * Returns the overall height of the org.apache.flex.html.Alert component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredHeight():Number
+ {
+ return 0;
+ }
+
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertView.as
new file mode 100644
index 0000000..5788d47
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/AlertView.as
@@ -0,0 +1,226 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IAlertModel;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IParent;
+ 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.geom.Rectangle;
+ import org.apache.flex.html.Alert;
+ import org.apache.flex.html.ControlBar;
+ import org.apache.flex.html.Label;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.html.TitleBar;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The AlertView class creates the visual elements of the org.apache.flex.html.Alert
+ * component. The job of the view bead is to put together the parts of the Alert, such as the
+ * title bar, message, and various buttons, within the space of the Alert component strand.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class AlertView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function AlertView()
+ {
+ }
+
+ private var _titleBar:TitleBar;
+ private var _controlBar:ControlBar;
+ private var _label:Label;
+ private var _okButton:TextButton;
+ private var _cancelButton:TextButton;
+ private var _yesButton:TextButton;
+ private var _noButton:TextButton;
+
+ /**
+ * @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;
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
+ if (backgroundColor != null || backgroundImage != null)
+ {
+ if (value.getBeadByType(IBackgroundBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
+ }
+
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
+ if (borderStyles is Array)
+ {
+ borderStyle = borderStyles[1];
+ }
+ if (borderStyle == null)
+ {
+ borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
+ }
+ if (borderStyle != null && borderStyle != "none")
+ {
+ if (value.getBeadByType(IBorderBead) == null)
+ value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
+ }
+
+ var flags:uint = IAlertModel(UIBase(_strand).model).flags;
+ if( flags & Alert.OK ) {
+ _okButton = new TextButton();
+ _okButton.text = IAlertModel(UIBase(_strand).model).okLabel;
+ _okButton.addEventListener("click",handleOK);
+ }
+ if( flags & Alert.CANCEL ) {
+ _cancelButton = new TextButton();
+ _cancelButton.text = IAlertModel(UIBase(_strand).model).cancelLabel;
+ _cancelButton.addEventListener("click",handleCancel);
+ }
+ if( flags & Alert.YES ) {
+ _yesButton = new TextButton();
+ _yesButton.text = IAlertModel(UIBase(_strand).model).yesLabel;
+ _yesButton.addEventListener("click",handleYes);
+ }
+ if( flags & Alert.NO ) {
+ _noButton = new TextButton();
+ _noButton.text = IAlertModel(UIBase(_strand).model).noLabel;
+ _noButton.addEventListener("click",handleNo);
+ }
+
+ _titleBar = new TitleBar();
+ _titleBar.title = IAlertModel(UIBase(_strand).model).title;
+
+ _label = new Label();
+ _label.text = IAlertModel(UIBase(_strand).model).message;
+
+ _controlBar = new ControlBar();
+ if( _okButton ) _controlBar.addElement(_okButton);
+ if( _cancelButton ) _controlBar.addElement(_cancelButton);
+ if( _yesButton ) _controlBar.addElement(_yesButton);
+ if( _noButton ) _controlBar.addElement(_noButton);
+
+ IParent(_strand).addElement(_titleBar);
+ IParent(_strand).addElement(_controlBar);
+ IParent(_strand).addElement(_label);
+
+ sizeHandler(null);
+ }
+
+ /**
+ * @private
+ */
+ private function sizeHandler(event:Event):void
+ {
+ var labelMeasure:IMeasurementBead = _label.measurementBead;
+ var titleMeasure:IMeasurementBead = _titleBar.measurementBead;
+ var ctrlMeasure:IMeasurementBead = _controlBar.measurementBead;
+ var maxWidth:Number = Math.max(titleMeasure.measuredWidth, ctrlMeasure.measuredWidth, labelMeasure.measuredWidth);
+
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
+
+ _titleBar.x = 0;
+ _titleBar.y = 0;
+ _titleBar.width = maxWidth;
+ _titleBar.height = 25;
+ _titleBar.dispatchEvent(new Event("layoutNeeded"));
+
+ // content placement here
+ _label.x = metrics.left;
+ _label.y = _titleBar.y + _titleBar.height + metrics.top;
+ _label.width = maxWidth - metrics.left - metrics.right;
+
+ _controlBar.x = 0;
+ _controlBar.y = _titleBar.height + _label.y + _label.height + metrics.bottom;
+ _controlBar.width = maxWidth;
+ _controlBar.height = 25;
+ _controlBar.dispatchEvent(new Event("layoutNeeded"));
+
+ UIBase(_strand).width = maxWidth;
+ UIBase(_strand).height = _titleBar.height + _label.height + _controlBar.height + metrics.top + metrics.bottom;
+ }
+
+ /**
+ * @private
+ */
+ private function handleOK(event:Event):void
+ {
+ // create some custom event where the detail value
+ // is the OK button flag. Do same for other event handlers
+ dispatchCloseEvent(Alert.OK);
+ }
+
+ /**
+ * @private
+ */
+ private function handleCancel(event:Event):void
+ {
+ dispatchCloseEvent(Alert.CANCEL);
+ }
+
+ /**
+ * @private
+ */
+ private function handleYes(event:Event):void
+ {
+ dispatchCloseEvent(Alert.YES);
+ }
+
+ /**
+ * @private
+ */
+ private function handleNo(event:Event):void
+ {
+ dispatchCloseEvent(Alert.NO);
+ }
+
+ /**
+ * @private
+ */
+ public function dispatchCloseEvent(buttonFlag:uint):void
+ {
+ // TO DO: buttonFlag should be part of the event
+ var newEvent:Event = new Event("close",true);
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/BackgroundImageBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/BackgroundImageBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/BackgroundImageBead.as
new file mode 100644
index 0000000..bee07e9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/BackgroundImageBead.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Bitmap;
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+
+ /**
+ * The BackgroundImageBead is used to render an image as the background to any component
+ * that supports it, such as Container.
+ *
+ * Note that this bead is for ActionScript only since CSS/HTML allows this just by specifying
+ * a background image in the style selector. To use this bead, place a ClassReference to it
+ * within @media -flex-flash { } group in the CSS declarations.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class BackgroundImageBead implements IBead, IBackgroundBead
+ {
+ /**
+ * Constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function BackgroundImageBead()
+ {
+ backgroundSprite = new Sprite();
+ }
+
+ private var _strand:IStrand;
+ private var backgroundSprite:Sprite;
+ private var bitmap:Bitmap;
+ private var loader:Loader;
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ setupBackground(backgroundSprite);
+ }
+
+ /**
+ * @private
+ */
+ private function setupBackground(sprite:Sprite, state:String = null):void
+ {
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ loader = new Loader();
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+ trace(e);
+ e.preventDefault();
+ });
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ var host:UIBase = UIBase(_strand);
+ if (bitmap) {
+ host.removeChild(bitmap);
+ }
+
+ bitmap = Bitmap(LoaderInfo(e.target).content);
+
+ host.addChildAt(bitmap,0);
+
+ if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
+ host.setWidth(loader.content.width);
+ else
+ bitmap.width = UIBase(_strand).width;
+
+ if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
+ host.setHeight(loader.content.height);
+ else
+ bitmap.height = UIBase(_strand).height;
+ });
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ButtonBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ButtonBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ButtonBarView.as
new file mode 100644
index 0000000..cbe0a3e
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ButtonBarView.as
@@ -0,0 +1,69 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.supportClasses.Border;
+
+ /**
+ * The ButtonBarView class creates the visual elements of the org.apache.flex.html.ButtonBar
+ * component. A ButtonBar is a type of List and ButtonBarView extends the ListView bead, adding a border.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ButtonBarView extends ListView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ButtonBarView()
+ {
+ super();
+ }
+
+ /**
+ * @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
+ {
+ _strand = value;
+ super.strand = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSButtonView.as
new file mode 100644
index 0000000..fcd14cc
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSButtonView.as
@@ -0,0 +1,167 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.CSSBorderUtils;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSButtonView class is the default view for
+ * the org.apache.flex.html.Button class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style. This view
+ * does not display text. Use CSSTextButtonView and
+ * TextButton instead.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ }
+
+ private var textModel:ITextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+
+ setupBackground(overSprite, "hover");
+ setupBackground(downSprite, "active");
+ setupBackground(upSprite);
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, "hover");
+ setupSkin(downSprite, "active");
+ setupSkin(upSprite);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, state:String = null):void
+ {
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ CSSBorderUtils.draw(sprite.graphics,
+ DisplayObject(_strand).width + pl + pr,
+ DisplayObject(_strand).height + pt + pb,
+ _strand as DisplayObject,
+ state, true);
+ }
+
+ private function setupBackground(sprite:Sprite, state:String = null):void
+ {
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ setupSkin(sprite, state);
+ updateHitArea();
+ });
+ }
+ else {
+ setupSkin(sprite, state);
+ updateHitArea();
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+
+ private function updateHitArea():void
+ {
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+
+ }
+ }
+}
[22/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CloseButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CloseButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CloseButtonView.as
deleted file mode 100644
index 7d3fb19..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CloseButtonView.as
+++ /dev/null
@@ -1,101 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.TitleBar;
-
- /**
- * The CloseButtonView class is the view for
- * the down arrow button in a ScrollBar and other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CloseButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CloseButtonView()
- {
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x666666);
- drawView(overView.graphics, 0x999999);
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.beginFill(bgColor);
- g.drawRect(0, 0, 11, 11);
- g.endFill();
- g.lineStyle(2);
- g.moveTo(3,3);
- g.lineTo(8,8);
- g.moveTo(3,8);
- g.lineTo(8,3);
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 11, 11);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ComboBoxView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ComboBoxView.as
deleted file mode 100644
index e725517..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ComboBoxView.as
+++ /dev/null
@@ -1,247 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.DisplayObjectContainer;
- import flash.display.Sprite;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IComboBoxModel;
- import org.apache.flex.core.IPopUpHost;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.core.IParent;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.TextInput;
-
- /**
- * The ComboBoxView class creates the visual elements of the org.apache.flex.html.ComboBox
- * component. The job of the view bead is to put together the parts of the ComboBox such as the TextInput
- * control and org.apache.flex.html.Button to trigger the pop-up.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ComboBoxView extends BeadViewBase implements IBeadView, IComboBoxView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ComboBoxView()
- {
- }
-
- private var textInput:TextInput;
- private var button:Button;
- private var selectionModel:IComboBoxModel;
-
- /**
- * The value of the TextInput component of the ComboBox.
- *
- * @copy org.apache.flex.html.beads.IComboBoxView#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return textInput.text;
- }
- public function set text(value:String):void
- {
- textInput.text = value;
- }
-
- /**
- * The HTML value of the TextInput component of the ComboBox.
- *
- * @copy org.apache.flex.html.beads.IComboBoxView#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return textInput.html;
- }
- public function set html(value:String):void
- {
- textInput.html = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get strand():IStrand
- {
- return _strand;
- }
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- selectionModel = value.getBeadByType(IComboBoxModel) as IComboBoxModel;
- selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
-
- textInput = new TextInput();
- IParent(strand).addElement(textInput);
- textInput.width = 100;
- textInput.height = 18;
-
- upSprite = new Sprite();
- drawButton( upSprite, "up", 18, 18 );
- overSprite = new Sprite();
- drawButton( overSprite, "over", 18, 18 );
- downSprite = new Sprite();
- drawButton( downSprite, "down", 18, 18 );
-
- button = new Button();
- button.upState = upSprite;
- button.overState = overSprite;
- button.downState = downSprite;
- DisplayObjectContainer(strand).addChild(button);
- button.width = 18;
- button.height = 18;
- button.x = textInput.width;
- button.y = textInput.y;
-
- // listen for events on the text input and modify the list and selection
- textInput.addEventListener("change", textChangeHandler,false,0,true);
- }
-
- private var upSprite:Sprite;
- private var overSprite:Sprite;
- private var downSprite:Sprite;
-
- /**
- * @private
- */
- private function drawButton( sprite:Sprite, mode:String, width:Number, height:Number ) : void
- {
- sprite.graphics.clear();
- sprite.graphics.lineStyle(1,0xFFFFFF);
- sprite.graphics.drawRect(0, 0, width-1, height-1);
- sprite.graphics.lineStyle(-1);
-
- if( mode == "over" ) sprite.graphics.beginFill(0xCCCCCC);
- else if( mode == "down" ) sprite.graphics.beginFill(0x888888);
- sprite.graphics.drawRect(0, 0, width-1, height-1);
- sprite.graphics.endFill();
-
- sprite.graphics.beginFill(0x333333);
- sprite.graphics.moveTo(4,4);
- sprite.graphics.lineTo(width-4,4);
- sprite.graphics.lineTo(int(width/2),height-4);
- sprite.graphics.lineTo(4,4);
- sprite.graphics.endFill();
- }
-
- private var _popUp:IStrand;
-
- /**
- * 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():IStrand
- {
- 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)
- {
- var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
- _popUp = new popUpClass() as IStrand;
- }
- var root:Object = DisplayObject(_strand).root;
- var host:DisplayObjectContainer = DisplayObject(_strand).parent;
- while (host && !(host is IPopUpHost))
- host = host.parent;
- if (host)
- IPopUpHost(host).addElement(popUp);
- }
- else
- {
- DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
- }
- }
- }
-
- /**
- * @private
- */
- private function selectionChangeHandler(event:Event):void
- {
- text = selectionModel.selectedItem.toString();
- }
-
- /**
- * @private
- */
- private function textChangeHandler(event:Event):void
- {
- var newEvent:Event = new Event("change");
- IEventDispatcher(strand).dispatchEvent(newEvent);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
deleted file mode 100644
index 26e78be..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ContainerView.as
+++ /dev/null
@@ -1,553 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.IContainerView;
- import org.apache.flex.core.IContentViewHost;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- 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;
- 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.geom.Rectangle;
- import org.apache.flex.geom.Size;
- import org.apache.flex.html.beads.models.ViewportModel;
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.html.supportClasses.ContainerContentArea;
- import org.apache.flex.html.supportClasses.Viewport;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * This class creates and manages the contents of a Container. On the ActionScript
- * side, a Container has a contentView into which the offical children can be
- * placed. When adding an element that implements IChrome, that element is not
- * placed into the contentView, but is made a child of the Container directly.
- *
- * Containers also have a layout associated with them which controls the size and
- * placement of the elements in the contentView. When a Container does not have an
- * explicit size (including a percent size), the content dictates the size of the
- * Container.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ContainerView extends BeadViewBase implements IBeadView, IContainerView, ILayoutHost
- {
- /**
- * The ContainerView class is the default view for
- * the org.apache.flex.core.ContainerBase classes.
- * It lets you use some CSS styles to manage the border, background
- * and padding around the content area.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ContainerView()
- {
- super();
-
- layoutRunning = false;
- }
-
- /**
- * The sub-element used as the parent of the container's elements. This does not
- * include the chrome elements.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get contentView():IParentIUIBase
- {
- return viewport.contentView as IParentIUIBase;
- }
-
- /**
- * The view that can be resized.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get resizableView():IUIBase
- {
- return host;
- }
-
- /**
- * The viewport used to present the content and may display
- * scroll bars (depending on the actual type of viewport).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function get viewport():IViewport
- {
- return _viewport;
- }
-
- /**
- * The data model used by the viewport to determine how it should
- * present the content area.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get viewportModel():IViewportModel
- {
- return _viewportModel;
- }
-
- private var _viewportModel:IViewportModel;
- private var _viewport:IViewport;
- private var layoutRunning:Boolean;
-
- /**
- * @private
- */
- public function addElement(c:Object, dispatchEvent:Boolean = true):void
- {
- contentView.addElement(c, dispatchEvent);
- }
-
- /**
- * @private
- */
- public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
- {
- contentView.addElementAt(c, index, dispatchEvent);
- }
-
- /**
- * @private
- */
- public function getElementIndex(c:Object):int
- {
- return contentView.getElementIndex(c);
- }
-
- /**
- * @private
- */
- public function removeElement(c:Object, dispatchEvent:Boolean = true):void
- {
- contentView.removeElement(c, dispatchEvent);
- }
-
- /**
- * @private
- */
- public function get numElements():int
- {
- return contentView.numElements;
- }
-
- /**
- * @private
- */
- public function getElementAt(index:int):Object
- {
- return contentView.getElementAt(index);
- }
-
- /**
- * Strand setter.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- _strand = value;
- super.strand = value;
-
- createViewport();
-
- (host as IContentViewHost).strandChildren.addElement(viewport.contentView, false);
-
- displayBackgroundAndBorder(host as UIBase);
-
- // listen for initComplete to signal that the strand is set with its size
- // and beads.
- host.addEventListener("initComplete", initCompleteHandler);
- }
-
- /**
- * Handles the initComplete event by completing the setup and kicking off the
- * presentation of the Container.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function initCompleteHandler(event:Event):void
- {
- var ilc:ILayoutChild = host as ILayoutChild;
- // Complete the setup if the height is sized to content or has been explicitly set
- // and the width is sized to content or has been explicitly set
- if ((ilc.isHeightSizedToContent() || !isNaN(ilc.explicitHeight)) &&
- (ilc.isWidthSizedToContent() || !isNaN(ilc.explicitWidth))) {
- completeSetup();
-
- var num:Number = contentView.numElements;
- if (num > 0) performLayout(event);
- }
- else {
- // otherwise, wait until the unknown sizes have been set and then finish
- host.addEventListener("sizeChanged", deferredSizeHandler);
- host.addEventListener("widthChanged", deferredSizeHandler);
- host.addEventListener("heightChanged", deferredSizeHandler);
- }
- }
-
- /**
- * Handles the case where the size of the host is not immediately known, usually do
- * to one of its dimensions being indicated as a percent size.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private function deferredSizeHandler(event:Event):void
- {
- host.removeEventListener("sizeChanged", deferredSizeHandler);
- host.removeEventListener("widthChanged", deferredSizeHandler);
- host.removeEventListener("heightChanged", deferredSizeHandler);
- completeSetup();
-
- var num:Number = contentView.numElements;
- if (num > 0)
- {
- performLayout(event);
- }
- }
-
- /**
- * Called when the host is ready to complete its setup (usually after its size has been
- * determined).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function completeSetup():void
- {
- // when the first layout is complete, set up listeners for changes
- // to the childrens' sizes.
- host.addEventListener("layoutComplete", childrenChangedHandler);
-
- host.addEventListener("childrenAdded", performLayout);
- host.addEventListener("layoutNeeded", performLayout);
- host.addEventListener("widthChanged", resizeHandler);
- host.addEventListener("heightChanged", resizeHandler);
- host.addEventListener("sizeChanged", resizeHandler);
- host.addEventListener("viewCreated", viewCreatedHandler);
- }
-
- /**
- * Handles the viewCreated event by performing the first layout if
- * there are children already present (ie, from MXML).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function viewCreatedHandler(event:Event):void
- {
- if ((host as UIBase).numElements > 0) {
- performLayout(null);
- }
- }
-
- /**
- * Calculate the space taken up by non-content children like a TItleBar in a Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function getChromeMetrics():Rectangle
- {
- return new Rectangle(0, 0, 0, 0);
- }
-
- /**
- * Creates the Viewport (or ScrollableViewport) through which the content
- * area is presented.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function createViewport():void
- {
- var c:Class;
- if (viewportModel == null) {
- _viewportModel = _strand.getBeadByType(IViewportModel) as IViewportModel;
- if (viewportModel == null) {
- c = ValuesManager.valuesImpl.getValue(host, "iViewportModel");
- if (c)
- {
- _viewportModel = new c() as IViewportModel;
- _strand.addBead(_viewportModel);
- }
- }
- }
-
- if (viewport == null) {
- _viewport = _strand.getBeadByType(IViewport) as IViewport;
- if (viewport == null) {
- c = ValuesManager.valuesImpl.getValue(host, "iViewport");
- if (c)
- {
- _viewport = new c() as IViewport;
- _strand.addBead(viewport);
- }
- }
- }
- }
-
- /**
- * Positions the viewport, then sets any known sizes of the Viewport prior
- * to laying out its content.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function layoutViewBeforeContentLayout():void
- {
- var host:ILayoutChild = this.host as ILayoutChild;
- var vm:IViewportModel = viewportModel;
- vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
- vm.chromeMetrics = getChromeMetrics();
- viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
- vm.borderMetrics.top + vm.chromeMetrics.top)
- viewport.layoutViewportBeforeContentLayout(
- !host.isWidthSizedToContent() ?
- host.width - vm.borderMetrics.left - vm.borderMetrics.right -
- vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
- !host.isHeightSizedToContent() ?
- host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
- vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
-
- }
-
- /**
- * Executes the layout associated with this container. Once the layout has been
- * run, it may affect the size of the host or may cause the host to present scroll
- * bars view its viewport.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function performLayout(event:Event):void
- {
- layoutRunning = true;
-
- layoutViewBeforeContentLayout();
-
- var host:UIBase = _strand as UIBase;
-
- var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout;
- if (layout == null) {
- var c:Class = ValuesManager.valuesImpl.getValue(host, "iBeadLayout");
- if (c) {
- layout = new c() as IBeadLayout;
- _strand.addBead(layout);
- }
- }
-
- if (layout) {
- layout.layout();
- }
-
- layoutViewAfterContentLayout();
-
- layoutRunning = false;
- }
-
- /**
- * @private
- */
- private var adjusting:Boolean = false;
-
- /**
- * Adjusts the size of the host, or adds scrollbars to the viewport, after
- * the layout has been run.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function layoutViewAfterContentLayout():void
- {
- var host:UIBase = _strand as UIBase;
- var vm:IViewportModel = viewportModel;
-
- adjusting = true;
-
- var viewportSize:Size = viewport.layoutViewportAfterContentLayout();
-
- if (host.isWidthSizedToContent() && host.isHeightSizedToContent()) {
- host.setWidthAndHeight(viewportSize.width + vm.borderMetrics.left + vm.borderMetrics.right +
- vm.chromeMetrics.left + vm.chromeMetrics.right,
- viewportSize.height + vm.borderMetrics.top + vm.borderMetrics.bottom +
- vm.chromeMetrics.top + vm.chromeMetrics.bottom,
- false);
- }
- else if (!host.isWidthSizedToContent() && host.isHeightSizedToContent())
- {
- host.setHeight(viewportSize.height + vm.borderMetrics.top + vm.borderMetrics.bottom +
- vm.chromeMetrics.top + vm.chromeMetrics.bottom, false);
- }
- else if (host.isWidthSizedToContent() && !host.isHeightSizedToContent())
- {
- host.setWidth(viewportSize.width + vm.borderMetrics.left + vm.borderMetrics.right +
- vm.chromeMetrics.left + vm.chromeMetrics.right, false);
- }
- adjusting = false;
- }
-
- /**
- * Handles dynamic changes to the host's size by running the layout once
- * the viewport has been adjusted.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function resizeHandler(event:Event):void
- {
- if (!adjusting) {
- performLayout(event);
- }
- }
-
- /**
- * Whenever children are added, listeners are added to detect changes
- * in their size.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function childrenChangedHandler(event:Event):void
- {
- var host:UIBase = _strand as UIBase;
- host.removeEventListener(event.type, childrenChangedHandler);
-
- var n:Number = contentView.numElements;
- for (var i:int=0; i < n; i++) {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- child.addEventListener("widthChanged", childResizeHandler);
- child.addEventListener("heightChanged", childResizeHandler);
- child.addEventListener("sizeChanged", childResizeHandler);
- }
- }
-
- /**
- * This event handles changes to the size of children of the container by running
- * the layout again and adjusting the size of the container or viewport as necessary.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function childResizeHandler(event:Event):void
- {
- // during this process we don't want the layout to trigger
- // an endless event chain should any children get resized
- // by the layout.
- if (layoutRunning) return;
- performLayout(event);
- }
-
- protected function displayBackgroundAndBorder(host:UIBase) : void
- {
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(host, "background-image");
- if (backgroundColor != null || backgroundImage != null)
- {
- if (host.getBeadByType(IBackgroundBead) == null)
- var c:Class = ValuesManager.valuesImpl.getValue(host, "iBackgroundBead");
- if (c) {
- host.addBead( new c() as IBead );
- }
- }
-
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(host, "border");
- if (borderStyles is Array)
- {
- borderStyle = borderStyles[1];
- }
- if (borderStyle == null)
- {
- borderStyle = ValuesManager.valuesImpl.getValue(host, "border-style") as String;
- }
- if (borderStyle != null && borderStyle != "none")
- {
- if (host.getBeadByType(IBorderBead) == null) {
- c = ValuesManager.valuesImpl.getValue(host, "iBorderBead");
- if (c) {
- host.addBead( new c() as IBead );
- }
- }
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ControlBarMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ControlBarMeasurementBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ControlBarMeasurementBead.as
deleted file mode 100644
index 18d19dd..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ControlBarMeasurementBead.as
+++ /dev/null
@@ -1,116 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObjectContainer;
-
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.html.Container;
-
- /**
- * The ControlBarMeasurementBead class measures the size of a org.apache.flex.html.ControlBar
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ControlBarMeasurementBead implements IMeasurementBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ControlBarMeasurementBead()
- {
- }
-
- /**
- * Returns the overall width of the ControlBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredWidth():Number
- {
- // Note: the measurement should problably be done by the ControlBar's layout manager bead
- // since it would know the arrangement of the items and how far apart they are and if
- // there are margins and paddings and gaps involved.
- var mwidth:Number = 0;
- var container:Container = Container(_strand);
- var n:int = container.numElements;
- for(var i:int=0; i < n; i++) {
- var child:IUIBase = container.getElementAt(i) as IUIBase;
- if( child == null ) continue;
- var childMeasure:IMeasurementBead = child.getBeadByType(IMeasurementBead) as IMeasurementBead;
- if (childMeasure)
- mwidth += childMeasure.measuredWidth;
- }
- return mwidth;
- }
-
- /**
- * Returns the overall height of the ControlBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredHeight():Number
- {
- // Note: the measurement should problably be done by the ControlBar's layout manager bead
- // since it would know the arrangement of the items and how far apart they are and if
- // there are margins and paddings and gaps involved.
- var mheight:Number = 0;
- var n:int = DisplayObjectContainer(_strand).numChildren;
- for(var i:int=0; i < n; i++) {
- var child:IUIBase = DisplayObjectContainer(_strand).getChildAt(i) as IUIBase;
- if( child == null ) continue;
- var childMeasure:IMeasurementBead = child.getBeadByType(IMeasurementBead) as IMeasurementBead;
- mheight += childMeasure.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridColumnView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridColumnView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridColumnView.as
deleted file mode 100644
index 7efa3ee..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridColumnView.as
+++ /dev/null
@@ -1,101 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IStrand;
- import org.apache.flex.html.supportClasses.DataGridColumn;
-
- /**
- * The DataGridColumnView class extends org.apache.flex.html.beads.ListView and
- * provides properties to the org.apache.flex.html.List that makes a column in
- * the org.apache.flex.html.DataGrid.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridColumnView extends ListView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridColumnView()
- {
- }
-
- /**
- * @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;
- }
-
- private var _columnIndex:uint;
-
- /**
- * The zero-based index for the column.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get columnIndex():uint
- {
- return _columnIndex;
- }
- public function set columnIndex(value:uint):void
- {
- _columnIndex = value;
- }
-
- private var _column:DataGridColumn;
-
- /**
- * The org.apache.flex.html.support.DataGridColumn containing information used to
- * present the org.apache.flex.html.List as a column in the
- * org.apache.flex.html.DataGrid.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get column():DataGridColumn
- {
- return _column;
- }
- public function set column(value:DataGridColumn):void
- {
- _column = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridLinesBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridLinesBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridLinesBead.as
deleted file mode 100644
index b4e5b1d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridLinesBead.as
+++ /dev/null
@@ -1,199 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.collections.ArrayList;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IDataGridModel;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.graphics.GraphicsContainer;
- import org.apache.flex.core.graphics.IStroke;
- import org.apache.flex.core.graphics.SolidColor;
- import org.apache.flex.core.graphics.SolidColorStroke;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.beads.models.DataGridPresentationModel;
- import org.apache.flex.html.supportClasses.DataGridColumn;
-
- /**
- * The DataGridLinesBead is an add on bead for the DataGrid. This bead
- * adds horizontal and vertical grid lines to a DataGrid. The size and
- * color of the lines is specified by the stroke property (defaults to
- * a thin dark line).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridLinesBead implements IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridLinesBead()
- {
- // Set default separator line stroke.
- var lineStroke:SolidColorStroke = new SolidColorStroke();
- lineStroke.color = 0x333333;
- lineStroke.alpha = 1.0;
- lineStroke.weight = 1;
- stroke = lineStroke;
- }
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.UIBase#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;
-
- _overlay = new GraphicsContainer();
-
- IEventDispatcher(_strand).addEventListener("beadsAdded", handleBeadsAdded);
- }
-
- private var _stroke:IStroke;
-
- /**
- * Describes the line style used to separate the rows and columns.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get stroke():IStroke
- {
- return _stroke;
- }
- public function set stroke(value:IStroke):void
- {
- _stroke = value;
- }
-
- private var _overlay:GraphicsContainer;
- private var _area:UIBase;
-
- /**
- * Invoked when all of the beads have been added to the DataGrid. This
- * function seeks the Container that parents the lists that are the DataGrid's
- * columns. An overlay GraphicContainer is added to this Container so that the
- * grid lines will scroll with the rows.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private function handleBeadsAdded(event:Event):void
- {
- var host:UIBase = _strand as UIBase;
- var n:int = host.numElements;
- for (var i:int=0; i < n; i++) {
- var child:UIBase = host.getElementAt(i) as UIBase;
- if (child.id == "dataGridListArea") {
- _area = child;
- _area.addElement(_overlay);
- break;
- }
- }
-
- // Now set up listeners to handle changes in the size of the DataGrid.
- IEventDispatcher(_strand).addEventListener("sizeChanged", drawLines);
- IEventDispatcher(_strand).addEventListener("widthChanged", drawLines);
- IEventDispatcher(_strand).addEventListener("heightChanged", drawLines);
-
- // Also set up a listener on the model to know when the dataProvider has
- // changed which might affect the number of rows/columns and thus the
- // grid lines.
- var model:IBeadModel = _strand.getBeadByType(IBeadModel) as IBeadModel;
- IEventDispatcher(model).addEventListener("dataProviderChanged", drawLines);
- }
-
- /**
- * This event handler is invoked whenever something happens to the DataGrid. This
- * function draws the lines either using a default stroke or the one specified by
- * the stroke property.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private function drawLines(event:Event):void
- {
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
- var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
- var layoutParent:ILayoutHost = _area.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
-
- var columns:Array = sharedModel.columns;
- var arrayList:ArrayList = sharedModel.dataProvider as ArrayList;
- var rowHeight:Number = presentationModel.rowHeight;
-
- var totalHeight:Number = arrayList.length * rowHeight;
- var columnWidth:Number = _area.width / columns.length;
-
- // translate the stroke to a fill since rectangles are used for the grid
- // lines and not lines.
- var lineFill:SolidColor = new SolidColor();
- var weight:Number = 1;
- lineFill.color = (stroke as SolidColorStroke).color;
- lineFill.alpha = (stroke as SolidColorStroke).alpha;
- weight = (stroke as SolidColorStroke).weight;
- _overlay.fill = lineFill;
-
- columnWidth = (columns[0] as DataGridColumn).columnWidth;
- var xpos:Number = isNaN(columnWidth) ? _area.width / columns.length : columnWidth;
-
- _overlay.removeAllElements();
-
- // draw the verticals
- for (var i:int=1; i < columns.length; i++) {
- _overlay.drawRect(xpos, 0, weight, totalHeight);
- columnWidth = (columns[i] as DataGridColumn).columnWidth;
- xpos += isNaN(columnWidth) ? _area.width / columns.length : columnWidth;
- }
-
- var n:int = arrayList.length;
-
- // draw the horizontals
- for (i=1; i < n+1; i++) {
- _overlay.drawRect(0, i*rowHeight, _area.width, weight);
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridView.as
deleted file mode 100644
index 582a1e7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataGridView.as
+++ /dev/null
@@ -1,294 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IDataGridModel;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.ButtonBar;
- import org.apache.flex.html.Container;
- import org.apache.flex.html.List;
- import org.apache.flex.html.beads.layouts.ButtonBarLayout;
- import org.apache.flex.html.beads.layouts.VerticalLayout;
- import org.apache.flex.html.beads.models.ArraySelectionModel;
- import org.apache.flex.html.beads.models.DataGridPresentationModel;
- import org.apache.flex.html.supportClasses.DataGridColumn;
- import org.apache.flex.html.supportClasses.ScrollingViewport;
- import org.apache.flex.html.supportClasses.Viewport;
-
- /**
- * The DataGridView class is the visual bead for the org.apache.flex.html.DataGrid.
- * This class constructs the items that make the DataGrid: Lists for each column and a
- * org.apache.flex.html.ButtonBar for the column headers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridView implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridView()
- {
- }
-
- private var _strand:IStrand;
- private var _header:ButtonBar;
- private var _listArea:Container;
-
- private var _lists:Array;
-
- /**
- * An array of List objects the comprise the columns of the DataGrid.
- */
- public function get getColumnLists():Array
- {
- return _lists;
- }
-
- /**
- * @private
- */
- public function get host():IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
-
- var host:UIBase = value as UIBase;
- host.addEventListener("widthChanged", handleSizeChanges);
- host.addEventListener("heightChanged", handleSizeChanges);
-
- _header = new ButtonBar();
- _header.id = "dataGridHeader";
-
- var scrollPort:ScrollingViewport = new ScrollingViewport();
-// scrollPort.showsHorizontalScrollBar = false;
-
- _listArea = new Container();
- _listArea.id = "dataGridListArea";
- _listArea.className = "DataGridListArea";
- _listArea.addBead(scrollPort);
-
- finishSetup(null);
- }
-
- /**
- * @private
- */
- private function finishSetup(event:Event):void
- {
- var host:UIBase = _strand as UIBase;
-
- // see if there is a presentation model already in place. if not, add one.
- var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
- if (presentationModel == null) {
- presentationModel = new DataGridPresentationModel();
- _strand.addBead(presentationModel);
- }
-
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
- IEventDispatcher(sharedModel).addEventListener("dataProviderChanged",handleDataProviderChanged);
-
- var columnLabels:Array = new Array();
- var buttonWidths:Array = new Array();
-
- for(var i:int=0; i < sharedModel.columns.length; i++) {
- var dgc:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
- columnLabels.push(dgc.label);
- if (!isNaN(dgc.columnWidth)) buttonWidths.push(dgc.columnWidth);
- }
-
- var bblayout:ButtonBarLayout = new ButtonBarLayout();
- if (buttonWidths.length == sharedModel.columns.length) {
- bblayout.buttonWidths = buttonWidths;
- }
-
- var buttonBarModel:ArraySelectionModel = new ArraySelectionModel();
- buttonBarModel.dataProvider = columnLabels;
-
- _header.addBead(buttonBarModel);
- _header.addBead(bblayout);
- _header.addBead(new Viewport());
- host.addElement(_header);
-
- host.addElement(_listArea);
-
- // do we know what the size is? If not, wait to be sized
-
- if (host.isHeightSizedToContent() || host.isWidthSizedToContent()) {
- host.addEventListener("sizeChanged", handleSizeChanges);
- }
-
- // else size now
- else {
- handleDataProviderChanged(event);
- }
- }
-
- /**
- * @private
- */
- private function handleSizeChanges(event:Event):void
- {
- var useWidth:Number = _listArea.width;
- var useHeight:Number = _listArea.height;
-
- if (host.width > 0) {
- useWidth = host.width;
- }
-
- _header.x = 0;
- _header.y = 0;
- _header.width = useWidth;
- _header.height = 25;
-
- if (host.height > 0) {
- useHeight = host.height - _header.height;
- }
-
- _listArea.x = 0;
- _listArea.y = 26;
- _listArea.width = useWidth;
- _listArea.height = useHeight;
-
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
-
- if (_lists != null && _lists.length > 0) {
- var xpos:Number = 0;
- var listWidth:Number = host.width / _lists.length;
- for (var i:int=0; i < _lists.length; i++) {
- var list:List = _lists[i] as List;
- list.x = xpos;
- list.y = 0;
-
- var dataGridColumn:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
- var colWidth:Number = dataGridColumn.columnWidth;
- if (!isNaN(colWidth)) list.width = colWidth;
- else list.width = listWidth;
-
- xpos += list.width;
- }
- }
- }
-
- /**
- * @private
- */
- private function handleDataProviderChanged(event:Event):void
- {
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
-
- if (_lists == null || _lists.length == 0) {
- createLists();
- }
-
- for (var i:int=0; i < _lists.length; i++)
- {
- var list:List = _lists[i] as List;
- var listModel:ISelectionModel = list.getBeadByType(IBeadModel) as ISelectionModel;
- listModel.dataProvider = sharedModel.dataProvider;
- }
-
- handleSizeChanges(event);
- }
-
- /**
- * @private
- */
- private function handleColumnListChange(event:Event):void
- {
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
- var list:List = event.target as List;
- sharedModel.selectedIndex = list.selectedIndex;
-
- for(var i:int=0; i < _lists.length; i++) {
- if (list != _lists[i]) {
- var otherList:List = _lists[i] as List;
- otherList.selectedIndex = list.selectedIndex;
- }
- }
-
- IEventDispatcher(_strand).dispatchEvent(new Event('change'));
- }
-
- /**
- * @private
- */
- private function createLists():void
- {
- var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
- var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
- var listWidth:Number = host.width / sharedModel.columns.length;
-
- _lists = new Array();
-
- for (var i:int=0; i < sharedModel.columns.length; i++) {
- var dataGridColumn:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
-
- var list:List = new List();
- list.id = "dataGridColumn"+String(i);
- list.className = "DataGridColumn";
- list.addBead(sharedModel);
- list.itemRenderer = dataGridColumn.itemRenderer;
- list.labelField = dataGridColumn.dataField;
- list.addEventListener('change',handleColumnListChange);
- list.addBead(presentationModel);
-
- var colWidth:Number = dataGridColumn.columnWidth;
- if (!isNaN(colWidth)) list.width = colWidth;
- else list.width = listWidth;
-
- _listArea.addElement(list);
- _lists.push(list);
- }
-
- _listArea.dispatchEvent(new Event("layoutNeeded"));
- }
- }
-}
-
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
deleted file mode 100644
index 609bfbc..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
+++ /dev/null
@@ -1,161 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IListPresentationModel;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.SimpleCSSStyles;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.List;
-
- /**
- * The DataItemRendererFactoryForArrayData class reads an
- * array of data and creates an item renderer for every
- * item in the array. Other implementations of
- * IDataProviderItemRendererMapper map different data
- * structures or manage a virtual set of renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataItemRendererFactoryForArrayData()
- {
- }
-
- private var selectionModel:ISelectionModel;
-
- private var labelField:String;
-
- 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;
- selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
- var listView:IListView = value.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
- labelField = (listView.host as List).labelField;
-
- if (!itemRendererFactory)
- {
- _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
- _strand.addBead(_itemRendererFactory);
- }
-
- dataProviderChangeHandler(null);
- }
-
- private var _itemRendererFactory:IItemRendererClassFactory;
-
- /**
- * The org.apache.flex.core.IItemRendererClassFactory used
- * to generate instances of item renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRendererFactory():IItemRendererClassFactory
- {
- return _itemRendererFactory;
- }
-
- /**
- * @private
- */
- public function set itemRendererFactory(value:IItemRendererClassFactory):void
- {
- _itemRendererFactory = value;
- }
-
- /**
- * The org.apache.flex.core.IItemRendererParent that will
- * parent the item renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- private function dataProviderChangeHandler(event:Event):void
- {
- var dp:Array = selectionModel.dataProvider as Array;
- if (!dp)
- return;
-
- dataGroup.removeAllElements();
-
- var listView:IListView = _strand.getBeadByType(IListView) as IListView;
- var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
-
- var n:int = dp.length;
- for (var i:int = 0; i < n; i++)
- {
- var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
- ir.index = i;
- ir.labelField = labelField;
- if (presentationModel) {
- var style:SimpleCSSStyles = new SimpleCSSStyles();
- style.marginBottom = presentationModel.separatorThickness;
- UIBase(ir).style = style;
- UIBase(ir).height = presentationModel.rowHeight;
- }
- dataGroup.addElement(ir);
- ir.data = dp[i];
- }
-
- IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
deleted file mode 100644
index 9895394..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
+++ /dev/null
@@ -1,174 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.collections.ArrayList;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IListPresentationModel;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.SimpleCSSStyles;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.List;
-
- /**
- * The DataItemRendererFactoryForArrayList class uses an ArrayList
- * and creates an item renderer for every
- * item in the collection. Other implementations of
- * IDataProviderItemRendererMapper map different data
- * structures or manage a virtual set of renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataItemRendererFactoryForArrayList implements IBead, IDataProviderItemRendererMapper
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataItemRendererFactoryForArrayList()
- {
- }
-
- private var selectionModel:ISelectionModel;
-
- private var labelField:String;
-
- 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("beadsAdded", finishSetup);
- IEventDispatcher(_strand).addEventListener("initComplete", finishSetup);
- }
-
- private function finishSetup(event:Event):void
- {
- selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- var listView:IListView = _strand.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
- labelField = (listView.host as List).labelField;
-
- if (!itemRendererFactory)
- {
- _itemRendererFactory = _strand.getBeadByType(IItemRendererClassFactory) as IItemRendererClassFactory;
- if (_itemRendererFactory == null) {
- _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
- _strand.addBead(_itemRendererFactory);
- }
- }
-
- dataProviderChangeHandler(null);
- }
-
- private var _itemRendererFactory:IItemRendererClassFactory;
-
- /**
- * The org.apache.flex.core.IItemRendererClassFactory used
- * to generate instances of item renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRendererFactory():IItemRendererClassFactory
- {
- return _itemRendererFactory;
- }
-
- /**
- * @private
- */
- public function set itemRendererFactory(value:IItemRendererClassFactory):void
- {
- _itemRendererFactory = value;
- }
-
- /**
- * The org.apache.flex.core.IItemRendererParent that will
- * parent the item renderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- private function dataProviderChangeHandler(event:Event):void
- {
- var dp:ArrayList = selectionModel.dataProvider as ArrayList;
- if (!dp)
- return;
-
- dataGroup.removeAllElements();
-
- var listView:IListView = _strand.getBeadByType(IListView) as IListView;
- var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
-
- var n:int = dp.length;
- for (var i:int = 0; i < n; i++)
- {
- var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
- ir.index = i;
- ir.labelField = labelField;
- if (presentationModel) {
- UIBase(ir).height = presentationModel.rowHeight;
-
- // ensure that the IR spans the width of its column
- var style:SimpleCSSStyles = new SimpleCSSStyles();
- style.right = 0;
- style.left = 0;
- UIBase(ir).style = style;
- }
- dataGroup.addElement(ir);
- ir.data = dp.getItemAt(i);
- }
-
- IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
deleted file mode 100644
index d399cfb..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
+++ /dev/null
@@ -1,142 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IDataGridModel;
- import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.supportClasses.DataItemRenderer;
-
- /**
- * The DataItemRendererFactoryForColumnData class implents the
- * org.apache.flex.core.IDataProviderItemRendererMapper interface and creates the itemRenderers
- * for each cell in the org.apache.flex.html.DataGrid.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataItemRendererFactoryForColumnData implements IBead, IDataProviderItemRendererMapper
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataItemRendererFactoryForColumnData()
- {
- }
-
- private var selectionModel:IDataGridModel;
-
- 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;
- selectionModel = value.getBeadByType(IDataGridModel) as IDataGridModel;
- var listView:IListView = value.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
- if (!itemRendererFactory)
- {
- _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
- _strand.addBead(_itemRendererFactory);
- }
-
- dataProviderChangeHandler(null);
- }
-
- private var _itemRendererFactory:IItemRendererClassFactory;
-
- /**
- * The factory used to create the itemRenderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRendererFactory():IItemRendererClassFactory
- {
- return _itemRendererFactory
- }
- public function set itemRendererFactory(value:IItemRendererClassFactory):void
- {
- _itemRendererFactory = value;
- }
-
- /**
- * The dataGroup that is the pareent for the itemRenderers
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- /**
- * @private
- */
- private function dataProviderChangeHandler(event:Event):void
- {
- var dp:Array = selectionModel.dataProvider as Array;
- if (!dp)
- return;
-
- dataGroup.removeAllElements();
-
- var view:DataGridColumnView = _strand.getBeadByType(IBeadView) as DataGridColumnView;
- if (view == null) return;
-
- var n:int = dp.length;
- for (var i:int = 0; i < n; i++)
- {
- var tf:DataItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as DataItemRenderer;
- tf.index = i;
- tf.labelField = view.column.dataField;
- dataGroup.addElement(tf);
- tf.data = dp[i];
- }
-
- IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataProviderChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataProviderChangeNotifier.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataProviderChangeNotifier.as
deleted file mode 100644
index 8905fb9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DataProviderChangeNotifier.as
+++ /dev/null
@@ -1,154 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDocument;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.collections.ArrayList;
-
- /**
- * The DataProviderChangeNotifier notifies listeners when a selection model's
- * ArrayList dataProvider has changed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataProviderChangeNotifier implements IBead, IDocument
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataProviderChangeNotifier()
- {
- }
-
- protected var _dataProvider:ArrayList;
-
- 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;
-
- if (_dataProvider == null) {
- var object:Object = document[sourceID];
- _dataProvider = object[propertyName] as ArrayList;
- }
-
- _dataProvider.addEventListener("itemAdded", handleItemAdded);
- _dataProvider.addEventListener("itemRemoved", handleItemRemoved);
- _dataProvider.addEventListener("itemUpdated", handleItemUpdated);
-
- }
-
- protected var document:Object;
-
- /**
- * @private
- */
- public function setDocument(document:Object, id:String = null):void
- {
- this.document = document;
- }
-
- private var _sourceID:String;
-
- /**
- * The ID of the object holding the ArrayList, usually a model.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get sourceID():String
- {
- return _sourceID;
- }
- public function set sourceID(value:String):void
- {
- _sourceID = value;
- }
-
- private var _propertyName:String;
-
- /**
- * The property in the sourceID that is the ArrayList.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get propertyName():String
- {
- return _propertyName;
- }
-
- public function set propertyName(value:String):void
- {
- _propertyName = value;
- }
-
- /**
- * @private
- */
- private function handleItemAdded(event:Event):void
- {
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- selectionModel.dispatchEvent(new Event("dataProviderChanged"));
- }
-
- /**
- * @private
- */
- private function handleItemRemoved(event:Event):void
- {
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- selectionModel.dispatchEvent(new Event("dataProviderChanged"));
- }
-
- /**
- * @private
- */
- private function handleItemUpdated(event:Event):void
- {
- var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- selectionModel.dispatchEvent(new Event("dataProviderChanged"));
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateChooserView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateChooserView.as
deleted file mode 100644
index 5abf4c4..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DateChooserView.as
+++ /dev/null
@@ -1,256 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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();
- }
- }
-}
[10/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSImageAndTextButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
new file mode 100644
index 0000000..12ac07d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSImageAndTextButtonView.as
@@ -0,0 +1,367 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+ import flash.text.TextField;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.html.beads.models.ImageAndTextModel;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSTextButtonView class is the default view for
+ * the org.apache.flex.html.TextButton class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style and displays
+ * a text label. This view does not support right-to-left
+ * text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSImageAndTextButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSImageAndTextButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ upTextField.autoSize = "left";
+ downTextField.autoSize = "left";
+ overTextField.autoSize = "left";
+ upSprite.addChild(upTextField);
+ downSprite.addChild(downTextField);
+ overSprite.addChild(overTextField);
+ }
+
+ private var textModel:ImageAndTextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ textModel = value.getBeadByType(ImageAndTextModel) as ImageAndTextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ textModel.addEventListener("imageChange", imageChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ upTextField.styleParent = _strand;
+ downTextField.styleParent = _strand;
+ overTextField.styleParent = _strand;
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
+ upTextField.parentHandlesPadding = true;
+ downTextField.parentHandlesPadding = true;
+ overTextField.parentHandlesPadding = true;
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+ if (textModel.text !== null)
+ text = textModel.text;
+ if (textModel.html !== null)
+ html = textModel.html;
+
+ setupSkins();
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, overTextField, "hover");
+ setupSkin(downSprite, downTextField, "active");
+ setupSkin(upSprite, upTextField);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
+ {
+ var sw:uint = DisplayObject(_strand).width;
+ var sh:uint = DisplayObject(_strand).height;
+
+ textField.defaultTextFormat.leftMargin = 0;
+ textField.defaultTextFormat.rightMargin = 0;
+ // set it again so it gets noticed
+ textField.defaultTextFormat = textField.defaultTextFormat;
+
+ var borderColor:uint;
+ var borderThickness:uint;
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
+ if (borderStyles is Array)
+ {
+ borderColor = CSSUtils.toColor(borderStyles[2]);
+ borderStyle = borderStyles[1];
+ borderThickness = borderStyles[0];
+ }
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
+ var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
+ if (value != null)
+ borderStyle = value as String;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
+ if (value != null)
+ borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = 2 * (value as Number);
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
+ }
+ }
+
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
+ var bgColor:uint;
+ var bgAlpha:Number = 1;
+ if (backgroundColor != null)
+ {
+ bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
+ if (bgColor & 0xFF000000)
+ {
+ bgAlpha = bgColor >>> 24 / 255;
+ bgColor = bgColor & 0xFFFFFF;
+ }
+ }
+ if (borderStyle == "solid")
+ {
+ var useWidth:Number = Math.max(sw,textField.textWidth);
+ var useHeight:Number = Math.max(sh,textField.textHeight);
+
+ if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
+ useWidth = textField.textWidth+pl+pr+2*borderThickness;
+ if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
+ useHeight = textField.textHeight+pt+pb+2*borderThickness;
+
+ sprite.graphics.clear();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, useWidth, useHeight,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
+ textField.y = ((useHeight - textField.textHeight) / 2) - 2;
+ textField.x = ((useWidth - textField.textWidth) / 2) - 2;
+ }
+ var backgroundImage:Object = image;
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ sprite.addChild(textField);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ updateHitArea();
+ loader.x = pl;
+ textField.x = loader.width + pl;
+ textField.y = pt;
+ loader.y = (textField.height + pt + pb - loader.height) / 2;
+ sprite.graphics.clear();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, textField.x + textField.width + pr + borderThickness,
+ textField.y + textField.height + pb + borderThickness,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
+ });
+ }
+ var textColor:Object = ValuesManager.valuesImpl.getValue(_strand, "color", state);
+ if (textColor) {
+ textField.textColor = Number(textColor);
+ }
+ }
+
+ private function textChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ private var upTextField:CSSTextField;
+ private var downTextField:CSSTextField;
+ private var overTextField:CSSTextField;
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+
+ /**
+ * The URL of an icon to use in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get image():String
+ {
+ return textModel.image;
+ }
+
+ private function imageChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ /**
+ * The text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ updateHitArea();
+ }
+
+ private function updateHitArea():void
+ {
+ var useWidth:uint = Math.max(DisplayObject(_strand).width, upTextField.textWidth);
+ var useHeight:uint = Math.max(DisplayObject(_strand).height, upTextField.textHeight);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, useWidth, useHeight);
+ shape.graphics.endFill();
+
+ }
+
+ /**
+ * The html-formatted text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return upTextField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ upTextField.htmlText = value;
+ downTextField.htmlText = value;
+ overTextField.htmlText = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
new file mode 100644
index 0000000..cc285b7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -0,0 +1,347 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+ import flash.text.TextField;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSTextButtonView class is the default view for
+ * the org.apache.flex.html.TextButton class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style and displays
+ * a text label. This view does not support right-to-left
+ * text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSTextButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSTextButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ upTextField.autoSize = "left";
+ downTextField.autoSize = "left";
+ overTextField.autoSize = "left";
+ upSprite.addChild(upTextField);
+ downSprite.addChild(downTextField);
+ overSprite.addChild(overTextField);
+ }
+
+ private var textModel:ITextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ textModel = value.getBeadByType(ITextModel) as ITextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ upTextField.styleParent = _strand;
+ downTextField.styleParent = _strand;
+ overTextField.styleParent = _strand;
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
+ upTextField.parentHandlesPadding = true;
+ downTextField.parentHandlesPadding = true;
+ overTextField.parentHandlesPadding = true;
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+ if (textModel.text !== null)
+ text = textModel.text;
+ if (textModel.html !== null)
+ html = textModel.html;
+
+ setupSkins();
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("sizeChanged",sizeChangeHandler);
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, overTextField, "hover");
+ setupSkin(downSprite, downTextField, "active");
+ setupSkin(upSprite, upTextField);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
+ {
+ var sw:uint = DisplayObject(_strand).width;
+ var sh:uint = DisplayObject(_strand).height;
+
+ textField.defaultTextFormat.leftMargin = 0;
+ textField.defaultTextFormat.rightMargin = 0;
+ // set it again so it gets noticed
+ textField.defaultTextFormat = textField.defaultTextFormat;
+
+ var borderColor:uint;
+ var borderThickness:uint;
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
+ if (borderStyles is Array)
+ {
+ borderColor = CSSUtils.toColor(borderStyles[2]);
+ borderStyle = borderStyles[1];
+ borderThickness = borderStyles[0];
+ }
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
+ var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
+ if (value != null)
+ borderStyle = value as String;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
+ if (value != null)
+ borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = 2 * (value as Number);
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
+ }
+ }
+
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
+ var bgColor:uint;
+ var bgAlpha:Number = 1;
+ if (backgroundColor != null)
+ {
+ bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
+ if (bgColor & 0xFF000000)
+ {
+ bgAlpha = bgColor >>> 24 / 255;
+ bgColor = bgColor & 0xFFFFFF;
+ }
+ }
+ if (borderStyle == "solid")
+ {
+ var useWidth:Number = Math.max(sw,textField.textWidth);
+ var useHeight:Number = Math.max(sh,textField.textHeight);
+
+ if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
+ useWidth = textField.textWidth+pl+pr+2*borderThickness;
+ if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
+ useHeight = textField.textHeight+pt+pb+2*borderThickness;
+
+ sprite.graphics.clear();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, useWidth, useHeight,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
+ textField.y = ((useHeight - textField.textHeight) / 2) - 2;
+ textField.x = ((useWidth - textField.textWidth) / 2) - 2;
+ }
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ var useWidth:Number = Math.max(sw,textField.textWidth);
+ var useHeight:Number = Math.max(sh,textField.textHeight);
+
+ if ((useWidth-2*Number(padding)-2*borderThickness) < textField.textWidth)
+ useWidth = textField.textWidth+2*Number(padding)+2*borderThickness;
+ if ((useHeight-2*Number(padding)-2*borderThickness) < textField.textHeight)
+ useHeight = textField.textHeight+2*Number(padding)+2*borderThickness;
+
+ textField.y = (useHeight - textField.height) / 2;
+ textField.x = (useWidth - textField.width) / 2;
+ updateHitArea();
+ });
+ }
+ var textColor:Object = ValuesManager.valuesImpl.getValue(_strand, "color", state);
+ if (textColor) {
+ textField.textColor = Number(textColor);
+ }
+ }
+
+ private function textChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ private var upTextField:CSSTextField;
+ private var downTextField:CSSTextField;
+ private var overTextField:CSSTextField;
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+
+ /**
+ * The text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ updateHitArea();
+ }
+
+ private function updateHitArea():void
+ {
+ var useWidth:uint = Math.max(DisplayObject(_strand).width, upTextField.textWidth);
+ var useHeight:uint = Math.max(DisplayObject(_strand).height, upTextField.textHeight);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, useWidth, useHeight);
+ shape.graphics.endFill();
+
+ }
+
+ /**
+ * The html-formatted text to be displayed in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return upTextField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ upTextField.htmlText = value;
+ downTextField.htmlText = value;
+ overTextField.htmlText = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
new file mode 100644
index 0000000..7de01ef
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CSSTextToggleButtonView.as
@@ -0,0 +1,105 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IStrand;
+ import org.apache.flex.core.IStyleableObject;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The CSSTextToggleButtonView class is the default view for
+ * the org.apache.flex.html.TextToggleButton class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style and displays
+ * a text label. This view does not support right-to-left
+ * text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSTextToggleButtonView extends CSSTextButtonView
+ {
+ /**
+ * The suffix appended to the className when selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static const SELECTED:String = "_Selected";
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSTextToggleButtonView()
+ {
+ }
+
+ private var toggleButtonModel:IToggleButtonModel;
+
+ private var _selected:Boolean;
+
+ /**
+ * @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;
+
+ toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
+ toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
+ }
+
+ private function selectedChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ var className:String = IStyleableObject(_strand).className;
+ if (toggleButtonModel.selected)
+ {
+ if (className.indexOf(SELECTED) == className.length - SELECTED.length)
+ IStyleableObject(_strand).className = className.substring(0, className.length - SELECTED.length);
+ setupSkins();
+ }
+ else
+ {
+ if (className.indexOf(SELECTED) == -1)
+ IStyleableObject(_strand).className += SELECTED;
+ setupSkins();
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CheckBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CheckBoxView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CheckBoxView.as
new file mode 100644
index 0000000..a04f2bf
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CheckBoxView.as
@@ -0,0 +1,296 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The CheckBoxView class is the default view for
+ * the org.apache.flex.html.CheckBox class.
+ * It displays a simple checkbox with an 'x' if checked,
+ * and a label on the right. There are no styles or
+ * properties to configure the look of the 'x' or the
+ * position of the label relative to the checkbox as
+ * there are no equivalents in the standard HTML checkbox.
+ *
+ * A more complex CheckBox could implement more view
+ * configuration.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CheckBoxView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CheckBoxView()
+ {
+ sprites = [ upSprite = new Sprite(),
+ downSprite = new Sprite(),
+ overSprite = new Sprite(),
+ upAndSelectedSprite = new Sprite(),
+ downAndSelectedSprite = new Sprite(),
+ overAndSelectedSprite = new Sprite() ];
+
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = new CSSTextField();
+ tf.type = TextFieldType.DYNAMIC;
+ tf.autoSize = TextFieldAutoSize.LEFT;
+ tf.name = "textField";
+ var icon:Shape = new Shape();
+ icon.name = "icon";
+ s.addChild(icon);
+ s.addChild(tf);
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upAndSelectedSprite:Sprite;
+ private var downAndSelectedSprite:Sprite;
+ private var overAndSelectedSprite:Sprite;
+
+ private var sprites:Array;
+
+ private var _toggleButtonModel:IToggleButtonModel;
+
+ // TODO: Can we remove this?
+ private function get toggleButtonModel() : IToggleButtonModel
+ {
+ return _toggleButtonModel;
+ }
+
+ /**
+ * @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;
+
+ _toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
+ _toggleButtonModel.addEventListener("textChange", textChangeHandler);
+ _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
+ _toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
+ if (_toggleButtonModel.text !== null)
+ text = _toggleButtonModel.text;
+
+ layoutControl();
+
+ var hitArea:Shape = new Shape();
+ hitArea.graphics.beginFill(0x000000);
+ hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
+ hitArea.graphics.endFill();
+
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = hitArea;
+
+ if (toggleButtonModel.text !== null)
+ text = toggleButtonModel.text;
+ if (toggleButtonModel.html !== null)
+ html = toggleButtonModel.html;
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.text = value;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.htmlText = value;
+ }
+
+ layoutControl();
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = toggleButtonModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = toggleButtonModel.html;
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * @copy org.apache.flex.core.IToggleButtonModel#selected
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+
+ /**
+ * @private
+ */
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+
+ layoutControl();
+
+ if( value ) {
+ SimpleButton(_strand).upState = upAndSelectedSprite;
+ SimpleButton(_strand).downState = downAndSelectedSprite;
+ SimpleButton(_strand).overState = overAndSelectedSprite;
+
+ } else {
+ SimpleButton(_strand).upState = upSprite;
+ SimpleButton(_strand).downState = downSprite;
+ SimpleButton(_strand).overState = overSprite;
+ }
+ }
+
+ private function selectedChangeHandler(event:Event):void
+ {
+ selected = toggleButtonModel.selected;
+ }
+
+ /**
+ * Display the icon and text label
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function layoutControl() : void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var icon:Shape = s.getChildByName("icon") as Shape;
+ var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
+
+ drawCheckBox(icon);
+
+ var mh:Number = Math.max(icon.height,tf.height);
+
+ icon.x = 0;
+ icon.y = (mh - icon.height)/2;
+
+ tf.x = icon.x + icon.width + 1;
+ tf.y = (mh - tf.height)/2;
+ }
+
+ }
+
+ /**
+ * Draw the checkbox
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function drawCheckBox(icon:Shape) : void
+ {
+ icon.graphics.clear();
+ icon.graphics.beginFill(0xf8f8f8);
+ icon.graphics.lineStyle(1,0x808080);
+ icon.graphics.drawRect(0,0,10,10);
+ icon.graphics.endFill();
+
+ if( _toggleButtonModel.selected ) {
+ icon.graphics.lineStyle(2,0);
+ icon.graphics.moveTo(3,4);
+ icon.graphics.lineTo(5,7);
+ icon.graphics.lineTo(9,0);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CloseButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CloseButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CloseButtonView.as
new file mode 100644
index 0000000..7d3fb19
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/CloseButtonView.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.TitleBar;
+
+ /**
+ * The CloseButtonView class is the view for
+ * the down arrow button in a ScrollBar and other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CloseButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CloseButtonView()
+ {
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xCCCCCC);
+ drawView(downView.graphics, 0x666666);
+ drawView(overView.graphics, 0x999999);
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.beginFill(bgColor);
+ g.drawRect(0, 0, 11, 11);
+ g.endFill();
+ g.lineStyle(2);
+ g.moveTo(3,3);
+ g.lineTo(8,8);
+ g.moveTo(3,8);
+ g.lineTo(8,3);
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 11, 11);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ComboBoxView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ComboBoxView.as
new file mode 100644
index 0000000..e725517
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ComboBoxView.as
@@ -0,0 +1,247 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Sprite;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.TextInput;
+
+ /**
+ * The ComboBoxView class creates the visual elements of the org.apache.flex.html.ComboBox
+ * component. The job of the view bead is to put together the parts of the ComboBox such as the TextInput
+ * control and org.apache.flex.html.Button to trigger the pop-up.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ComboBoxView extends BeadViewBase implements IBeadView, IComboBoxView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ComboBoxView()
+ {
+ }
+
+ private var textInput:TextInput;
+ private var button:Button;
+ private var selectionModel:IComboBoxModel;
+
+ /**
+ * The value of the TextInput component of the ComboBox.
+ *
+ * @copy org.apache.flex.html.beads.IComboBoxView#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return textInput.text;
+ }
+ public function set text(value:String):void
+ {
+ textInput.text = value;
+ }
+
+ /**
+ * The HTML value of the TextInput component of the ComboBox.
+ *
+ * @copy org.apache.flex.html.beads.IComboBoxView#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return textInput.html;
+ }
+ public function set html(value:String):void
+ {
+ textInput.html = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get strand():IStrand
+ {
+ return _strand;
+ }
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ selectionModel = value.getBeadByType(IComboBoxModel) as IComboBoxModel;
+ selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+
+ textInput = new TextInput();
+ IParent(strand).addElement(textInput);
+ textInput.width = 100;
+ textInput.height = 18;
+
+ upSprite = new Sprite();
+ drawButton( upSprite, "up", 18, 18 );
+ overSprite = new Sprite();
+ drawButton( overSprite, "over", 18, 18 );
+ downSprite = new Sprite();
+ drawButton( downSprite, "down", 18, 18 );
+
+ button = new Button();
+ button.upState = upSprite;
+ button.overState = overSprite;
+ button.downState = downSprite;
+ DisplayObjectContainer(strand).addChild(button);
+ button.width = 18;
+ button.height = 18;
+ button.x = textInput.width;
+ button.y = textInput.y;
+
+ // listen for events on the text input and modify the list and selection
+ textInput.addEventListener("change", textChangeHandler,false,0,true);
+ }
+
+ private var upSprite:Sprite;
+ private var overSprite:Sprite;
+ private var downSprite:Sprite;
+
+ /**
+ * @private
+ */
+ private function drawButton( sprite:Sprite, mode:String, width:Number, height:Number ) : void
+ {
+ sprite.graphics.clear();
+ sprite.graphics.lineStyle(1,0xFFFFFF);
+ sprite.graphics.drawRect(0, 0, width-1, height-1);
+ sprite.graphics.lineStyle(-1);
+
+ if( mode == "over" ) sprite.graphics.beginFill(0xCCCCCC);
+ else if( mode == "down" ) sprite.graphics.beginFill(0x888888);
+ sprite.graphics.drawRect(0, 0, width-1, height-1);
+ sprite.graphics.endFill();
+
+ sprite.graphics.beginFill(0x333333);
+ sprite.graphics.moveTo(4,4);
+ sprite.graphics.lineTo(width-4,4);
+ sprite.graphics.lineTo(int(width/2),height-4);
+ sprite.graphics.lineTo(4,4);
+ sprite.graphics.endFill();
+ }
+
+ private var _popUp:IStrand;
+
+ /**
+ * 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():IStrand
+ {
+ 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)
+ {
+ var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
+ _popUp = new popUpClass() as IStrand;
+ }
+ var root:Object = DisplayObject(_strand).root;
+ var host:DisplayObjectContainer = DisplayObject(_strand).parent;
+ while (host && !(host is IPopUpHost))
+ host = host.parent;
+ if (host)
+ IPopUpHost(host).addElement(popUp);
+ }
+ else
+ {
+ DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function selectionChangeHandler(event:Event):void
+ {
+ text = selectionModel.selectedItem.toString();
+ }
+
+ /**
+ * @private
+ */
+ private function textChangeHandler(event:Event):void
+ {
+ var newEvent:Event = new Event("change");
+ IEventDispatcher(strand).dispatchEvent(newEvent);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
new file mode 100644
index 0000000..26e78be
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ContainerView.as
@@ -0,0 +1,553 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ContainerBase;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IContainer;
+ import org.apache.flex.core.IContainerView;
+ import org.apache.flex.core.IContentViewHost;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ 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;
+ 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.geom.Rectangle;
+ import org.apache.flex.geom.Size;
+ import org.apache.flex.html.beads.models.ViewportModel;
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.html.supportClasses.ContainerContentArea;
+ import org.apache.flex.html.supportClasses.Viewport;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * This class creates and manages the contents of a Container. On the ActionScript
+ * side, a Container has a contentView into which the offical children can be
+ * placed. When adding an element that implements IChrome, that element is not
+ * placed into the contentView, but is made a child of the Container directly.
+ *
+ * Containers also have a layout associated with them which controls the size and
+ * placement of the elements in the contentView. When a Container does not have an
+ * explicit size (including a percent size), the content dictates the size of the
+ * Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ContainerView extends BeadViewBase implements IBeadView, IContainerView, ILayoutHost
+ {
+ /**
+ * The ContainerView class is the default view for
+ * the org.apache.flex.core.ContainerBase classes.
+ * It lets you use some CSS styles to manage the border, background
+ * and padding around the content area.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ContainerView()
+ {
+ super();
+
+ layoutRunning = false;
+ }
+
+ /**
+ * The sub-element used as the parent of the container's elements. This does not
+ * include the chrome elements.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get contentView():IParentIUIBase
+ {
+ return viewport.contentView as IParentIUIBase;
+ }
+
+ /**
+ * The view that can be resized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get resizableView():IUIBase
+ {
+ return host;
+ }
+
+ /**
+ * The viewport used to present the content and may display
+ * scroll bars (depending on the actual type of viewport).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function get viewport():IViewport
+ {
+ return _viewport;
+ }
+
+ /**
+ * The data model used by the viewport to determine how it should
+ * present the content area.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewportModel():IViewportModel
+ {
+ return _viewportModel;
+ }
+
+ private var _viewportModel:IViewportModel;
+ private var _viewport:IViewport;
+ private var layoutRunning:Boolean;
+
+ /**
+ * @private
+ */
+ public function addElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ contentView.addElement(c, dispatchEvent);
+ }
+
+ /**
+ * @private
+ */
+ public function addElementAt(c:Object, index:int, dispatchEvent:Boolean = true):void
+ {
+ contentView.addElementAt(c, index, dispatchEvent);
+ }
+
+ /**
+ * @private
+ */
+ public function getElementIndex(c:Object):int
+ {
+ return contentView.getElementIndex(c);
+ }
+
+ /**
+ * @private
+ */
+ public function removeElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ contentView.removeElement(c, dispatchEvent);
+ }
+
+ /**
+ * @private
+ */
+ public function get numElements():int
+ {
+ return contentView.numElements;
+ }
+
+ /**
+ * @private
+ */
+ public function getElementAt(index:int):Object
+ {
+ return contentView.getElementAt(index);
+ }
+
+ /**
+ * Strand setter.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ super.strand = value;
+
+ createViewport();
+
+ (host as IContentViewHost).strandChildren.addElement(viewport.contentView, false);
+
+ displayBackgroundAndBorder(host as UIBase);
+
+ // listen for initComplete to signal that the strand is set with its size
+ // and beads.
+ host.addEventListener("initComplete", initCompleteHandler);
+ }
+
+ /**
+ * Handles the initComplete event by completing the setup and kicking off the
+ * presentation of the Container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function initCompleteHandler(event:Event):void
+ {
+ var ilc:ILayoutChild = host as ILayoutChild;
+ // Complete the setup if the height is sized to content or has been explicitly set
+ // and the width is sized to content or has been explicitly set
+ if ((ilc.isHeightSizedToContent() || !isNaN(ilc.explicitHeight)) &&
+ (ilc.isWidthSizedToContent() || !isNaN(ilc.explicitWidth))) {
+ completeSetup();
+
+ var num:Number = contentView.numElements;
+ if (num > 0) performLayout(event);
+ }
+ else {
+ // otherwise, wait until the unknown sizes have been set and then finish
+ host.addEventListener("sizeChanged", deferredSizeHandler);
+ host.addEventListener("widthChanged", deferredSizeHandler);
+ host.addEventListener("heightChanged", deferredSizeHandler);
+ }
+ }
+
+ /**
+ * Handles the case where the size of the host is not immediately known, usually do
+ * to one of its dimensions being indicated as a percent size.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private function deferredSizeHandler(event:Event):void
+ {
+ host.removeEventListener("sizeChanged", deferredSizeHandler);
+ host.removeEventListener("widthChanged", deferredSizeHandler);
+ host.removeEventListener("heightChanged", deferredSizeHandler);
+ completeSetup();
+
+ var num:Number = contentView.numElements;
+ if (num > 0)
+ {
+ performLayout(event);
+ }
+ }
+
+ /**
+ * Called when the host is ready to complete its setup (usually after its size has been
+ * determined).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function completeSetup():void
+ {
+ // when the first layout is complete, set up listeners for changes
+ // to the childrens' sizes.
+ host.addEventListener("layoutComplete", childrenChangedHandler);
+
+ host.addEventListener("childrenAdded", performLayout);
+ host.addEventListener("layoutNeeded", performLayout);
+ host.addEventListener("widthChanged", resizeHandler);
+ host.addEventListener("heightChanged", resizeHandler);
+ host.addEventListener("sizeChanged", resizeHandler);
+ host.addEventListener("viewCreated", viewCreatedHandler);
+ }
+
+ /**
+ * Handles the viewCreated event by performing the first layout if
+ * there are children already present (ie, from MXML).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function viewCreatedHandler(event:Event):void
+ {
+ if ((host as UIBase).numElements > 0) {
+ performLayout(null);
+ }
+ }
+
+ /**
+ * Calculate the space taken up by non-content children like a TItleBar in a Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function getChromeMetrics():Rectangle
+ {
+ return new Rectangle(0, 0, 0, 0);
+ }
+
+ /**
+ * Creates the Viewport (or ScrollableViewport) through which the content
+ * area is presented.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function createViewport():void
+ {
+ var c:Class;
+ if (viewportModel == null) {
+ _viewportModel = _strand.getBeadByType(IViewportModel) as IViewportModel;
+ if (viewportModel == null) {
+ c = ValuesManager.valuesImpl.getValue(host, "iViewportModel");
+ if (c)
+ {
+ _viewportModel = new c() as IViewportModel;
+ _strand.addBead(_viewportModel);
+ }
+ }
+ }
+
+ if (viewport == null) {
+ _viewport = _strand.getBeadByType(IViewport) as IViewport;
+ if (viewport == null) {
+ c = ValuesManager.valuesImpl.getValue(host, "iViewport");
+ if (c)
+ {
+ _viewport = new c() as IViewport;
+ _strand.addBead(viewport);
+ }
+ }
+ }
+ }
+
+ /**
+ * Positions the viewport, then sets any known sizes of the Viewport prior
+ * to laying out its content.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function layoutViewBeforeContentLayout():void
+ {
+ var host:ILayoutChild = this.host as ILayoutChild;
+ var vm:IViewportModel = viewportModel;
+ vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
+ vm.chromeMetrics = getChromeMetrics();
+ viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
+ vm.borderMetrics.top + vm.chromeMetrics.top)
+ viewport.layoutViewportBeforeContentLayout(
+ !host.isWidthSizedToContent() ?
+ host.width - vm.borderMetrics.left - vm.borderMetrics.right -
+ vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
+ !host.isHeightSizedToContent() ?
+ host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
+ vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
+
+ }
+
+ /**
+ * Executes the layout associated with this container. Once the layout has been
+ * run, it may affect the size of the host or may cause the host to present scroll
+ * bars view its viewport.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function performLayout(event:Event):void
+ {
+ layoutRunning = true;
+
+ layoutViewBeforeContentLayout();
+
+ var host:UIBase = _strand as UIBase;
+
+ var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout;
+ if (layout == null) {
+ var c:Class = ValuesManager.valuesImpl.getValue(host, "iBeadLayout");
+ if (c) {
+ layout = new c() as IBeadLayout;
+ _strand.addBead(layout);
+ }
+ }
+
+ if (layout) {
+ layout.layout();
+ }
+
+ layoutViewAfterContentLayout();
+
+ layoutRunning = false;
+ }
+
+ /**
+ * @private
+ */
+ private var adjusting:Boolean = false;
+
+ /**
+ * Adjusts the size of the host, or adds scrollbars to the viewport, after
+ * the layout has been run.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function layoutViewAfterContentLayout():void
+ {
+ var host:UIBase = _strand as UIBase;
+ var vm:IViewportModel = viewportModel;
+
+ adjusting = true;
+
+ var viewportSize:Size = viewport.layoutViewportAfterContentLayout();
+
+ if (host.isWidthSizedToContent() && host.isHeightSizedToContent()) {
+ host.setWidthAndHeight(viewportSize.width + vm.borderMetrics.left + vm.borderMetrics.right +
+ vm.chromeMetrics.left + vm.chromeMetrics.right,
+ viewportSize.height + vm.borderMetrics.top + vm.borderMetrics.bottom +
+ vm.chromeMetrics.top + vm.chromeMetrics.bottom,
+ false);
+ }
+ else if (!host.isWidthSizedToContent() && host.isHeightSizedToContent())
+ {
+ host.setHeight(viewportSize.height + vm.borderMetrics.top + vm.borderMetrics.bottom +
+ vm.chromeMetrics.top + vm.chromeMetrics.bottom, false);
+ }
+ else if (host.isWidthSizedToContent() && !host.isHeightSizedToContent())
+ {
+ host.setWidth(viewportSize.width + vm.borderMetrics.left + vm.borderMetrics.right +
+ vm.chromeMetrics.left + vm.chromeMetrics.right, false);
+ }
+ adjusting = false;
+ }
+
+ /**
+ * Handles dynamic changes to the host's size by running the layout once
+ * the viewport has been adjusted.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function resizeHandler(event:Event):void
+ {
+ if (!adjusting) {
+ performLayout(event);
+ }
+ }
+
+ /**
+ * Whenever children are added, listeners are added to detect changes
+ * in their size.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function childrenChangedHandler(event:Event):void
+ {
+ var host:UIBase = _strand as UIBase;
+ host.removeEventListener(event.type, childrenChangedHandler);
+
+ var n:Number = contentView.numElements;
+ for (var i:int=0; i < n; i++) {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ child.addEventListener("widthChanged", childResizeHandler);
+ child.addEventListener("heightChanged", childResizeHandler);
+ child.addEventListener("sizeChanged", childResizeHandler);
+ }
+ }
+
+ /**
+ * This event handles changes to the size of children of the container by running
+ * the layout again and adjusting the size of the container or viewport as necessary.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function childResizeHandler(event:Event):void
+ {
+ // during this process we don't want the layout to trigger
+ // an endless event chain should any children get resized
+ // by the layout.
+ if (layoutRunning) return;
+ performLayout(event);
+ }
+
+ protected function displayBackgroundAndBorder(host:UIBase) : void
+ {
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(host, "background-image");
+ if (backgroundColor != null || backgroundImage != null)
+ {
+ if (host.getBeadByType(IBackgroundBead) == null)
+ var c:Class = ValuesManager.valuesImpl.getValue(host, "iBackgroundBead");
+ if (c) {
+ host.addBead( new c() as IBead );
+ }
+ }
+
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(host, "border");
+ if (borderStyles is Array)
+ {
+ borderStyle = borderStyles[1];
+ }
+ if (borderStyle == null)
+ {
+ borderStyle = ValuesManager.valuesImpl.getValue(host, "border-style") as String;
+ }
+ if (borderStyle != null && borderStyle != "none")
+ {
+ if (host.getBeadByType(IBorderBead) == null) {
+ c = ValuesManager.valuesImpl.getValue(host, "iBorderBead");
+ if (c) {
+ host.addBead( new c() as IBead );
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ControlBarMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ControlBarMeasurementBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ControlBarMeasurementBead.as
new file mode 100644
index 0000000..18d19dd
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ControlBarMeasurementBead.as
@@ -0,0 +1,116 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObjectContainer;
+
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.html.Container;
+
+ /**
+ * The ControlBarMeasurementBead class measures the size of a org.apache.flex.html.ControlBar
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ControlBarMeasurementBead implements IMeasurementBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ControlBarMeasurementBead()
+ {
+ }
+
+ /**
+ * Returns the overall width of the ControlBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredWidth():Number
+ {
+ // Note: the measurement should problably be done by the ControlBar's layout manager bead
+ // since it would know the arrangement of the items and how far apart they are and if
+ // there are margins and paddings and gaps involved.
+ var mwidth:Number = 0;
+ var container:Container = Container(_strand);
+ var n:int = container.numElements;
+ for(var i:int=0; i < n; i++) {
+ var child:IUIBase = container.getElementAt(i) as IUIBase;
+ if( child == null ) continue;
+ var childMeasure:IMeasurementBead = child.getBeadByType(IMeasurementBead) as IMeasurementBead;
+ if (childMeasure)
+ mwidth += childMeasure.measuredWidth;
+ }
+ return mwidth;
+ }
+
+ /**
+ * Returns the overall height of the ControlBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get measuredHeight():Number
+ {
+ // Note: the measurement should problably be done by the ControlBar's layout manager bead
+ // since it would know the arrangement of the items and how far apart they are and if
+ // there are margins and paddings and gaps involved.
+ var mheight:Number = 0;
+ var n:int = DisplayObjectContainer(_strand).numChildren;
+ for(var i:int=0; i < n; i++) {
+ var child:IUIBase = DisplayObjectContainer(_strand).getChildAt(i) as IUIBase;
+ if( child == null ) continue;
+ var childMeasure:IMeasurementBead = child.getBeadByType(IMeasurementBead) as IMeasurementBead;
+ mheight += childMeasure.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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridColumnView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridColumnView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridColumnView.as
new file mode 100644
index 0000000..7efa3ee
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridColumnView.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.html.supportClasses.DataGridColumn;
+
+ /**
+ * The DataGridColumnView class extends org.apache.flex.html.beads.ListView and
+ * provides properties to the org.apache.flex.html.List that makes a column in
+ * the org.apache.flex.html.DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridColumnView extends ListView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridColumnView()
+ {
+ }
+
+ /**
+ * @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;
+ }
+
+ private var _columnIndex:uint;
+
+ /**
+ * The zero-based index for the column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columnIndex():uint
+ {
+ return _columnIndex;
+ }
+ public function set columnIndex(value:uint):void
+ {
+ _columnIndex = value;
+ }
+
+ private var _column:DataGridColumn;
+
+ /**
+ * The org.apache.flex.html.support.DataGridColumn containing information used to
+ * present the org.apache.flex.html.List as a column in the
+ * org.apache.flex.html.DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get column():DataGridColumn
+ {
+ return _column;
+ }
+ public function set column(value:DataGridColumn):void
+ {
+ _column = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridLinesBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridLinesBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridLinesBead.as
new file mode 100644
index 0000000..b4e5b1d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridLinesBead.as
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.collections.ArrayList;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IDataGridModel;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.graphics.GraphicsContainer;
+ import org.apache.flex.core.graphics.IStroke;
+ import org.apache.flex.core.graphics.SolidColor;
+ import org.apache.flex.core.graphics.SolidColorStroke;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.beads.models.DataGridPresentationModel;
+ import org.apache.flex.html.supportClasses.DataGridColumn;
+
+ /**
+ * The DataGridLinesBead is an add on bead for the DataGrid. This bead
+ * adds horizontal and vertical grid lines to a DataGrid. The size and
+ * color of the lines is specified by the stroke property (defaults to
+ * a thin dark line).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridLinesBead implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridLinesBead()
+ {
+ // Set default separator line stroke.
+ var lineStroke:SolidColorStroke = new SolidColorStroke();
+ lineStroke.color = 0x333333;
+ lineStroke.alpha = 1.0;
+ lineStroke.weight = 1;
+ stroke = lineStroke;
+ }
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.UIBase#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;
+
+ _overlay = new GraphicsContainer();
+
+ IEventDispatcher(_strand).addEventListener("beadsAdded", handleBeadsAdded);
+ }
+
+ private var _stroke:IStroke;
+
+ /**
+ * Describes the line style used to separate the rows and columns.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get stroke():IStroke
+ {
+ return _stroke;
+ }
+ public function set stroke(value:IStroke):void
+ {
+ _stroke = value;
+ }
+
+ private var _overlay:GraphicsContainer;
+ private var _area:UIBase;
+
+ /**
+ * Invoked when all of the beads have been added to the DataGrid. This
+ * function seeks the Container that parents the lists that are the DataGrid's
+ * columns. An overlay GraphicContainer is added to this Container so that the
+ * grid lines will scroll with the rows.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private function handleBeadsAdded(event:Event):void
+ {
+ var host:UIBase = _strand as UIBase;
+ var n:int = host.numElements;
+ for (var i:int=0; i < n; i++) {
+ var child:UIBase = host.getElementAt(i) as UIBase;
+ if (child.id == "dataGridListArea") {
+ _area = child;
+ _area.addElement(_overlay);
+ break;
+ }
+ }
+
+ // Now set up listeners to handle changes in the size of the DataGrid.
+ IEventDispatcher(_strand).addEventListener("sizeChanged", drawLines);
+ IEventDispatcher(_strand).addEventListener("widthChanged", drawLines);
+ IEventDispatcher(_strand).addEventListener("heightChanged", drawLines);
+
+ // Also set up a listener on the model to know when the dataProvider has
+ // changed which might affect the number of rows/columns and thus the
+ // grid lines.
+ var model:IBeadModel = _strand.getBeadByType(IBeadModel) as IBeadModel;
+ IEventDispatcher(model).addEventListener("dataProviderChanged", drawLines);
+ }
+
+ /**
+ * This event handler is invoked whenever something happens to the DataGrid. This
+ * function draws the lines either using a default stroke or the one specified by
+ * the stroke property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private function drawLines(event:Event):void
+ {
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+ var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
+ var layoutParent:ILayoutHost = _area.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
+
+ var columns:Array = sharedModel.columns;
+ var arrayList:ArrayList = sharedModel.dataProvider as ArrayList;
+ var rowHeight:Number = presentationModel.rowHeight;
+
+ var totalHeight:Number = arrayList.length * rowHeight;
+ var columnWidth:Number = _area.width / columns.length;
+
+ // translate the stroke to a fill since rectangles are used for the grid
+ // lines and not lines.
+ var lineFill:SolidColor = new SolidColor();
+ var weight:Number = 1;
+ lineFill.color = (stroke as SolidColorStroke).color;
+ lineFill.alpha = (stroke as SolidColorStroke).alpha;
+ weight = (stroke as SolidColorStroke).weight;
+ _overlay.fill = lineFill;
+
+ columnWidth = (columns[0] as DataGridColumn).columnWidth;
+ var xpos:Number = isNaN(columnWidth) ? _area.width / columns.length : columnWidth;
+
+ _overlay.removeAllElements();
+
+ // draw the verticals
+ for (var i:int=1; i < columns.length; i++) {
+ _overlay.drawRect(xpos, 0, weight, totalHeight);
+ columnWidth = (columns[i] as DataGridColumn).columnWidth;
+ xpos += isNaN(columnWidth) ? _area.width / columns.length : columnWidth;
+ }
+
+ var n:int = arrayList.length;
+
+ // draw the horizontals
+ for (i=1; i < n+1; i++) {
+ _overlay.drawRect(0, i*rowHeight, _area.width, weight);
+ }
+ }
+ }
+}
\ No newline at end of file
[05/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
new file mode 100644
index 0000000..ca06c77
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ItemRendererMouseController.as
@@ -0,0 +1,203 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ISelectableItemRenderer;
+ import org.apache.flex.core.IStrand;
+COMPILE::AS3 {
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
+}
+COMPILE::JS {
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.events.BrowserEvent;
+ import goog.events.Event;
+ import goog.events.EventType;
+ import goog.events;
+}
+
+ /**
+ * The ItemRendererMouseController class bead handles mouse events in itemRenderers. This
+ * includes roll-overs, mouse down, and mouse up. These platform-specific events are then
+ * re-dispatched as FlexJS events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignoreimport goog.events.Event
+ */
+ public class ItemRendererMouseController implements IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ItemRendererMouseController()
+ {
+ }
+
+ private var renderer:ISelectableItemRenderer;
+ 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;
+ renderer = value as ISelectableItemRenderer;
+
+ COMPILE::AS3 {
+ renderer.addEventListener(MouseEvent.ROLL_OVER, rollOverHandler);
+ renderer.addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
+ renderer.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+ }
+
+ COMPILE::JS {
+ var element:WrappedHTMLElement = (_strand as UIBase).element;
+
+ goog.events.listen(element, goog.events.EventType.MOUSEOVER, this.handleMouseOver);
+ goog.events.listen(element, goog.events.EventType.MOUSEOUT, this.handleMouseOut);
+ goog.events.listen(element, goog.events.EventType.MOUSEDOWN, this.handleMouseDown);
+ goog.events.listen(element, goog.events.EventType.MOUSEUP, this.handleMouseUp);
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ protected function rollOverHandler(event:MouseEvent):void
+ {
+ var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
+ if (target)
+ {
+ target.hovered = true;
+ target.dispatchEvent(new Event("itemRendererRollOver",true));
+ }
+ }
+
+ COMPILE::JS
+ protected function handleMouseOver(event:BrowserEvent):void
+ {
+ var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
+ if (target) {
+ target.hovered = true;
+ target.dispatchEvent(new Event("itemRendererRollOver",true));
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ protected function rollOutHandler(event:MouseEvent):void
+ {
+ var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
+ if (target)
+ {
+ target.hovered = false;
+ target.down = false;
+ target.dispatchEvent(new Event("itemRendererRollOut",true));
+ }
+ }
+
+ COMPILE::JS
+ protected function handleMouseOut(event:BrowserEvent):void
+ {
+ var target:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
+ if (target)
+ {
+ target.hovered = false;
+ target.down = false;
+ target.dispatchEvent(new Event("itemRendererRollOut",true));
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ protected function mouseDownHandler(event:MouseEvent):void
+ {
+ var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
+ if (target)
+ {
+ target.down = true;
+ target.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::JS
+ protected function handleMouseDown(event:BrowserEvent):void
+ {
+ var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
+ if (target)
+ {
+ target.down = true;
+ target.hovered = false;
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ protected function mouseUpHandler(event:MouseEvent):void
+ {
+ var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
+ if (target)
+ {
+ target.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+ target.selected = true;
+ target.dispatchEvent(new Event("selected"));
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::JS
+ protected function handleMouseUp(event:BrowserEvent):void
+ {
+ var target:ISelectableItemRenderer = event.currentTarget as ISelectableItemRenderer;
+ if (target)
+ {
+ target.selected = true;
+ target.dispatchEvent(new Event("selected"));
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
new file mode 100644
index 0000000..9760591
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IItemRendererParent;
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.html.beads.IListView;
+
+ /**
+ * The ListSingleSelectionMouseController class is a controller for
+ * org.apache.flex.html.List. Controllers
+ * watch for events from the interactive portions of a View and
+ * update the data model or dispatch a semantic event.
+ * This controller watches for events from the item renderers
+ * and updates an ISelectionModel (which only supports single
+ * selection). Other controller/model pairs would support
+ * various kinds of multiple selection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ListSingleSelectionMouseController implements IBeadController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ListSingleSelectionMouseController()
+ {
+ }
+
+ /**
+ * The model.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var listModel:ISelectionModel;
+
+ /**
+ * The view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var listView:IListView;
+
+ /**
+ * The parent of the item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ 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;
+ listModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ listView = value.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ dataGroup.addEventListener("selected", selectedHandler, true);
+ IEventDispatcher(_strand).addEventListener(MouseEvent.ROLL_OVER, rolloverHandler);
+ }
+
+ private function selectedHandler(event:Event):void
+ {
+ listModel.selectedIndex = ISelectableItemRenderer(event.target).index;
+ listView.host.dispatchEvent(new Event("change"));
+ }
+
+ private function rolloverHandler(event:Event):void
+ {
+ var renderer:ISelectableItemRenderer = event.target as ISelectableItemRenderer;
+ if (renderer) {
+ //trace("ListSingleSelectionMouseController.ROLL_OVER");
+ IRollOverModel(listModel).rollOverIndex = renderer.index;
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
new file mode 100644
index 0000000..8d9d27b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/ScrollBarMouseControllerBase.as
@@ -0,0 +1,184 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.html.beads.IScrollBarView;
+
+ /**
+ * The ScrollBarMouseControllerBase class is the base class
+ * for ScrollBarMouseControllers such as VScrollBarMouseController.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ScrollBarMouseControllerBase implements IBeadController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ScrollBarMouseControllerBase()
+ {
+ }
+
+ /**
+ * The data model
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var sbModel:IScrollBarModel;
+
+ /**
+ * The view
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var sbView:IScrollBarView;
+
+ private var _strand:IStrand;
+
+ /**
+ * @private
+ */
+ public function get strand():IStrand
+ {
+ return _strand;
+ }
+
+ /**
+ * @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;
+ sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbView = value.getBeadByType(IScrollBarView) as IScrollBarView;
+ sbView.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
+ sbView.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
+ sbView.decrement.addEventListener("buttonRepeat", decrementClickHandler);
+ sbView.increment.addEventListener("buttonRepeat", incrementClickHandler);
+ sbView.track.addEventListener(MouseEvent.CLICK, trackClickHandler);
+ sbView.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbMouseDownHandler);
+ }
+
+ /**
+ * Force the input number to be "snapped" to the snapInterval.
+ *
+ * @param value The input number.
+ * @return The input number "snapped" to the snapInterval.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function snap(value:Number):Number
+ {
+ var si:Number = sbModel.snapInterval;
+ var n:Number = Math.round((value - sbModel.minimum) / si) * si + sbModel.minimum;
+ if (value > 0)
+ {
+ if (value - n < n + si - value)
+ return n;
+ return n + si;
+
+ }
+ if (value - n > n + si - value)
+ return n + si;
+ return n;
+ }
+
+ /**
+ * Updates the model when the decrement button is clicked.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function decrementClickHandler(event:Event):void
+ {
+ sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.stepSize));
+ IEventDispatcher(_strand).dispatchEvent(new Event("scroll"));
+ }
+
+ /**
+ * Updates the model when the increment button is clicked.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function incrementClickHandler(event:Event):void
+ {
+ sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.stepSize));
+ IEventDispatcher(_strand).dispatchEvent(new Event("scroll"));
+ }
+
+ /**
+ * Handles a click in the track. Must be overridden.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function trackClickHandler(event:MouseEvent):void
+ {
+ }
+
+ /**
+ * Handles a mouse down on the thumb. Must be overridden.
+ * Subclasses process the mouseMove and mouseUp events.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function thumbMouseDownHandler(event:MouseEvent):void
+ {
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SliderMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SliderMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SliderMouseController.as
new file mode 100644
index 0000000..6469fd0
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SliderMouseController.as
@@ -0,0 +1,286 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBeadController;
+ import org.apache.flex.core.IRangeModel;
+ 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.events.MouseEvent;
+ import org.apache.flex.geom.Point;
+ import org.apache.flex.html.beads.ISliderView;
+ import org.apache.flex.html.beads.SliderTrackView;
+
+ COMPILE::JS
+ {
+ import goog.events;
+ import goog.events.EventType;
+ import org.apache.flex.events.BrowserEvent;
+ import org.apache.flex.html.Slider;
+ import org.apache.flex.html.beads.SliderThumbView;
+ import org.apache.flex.html.beads.SliderTrackView;
+ }
+
+ /**
+ * The SliderMouseController class bead handles mouse events on the
+ * org.apache.flex.html.Slider's component parts (thumb and track) and
+ * dispatches change events on behalf of the Slider (as well as co-ordinating visual
+ * changes (such as moving the thumb when the track has been tapped or clicked).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SliderMouseController implements IBead, IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SliderMouseController()
+ {
+ }
+
+ private var rangeModel:IRangeModel;
+
+ 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;
+
+ rangeModel = UIBase(value).model as IRangeModel;
+
+ COMPILE::AS3
+ {
+ var sliderView:ISliderView = value.getBeadByType(ISliderView) as ISliderView;
+ sliderView.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDownHandler);
+
+ // add handler to detect click on track
+ sliderView.track.addEventListener(MouseEvent.CLICK, trackClickHandler, false, 99999);
+
+ }
+ COMPILE::JS
+ {
+ track = value.getBeadByType(
+ SliderTrackView) as SliderTrackView;
+ thumb = value.getBeadByType(
+ SliderThumbView) as SliderThumbView;
+
+ goog.events.listen(track.element, goog.events.EventType.CLICK,
+ handleTrackClick, false, this);
+
+ goog.events.listen(thumb.element, goog.events.EventType.MOUSEDOWN,
+ handleThumbDown, false, this);
+
+ }
+ }
+
+ COMPILE::JS
+ private var track:SliderTrackView;
+
+ COMPILE::JS
+ private var thumb:SliderThumbView;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function thumbDownHandler( event:MouseEvent ) : void
+ {
+ UIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_MOVE, thumbMoveHandler);
+ UIBase(_strand).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_UP, thumbUpHandler);
+
+ var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
+
+ origin = new Point(event.screenX, event.screenY);
+ thumb = new Point(sliderView.thumb.x,sliderView.thumb.y);
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function thumbUpHandler( event:MouseEvent ) : void
+ {
+ UIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMoveHandler);
+ UIBase(_strand).topMostEventDispatcher.removeEventListener(MouseEvent.MOUSE_UP, thumbUpHandler);
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
+ }
+
+ COMPILE::AS3
+ private var origin:Point;
+ COMPILE::AS3
+ private var thumb:Point;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function thumbMoveHandler( event:MouseEvent ) : void
+ {
+ var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
+
+ var deltaX:Number = event.screenX - origin.x;
+ var thumbW:Number = sliderView.thumb.width/2;
+ var newX:Number = thumb.x + deltaX;
+
+ var p:Number = newX/UIBase(_strand).width;
+ var n:Number = p*(rangeModel.maximum - rangeModel.minimum) + rangeModel.minimum;
+
+ rangeModel.value = n;
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function trackClickHandler( event:MouseEvent ) : void
+ {
+ event.stopImmediatePropagation();
+
+ var sliderView:ISliderView = _strand.getBeadByType(ISliderView) as ISliderView;
+
+ var xloc:Number = event.localX;
+ var p:Number = xloc/UIBase(_strand).width;
+ var n:Number = p*(rangeModel.maximum - rangeModel.minimum) + rangeModel.minimum;
+
+ rangeModel.value = n;
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
+ }
+
+ /**
+ */
+ COMPILE::JS
+ private function handleTrackClick(event:BrowserEvent):void
+ {
+ var host:Slider = _strand as Slider;
+ var xloc:Number = event.clientX;
+ var p:Number = Math.min(1, xloc / parseInt(track.element.style.width, 10));
+ var n:Number = p * (host.maximum - host.minimum) +
+ host.minimum;
+
+ host.value = n;
+
+ origin = parseInt(thumb.element.style.left, 10);
+ position = parseInt(thumb.element.style.left, 10);
+
+ calcValFromMousePosition(event, true);
+
+ host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
+ }
+
+
+ /**
+ */
+ COMPILE::JS
+ private function handleThumbDown(event:BrowserEvent):void
+ {
+ var host:Slider = _strand as Slider;
+ goog.events.listen(host.element, goog.events.EventType.MOUSEUP,
+ handleThumbUp, false, this);
+ goog.events.listen(host.element, goog.events.EventType.MOUSEMOVE,
+ handleThumbMove, false, this);
+
+ origin = event.clientX;
+ position = parseInt(thumb.element.style.left, 10);
+ }
+
+ COMPILE::JS
+ private var origin:Number;
+ COMPILE::JS
+ private var position:int;
+
+ /**
+ */
+ COMPILE::JS
+ private function handleThumbUp(event:BrowserEvent):void
+ {
+ var host:Slider = _strand as Slider;
+ goog.events.unlisten(host.element, goog.events.EventType.MOUSEUP,
+ handleThumbUp, false, this);
+ goog.events.unlisten(host.element, goog.events.EventType.MOUSEMOVE,
+ handleThumbMove, false, this);
+
+ calcValFromMousePosition(event, false);
+
+ host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
+ }
+
+
+ /**
+ */
+ COMPILE::JS
+ private function handleThumbMove(event:BrowserEvent):void
+ {
+ var host:Slider = _strand as Slider;
+ calcValFromMousePosition(event, false);
+
+ host.dispatchEvent(new org.apache.flex.events.Event('valueChange'));
+ }
+
+
+ /**
+ */
+ COMPILE::JS
+ private function calcValFromMousePosition(event:BrowserEvent, useOffset:Boolean):void
+ {
+ var host:Slider = _strand as Slider;
+ var deltaX:Number = (useOffset ? event.offsetX : event.clientX) - origin;
+ var thumbW:int = parseInt(thumb.element.style.width, 10) / 2;
+ var newX:Number = position + deltaX;
+
+ var p:Number = newX / parseInt(track.element.style.width, 10);
+ var n:Number = p * (host.maximum - host.minimum) +
+ host.minimum;
+ n = host.snap(n);
+ if (n < host.minimum) n = host.minimum;
+ else if (n > host.maximum) n = host.maximum;
+
+ p = (n - host.minimum) / (host.maximum -
+ host.minimum);
+ newX = p * parseInt(track.element.style.width, 10);
+
+ thumb.element.style.left = String(newX -
+ parseInt(thumb.element.style.width, 10) / 2) + 'px';
+
+ host.value = n;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
new file mode 100644
index 0000000..53309df
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/SpinnerMouseController.as
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IRangeModel;
+ 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.events.MouseEvent;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.html.beads.ISpinnerView;
+ COMPILE::JS
+ {
+ import org.apache.flex.html.Spinner;
+ import goog.events;
+ import goog.events.EventType;
+ }
+
+ /**
+ * The SpinnerMouseController class bead handles mouse events on the
+ * org.apache.flex.html.Spinner's component buttons, changing the
+ * value of the Spinner.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SpinnerMouseController implements IBeadController
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SpinnerMouseController()
+ {
+ }
+
+ private var rangeModel:IRangeModel;
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @flexjsignorecoercion org.apache.flex.html.Spinner
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ rangeModel = UIBase(value).model as IRangeModel;
+
+ COMPILE::AS3
+ {
+ var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
+ spinnerBead.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);
+ spinnerBead.decrement.addEventListener("buttonRepeat", decrementClickHandler);
+ spinnerBead.increment.addEventListener(MouseEvent.CLICK, incrementClickHandler);
+ spinnerBead.increment.addEventListener("buttonRepeat", incrementClickHandler);
+ }
+
+ COMPILE::JS
+ {
+ var host:Spinner = value as Spinner;
+ incrementButton = host.incrementButton;
+ decrementButton = host.decrementButton;
+
+ goog.events.listen(incrementButton.element, goog.events.EventType.CLICK,
+ incrementClickHandler);
+
+ goog.events.listen(decrementButton.element, goog.events.EventType.CLICK,
+ decrementClickHandler);
+
+ }
+ }
+
+ private var incrementButton:TextButton;
+ private var decrementButton:TextButton;
+
+ /**
+ * @private
+ */
+ private function decrementClickHandler( event:Event ) : void
+ {
+ rangeModel.value = Math.max(rangeModel.minimum, rangeModel.value - rangeModel.stepSize);
+ IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
+ }
+
+ /**
+ * @private
+ */
+ private function incrementClickHandler( event:Event ) : void
+ {
+ rangeModel.value = Math.min(rangeModel.maximum, rangeModel.value + rangeModel.stepSize);
+ IEventDispatcher(_strand).dispatchEvent(new Event("valueChange"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
new file mode 100644
index 0000000..611f6dd
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
@@ -0,0 +1,101 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.controllers
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.MouseEvent;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The VScrollBarMouseController class is the controller for
+ * org.apache.flex.html.supportClasses.ScrollBar
+ * that acts as the Vertical ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VScrollBarMouseController extends ScrollBarMouseControllerBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VScrollBarMouseController()
+ {
+ }
+
+ /**
+ * @private
+ */
+ override protected function trackClickHandler(event:MouseEvent):void
+ {
+ if (sbView.thumb.visible)
+ {
+ if (event.localY < sbView.thumb.y)
+ {
+ sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.pageStepSize));
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+ else
+ {
+ sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.pageStepSize));
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+ }
+ }
+
+ private var thumbDownY:Number;
+ private var lastThumbY:Number;
+
+ /**
+ * @private
+ */
+ override protected function thumbMouseDownHandler(event:MouseEvent):void
+ {
+ sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
+ sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
+ thumbDownY = event.screenY;
+ lastThumbY = sbView.thumb.y;
+ }
+
+ private function thumbMouseMoveHandler(event:MouseEvent):void
+ {
+ var thumb:DisplayObject = sbView.thumb;
+ var track:DisplayObject = sbView.track;
+ thumb.y = Math.max(track.y, Math.min(lastThumbY + (event.screenY - thumbDownY), track.y + track.height - thumb.height));
+ var newValue:Number = snap((thumb.y - track.y) / (track.height - thumb.height) * (sbModel.maximum - sbModel.minimum - sbModel.pageSize));
+ sbModel.value = newValue;
+ IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
+ }
+
+ private function thumbMouseUpHandler(event:MouseEvent):void
+ {
+ sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
+ sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as
new file mode 100644
index 0000000..8a8c0d7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/BasicLayout.as
@@ -0,0 +1,445 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ 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.utils.CSSUtils;
+ //import org.apache.flex.utils.dbg.DOMPathUtil;
+
+ /**
+ * The BasicLayout class is a simple layout
+ * bead. It takes the set of children and lays them out
+ * as specified by CSS properties like left, right, top
+ * and bottom.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class BasicLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function BasicLayout()
+ {
+ }
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
+ * @flexjsignorecoercion org.apache.flex.core.UIBase
+ */
+ public function layout():Boolean
+ {
+ COMPILE::AS3
+ {
+ //trace(DOMPathUtil.getPath(host), event ? event.type : "fixed size");
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+
+ var gotMargin:Boolean;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ var ml:Number;
+ var mr:Number;
+ var mt:Number;
+ var mb:Number;
+ var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent();
+ var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent();
+ var w:Number = hostWidthSizedToContent ? 0 : contentView.width;
+ var h:Number = hostHeightSizedToContent ? 0 : contentView.height;
+ var n:int = contentView.numElements;
+ var maxWidth:Number = 0;
+ var maxHeight:Number = 0;
+ var childData:Array = [];
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ var left:Number = ValuesManager.valuesImpl.getValue(child, "left");
+ var right:Number = ValuesManager.valuesImpl.getValue(child, "right");
+ var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
+ var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
+ var ww:Number = w;
+ var hh:Number = h;
+
+ var ilc:ILayoutChild = child as ILayoutChild;
+ if (!isNaN(left))
+ {
+ if (ilc)
+ ilc.setX(left);
+ else
+ child.x = left;
+ ww -= left;
+ }
+ if (!isNaN(top))
+ {
+ if (ilc)
+ ilc.setY(top);
+ else
+ child.y = top;
+ hh -= top;
+ }
+ if (ilc)
+ {
+ if (!hostWidthSizedToContent)
+ {
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth((ww - (isNaN(right) ? 0 : right)) * ilc.percentWidth / 100, true);
+ }
+ else
+ childData[i] = { bottom: bottom, right: right, ww: ww, ilc: ilc, child: child };
+ }
+ if (!isNaN(right))
+ {
+ if (!hostWidthSizedToContent)
+ {
+ if (!isNaN(left))
+ {
+ if (ilc)
+ ilc.setWidth(ww - right, true);
+ else
+ child.width = ww - right;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setX( w - right - child.width);
+ else
+ child.x = w - right - child.width;
+ }
+ }
+ else
+ childData[i] = { ww: ww, left: left, right: right, ilc: ilc, child: child };
+ }
+
+ if (isNaN(right) && isNaN(left))
+ {
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ gotMargin = true;
+ marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
+ marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
+ var horizontalCenter:Boolean =
+ (marginLeft == "auto" && marginRight == "auto") ||
+ (margin is String && margin == "auto") ||
+ (margin is Array &&
+ ((margin.length < 4 && margin[1] == "auto") ||
+ (margin.length == 4 && margin[1] == "auto" && margin[3] == "auto")));
+ if (!hostWidthSizedToContent)
+ {
+ if (!horizontalCenter)
+ {
+ mr = CSSUtils.getRightValue(marginRight, margin, ww);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+ if (ilc)
+ ilc.setX(ml);
+ else
+ child.x = ml;
+ if (ilc && isNaN(ilc.percentWidth) && isNaN(ilc.explicitWidth))
+ child.width = ww - child.x - mr;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setX((ww - child.width) / 2);
+ else
+ child.x = (ww - child.width) / 2;
+ }
+ }
+ else
+ {
+ if (!horizontalCenter)
+ {
+ mr = CSSUtils.getRightValue(marginRight, margin, ww);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+ if (ilc)
+ ilc.setX(ml);
+ else
+ child.x = ml;
+ if (ilc && isNaN(ilc.percentWidth) && isNaN(ilc.explicitWidth))
+ childData[i] = { ww: ww, left: ml, right: mr, ilc: ilc, child: child };
+ }
+ else
+ {
+ childData[i] = { ww: ww, center: true, ilc: ilc, child: child };
+ }
+ }
+
+ }
+ if (isNaN(top) && isNaN(bottom))
+ {
+ if (!gotMargin)
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
+ marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
+ mt = CSSUtils.getTopValue(marginTop, margin, hh);
+ mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
+ if (ilc)
+ ilc.setY(mt);
+ else
+ child.y = mt;
+ /* browsers don't use margin-bottom to stretch things vertically
+ if (!hostHeightSizedToContent)
+ {
+ if (ilc && isNaN(ilc.percentHeight) && isNaN(ilc.explicitHeight))
+ child.height = hh - child.y - mb;
+ }
+ else
+ {
+ if (!childData[i])
+ childData[i] = { hh: hh, bottom: mb, ilc: ilc, child: child };
+ else
+ {
+ childData[i].hh = hh;
+ childData[i].bottom = mb;
+ }
+ }
+ */
+ }
+
+ if (ilc)
+ {
+ if (!hostHeightSizedToContent)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight((hh - (isNaN(bottom) ? 0 : bottom)) * ilc.percentHeight / 100, true);
+ }
+ else
+ {
+ if (!childData[i])
+ childData[i] = { hh: hh, bottom: bottom, ilc: ilc, child: child };
+ else
+ {
+ childData[i].hh = hh;
+ childData[i].bottom = bottom;
+ }
+ }
+ }
+ if (!isNaN(bottom))
+ {
+ if (!hostHeightSizedToContent)
+ {
+ if (!isNaN(top))
+ {
+ if (ilc)
+ ilc.setHeight(hh - bottom, true);
+ else
+ child.height = hh - bottom;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setY(h - bottom - child.height);
+ else
+ child.y = h - bottom - child.height;
+ }
+ }
+ else
+ {
+ if (!childData[i])
+ childData[i] = { top: top, bottom: bottom, hh:hh, ilc: ilc, child: child };
+ else
+ {
+ childData[i].top = top;
+ childData[i].bottom = bottom;
+ childData[i].hh = hh;
+ }
+ }
+ }
+ if (!childData[i])
+ child.dispatchEvent(new Event("sizeChanged"));
+ maxWidth = Math.max(maxWidth, child.x + child.width);
+ maxHeight = Math.max(maxHeight, child.y + child.height);
+ }
+ if (hostHeightSizedToContent || hostWidthSizedToContent)
+ {
+ for (i = 0; i < n; i++)
+ {
+ var data:Object = childData[i];
+ if (data)
+ {
+ if (hostWidthSizedToContent)
+ {
+ if (data.ilc && !isNaN(data.ilc.percentWidth))
+ data.ilc.setWidth((data.ww - (isNaN(data.right) ? 0 : data.right)) * data.ilc.percentWidth / 100, true);
+ if (data.center)
+ {
+ if (data.ilc)
+ data.ilc.setX((data.ww - data.child.width) / 2);
+ else
+ data.child.x = (data.ww - data.child.width) / 2;
+ }
+ else if (!isNaN(data.right))
+ {
+ if (!isNaN(data.left))
+ {
+ if (data.ilc)
+ data.ilc.setWidth(data.ww - data.right, true);
+ else
+ data.child.width = data.ww - data.right;
+ }
+ else
+ {
+ if (data.ilc)
+ data.ilc.setX(maxWidth - data.right - data.child.width);
+ else
+ data.child.x = maxWidth - data.right - data.child.width;
+ }
+ }
+ }
+ if (hostHeightSizedToContent)
+ {
+ if (data.ilc && !isNaN(data.ilc.percentHeight))
+ data.ilc.setHeight((data.hh - (isNaN(data.bottom) ? 0 : data.bottom)) * data.ilc.percentHeight / 100, true);
+ if (!isNaN(data.bottom))
+ {
+ if (!isNaN(data.top))
+ {
+ if (data.ilc)
+ data.ilc.setHeight(data.hh - data.bottom, true);
+ else
+ data.child.height = data.hh - data.bottom;
+ }
+ else
+ {
+ if (data.ilc)
+ data.ilc.setY(maxHeight - data.bottom - data.child.height);
+ else
+ data.child.y = maxHeight - data.bottom - data.child.height;
+ }
+ }
+ }
+ child.dispatchEvent(new Event("sizeChanged"));
+ }
+ }
+ }
+
+ host.dispatchEvent( new Event("layoutComplete") );
+
+ return true;
+
+ }
+ COMPILE::JS
+ {
+ var i:int
+ var n:int;
+ var h:Number;
+ var w:Number;
+
+ var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = viewBead.contentView;
+ w = contentView.width;
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ h = contentView.height;
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ var maxHeight:Number = 0;
+ var maxWidth:Number = 0;
+ n = contentView.numElements;
+ for (i = 0; i < n; i++) {
+ var child:UIBase = contentView.getElementAt(i) as UIBase;
+ child.setDisplayStyleForLayout('block');
+ var left:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'left');
+ var right:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'right');
+ var top:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'top');
+ var bottom:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'bottom');
+ var margin:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin');
+ var marginLeft:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-left');
+ var marginRight:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-right');
+ var horizontalCenter:Boolean =
+ (marginLeft == 'auto' && marginRight == 'auto') ||
+ (typeof(margin) === 'string' && margin == 'auto') ||
+ (margin && margin.hasOwnProperty('length') &&
+ ((margin.length < 4 && margin[1] == 'auto') ||
+ (margin.length == 4 && margin[1] == 'auto' && margin[3] == 'auto')));
+
+ if (!isNaN(left)) {
+ child.positioner.style.position = 'absolute';
+ child.positioner.style.left = left.toString() + 'px';
+ }
+ if (!isNaN(top)) {
+ child.positioner.style.position = 'absolute';
+ child.positioner.style.top = top.toString() + 'px';
+ }
+ if (!isNaN(right)) {
+ child.positioner.style.position = 'absolute';
+ child.positioner.style.right = right.toString() + 'px';
+ }
+ if (!isNaN(bottom)) {
+ child.positioner.style.position = 'absolute';
+ child.positioner.style.bottom = bottom.toString() + 'px';
+ }
+ if (horizontalCenter)
+ {
+ child.positioner.style.position = 'absolute';
+ child.positioner.style.left = ((w - child.width) / 2).toString() + 'px';
+ }
+ child.dispatchEvent('sizeChanged');
+ maxWidth = Math.max(maxWidth, child.positioner.offsetLeft + child.positioner.offsetWidth);
+ maxHeight = Math.max(maxHeight, child.positioner.offsetTop + child.positioner.offsetHeight);
+ }
+ // if there are children and maxHeight is ok, use it.
+ // maxHeight can be NaN if the child hasn't been rendered yet.
+ if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
+ contentView.width = maxWidth;
+ }
+ if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
+ contentView.height = maxHeight;
+ }
+ return true;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
new file mode 100644
index 0000000..5bd1159
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
@@ -0,0 +1,143 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IViewportModel;
+ 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.List;
+ import org.apache.flex.html.beads.ButtonBarView;
+
+ /**
+ * The ButtonBarLayout class bead sizes and positions the org.apache.flex.html.Button
+ * elements that make up a org.apache.flex.html.ButtonBar. This bead arranges the Buttons
+ * horizontally and makes them all the same width unless the buttonWidths property has been set in which case
+ * the values stored in that array are used.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ButtonBarLayout implements IBeadLayout
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ButtonBarLayout()
+ {
+ }
+
+ 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 _buttonWidths:Array = null;
+
+ /**
+ * An array of widths (Number), one per button. These values supersede the
+ * default of equally-sized buttons.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get buttonWidths():Array
+ {
+ return _buttonWidths;
+ }
+ public function set buttonWidths(value:Array):void
+ {
+ _buttonWidths = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var layoutParent:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
+ var itemRendererParent:IItemRendererParent = contentView as IItemRendererParent;
+ var viewportModel:IViewportModel = (layoutParent as ButtonBarView).viewportModel;
+
+ var n:int = contentView.numElements;
+ var realN:int = n;
+
+ for (var j:int=0; j < n; j++)
+ {
+ var child:IUIBase = itemRendererParent.getElementAt(j) as IUIBase;
+ if (child == null || !child.visible) realN--;
+ }
+
+ var xpos:Number = 0;
+ var useWidth:Number = contentView.width / realN;
+ var useHeight:Number = contentView.height;
+
+ for (var i:int=0; i < n; i++)
+ {
+ var ir:ISelectableItemRenderer = itemRendererParent.getElementAt(i) as ISelectableItemRenderer;
+ if (ir == null || !UIBase(ir).visible) continue;
+ UIBase(ir).y = 0;
+ UIBase(ir).x = xpos;
+ if (!isNaN(useHeight) && useHeight > 0) {
+ UIBase(ir).height = useHeight;
+ }
+
+ if (buttonWidths) UIBase(ir).width = Number(buttonWidths[i]);
+ else if (!isNaN(useWidth) && useWidth > 0) {
+ UIBase(ir).width = useWidth;
+ }
+ xpos += UIBase(ir).width;
+ }
+
+ IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") );
+
+ return true;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/DataGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/DataGridLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/DataGridLayout.as
new file mode 100644
index 0000000..33399c3
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/DataGridLayout.as
@@ -0,0 +1,156 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.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.ButtonBar;
+ 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
+ {
+ /**
+ * 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;
+ }
+
+ 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;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var sw:Number = UIBase(_strand).width;
+ var sh:Number = UIBase(_strand).height;
+
+ var columnHeight:Number = Math.floor(sh - header.height);
+ var columnWidth:Number = Math.floor(sw / columns.length);
+
+ var xpos:Number = 0;
+ var ypos:Number = Math.floor(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;
+
+ var buttonWidths:Array = new Array();
+
+ 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;
+
+ buttonWidths.push(column.width);
+ }
+
+ var bar:ButtonBar = header as ButtonBar;
+ var barLayout:ButtonBarLayout = bar.getBeadByType(ButtonBarLayout) as ButtonBarLayout;
+ barLayout.buttonWidths = buttonWidths;
+
+ header.x = 0;
+ header.y = 0;
+ header.width = sw;
+ header.dispatchEvent(new Event("layoutNeeded"));
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
new file mode 100644
index 0000000..4198fea
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
@@ -0,0 +1,244 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ 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;
+ 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.geom.Rectangle;
+ import org.apache.flex.html.supportClasses.Viewport;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * 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()
+ {
+ }
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ }
+
+ private var _maxWidth:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxWidth():Number
+ {
+ return _maxWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxWidth(value:Number):void
+ {
+ _maxWidth = value;
+ }
+
+ private var _maxHeight:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxHeight():Number
+ {
+ return _maxHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxHeight(value:Number):void
+ {
+ _maxHeight = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+ var hostSizedToContent:Boolean = host.isHeightSizedToContent();
+
+ var n:int = contentView.numElements;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ maxHeight = 0;
+ var verticalMargins:Array = [];
+
+ var xx:Number = contentView.width;
+ if (isNaN(xx) || xx <= 0)
+ return true;
+ xx -= padding.right + 1; // some browsers won't layout to the edge
+
+ 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 + padding.top;
+ if (i == 0)
+ {
+ child.x = ml + padding.left;
+ child.width = xx - mr - child.x;
+ }
+ else
+ child.x = xx - child.width - mr;
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ 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;
+ }
+ if (hostSizedToContent)
+ ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
+
+ return true;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HScrollBarLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
new file mode 100644
index 0000000..38b97ec
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
@@ -0,0 +1,121 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.layouts
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.html.beads.IScrollBarView;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The HScrollBarLayout class is a layout
+ * bead that displays lays out the pieces of a
+ * horizontal ScrollBar like the thumb, track
+ * and arrow buttons.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HScrollBarLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HScrollBarLayout()
+ {
+ }
+
+ private var sbModel:IScrollBarModel;
+ private var sbView:IScrollBarView;
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ sbView = _strand.getBeadByType(IScrollBarView) as IScrollBarView;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ if (!sbModel)
+ sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel
+
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
+
+ var w:Number = DisplayObject(_strand).width + metrics.left + metrics.right;
+ var increment:DisplayObject = sbView.increment;
+ var decrement:DisplayObject = sbView.decrement;
+ var track:DisplayObject = sbView.track;
+ var thumb:DisplayObject = sbView.thumb;
+
+ decrement.x = 0;
+ decrement.y = 0;
+ decrement.height = DisplayObject(_strand).height;
+ decrement.width = DisplayObject(_strand).height;
+
+ increment.height = DisplayObject(_strand).height;
+ increment.width = DisplayObject(_strand).height;
+ increment.x = w - increment.width - 1;
+ increment.y = 0;
+
+ track.x = decrement.width;
+ track.y = 0;
+ track.height = DisplayObject(_strand).height;
+ track.width = increment.x - decrement.width;
+ thumb.width = sbModel.pageSize / (sbModel.maximum - sbModel.minimum) * track.width;
+ if (track.width > thumb.width)
+ {
+ thumb.visible = true;
+ thumb.x = (sbModel.value / (sbModel.maximum - sbModel.minimum - sbModel.pageSize) * (track.width - thumb.width)) + track.x;
+ }
+ else
+ {
+ thumb.visible = false;
+ }
+
+ return true;
+ }
+
+ }
+}
[20/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
deleted file mode 100644
index 9c4875c..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ImageView.as
+++ /dev/null
@@ -1,223 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- COMPILE::AS3
- {
- import flash.display.Bitmap;
- import flash.display.Loader;
- import flash.display.LoaderInfo;
- import flash.events.IOErrorEvent;
- import flash.net.URLRequest;
- }
- COMPILE::JS
- {
- import goog.events;
- }
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IImageModel;
- 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;
-
- /**
- * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageView()
- {
- }
-
- COMPILE::AS3
- private var bitmap:Bitmap;
- COMPILE::AS3
- private var loader:Loader;
-
- private var _model:IImageModel;
-
- /**
- * @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;
-
- COMPILE::AS3
- {
- IEventDispatcher(_strand).addEventListener("widthChanged",handleSizeChange);
- IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
- }
-
- _model = value.getBeadByType(IImageModel) as IImageModel;
- _model.addEventListener("urlChanged",handleUrlChange);
-
- handleUrlChange(null);
- }
-
- /**
- * @private
- */
- private function handleUrlChange(event:Event):void
- {
- COMPILE::AS3
- {
- if (_model.source) {
- loader = new Loader();
- loader.contentLoaderInfo.addEventListener("complete",onComplete);
- loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
- trace(e);
- e.preventDefault();
- });
- loader.load(new URLRequest(_model.source));
- }
- }
- COMPILE::JS
- {
- if (_model.source) {
- var host:IUIBase = _strand as IUIBase;
- host.element.addEventListener('load',
- loadHandler, false);
- host.addEventListener('sizeChanged',
- sizeChangedHandler);
- (host.element as HTMLImageElement).src = _model.source;
- }
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function onComplete(event:Object):void
- {
- var host:UIBase = UIBase(_strand);
- if (bitmap) {
- host.removeChild(bitmap);
- }
-
- bitmap = Bitmap(LoaderInfo(event.target).content);
-
- host.addChild(bitmap);
-
- if (host.isWidthSizedToContent())
- {
- host.dispatchEvent(new Event("widthChanged"));
- if (host.parent)
- host.parent.dispatchEvent(new Event("layoutNeeded"));
- }
- else
- bitmap.width = UIBase(_strand).width;
-
- if (host.isHeightSizedToContent())
- {
- host.dispatchEvent(new Event("heightChanged"));
- if (host.parent)
- host.parent.dispatchEvent(new Event("layoutNeeded"));
- }
- else
- bitmap.height = UIBase(_strand).height;
-
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function handleSizeChange(event:Object):void
- {
- var host:UIBase = UIBase(_strand);
- if (bitmap) {
- if (!isNaN(host.explicitWidth) || !isNaN(host.percentWidth))
- bitmap.width = UIBase(_strand).width;
- if (!isNaN(host.explicitHeight) || !isNaN(host.percentHeight))
- bitmap.height = UIBase(_strand).height;
- }
- }
-
- COMPILE::JS
- private function loadHandler(event:Object):void
- {
- var host:UIBase = UIBase(_strand);
- host.parent.dispatchEvent(new Event("layoutNeeded"));
- }
-
- /**
- * @flexjsignorecoercion HTMLElement
- */
- COMPILE::JS
- private function sizeChangedHandler(event:Object):void
- {
- var host:UIBase = _strand as UIBase;
- var s:Object = host.positioner.style;
- var l:Number = NaN;
- var ls:String = s.left;
- if (typeof(ls) === 'string' && ls.length > 0)
- l = parseFloat(ls.substring(0, ls.length - 2));
- var r:Number = NaN;
- var rs:String = s.right;
- if (typeof(rs) === 'string' && rs.length > 0)
- r = parseFloat(rs.substring(0, rs.length - 2));
- if (!isNaN(l) &&
- !isNaN(r)) {
- // if just using size constraints and image will not shrink or grow
- var computedWidth:Number = (host.positioner.offsetParent as HTMLElement).offsetWidth -
- l - r;
- s.width = computedWidth.toString() + 'px';
- }
- var t:Number = NaN;
- var ts:String = s.top;
- if (typeof(ts) === 'string' && ts.length > 0)
- t = parseFloat(ts.substring(0, ts.length - 2));
- var b:Number = NaN;
- var bs:String = s.right;
- if (typeof(bs) === 'string' && bs.length > 0)
- b = parseFloat(bs.substring(0, bs.length - 2));
- if (!isNaN(t) &&
- !isNaN(b)) {
- // if just using size constraints and image will not shrink or grow
- var computedHeight:Number = (host.positioner.offsetParent as HTMLElement).offsetHeight -
- t - b;
- s.height = computedHeight.toString() + 'px';
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
deleted file mode 100644
index 9fca051..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/LeftArrowButtonView.as
+++ /dev/null
@@ -1,112 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The LeftArrowButtonView class is the view for
- * the left arrow button in a ScrollBar and other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class LeftArrowButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function LeftArrowButtonView()
- {
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.lineStyle(1, 0x808080);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
- g.endFill();
- g.lineStyle(0);
- g.beginFill(0);
- g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.HalfSize);
- g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.ThreeQuarterSize);
- g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.QuarterSize);
- g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.HalfSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
-
- SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
- SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- private function sizeChangeHandler(event:Event):void
- {
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
deleted file mode 100644
index a38afec..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ListView.as
+++ /dev/null
@@ -1,210 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.IItemRenderer;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IRollOverModel;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.Strand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.beads.models.ArraySelectionModel;
- import org.apache.flex.html.beads.models.ScrollBarModel;
- import org.apache.flex.html.beads.models.SingleLineBorderModel;
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.html.supportClasses.DataGroup;
- import org.apache.flex.html.supportClasses.ScrollBar;
-
- /**
- * The List class creates the visual elements of the org.apache.flex.html.List
- * component. A List consists of the area to display the data (in the dataGroup), any
- * scrollbars, and so forth.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ListView extends ContainerView implements IListView
- {
- public function ListView()
- {
- }
-
- private var listModel:ISelectionModel;
-
- private var _border:Border;
-
- /**
- * The border surrounding the org.apache.flex.html.List.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get border():Border
- {
- return _border;
- }
-
- /**
- * The area holding the itemRenderers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataGroup():IItemRendererParent
- {
- return contentView as IItemRendererParent;
- }
-
- /**
- * @private
- */
- override public function get resizableView():IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @private
- */
- override public function get host():IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- _strand = value;
- super.strand = value;
- }
-
- override protected function completeSetup():void
- {
- super.completeSetup();
-
- // list is not interested in UI children, it wants to know when new items
- // have been added or the dataProvider has changed.
-
- host.removeEventListener("childrenAdded", childrenChangedHandler);
- host.removeEventListener("childrenAdded", performLayout);
- host.addEventListener("itemsCreated", itemsCreatedHandler);
-
- listModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- listModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
- listModel.addEventListener("rollOverIndexChanged", rollOverIndexChangeHandler);
- listModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
- }
-
- private var lastSelectedIndex:int = -1;
-
- /**
- * @private
- */
- protected function itemsCreatedHandler(event:Event):void
- {
- performLayout(event);
- }
-
- /**
- * @private
- */
- protected function dataProviderChangeHandler(event:Event):void
- {
- performLayout(event);
- }
-
- /**
- * @private
- */
- private function selectionChangeHandler(event:Event):void
- {
- if (lastSelectedIndex != -1)
- {
- var ir:ISelectableItemRenderer = dataGroup.getItemRendererForIndex(lastSelectedIndex) as ISelectableItemRenderer;
- ir.selected = false;
- }
- if (listModel.selectedIndex != -1)
- {
- ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex) as ISelectableItemRenderer;
- ir.selected = true;
- }
- lastSelectedIndex = listModel.selectedIndex;
- }
-
- private var lastRollOverIndex:int = -1;
-
- /**
- * @private
- */
- private function rollOverIndexChangeHandler(event:Event):void
- {
- if (lastRollOverIndex != -1)
- {
- var ir:ISelectableItemRenderer = dataGroup.getItemRendererForIndex(lastRollOverIndex) as ISelectableItemRenderer;
- ir.hovered = false;
- }
- if (IRollOverModel(listModel).rollOverIndex != -1)
- {
- ir = dataGroup.getItemRendererForIndex(IRollOverModel(listModel).rollOverIndex) as ISelectableItemRenderer;
- ir.hovered = true;
- }
- lastRollOverIndex = IRollOverModel(listModel).rollOverIndex;
- }
-
- /**
- * respond to a change in size or request to re-layout everything
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override protected function resizeHandler(event:Event):void
- {
- super.resizeHandler(event);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/MultilineTextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/MultilineTextFieldView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/MultilineTextFieldView.as
deleted file mode 100644
index 72dc588..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/MultilineTextFieldView.as
+++ /dev/null
@@ -1,56 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.text.TextFieldType;
-
- /**
- * The TextFieldView class is the default view for
- * the org.apache.flex.html.Label class.
- * It displays text using a TextField, so there is no
- * right-to-left text support in this view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class MultilineTextFieldView extends TextFieldViewBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function MultilineTextFieldView()
- {
- super();
-
- textField.selectable = false;
- textField.type = TextFieldType.DYNAMIC;
- textField.mouseEnabled = false;
- textField.autoSize = "left";
- textField.multiline = true;
- textField.wordWrap = true;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/NumericStepperView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/NumericStepperView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/NumericStepperView.as
deleted file mode 100644
index 6ebdbf4..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/NumericStepperView.as
+++ /dev/null
@@ -1,186 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IRangeModel;
- 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.Label;
- import org.apache.flex.html.Spinner;
- import org.apache.flex.html.TextInput;
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.html.supportClasses.ScrollBar;
-
- /**
- * The NumericStepperView class creates the visual elements of the
- * org.apache.flex.html.NumericStepper component. A NumberStepper consists of a
- * org.apache.flex.html.TextInput component to display the value and a
- * org.apache.flex.html.Spinner to change the value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class NumericStepperView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function NumericStepperView()
- {
- }
-
- private var label:Label;
- private var input:TextInput;
- private var spinner:Spinner;
-
- /**
- * @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;
-
- // add an input field
- input = new TextInput();
- IParent(value).addElement(input);
-
- // add a spinner
- spinner = new Spinner();
- spinner.addBead( UIBase(value).model as IBead );
- IParent(value).addElement(spinner);
- spinner.height = input.height;
-
- // listen for changes to the text input field which will reset the
- // value. ideally, we should either set the input to accept only
- // numeric values or, barring that, reject non-numeric entries. we
- // cannot do that right now however.
- input.model.addEventListener("textChange",inputChangeHandler);
-
- // listen for change events on the spinner so the value can be updated as
- // as resizing the component
- spinner.addEventListener("valueChange",spinnerValueChanged);
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("sizeChanged",sizeChangeHandler);
-
- // listen for changes to the model itself and update the UI accordingly
- IEventDispatcher(UIBase(value).model).addEventListener("valueChange",modelChangeHandler);
- IEventDispatcher(UIBase(value).model).addEventListener("minimumChange",modelChangeHandler);
- IEventDispatcher(UIBase(value).model).addEventListener("maximumChange",modelChangeHandler);
- IEventDispatcher(UIBase(value).model).addEventListener("stepSizeChange",modelChangeHandler);
- IEventDispatcher(UIBase(value).model).addEventListener("snapIntervalChange",modelChangeHandler);
-
- input.text = String(spinner.value);
-
- var host:ILayoutChild = ILayoutChild(value);
- if ((host.isWidthSizedToContent() || isNaN(host.explicitWidth)) &&
- (host.isHeightSizedToContent() || isNaN(host.explicitHeight)))
- sizeChangeHandler(null);
- }
-
- /**
- * @private
- */
- private function sizeChangeHandler(event:Event) : void
- {
- input.x = 2;
- input.y = (UIBase(_strand).height - input.height)/2;
- input.width = UIBase(_strand).width-spinner.width-2;
- spinner.x = input.width+2;
- spinner.y = 0;
- }
-
- /**
- * @private
- */
- private function spinnerValueChanged(event:Event) : void
- {
- input.text = String(spinner.value);
-
- var newEvent:Event = new Event(event.type,event.bubbles);
- IEventDispatcher(_strand).dispatchEvent(newEvent);
- }
-
- /**
- * @private
- */
- private function inputChangeHandler(event:Event) : void
- {
- var newValue:Number = Number(input.text);
-
- if( !isNaN(newValue) ) {
- spinner.value = newValue;
- }
- else {
- input.text = String(spinner.value);
- }
- }
-
- /**
- * @private
- */
- private function modelChangeHandler( event:Event ) : void
- {
- var n:Number = IRangeModel(UIBase(_strand).model).value;
- input.text = String(IRangeModel(UIBase(_strand).model).value);
- }
-
- /**
- * The area containing the TextInput and Spinner controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get contentView():IParentIUIBase
- {
- return _strand as IParentIUIBase;
- }
-
- /**
- * @private
- */
- public function get resizableView():IUIBase
- {
- return _strand as IUIBase;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
deleted file mode 100644
index c52fe93..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelView.as
+++ /dev/null
@@ -1,168 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IContentViewHost;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.IViewportModel;
- 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.geom.Rectangle;
- import org.apache.flex.geom.Size;
- import org.apache.flex.html.Container;
- import org.apache.flex.html.Panel;
- import org.apache.flex.html.TitleBar;
- import org.apache.flex.utils.CSSContainerUtils;
- import org.apache.flex.utils.CSSUtils;
-
- /**
- * The Panel class creates the visual elements of the org.apache.flex.html.Panel
- * component. A Panel has a org.apache.flex.html.TitleBar, and content. A
- * different View, PanelWithControlBarView, can display a ControlBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class PanelView extends ContainerView implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function PanelView()
- {
- super();
- }
-
- private var _titleBar:TitleBar;
-
- /**
- * The org.apache.flex.html.TitleBar component of the
- * org.apache.flex.html.Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get titleBar():TitleBar
- {
- return _titleBar;
- }
-
- /**
- * @private
- */
- public function set titleBar(value:TitleBar):void
- {
- _titleBar = value;
- }
-
- /**
- * @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
- {
- var host:UIBase = UIBase(value);
-
- if (!_titleBar) {
- _titleBar = new TitleBar();
- _titleBar.id = "panelTitleBar";
- _titleBar.height = 30;
- }
- // replace the TitleBar's model with the Panel's model (it implements ITitleBarModel) so that
- // any changes to values in the Panel's model that correspond values in the TitleBar will
- // be picked up automatically by the TitleBar.
- titleBar.model = host.model;
-
- super.strand = value;
- }
-
- override protected function completeSetup():void
- {
- (host as IContentViewHost).strandChildren.addElement(titleBar);
- super.completeSetup();
- }
-
- /**
- * Calculate the space taken up by non-content children like a TItleBar in a Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override protected function getChromeMetrics():Rectangle
- {
- return new Rectangle(0, titleBar.height, 0, 0 - titleBar.height);
- }
-
- override protected function layoutViewBeforeContentLayout():void
- {
- var vm:IViewportModel = viewportModel;
- var host:ILayoutChild = this.host as ILayoutChild;
- vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
- titleBar.x = vm.borderMetrics.left;
- titleBar.y = vm.borderMetrics.top;
- if (!host.isWidthSizedToContent())
- titleBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
- vm.chromeMetrics = getChromeMetrics();
- viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
- vm.borderMetrics.top + vm.chromeMetrics.top);
- viewport.layoutViewportBeforeContentLayout(
- !host.isWidthSizedToContent() ?
- host.width - vm.borderMetrics.left - vm.borderMetrics.right -
- vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
- !host.isHeightSizedToContent() ?
- host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
- vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
- }
-
- override protected function layoutViewAfterContentLayout():void
- {
- var vm:IViewportModel = viewportModel;
- var viewportSize:Size = this.viewport.layoutViewportAfterContentLayout();
- var host:ILayoutChild = this.host as ILayoutChild;
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- if (!hasWidth) {
- titleBar.width = viewportSize.width; // should get titlebar to layout and get new height
- vm.chromeMetrics = this.getChromeMetrics();
- vm.chromeMetrics.top = titleBar.height;
- }
- super.layoutViewAfterContentLayout();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
deleted file mode 100644
index 8dfcd42..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/PanelWithControlBarView.as
+++ /dev/null
@@ -1,207 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Sprite;
-
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IContentViewHost;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IPanelModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITitleBarModel;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.IViewportModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.geom.Size;
- import org.apache.flex.html.Container;
- import org.apache.flex.html.ControlBar;
- import org.apache.flex.html.TitleBar;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The Panel class creates the visual elements of the org.apache.flex.html.Panel
- * component. A Panel has a org.apache.flex.html.TitleBar, content, and an
- * optional org.apache.flex.html.ControlBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class PanelWithControlBarView extends ContainerView implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function PanelWithControlBarView()
- {
- }
-
- private var _titleBar:TitleBar;
-
- /**
- * The org.apache.flex.html.TitleBar component of the
- * org.apache.flex.html.Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get titleBar():TitleBar
- {
- return _titleBar;
- }
-
- private var _controlBar:ControlBar;
-
- /**
- * The org.apache.flex.html.ControlBar for the Panel; may be null.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get controlBar():ControlBar
- {
- return _controlBar;
- }
-
- /**
- * @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
- {
- var host:UIBase = UIBase(value);
-
- // TODO: (aharui) get class to instantiate from CSS
- if (!_titleBar) {
- _titleBar = new TitleBar();
- _titleBar.id = "panelTitleBar";
- _titleBar.height = 30;
- }
- // replace the TitleBar's model with the Panel's model (it implements ITitleBarModel) so that
- // any changes to values in the Panel's model that correspond values in the TitleBar will
- // be picked up automatically by the TitleBar.
- _titleBar.model = host.model;
-
- var controlBarItems:Array = (host.model as IPanelModel).controlBar;
- if( controlBarItems && controlBarItems.length > 0 ) {
- _controlBar = new ControlBar();
- _controlBar.id = "panelControlBar";
- _controlBar.height = 30;
-
- for each(var comp:IUIBase in controlBarItems) {
- _controlBar.addElement(comp, false);
- }
- }
-
- super.strand = value;
- }
-
- override protected function completeSetup():void
- {
- super.completeSetup();
-
- (_strand as IContentViewHost).strandChildren.addElement(titleBar, false);
-
- if (controlBar) {
- (_strand as IContentViewHost).strandChildren.addElement(_controlBar, false);
- }
- }
-
- /**
- * Calculate the space taken up by non-content children like a TItleBar in a Panel.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override protected function getChromeMetrics():Rectangle
- {
- return new Rectangle(0, titleBar.height, 0, controlBar.height - titleBar.height);
- }
-
- override protected function layoutViewBeforeContentLayout():void
- {
- var vm:IViewportModel = viewportModel;
- var host:ILayoutChild = this.host as ILayoutChild;
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
- titleBar.x = vm.borderMetrics.left;
- titleBar.y = vm.borderMetrics.top;
- if (hasWidth)
- {
- titleBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
- controlBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
- }
- vm.chromeMetrics = getChromeMetrics();
- controlBar.x = vm.borderMetrics.left;
- if (hasHeight && hasWidth)
- controlBar.y = host.height - vm.borderMetrics.bottom - controlBar.height;
-
- viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
- vm.borderMetrics.top + vm.chromeMetrics.top);
- viewport.layoutViewportBeforeContentLayout(
- hasWidth ?
- host.width - vm.borderMetrics.left - vm.borderMetrics.right -
- vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
- hasHeight ?
- host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
- vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
- }
-
- override protected function layoutViewAfterContentLayout():void
- {
- var vm:IViewportModel = viewportModel;
- var viewportSize:Size = this.viewport.layoutViewportAfterContentLayout();
- var host:ILayoutChild = this.host as ILayoutChild;
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- if (!hasWidth) {
- titleBar.width = viewportSize.width; // should get titlebar to layout and get new height
- vm.chromeMetrics = this.getChromeMetrics();
- vm.chromeMetrics.top = titleBar.height;
- controlBar.width = viewportSize.width; // should get controlbar to layout and get new height
- vm.chromeMetrics.bottom = controlBar.height;
- }
- super.layoutViewAfterContentLayout();
- if (!hasHeight) {
- controlBar.y = host.height - vm.borderMetrics.bottom - controlBar.height;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
deleted file mode 100644
index 245c3d3..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
+++ /dev/null
@@ -1,281 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IValueToggleButtonModel;
- import org.apache.flex.events.Event;
-
- /**
- * The RadioButtonView class creates the visual elements of the org.apache.flex.html.RadioButton
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class RadioButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function RadioButtonView()
- {
- sprites = [ upSprite = new Sprite(),
- downSprite = new Sprite(),
- overSprite = new Sprite(),
- upAndSelectedSprite = new Sprite(),
- downAndSelectedSprite = new Sprite(),
- overAndSelectedSprite = new Sprite() ];
-
- for each( var s:Sprite in sprites )
- {
- var tf:CSSTextField = new CSSTextField();
- tf.type = TextFieldType.DYNAMIC;
- tf.autoSize = TextFieldAutoSize.LEFT;
- tf.name = "textField";
- var icon:Shape = new Shape();
- icon.name = "icon";
- s.addChild(icon);
- s.addChild(tf);
- }
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var upAndSelectedSprite:Sprite;
- private var downAndSelectedSprite:Sprite;
- private var overAndSelectedSprite:Sprite;
-
- private var sprites:Array;
-
- private var _toggleButtonModel:IValueToggleButtonModel;
-
- /**
- * The model used for the RadioButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get toggleButtonModel() : IValueToggleButtonModel
- {
- return _toggleButtonModel;
- }
-
- /**
- * @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;
- _toggleButtonModel = value.getBeadByType(IValueToggleButtonModel) as IValueToggleButtonModel;
- _toggleButtonModel.addEventListener("textChange", textChangeHandler);
- _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
- _toggleButtonModel.addEventListener("selectedValueChange", selectedValueChangeHandler);
- if (_toggleButtonModel.text != null)
- text = _toggleButtonModel.text;
- if (_toggleButtonModel.html != null)
- html = _toggleButtonModel.html;
-
- layoutControl();
-
- var hitArea:Shape = new Shape();
- hitArea.graphics.beginFill(0x000000);
- hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
- hitArea.graphics.endFill();
-
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = hitArea;
-
- if (toggleButtonModel.text !== null)
- text = toggleButtonModel.text;
- if (toggleButtonModel.html !== null)
- html = toggleButtonModel.html;
-
- if (toggleButtonModel.selected && toggleButtonModel.value == value) {
- selected = true;
- }
- }
-
- /**
- * The string label for the org.apache.flex.html.RadioButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.text;
- }
- public function set text(value:String):void
- {
- for each( var s:Sprite in sprites )
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.text = value;
- }
-
- layoutControl();
- }
-
- /**
- * The HTML string for the org.apache.flex.html.RadioButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.htmlText;
- }
- public function set html(value:String):void
- {
- for each(var s:Sprite in sprites)
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.htmlText = value;
- }
-
- layoutControl();
- }
-
- /**
- * @private
- */
- private function textChangeHandler(event:Event):void
- {
- text = toggleButtonModel.text;
- }
-
- /**
- * @private
- */
- private function htmlChangeHandler(event:Event):void
- {
- html = toggleButtonModel.html;
- }
-
- private var _selected:Boolean;
-
- /**
- * The selection state of the RadioButton
- */
- public function get selected():Boolean
- {
- return _selected;
- }
- public function set selected(value:Boolean):void
- {
- _selected = value;
-
- if( value ) {
- SimpleButton(_strand).upState = upAndSelectedSprite;
- SimpleButton(_strand).downState = downAndSelectedSprite;
- SimpleButton(_strand).overState = overAndSelectedSprite;
-
- } else {
- SimpleButton(_strand).upState = upSprite;
- SimpleButton(_strand).downState = downSprite;
- SimpleButton(_strand).overState = overSprite;
- }
-
- layoutControl();
- }
-
- /**
- * @private
- */
- private function selectedValueChangeHandler(event:Event):void
- {
- selected = _toggleButtonModel.value == _toggleButtonModel.selectedValue;
- }
-
- /**
- * @private
- */
- protected function layoutControl() : void
- {
- for each(var s:Sprite in sprites)
- {
- var icon:Shape = s.getChildByName("icon") as Shape;
- var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
-
- drawRadioButton(icon);
-
- var mh:Number = Math.max(icon.height,tf.height);
-
- icon.x = 0;
- icon.y = (mh - icon.height)/2;
-
- tf.x = icon.x + icon.width + 1;
- tf.y = (mh - tf.height)/2;
- }
-
- }
-
- /**
- * @private
- */
- protected function drawRadioButton(icon:Shape) : void
- {
- icon.graphics.clear();
- icon.graphics.beginFill(0xf8f8f8);
- icon.graphics.lineStyle(1,0x808080);
- icon.graphics.drawEllipse(0,0,10,10);
- icon.graphics.endFill();
-
- if( selected ) {
- icon.graphics.beginFill(0);
- icon.graphics.drawEllipse(3,3,4,4);
- icon.graphics.endFill();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
deleted file mode 100644
index 225c37c..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RightArrowButtonView.as
+++ /dev/null
@@ -1,112 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The RightArrowButtonView class is the view for
- * the right arrow button in a ScrollBar and other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class RightArrowButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function RightArrowButtonView()
- {
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.lineStyle(1, 0x808080);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
- g.endFill();
- g.lineStyle(0);
- g.beginFill(0);
- g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
- g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.HalfSize);
- g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
- g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
-
- SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
- SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- private function sizeChangeHandler(event:Event):void
- {
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ScrollBarView.as
deleted file mode 100644
index e3f8c50..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/ScrollBarView.as
+++ /dev/null
@@ -1,216 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.Strand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-
- /**
- * The ScrollBarView class is the default view for
- * the org.apache.flex.html.supportClasses.ScrollBar class.
- * It implements the classic desktop-like ScrollBar.
- * A different view would implement more modern scrollbars that hide themselves
- * until hovered over with the mouse.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
- {
- public static const FullSize:int = 12;
- public static const ThreeQuarterSize:int = 9;
- public static const HalfSize:int = 6;
- public static const ThirdSize:int = 4;
- public static const QuarterSize:int = 3;
-
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ScrollBarView()
- {
- }
-
- protected var sbModel:IScrollBarModel;
-
- protected var _strand:IStrand;
-
- /**
- * The layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var layout:IBeadLayout;
-
- /**
- * The host component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get host():IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
-
- for each (var bead:IBead in beads)
- addBead(bead);
-
- sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
- sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
- sbModel.addEventListener("maximumChange", changeHandler);
- sbModel.addEventListener("minimumChange", changeHandler);
- sbModel.addEventListener("snapIntervalChange", changeHandler);
- sbModel.addEventListener("stepSizeChange", changeHandler);
- sbModel.addEventListener("pageSizeChange", changeHandler);
- sbModel.addEventListener("valueChange", changeHandler);
-
- if( _strand.getBeadByType(IBeadLayout) == null ) {
- layout = new (ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout")) as IBeadLayout;
- _strand.addBead(layout);
- }
- }
-
- protected function changeHandler(event:Event):void
- {
- layout.layout();
- }
-
- protected var _decrement:DisplayObject;
- protected var _increment:DisplayObject;
- protected var _track:DisplayObject;
- protected var _thumb:DisplayObject;
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#decrement
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get decrement():DisplayObject
- {
- return _decrement;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#increment
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get increment():DisplayObject
- {
- return _increment;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#track
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get track():DisplayObject
- {
- return _track;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#thumb
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get thumb():DisplayObject
- {
- return _thumb;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadView#viewHeight
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get viewHeight():Number
- {
- // don't want to put $height in an interface
- return _strand["$height"];
- }
-
- /**
- * @copy org.apache.flex.core.IBeadView#viewWidth
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get viewWidth():Number
- {
- // don't want to put $width in an interface
- return _strand["$width"];
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SimpleAlertView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SimpleAlertView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SimpleAlertView.as
deleted file mode 100644
index 949f9c9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SimpleAlertView.as
+++ /dev/null
@@ -1,149 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IParent;
- 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.geom.Rectangle;
- import org.apache.flex.html.Label;
- import org.apache.flex.html.TextButton;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The SimpleAlertView class creates the visual elements of the
- * org.apache.flex.html.SimpleAlert component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleAlertView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleAlertView()
- {
- }
-
- private var messageLabel:Label;
- private var okButton:TextButton;
-
- /**
- * @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;
-
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(value, "background-color");
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(value, "background-image");
- if (backgroundColor != null || backgroundImage != null)
- {
- if (value.getBeadByType(IBackgroundBead) == null)
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
- }
-
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(value, "border");
- if (borderStyles is Array)
- {
- borderStyle = borderStyles[1];
- }
- if (borderStyle == null)
- {
- borderStyle = ValuesManager.valuesImpl.getValue(value, "border-style") as String;
- }
- if (borderStyle != null && borderStyle != "none")
- {
- if (value.getBeadByType(IBorderBead) == null)
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
- }
-
- var model:IAlertModel = _strand.getBeadByType(IAlertModel) as IAlertModel;
- model.addEventListener("messageChange",handleMessageChange);
- model.addEventListener("htmlMessageChange",handleMessageChange);
-
- messageLabel = new Label();
- messageLabel.text = model.message;
- messageLabel.html = model.htmlMessage;
- IParent(_strand).addElement(messageLabel);
-
- okButton = new TextButton();
- okButton.text = model.okLabel;
- IParent(_strand).addElement(okButton);
- okButton.addEventListener("click",handleOK);
-
- handleMessageChange(null);
- }
-
- /**
- * @private
- */
- private function handleMessageChange(event:Event):void
- {
- var ruler:IMeasurementBead = messageLabel.getBeadByType(IMeasurementBead) as IMeasurementBead;
- if( ruler == null ) {
- messageLabel.addBead(ruler = new (ValuesManager.valuesImpl.getValue(messageLabel, "iMeasurementBead")) as IMeasurementBead);
- }
- var maxWidth:Number = Math.max(UIBase(_strand).width,ruler.measuredWidth);
-
- var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
-
- messageLabel.x = metrics.left;
- messageLabel.y = metrics.top;
- messageLabel.width = maxWidth;
-
- okButton.x = (maxWidth - okButton.width)/2;
- okButton.y = messageLabel.y + messageLabel.height + 20;
-
- UIBase(_strand).width = maxWidth + metrics.left + metrics.right;
- UIBase(_strand).height = okButton.y + okButton.height + metrics.bottom;
- }
-
- /**
- * @private
- */
- private function handleOK(event:Event):void
- {
- var newEvent:Event = new Event("close");
- IEventDispatcher(_strand).dispatchEvent(newEvent);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
deleted file mode 100644
index 49f3608..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
+++ /dev/null
@@ -1,91 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Graphics;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStatesObject;
- 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.CSSBorderUtils;
-
- /**
- * The SingleLineBorderBead class draws a single line solid border.
- * The color and thickness can be specified in CSS.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SingleLineBorderBead implements IBead, IBorderBead, IGraphicsDrawing
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SingleLineBorderBead()
- {
- }
-
- 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("heightChanged", changeHandler);
- IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
- IEventDispatcher(value).addEventListener("sizeChanged", changeHandler);
- changeHandler(null);
- }
-
- private function changeHandler(event:Event):void
- {
- var host:UIBase = UIBase(_strand);
- var g:Graphics = host.graphics;
- var w:Number = host.width;
- var h:Number = host.height;
- var state:String;
- if (host is IStatesObject)
- state = IStatesObject(host).currentState;
-
- var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
- if( this == gd ) g.clear();
-
- CSSBorderUtils.draw(g, w, h, host, state, false, false);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderThumbView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderThumbView.as
deleted file mode 100644
index c20c781..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderThumbView.as
+++ /dev/null
@@ -1,156 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- COMPILE::AS3
- {
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- }
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The SliderThumbView class creates the draggable input element for the
- * org.apache.flex.html.Slider component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SliderThumbView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SliderThumbView()
- {
- COMPILE::AS3
- {
- hitArea = new Shape();
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.clear();
- g.lineStyle(1,0x000000);
- g.beginFill(bgColor);
- g.drawCircle(SimpleButton(_strand).width/2, SimpleButton(_strand).height/2, 10);
- g.endFill();
- }
-
- COMPILE::AS3
- private var hitArea:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignoreimport org.apache.flex.core.WrappedHTMLElement
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- COMPILE::AS3
- {
- drawView(hitArea.graphics, 0xDD0000);
- drawView(upView.graphics, 0xFFFFFF);
- drawView(downView.graphics, 0x999999);
- drawView(overView.graphics, 0xDDDDDD);
-
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = hitArea;
-
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
- }
- COMPILE::JS
- {
-
- element = document.createElement('div') as WrappedHTMLElement;
- element.className = 'SliderThumb';
- element.id = 'thumb';
- element.style.backgroundColor = '#949494';
- element.style.border = 'thin solid #747474';
- element.style.position = 'relative';
- element.style.height = '30px';
- element.style.width = '10px';
- element.style.zIndex = '2';
- element.style.top = '-10px';
- element.style.left = '20px';
-
- host.element.appendChild(element);
-
- element.flexjs_wrapper = this;
-
- }
- }
-
- COMPILE::AS3
- private var upView:Shape;
- COMPILE::AS3
- private var downView:Shape;
- COMPILE::AS3
- private var overView:Shape;
-
- COMPILE::JS
- public var element:WrappedHTMLElement;
-
- /**
- * @private
- */
- COMPILE::AS3
- private function sizeChangeHandler( event:Event ) : void
- {
- drawView(hitArea.graphics, 0xDD0000);
- drawView(upView.graphics, 0xFFFFFF);
- drawView(downView.graphics, 0x999999);
- drawView(overView.graphics, 0xDDDDDD);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderTrackView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderTrackView.as
deleted file mode 100644
index 6752347..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderTrackView.as
+++ /dev/null
@@ -1,153 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- COMPILE::AS3
- {
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- }
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The SliderTrackView class creates the track area for the org.apache.flex.html.Slider
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SliderTrackView extends BeadViewBase implements IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SliderTrackView()
- {
- COMPILE::AS3
- {
- hitArea = new Shape();
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
- }
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.clear();
- g.lineStyle(1,0x000000);
- g.beginFill(bgColor);
- g.drawRect(0, 0, SimpleButton(_strand).width, SimpleButton(_strand).height);
- g.endFill();
- }
-
- COMPILE::AS3
- private var hitArea:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- COMPILE::AS3
- {
- drawView(hitArea.graphics, 0xDD0000);
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
-
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = hitArea;
-
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
- }
- COMPILE::JS
- {
- element = document.createElement('div') as WrappedHTMLElement;
- element.className = 'SliderTrack';
- element.id = 'track';
- element.style.backgroundColor = '#E4E4E4';
- element.style.height = '10px';
- element.style.width = '200px';
- element.style.border = 'thin solid #C4C4C4';
- element.style.position = 'relative';
- element.style.left = '0px';
- element.style.top = '10px';
- element.style.zIndex = '1';
-
- var host:UIBase = value as UIBase;
- host.element.appendChild(element);
- }
- }
-
- COMPILE::JS
- public var element:WrappedHTMLElement;
-
- COMPILE::AS3
- private var upView:Shape;
- COMPILE::AS3
- private var downView:Shape;
- COMPILE::AS3
- private var overView:Shape;
-
- /**
- * @private
- */
- COMPILE::AS3
- private function sizeChangeHandler( event:Event ) : void
- {
- drawView(hitArea.graphics, 0xDD0000);
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
- }
- }
-}
[09/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridView.as
new file mode 100644
index 0000000..582a1e7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataGridView.as
@@ -0,0 +1,294 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IDataGridModel;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.ButtonBar;
+ import org.apache.flex.html.Container;
+ import org.apache.flex.html.List;
+ import org.apache.flex.html.beads.layouts.ButtonBarLayout;
+ import org.apache.flex.html.beads.layouts.VerticalLayout;
+ import org.apache.flex.html.beads.models.ArraySelectionModel;
+ import org.apache.flex.html.beads.models.DataGridPresentationModel;
+ import org.apache.flex.html.supportClasses.DataGridColumn;
+ import org.apache.flex.html.supportClasses.ScrollingViewport;
+ import org.apache.flex.html.supportClasses.Viewport;
+
+ /**
+ * The DataGridView class is the visual bead for the org.apache.flex.html.DataGrid.
+ * This class constructs the items that make the DataGrid: Lists for each column and a
+ * org.apache.flex.html.ButtonBar for the column headers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridView implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridView()
+ {
+ }
+
+ private var _strand:IStrand;
+ private var _header:ButtonBar;
+ private var _listArea:Container;
+
+ private var _lists:Array;
+
+ /**
+ * An array of List objects the comprise the columns of the DataGrid.
+ */
+ public function get getColumnLists():Array
+ {
+ return _lists;
+ }
+
+ /**
+ * @private
+ */
+ public function get host():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+
+ var host:UIBase = value as UIBase;
+ host.addEventListener("widthChanged", handleSizeChanges);
+ host.addEventListener("heightChanged", handleSizeChanges);
+
+ _header = new ButtonBar();
+ _header.id = "dataGridHeader";
+
+ var scrollPort:ScrollingViewport = new ScrollingViewport();
+// scrollPort.showsHorizontalScrollBar = false;
+
+ _listArea = new Container();
+ _listArea.id = "dataGridListArea";
+ _listArea.className = "DataGridListArea";
+ _listArea.addBead(scrollPort);
+
+ finishSetup(null);
+ }
+
+ /**
+ * @private
+ */
+ private function finishSetup(event:Event):void
+ {
+ var host:UIBase = _strand as UIBase;
+
+ // see if there is a presentation model already in place. if not, add one.
+ var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
+ if (presentationModel == null) {
+ presentationModel = new DataGridPresentationModel();
+ _strand.addBead(presentationModel);
+ }
+
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+ IEventDispatcher(sharedModel).addEventListener("dataProviderChanged",handleDataProviderChanged);
+
+ var columnLabels:Array = new Array();
+ var buttonWidths:Array = new Array();
+
+ for(var i:int=0; i < sharedModel.columns.length; i++) {
+ var dgc:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
+ columnLabels.push(dgc.label);
+ if (!isNaN(dgc.columnWidth)) buttonWidths.push(dgc.columnWidth);
+ }
+
+ var bblayout:ButtonBarLayout = new ButtonBarLayout();
+ if (buttonWidths.length == sharedModel.columns.length) {
+ bblayout.buttonWidths = buttonWidths;
+ }
+
+ var buttonBarModel:ArraySelectionModel = new ArraySelectionModel();
+ buttonBarModel.dataProvider = columnLabels;
+
+ _header.addBead(buttonBarModel);
+ _header.addBead(bblayout);
+ _header.addBead(new Viewport());
+ host.addElement(_header);
+
+ host.addElement(_listArea);
+
+ // do we know what the size is? If not, wait to be sized
+
+ if (host.isHeightSizedToContent() || host.isWidthSizedToContent()) {
+ host.addEventListener("sizeChanged", handleSizeChanges);
+ }
+
+ // else size now
+ else {
+ handleDataProviderChanged(event);
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function handleSizeChanges(event:Event):void
+ {
+ var useWidth:Number = _listArea.width;
+ var useHeight:Number = _listArea.height;
+
+ if (host.width > 0) {
+ useWidth = host.width;
+ }
+
+ _header.x = 0;
+ _header.y = 0;
+ _header.width = useWidth;
+ _header.height = 25;
+
+ if (host.height > 0) {
+ useHeight = host.height - _header.height;
+ }
+
+ _listArea.x = 0;
+ _listArea.y = 26;
+ _listArea.width = useWidth;
+ _listArea.height = useHeight;
+
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+
+ if (_lists != null && _lists.length > 0) {
+ var xpos:Number = 0;
+ var listWidth:Number = host.width / _lists.length;
+ for (var i:int=0; i < _lists.length; i++) {
+ var list:List = _lists[i] as List;
+ list.x = xpos;
+ list.y = 0;
+
+ var dataGridColumn:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
+ var colWidth:Number = dataGridColumn.columnWidth;
+ if (!isNaN(colWidth)) list.width = colWidth;
+ else list.width = listWidth;
+
+ xpos += list.width;
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function handleDataProviderChanged(event:Event):void
+ {
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+
+ if (_lists == null || _lists.length == 0) {
+ createLists();
+ }
+
+ for (var i:int=0; i < _lists.length; i++)
+ {
+ var list:List = _lists[i] as List;
+ var listModel:ISelectionModel = list.getBeadByType(IBeadModel) as ISelectionModel;
+ listModel.dataProvider = sharedModel.dataProvider;
+ }
+
+ handleSizeChanges(event);
+ }
+
+ /**
+ * @private
+ */
+ private function handleColumnListChange(event:Event):void
+ {
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+ var list:List = event.target as List;
+ sharedModel.selectedIndex = list.selectedIndex;
+
+ for(var i:int=0; i < _lists.length; i++) {
+ if (list != _lists[i]) {
+ var otherList:List = _lists[i] as List;
+ otherList.selectedIndex = list.selectedIndex;
+ }
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event('change'));
+ }
+
+ /**
+ * @private
+ */
+ private function createLists():void
+ {
+ var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;
+ var presentationModel:DataGridPresentationModel = _strand.getBeadByType(DataGridPresentationModel) as DataGridPresentationModel;
+ var listWidth:Number = host.width / sharedModel.columns.length;
+
+ _lists = new Array();
+
+ for (var i:int=0; i < sharedModel.columns.length; i++) {
+ var dataGridColumn:DataGridColumn = sharedModel.columns[i] as DataGridColumn;
+
+ var list:List = new List();
+ list.id = "dataGridColumn"+String(i);
+ list.className = "DataGridColumn";
+ list.addBead(sharedModel);
+ list.itemRenderer = dataGridColumn.itemRenderer;
+ list.labelField = dataGridColumn.dataField;
+ list.addEventListener('change',handleColumnListChange);
+ list.addBead(presentationModel);
+
+ var colWidth:Number = dataGridColumn.columnWidth;
+ if (!isNaN(colWidth)) list.width = colWidth;
+ else list.width = listWidth;
+
+ _listArea.addElement(list);
+ _lists.push(list);
+ }
+
+ _listArea.dispatchEvent(new Event("layoutNeeded"));
+ }
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
new file mode 100644
index 0000000..609bfbc
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IListPresentationModel;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.SimpleCSSStyles;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.List;
+
+ /**
+ * The DataItemRendererFactoryForArrayData class reads an
+ * array of data and creates an item renderer for every
+ * item in the array. Other implementations of
+ * IDataProviderItemRendererMapper map different data
+ * structures or manage a virtual set of renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataItemRendererFactoryForArrayData()
+ {
+ }
+
+ private var selectionModel:ISelectionModel;
+
+ private var labelField:String;
+
+ 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;
+ selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ var listView:IListView = value.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+
+ labelField = (listView.host as List).labelField;
+
+ if (!itemRendererFactory)
+ {
+ _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ _strand.addBead(_itemRendererFactory);
+ }
+
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * The org.apache.flex.core.IItemRendererClassFactory used
+ * to generate instances of item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The org.apache.flex.core.IItemRendererParent that will
+ * parent the item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:Array = selectionModel.dataProvider as Array;
+ if (!dp)
+ return;
+
+ dataGroup.removeAllElements();
+
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
+ ir.index = i;
+ ir.labelField = labelField;
+ if (presentationModel) {
+ var style:SimpleCSSStyles = new SimpleCSSStyles();
+ style.marginBottom = presentationModel.separatorThickness;
+ UIBase(ir).style = style;
+ UIBase(ir).height = presentationModel.rowHeight;
+ }
+ dataGroup.addElement(ir);
+ ir.data = dp[i];
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
new file mode 100644
index 0000000..9895394
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForArrayList.as
@@ -0,0 +1,174 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.collections.ArrayList;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IListPresentationModel;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.SimpleCSSStyles;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.List;
+
+ /**
+ * The DataItemRendererFactoryForArrayList class uses an ArrayList
+ * and creates an item renderer for every
+ * item in the collection. Other implementations of
+ * IDataProviderItemRendererMapper map different data
+ * structures or manage a virtual set of renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataItemRendererFactoryForArrayList implements IBead, IDataProviderItemRendererMapper
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataItemRendererFactoryForArrayList()
+ {
+ }
+
+ private var selectionModel:ISelectionModel;
+
+ private var labelField:String;
+
+ 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("beadsAdded", finishSetup);
+ IEventDispatcher(_strand).addEventListener("initComplete", finishSetup);
+ }
+
+ private function finishSetup(event:Event):void
+ {
+ selectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+
+ labelField = (listView.host as List).labelField;
+
+ if (!itemRendererFactory)
+ {
+ _itemRendererFactory = _strand.getBeadByType(IItemRendererClassFactory) as IItemRendererClassFactory;
+ if (_itemRendererFactory == null) {
+ _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ _strand.addBead(_itemRendererFactory);
+ }
+ }
+
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * The org.apache.flex.core.IItemRendererClassFactory used
+ * to generate instances of item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The org.apache.flex.core.IItemRendererParent that will
+ * parent the item renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:ArrayList = selectionModel.dataProvider as ArrayList;
+ if (!dp)
+ return;
+
+ dataGroup.removeAllElements();
+
+ var listView:IListView = _strand.getBeadByType(IListView) as IListView;
+ var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var ir:ISelectableItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ISelectableItemRenderer;
+ ir.index = i;
+ ir.labelField = labelField;
+ if (presentationModel) {
+ UIBase(ir).height = presentationModel.rowHeight;
+
+ // ensure that the IR spans the width of its column
+ var style:SimpleCSSStyles = new SimpleCSSStyles();
+ style.right = 0;
+ style.left = 0;
+ UIBase(ir).style = style;
+ }
+ dataGroup.addElement(ir);
+ ir.data = dp.getItemAt(i);
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
new file mode 100644
index 0000000..d399cfb
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataItemRendererFactoryForColumnData.as
@@ -0,0 +1,142 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IDataGridModel;
+ import org.apache.flex.core.IDataProviderItemRendererMapper;
+ import org.apache.flex.core.IItemRendererClassFactory;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.supportClasses.DataItemRenderer;
+
+ /**
+ * The DataItemRendererFactoryForColumnData class implents the
+ * org.apache.flex.core.IDataProviderItemRendererMapper interface and creates the itemRenderers
+ * for each cell in the org.apache.flex.html.DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataItemRendererFactoryForColumnData implements IBead, IDataProviderItemRendererMapper
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataItemRendererFactoryForColumnData()
+ {
+ }
+
+ private var selectionModel:IDataGridModel;
+
+ 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;
+ selectionModel = value.getBeadByType(IDataGridModel) as IDataGridModel;
+ var listView:IListView = value.getBeadByType(IListView) as IListView;
+ dataGroup = listView.dataGroup;
+ selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+
+ if (!itemRendererFactory)
+ {
+ _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
+ _strand.addBead(_itemRendererFactory);
+ }
+
+ dataProviderChangeHandler(null);
+ }
+
+ private var _itemRendererFactory:IItemRendererClassFactory;
+
+ /**
+ * The factory used to create the itemRenderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRendererFactory():IItemRendererClassFactory
+ {
+ return _itemRendererFactory
+ }
+ public function set itemRendererFactory(value:IItemRendererClassFactory):void
+ {
+ _itemRendererFactory = value;
+ }
+
+ /**
+ * The dataGroup that is the pareent for the itemRenderers
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var dataGroup:IItemRendererParent;
+
+ /**
+ * @private
+ */
+ private function dataProviderChangeHandler(event:Event):void
+ {
+ var dp:Array = selectionModel.dataProvider as Array;
+ if (!dp)
+ return;
+
+ dataGroup.removeAllElements();
+
+ var view:DataGridColumnView = _strand.getBeadByType(IBeadView) as DataGridColumnView;
+ if (view == null) return;
+
+ var n:int = dp.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ var tf:DataItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as DataItemRenderer;
+ tf.index = i;
+ tf.labelField = view.column.dataField;
+ dataGroup.addElement(tf);
+ tf.data = dp[i];
+ }
+
+ IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.as
new file mode 100644
index 0000000..8905fb9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DataProviderChangeNotifier.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
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IDocument;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.collections.ArrayList;
+
+ /**
+ * The DataProviderChangeNotifier notifies listeners when a selection model's
+ * ArrayList dataProvider has changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataProviderChangeNotifier implements IBead, IDocument
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataProviderChangeNotifier()
+ {
+ }
+
+ protected var _dataProvider:ArrayList;
+
+ 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;
+
+ if (_dataProvider == null) {
+ var object:Object = document[sourceID];
+ _dataProvider = object[propertyName] as ArrayList;
+ }
+
+ _dataProvider.addEventListener("itemAdded", handleItemAdded);
+ _dataProvider.addEventListener("itemRemoved", handleItemRemoved);
+ _dataProvider.addEventListener("itemUpdated", handleItemUpdated);
+
+ }
+
+ protected var document:Object;
+
+ /**
+ * @private
+ */
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.document = document;
+ }
+
+ private var _sourceID:String;
+
+ /**
+ * The ID of the object holding the ArrayList, usually a model.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get sourceID():String
+ {
+ return _sourceID;
+ }
+ public function set sourceID(value:String):void
+ {
+ _sourceID = value;
+ }
+
+ private var _propertyName:String;
+
+ /**
+ * The property in the sourceID that is the ArrayList.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get propertyName():String
+ {
+ return _propertyName;
+ }
+
+ public function set propertyName(value:String):void
+ {
+ _propertyName = value;
+ }
+
+ /**
+ * @private
+ */
+ private function handleItemAdded(event:Event):void
+ {
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ /**
+ * @private
+ */
+ private function handleItemRemoved(event:Event):void
+ {
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ /**
+ * @private
+ */
+ private function handleItemUpdated(event:Event):void
+ {
+ var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.dispatchEvent(new Event("dataProviderChanged"));
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateChooserView.as
new file mode 100644
index 0000000..5abf4c4
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateFieldView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateFieldView.as
new file mode 100644
index 0000000..f709a1f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DateFieldView.as
@@ -0,0 +1,192 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils.PointUtils;
+ import org.apache.flex.geom.Point;
+ 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;
+ }
+
+ var model:IDateChooserModel = _strand.getBeadByType(IDateChooserModel) as IDateChooserModel;
+ _popUp.selectedDate = model.selectedDate;
+
+ var host:IPopUpHost = UIUtils.findPopUpHost(UIBase(_strand));
+ var point:Point = new Point(_button.x, _button.y+_button.height);
+ var p2:Point = PointUtils.localToGlobal(point, _strand);
+ var p3:Point = PointUtils.globalToLocal(p2, host);
+ _popUp.x = p3.x;
+ _popUp.y = p3.y;
+
+ host.addElement(_popUp);
+ }
+ else
+ {
+ UIUtils.removePopUp(_popUp);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DownArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DownArrowButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DownArrowButtonView.as
new file mode 100644
index 0000000..c68a633
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DownArrowButtonView.as
@@ -0,0 +1,111 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The DownArrowButtonView class is the view for
+ * the down arrow button in a ScrollBar and other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DownArrowButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DownArrowButtonView()
+ {
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.lineStyle(1);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
+ g.endFill();
+ g.lineStyle(0);
+ g.beginFill(0);
+ g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
+ g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.QuarterSize);
+ g.lineTo(ScrollBarView.HalfSize, ScrollBarView.ThreeQuarterSize);
+ g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.QuarterSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+
+ SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DropDownListView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DropDownListView.as
new file mode 100644
index 0000000..1334227
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/DropDownListView.as
@@ -0,0 +1,300 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.SolidBorderUtil;
+
+ /**
+ * The DropDownListView class is the default view for
+ * the org.apache.flex.html.DropDownList class.
+ * It displays a simple text label with what appears to be a
+ * down arrow button on the right, but really, the entire
+ * view is the button that will display or dismiss the dropdown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListView extends BeadViewBase implements IDropDownListView, IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upSprite.addChild(upTextField);
+ overSprite.addChild(overTextField);
+ downSprite.addChild(downTextField);
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ // auto-size collapses if no text
+ //upTextField.autoSize = "left";
+ //downTextField.autoSize = "left";
+ //overTextField.autoSize = "left";
+
+ upArrows = new Shape();
+ overArrows = new Shape();
+ downArrows = new Shape();
+ upSprite.addChild(upArrows);
+ overSprite.addChild(overArrows);
+ downSprite.addChild(downArrows);
+ drawArrows(upArrows);
+ drawArrows(overArrows);
+ drawArrows(downArrows);
+
+ }
+
+
+ private var selectionModel:ISelectionModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;;
+ selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+ selectionModel.addEventListener("dataProviderChanged", selectionChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+ if (selectionModel.selectedIndex !== -1)
+ text = selectionModel.selectedItem.toString();
+ else
+ text = "^W_";
+ upTextField.height = upTextField.textHeight + 4;
+ downTextField.height = downTextField.textHeight + 4;
+ overTextField.height = overTextField.textHeight + 4;
+ if (selectionModel.selectedIndex == -1)
+ text = "";
+
+ IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+ IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+ changeHandler(null);
+ }
+
+ private function selectionChangeHandler(event:Event):void
+ {
+ if (selectionModel.selectedItem == null)
+ text = "";
+ else if (selectionModel.labelField != null)
+ text = selectionModel.selectedItem[selectionModel.labelField].toString();
+ else
+ text = selectionModel.selectedItem.toString();
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var ww:Number = DisplayObject(_strand).width;
+ var hh:Number = DisplayObject(_strand).height;
+
+ upArrows.x = ww - upArrows.width - 6;
+ overArrows.x = ww - overArrows.width - 6;
+ downArrows.x = ww - downArrows.width - 6;
+ upArrows.y = (hh - upArrows.height) / 2;
+ overArrows.y = (hh - overArrows.height) / 2;
+ downArrows.y = (hh - downArrows.height) / 2;
+
+ upTextField.width = upArrows.x;
+ downTextField.width = downArrows.x;
+ overTextField.width = overArrows.x;
+ upTextField.height = hh;
+ downTextField.height = hh;
+ overTextField.height = hh;
+
+ drawBorder(upSprite, 0xf8f8f8, ww, hh);
+ drawBorder(overSprite, 0xe8e8e8, ww, hh);
+ drawBorder(downSprite, 0xd8d8d8, ww, hh);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ww, hh);
+ shape.graphics.endFill();
+ }
+
+ private var upTextField:CSSTextField;
+ private var downTextField:CSSTextField;
+ private var overTextField:CSSTextField;
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upArrows:Shape;
+ private var downArrows:Shape;
+ private var overArrows:Shape;
+
+ private function drawBorder(sprite:Sprite, color:uint, ww:Number, hh:Number):void
+ {
+ SolidBorderUtil.drawBorder(sprite.graphics, 0, 0,
+ ww, hh,
+ 0x808080, color, 1, 1, 4);
+ }
+
+ private function drawArrows(shape:Shape):void
+ {
+ var g:Graphics = shape.graphics;
+ g.beginFill(0);
+ g.moveTo(8, 0);
+ g.lineTo(12, 4);
+ g.lineTo(4, 4);
+ g.lineTo(8, 0);
+ g.endFill();
+ g.beginFill(0);
+ g.moveTo(8, 10);
+ g.lineTo(12, 6);
+ g.lineTo(4, 6);
+ g.lineTo(8, 10);
+ g.endFill();
+ }
+
+ /**
+ * The text that is displayed in the view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ var ww:Number = DisplayObject(_strand).width;
+ var hh:Number = DisplayObject(_strand).height;
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ }
+
+ private var _popUp:IStrand;
+
+ /**
+ * The dropdown/popup that displays the set of choices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get popUp():IStrand
+ {
+ if (!_popUp)
+ {
+ var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
+ _popUp = new popUpClass() as IStrand;
+ }
+ return _popUp;
+ }
+
+ private var _popUpVisible:Boolean;
+
+ /**
+ * A flag that indicates whether the dropdown/popup is
+ * visible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get popUpVisible():Boolean
+ {
+ return _popUpVisible;
+ }
+
+ /**
+ * @private
+ */
+ public function set popUpVisible(value:Boolean):void
+ {
+ if (value != _popUpVisible)
+ {
+ _popUpVisible = value;
+ if (value)
+ {
+ var root:Object = DisplayObject(_strand).root;
+ var host:DisplayObjectContainer = DisplayObject(_strand).parent;
+ while (host && !(host is IPopUpHost))
+ host = host.parent;
+ if (host)
+ IPopUpHost(host).addElement(popUp);
+ }
+ else
+ {
+ DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
+ }
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HRuleView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HRuleView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HRuleView.as
new file mode 100644
index 0000000..3c7e092
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HRuleView.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Bitmap;
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IImageModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HRuleView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HRuleView()
+ {
+ }
+
+ /**
+ * @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(_strand).addEventListener("widthChanged",handleSizeChange);
+ IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
+ IEventDispatcher(_strand).addEventListener("sizeChanged",handleSizeChange);
+
+ handleSizeChange(null);
+ }
+
+ /**
+ * @private
+ */
+ private function handleSizeChange(event:Object):void
+ {
+ var ui:UIBase = _strand as UIBase;
+ ui.graphics.clear();
+ ui.graphics.beginFill(0);
+ ui.graphics.drawRect(0, 0, ui.width, 1);
+ ui.graphics.endFill();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarThumbView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarThumbView.as
new file mode 100644
index 0000000..05a41b6
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarThumbView.as
@@ -0,0 +1,120 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.supportClasses.ScrollBar;
+
+ /**
+ * The HScrollBarThumbView class is the view for
+ * the thumb button in a Horizontal ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HScrollBarThumbView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HScrollBarThumbView()
+ {
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ var ww:Number = DisplayObject(_strand).width;
+ g.clear();
+ g.lineStyle(1);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ww, ScrollBarView.FullSize, ScrollBarView.HalfSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xc8c8c8);
+ drawView(downView.graphics, 0xc8c8c8);
+ drawView(overView.graphics, 0xb8b8b8);
+
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+ IEventDispatcher(_strand).addEventListener("widthChanged", widthChangedHandler);
+ }
+
+ private function widthChangedHandler(event:Event):void
+ {
+ DisplayObject(_strand).scaleY = 1.0;
+ DisplayObject(_strand).scaleX = 1.0;
+
+ var ww:Number = DisplayObject(_strand).width;
+ drawView(upView.graphics, 0xc8c8c8);
+ drawView(downView.graphics, 0xc8c8c8);
+ drawView(overView.graphics, 0xb8b8b8);
+
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ww, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarTrackView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarTrackView.as
new file mode 100644
index 0000000..de6a3af
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarTrackView.as
@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The HScrollBarTrackView class is the view for
+ * the track in a Horizontal ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HScrollBarTrackView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HScrollBarTrackView()
+ {
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ var w:Number = SimpleButton(_strand).width;
+
+ g.clear();
+ g.lineStyle(1, 0x808080);
+ g.beginFill(bgColor);
+ g.drawRect(0, 0, w, ScrollBarView.FullSize);
+ g.endFill();
+ g.lineStyle(0);
+ }
+
+ private function widthChangeHandler(event:Event):void
+ {
+ DisplayObject(_strand).scaleY = 1.0;
+ DisplayObject(_strand).scaleX = 1.0;
+
+ var w:Number = SimpleButton(_strand).width;
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, w);
+ shape.graphics.endFill();
+
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+
+ SimpleButton(value).addEventListener("widthChanged", widthChangeHandler);
+ shape = new Shape();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarView.as
new file mode 100644
index 0000000..68fe11f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/HScrollBarView.as
@@ -0,0 +1,99 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+ /**
+ * The HScrollBarView class is the default view for
+ * the org.apache.flex.html.supportClasses.HScrollBar class.
+ * It implements the classic desktop-like HScrollBar.
+ * A different view would implement more modern scrollbars that hide themselves
+ * until hovered over with the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HScrollBarView extends ScrollBarView implements IBeadView, IStrand, IScrollBarView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HScrollBarView()
+ {
+ }
+
+ /**
+ * @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;
+
+ UIBase(value).setHeight(ScrollBarView.FullSize, true);
+
+ // TODO: (aharui) put in values impl
+ _increment = new Button();
+ Button(_increment).addBead(new RightArrowButtonView());
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).addBead(new LeftArrowButtonView());
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+ _track = new Button();
+ Button(_track).addBead(new HScrollBarTrackView());
+ _thumb = new Button();
+ Button(_thumb).addBead(new HScrollBarThumbView());
+
+ UIBase(value).addChild(_decrement);
+ UIBase(value).addChild(_increment);
+ UIBase(value).addChild(_track);
+ UIBase(value).addChild(_thumb);
+
+ IEventDispatcher(_strand).addEventListener("widthChanged", changeHandler);
+
+ layout.layout();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBackgroundBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBackgroundBead.as
new file mode 100644
index 0000000..2590a9a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBackgroundBead.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+
+ /**
+ * The IBackgroundBead interface is a marker interface for beads
+ * that draw backgrounds.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IBackgroundBead extends IBead
+ {
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBorderBead.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBorderBead.as
new file mode 100644
index 0000000..3e4fc39
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IBorderBead.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBead;
+
+ /**
+ * The IBackgroundBead interface is a marker interface for beads
+ * that draw backgrounds.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IBorderBead extends IBead
+ {
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IComboBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IComboBoxView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IComboBoxView.as
new file mode 100644
index 0000000..650d300
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IComboBoxView.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+ import org.apache.flex.core.IStrand;
+
+ /**
+ * The IComboBoxView interface provides the protocol for any bead that
+ * creates the visual parts for a org.apache.flex.html.ComboBox control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IComboBoxView extends IBeadView
+ {
+ /**
+ * The string appearing in the input area for the ComboBox.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get text():String;
+ function set text(value:String):void;
+
+ /**
+ * The HTML string appearing in the input area for the ComboBox.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get html():String;
+ function set html(value:String):void;
+
+ /**
+ * The component housing the selection list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get popUp():IStrand;
+
+ /**
+ * Determines whether or not the pop-up with the selection list is visible or not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get popUpVisible():Boolean;
+ function set popUpVisible(value:Boolean):void;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDataGridView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDataGridView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDataGridView.as
new file mode 100644
index 0000000..8f04d11
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/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
+ {
+
+ }
+}
[16/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
deleted file mode 100644
index 77af305..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
+++ /dev/null
@@ -1,459 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IDocument;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- 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.geom.Rectangle;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The OneFlexibleChildVerticalLayout class is a simple layout
- * bead. It takes the set of children and lays them out
- * vertically in one column, separating them according to
- * CSS layout rules for margin and padding styles. But it
- * will size the one 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 OneFlexibleChildVerticalLayout implements IBeadLayout, IDocument
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function OneFlexibleChildVerticalLayout()
- {
- }
-
-
- /**
- * The id of the flexible child
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var flexibleChild:String;
-
- private var actualChild:ILayoutChild;
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @private
- * The document.
- */
- private var document:Object;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- }
-
- private var _maxWidth:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxWidth
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxWidth():Number
- {
- return _maxWidth;
- }
-
- /**
- * @private
- */
- public function set maxWidth(value:Number):void
- {
- _maxWidth = value;
- }
-
- private var _maxHeight:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxHeight
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxHeight():Number
- {
- return _maxHeight;
- }
-
- /**
- * @private
- */
- public function set maxHeight(value:Number):void
- {
- _maxHeight = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
- actualChild = document[flexibleChild];
-
- var ilc:ILayoutChild;
- var n:int = contentView.numElements;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- maxWidth = 0;
-
- var w:Number = contentView.width;
- var hh:Number = contentView.height - padding.bottom;
- var yy:int = padding.top;
- var flexChildIndex:int;
- var ml:Number;
- var mr:Number;
- var mt:Number;
- var mb:Number;
- var lastmb:Number;
- var lastmt:Number;
- var halign:Object;
- var left:Number;
- var right:Number;
-
- for (var i:int = 0; i < n; i++)
- {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- ilc = child as ILayoutChild;
- left = ValuesManager.valuesImpl.getValue(child, "left");
- right = ValuesManager.valuesImpl.getValue(child, "right");
- if (child == actualChild)
- {
- flexChildIndex = i;
- break;
- }
- 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;
- }
- mt = Number(marginTop);
- if (isNaN(mt))
- mt = 0;
- mb = Number(marginBottom);
- if (isNaN(mb))
- mb = 0;
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
- }
- 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;
- }
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
- }
- maxWidth = Math.max(maxWidth, ml + child.width + mr);
- setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
- child.y = yy + mt;
- yy += child.height + mt + mb;
- lastmb = mb;
- }
-
- if (n > 0 && n > flexChildIndex)
- {
- for (i = n - 1; i > flexChildIndex; i--)
- {
- child = contentView.getElementAt(i) as IUIBase;
- ilc = child as ILayoutChild;
- left = ValuesManager.valuesImpl.getValue(child, "left");
- right = ValuesManager.valuesImpl.getValue(child, "right");
- 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;
- }
- mt = Number(marginTop);
- if (isNaN(mt))
- mt = 0;
- mb = Number(marginBottom);
- if (isNaN(mb))
- mb = 0;
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
- }
- 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;
- }
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
- }
- setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
- maxWidth = Math.max(maxWidth, ml + child.width + mr);
- child.y = hh - child.height - mb;
- hh -= child.height + mt + mb;
- lastmt = mt;
- }
- }
-
- child = contentView.getElementAt(flexChildIndex) as IUIBase;
- ilc = child as ILayoutChild;
- left = ValuesManager.valuesImpl.getValue(child, "left");
- right = ValuesManager.valuesImpl.getValue(child, "right");
- 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;
- }
- mt = Number(marginTop);
- if (isNaN(mt))
- mt = 0;
- mb = Number(marginBottom);
- if (isNaN(mb))
- mb = 0;
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
- }
- 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;
- }
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
- }
- setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
- maxWidth = Math.max(maxWidth, ml + child.width + mr);
- child.y = yy + mt;
- child.height = hh - mb - child.y;
-
- return true;
- }
-
- private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
- right:Number, mr:Number, pr:Number, w:Number):void
- {
- var widthSet:Boolean = false;
-
- var ww:Number = w;
- var ilc:ILayoutChild = child as ILayoutChild;
- if (!isNaN(left))
- {
- child.x = left + ml;
- ww -= left + ml;
- }
- else
- {
- if (isNaN(right))
- child.x = ml + pl;
- ww -= ml;
- }
- if (!isNaN(right))
- {
- if (!isNaN(left))
- {
- if (ilc)
- ilc.setWidth(ww - right - mr, true);
- else
- {
- child.width = ww - right - mr;
- widthSet = true;
- }
- }
- else
- child.x = w - right - mr - child.width - 1; // some browsers don't like going all the way to the edge
- }
- if (ilc)
- {
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(w * ilc.percentWidth / 100, true);
- }
- if (!widthSet)
- child.dispatchEvent(new Event("sizeChanged"));
- }
-
- public function setDocument(document:Object, id:String = null):void
- {
- this.document = document;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as
deleted file mode 100644
index 39e70ef..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/TileLayout.as
+++ /dev/null
@@ -1,246 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- 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;
-
- /**
- * The TileLayout class bead sizes and positions the elements it manages into rows and columns.
- * The size of each element is determined either by setting TileLayout's columnWidth and rowHeight
- * properties, or having the tile size determined by factoring the numColumns into the area assigned
- * for the layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TileLayout implements IBeadLayout
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TileLayout()
- {
- }
-
- 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 _numColumns:Number = 4;
- private var _columnWidth:Number = Number.NaN;
- private var _rowHeight:Number = Number.NaN;
-
- /**
- * The number of tiles to fit horizontally into the layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get numColumns():Number
- {
- return _numColumns;
- }
- public function set numColumns(value:Number):void
- {
- _numColumns = value;
- }
-
- /**
- * The width of each column, in pixels. If left unspecified, the
- * columnWidth is determined by dividing the numColumns into the
- * strand's bounding box width.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get columnWidth():Number
- {
- return _columnWidth;
- }
- public function set columnWidth(value:Number):void
- {
- _columnWidth = value;
- }
-
- /**
- * The height of each row, in pixels. If left unspecified, the
- * rowHeight is determine by dividing the possible number of rows
- * into the strand's bounding box height.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rowHeight():Number
- {
- return _rowHeight;
- }
- public function set rowHeight(value:Number):void
- {
- _rowHeight = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- COMPILE::AS3
- {
- // this is where the layout is calculated
- var host:UIBase = _strand as UIBase;
- var p:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
- var area:UIBase = p.contentView as UIBase;
-
- var xpos:Number = 0;
- var ypos:Number = 0;
- var useWidth:Number = columnWidth;
- var useHeight:Number = rowHeight;
- var n:Number = area.numElements;
- if (n == 0) return false;
-
- var realN:Number = n;
- for(var j:int=0; j < n; j++)
- {
- var testChild:IUIBase = area.getElementAt(i) as IUIBase;
- if (testChild && !testChild.visible) realN--;
- }
-
- if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
- if (isNaN(useHeight)) {
- // given the width and total number of items, how many rows?
- var numRows:Number = Math.floor(realN/numColumns);
- useHeight = Math.floor(host.height / numRows);
- }
-
- var maxWidth:Number = useWidth;
- var maxHeight:Number = useHeight;
-
- for(var i:int=0; i < n; i++)
- {
- var child:IUIBase = area.getElementAt(i) as IUIBase;
- if (child && !child.visible) continue;
- child.width = useWidth;
- child.height = useHeight;
- child.x = xpos;
- child.y = ypos;
-
- xpos += useWidth;
- maxWidth = Math.max(maxWidth,xpos);
-
- var test:Number = (i+1)%numColumns;
-
- if (test == 0) {
- xpos = 0;
- ypos += useHeight;
- maxHeight = Math.max(maxHeight,ypos);
- }
- }
-
- maxWidth = Math.max(maxWidth, numColumns*useWidth);
- maxHeight = Math.max(maxHeight, numRows*useHeight);
-
- // Only return true if the contentView needs to be larger; that new
- // size is stored in the model.
- var sizeChanged:Boolean = true;
-
- IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") );
-
- return sizeChanged;
- }
- COMPILE::JS
- {
- var children:Array;
- var i:int;
- var n:int;
- var child:UIBase;
- var xpos:Number;
- var ypos:Number;
- var useWidth:Number;
- var useHeight:Number;
-
- var host:UIBase = _strand as UIBase;
- var viewBead:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = viewBead.contentView;
- children = contentView.internalChildren();
- n = children.length;
- if (n === 0) return false;
-
- var realN:int = n;
- for (i = 0; i < n; i++)
- {
- child = children[i].flexjs_wrapper;
- if (!child.visible) realN--;
- }
-
- xpos = 0;
- ypos = 0;
- useWidth = columnWidth;
- useHeight = rowHeight;
-
- if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
- if (isNaN(useHeight)) {
- // given the width and total number of items, how many rows?
- var numRows:Number = Math.floor(realN / numColumns);
- useHeight = Math.floor(host.height / numRows);
- }
-
- for (i = 0; i < n; i++)
- {
- child = children[i].flexjs_wrapper;
- if (!child.visible) continue;
- child.setDisplayStyleForLayout('inline-block');
- child.width = useWidth;
- child.height = useHeight;
- }
- return true;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
deleted file mode 100644
index 612519a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
+++ /dev/null
@@ -1,122 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.html.beads.IScrollBarView;
- import org.apache.flex.html.beads.ScrollBarView;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The VScrollBarLayout class is a layout
- * bead that displays lays out the pieces of a
- * vertical ScrollBar like the thumb, track
- * and arrow buttons.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBarLayout implements IBeadLayout
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBarLayout()
- {
- }
-
- private var sbModel:IScrollBarModel;
- private var sbView:IScrollBarView;
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- sbView = _strand.getBeadByType(IScrollBarView) as IScrollBarView;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- if (!sbModel)
- sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel
-
- var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
-
- var h:Number = DisplayObject(_strand).height + metrics.top + metrics.bottom;
- var increment:DisplayObject = sbView.increment;
- var decrement:DisplayObject = sbView.decrement;
- var track:DisplayObject = sbView.track;
- var thumb:DisplayObject = sbView.thumb;
-
- decrement.x = 0;
- decrement.y = 0;
-
- increment.x = 0;
- increment.y = h - increment.height - 1;
-
- if (track.width < thumb.width)
- track.x = (thumb.width - track.width) / 2;
- else if (track.width > thumb.width)
- thumb.x = (track.width - thumb.width) / 2;
- else
- track.x = 0;
- track.y = decrement.height;
- track.height = increment.y - decrement.height;
- thumb.height = sbModel.pageSize / (sbModel.maximum - sbModel.minimum) * track.height;
- if (track.height > thumb.height)
- {
- thumb.visible = true;
- thumb.y = (sbModel.value / (sbModel.maximum - sbModel.minimum - sbModel.pageSize) * (track.height - thumb.height)) + track.y;
- }
- else
- {
- thumb.visible = false;
- }
-
- return true;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
deleted file mode 100644
index d32777d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
+++ /dev/null
@@ -1,199 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IParent;
- 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.geom.Rectangle;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * ColumnLayout is a class that organizes the positioning of children
- * of a container into a set of columns where each column's width is set to
- * the maximum size of all of the children in that column.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VerticalColumnLayout implements IBeadLayout
- {
- /**
- * constructor
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VerticalColumnLayout()
- {
- }
-
- 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 _numColumns:int;
-
- /**
- * The number of columns.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get numColumns():int
- {
- return _numColumns;
- }
- public function set numColumns(value:int):void
- {
- _numColumns = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var host:UIBase = UIBase(_strand);
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParent = layoutParent.contentView;
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
- var sw:Number = host.width;
- var sh:Number = host.height;
-
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- var e:IUIBase;
- var i:int;
- var col:int = 0;
- var columns:Array = [];
- var rows:Array = [];
- var data:Array = [];
- for (i = 0; i < numColumns; i++)
- columns[i] = 0;
-
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- var ml:Number;
- var mr:Number;
- var mt:Number;
- var mb:Number;
- var n:int = contentView.numElements;
- var rowData:Object = { rowHeight: 0 };
-
- // determine max widths of columns
- for (i = 0; i < n; i++) {
- e = contentView.getElementAt(i) as IUIBase;
- margin = ValuesManager.valuesImpl.getValue(e, "margin");
- marginLeft = ValuesManager.valuesImpl.getValue(e, "margin-left");
- marginTop = ValuesManager.valuesImpl.getValue(e, "margin-top");
- marginRight = ValuesManager.valuesImpl.getValue(e, "margin-right");
- marginBottom = ValuesManager.valuesImpl.getValue(e, "margin-bottom");
- mt = CSSUtils.getTopValue(marginTop, margin, sh);
- mb = CSSUtils.getBottomValue(marginBottom, margin, sh);
- mr = CSSUtils.getRightValue(marginRight, margin, sw);
- ml = CSSUtils.getLeftValue(marginLeft, margin, sw);
- data.push({ mt: mt, mb: mb, mr: mr, ml: ml});
- var thisPrefWidth:int = 0;
- if (e is IStrand)
- {
- var measure:IMeasurementBead = e.getBeadByType(IMeasurementBead) as IMeasurementBead;
- if (measure)
- thisPrefWidth = measure.measuredWidth + ml + mr;
- else
- thisPrefWidth = e.width + ml + mr;
- }
- else
- thisPrefWidth = e.width + ml + mr;
-
- rowData.rowHeight = Math.max(rowData.rowHeight, e.height + mt + mb);
- columns[col] = Math.max(columns[col], thisPrefWidth);
- col = col + 1;
- if (col == numColumns)
- {
- rows.push(rowData);
- rowData = {rowHeight: 0};
- col = 0;
- }
- }
-
- var lastmb:Number = 0;
- var curx:int = padding.left;
- var cury:int = padding.top;
- var maxHeight:int = 0;
- var maxWidth:int = 0;
- col = 0;
- for (i = 0; i < n; i++)
- {
- e = contentView.getElementAt(i) as IUIBase;
- e.x = curx + ml;
- e.y = cury + data[i].mt;
- curx += columns[col++];
- maxHeight = Math.max(maxHeight, e.y + e.height + data[i].mb);
- maxWidth = Math.max(maxWidth, e.x + e.width + data[i].mr);
- if (col == numColumns)
- {
- cury += rows[0].rowHeight;
- rows.shift();
- col = 0;
- curx = padding.left;
- }
- }
- if (!hasWidth && n > 0 && !isNaN(maxWidth))
- {
- UIBase(contentView).setWidth(maxWidth, true);
- }
- if (!hasHeight && n > 0 && !isNaN(maxHeight))
- {
- UIBase(contentView).setHeight(maxHeight, true);
- }
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
deleted file mode 100644
index fe43af4..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VerticalLayout.as
+++ /dev/null
@@ -1,362 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.ValuesManager;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.utils.CSSContainerUtils;
- import org.apache.flex.utils.CSSUtils;
-
- /**
- * The VerticalLayout class is a simple layout
- * bead. It takes the set of children and lays them out
- * vertically in one column, separating them according to
- * CSS layout rules for margin and horizontal-align styles.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VerticalLayout implements IBeadLayout
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VerticalLayout()
- {
- }
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- }
-
- /**
- * Layout children vertically
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
- */
- public function layout():Boolean
- {
- COMPILE::AS3
- {
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
-
- var n:int = contentView.numElements;
- var hasHorizontalFlex:Boolean;
- var hostSizedToContent:Boolean = host.isWidthSizedToContent();
- var flexibleHorizontalMargins:Array = [];
- var ilc:ILayoutChild;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- var maxWidth:Number = 0;
- var cssValue:*;
- // asking for contentView.width can result in infinite loop if host isn't sized already
- var w:Number = hostSizedToContent ? 0 : contentView.width;
- var h:Number = contentView.height;
-
- for (var i:int = 0; i < n; i++)
- {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- ilc = child as ILayoutChild;
- var left:Number = NaN;
- cssValue = ValuesManager.valuesImpl.getValue(child, "left");
- if (cssValue !== undefined)
- left = CSSUtils.toNumber(cssValue);
- var right:Number = NaN;
- cssValue = ValuesManager.valuesImpl.getValue(child, "right");
- if (cssValue !== undefined)
- right = CSSUtils.toNumber(cssValue);
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- 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");
- var ml:Number = CSSUtils.getLeftValue(marginLeft, margin, w);
- var mr:Number = CSSUtils.getRightValue(marginRight, margin, w);
- var mt:Number = CSSUtils.getTopValue(marginTop, margin, h);
- var mb:Number = CSSUtils.getBottomValue(marginBottom, margin, h);
- var lastmb:Number;
- var yy:Number;
- if (i == 0)
- {
- if (ilc)
- ilc.setY(mt + padding.top);
- else
- child.y = mt + padding.top;
- }
- else
- {
- if (ilc)
- ilc.setY(yy + Math.max(mt, lastmb));
- else
- child.y = yy + Math.max(mt, lastmb);
- }
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
- }
- lastmb = mb;
- var marginObject:Object = {};
- flexibleHorizontalMargins[i] = marginObject;
- if (marginLeft == "auto")
- {
- ml = 0;
- marginObject.marginLeft = marginLeft;
- hasHorizontalFlex = true;
- }
- else
- {
- ml = Number(marginLeft);
- if (isNaN(ml))
- {
- ml = 0;
- marginObject.marginLeft = marginLeft;
- }
- else
- marginObject.marginLeft = ml;
- }
- if (marginRight == "auto")
- {
- mr = 0;
- marginObject.marginRight = marginRight;
- hasHorizontalFlex = true;
- }
- else
- {
- mr = Number(marginRight);
- if (isNaN(mr))
- {
- mr = 0;
- marginObject.marginRight = marginRight;
- }
- else
- marginObject.marginRight = mr;
- }
- if (!hostSizedToContent)
- {
- // if host is sized by parent,
- // we can position and size children horizontally now
- setPositionAndWidth(child, left, ml, padding.left,
- right, mr, padding.right, w);
- }
- else
- {
- if (!isNaN(left))
- {
- ml = left;
- marginObject.left = ml;
- }
- if (!isNaN(right))
- {
- mr = right;
- marginObject.right = mr;
- }
- maxWidth = Math.max(maxWidth, ml + child.width + mr);
- }
- yy = child.y + child.height;
- }
- if (hostSizedToContent)
- {
- for (i = 0; i < n; i++)
- {
- child = contentView.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- var obj:Object = flexibleHorizontalMargins[i];
- setPositionAndWidth(child, obj.left, obj.marginLeft, padding.left,
- obj.right, obj.marginRight, padding.right, maxWidth);
- }
- }
- if (hasHorizontalFlex)
- {
- for (i = 0; i < n; i++)
- {
- child = contentView.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- ilc = child as ILayoutChild;
- obj = flexibleHorizontalMargins[i];
- if (hasHorizontalFlex)
- {
- if (ilc)
- {
- if (obj.marginLeft == "auto" && obj.marginRight == "auto")
- ilc.setX(maxWidth - child.width / 2);
- else if (obj.marginLeft == "auto")
- ilc.setX(maxWidth - child.width - obj.marginRight - padding.right);
- }
- else
- {
- if (obj.marginLeft == "auto" && obj.marginRight == "auto")
- child.x = maxWidth - child.width / 2;
- else if (obj.marginLeft == "auto")
- child.x = maxWidth - child.width - obj.marginRight - padding.right;
- }
- }
- }
- }
-
- // Only return true if the contentView needs to be larger; that new
- // size is stored in the model.
- var sizeChanged:Boolean = true;
-
- host.dispatchEvent( new Event("layoutComplete") );
-
- return sizeChanged;
-
- }
- COMPILE::JS
- {
- var children:Array;
- var i:int;
- var n:int;
-
- var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = viewBead.contentView;
- children = contentView.internalChildren();
- var scv:Object = getComputedStyle(host.positioner);
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- var maxWidth:Number = 0;
- n = children.length;
- for (i = 0; i < n; i++)
- {
- var child:WrappedHTMLElement = children[i];
- child.flexjs_wrapper.setDisplayStyleForLayout('block');
- if (child.style.display === 'none')
- {
- child.flexjs_wrapper.setDisplayStyleForLayout('block');
- }
- else
- {
- // block elements don't measure width correctly so set to inline for a second
- child.style.display = 'inline-block';
- maxWidth = Math.max(maxWidth, child.offsetLeft + child.offsetWidth);
- child.style.display = 'block';
- }
- child.flexjs_wrapper.dispatchEvent('sizeChanged');
- }
- if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
- var pl:String = scv['padding-left'];
- var pr:String = scv['padding-right'];
- var npl:int = parseInt(pl.substring(0, pl.length - 2), 10);
- var npr:int = parseInt(pr.substring(0, pr.length - 2), 10);
- maxWidth += npl + npr;
- contentView.width = maxWidth;
- }
- return true;
- }
- }
-
- COMPILE::AS3
- private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
- right:Number, mr:Number, pr:Number, w:Number):void
- {
- var widthSet:Boolean = false;
-
- var ww:Number = w;
- var ilc:ILayoutChild = child as ILayoutChild;
- if (!isNaN(left))
- {
- if (ilc)
- ilc.setX(left + ml);
- else
- child.x = left + ml;
- ww -= left + ml;
- }
- else
- {
- if (ilc)
- ilc.setX(ml + pl);
- else
- child.x = ml + pl;
- ww -= ml + pl;
- }
- if (!isNaN(right))
- {
- if (!isNaN(left))
- {
- if (ilc)
- ilc.setWidth(ww - right - mr, true);
- else
- {
- child.width = ww - right - mr;
- widthSet = true;
- }
- }
- else
- {
- if (ilc)
- ilc.setX(w - right - mr - child.width);
- else
- child.x = w - right - mr - child.width;
- }
- }
- if (ilc)
- {
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(w * ilc.percentWidth / 100, true);
- }
- if (!widthSet)
- child.dispatchEvent(new Event("sizeChanged"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/AlertModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/AlertModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/AlertModel.as
deleted file mode 100644
index caa6215..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/AlertModel.as
+++ /dev/null
@@ -1,288 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The AlertModel class bead implements the org.apache.flex.core.IAlertModel and holds the properties
- * for an org.apache.flex.html.Alert such the buttons to use and message to display.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class AlertModel extends EventDispatcher implements IAlertModel, IBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function AlertModel()
- {
- super();
- }
-
- 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 _title:String;
-
- /**
- * The title for the Alert.
- *
- * @copy org.apache.flex.core.IAlertModel#title
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return _title;
- }
- public function set title(value:String):void
- {
- if( value != _title ) {
- _title = value;
- dispatchEvent( new Event("titleChange") );
- }
- }
-
- private var _htmlTitle:String;
-
- /**
- * The HTML title for the Alert.
- *
- * @copy org.apache.flex.core.IAlertModel#htmlTitle
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlTitle():String
- {
- return _htmlTitle;
- }
- public function set htmlTitle(value:String):void
- {
- if( value != _htmlTitle ) {
- _htmlTitle = value;
- dispatchEvent( new Event("htmlTitleChange") );
- }
- }
-
- private var _message:String;
-
- /**
- * The message to display.
- *
- * @copy org.apache.flex.core.IAlertModel#message
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get message():String
- {
- return _message;
- }
- public function set message(value:String):void
- {
- if( value != _message ) {
- _message = value;
- dispatchEvent( new Event("messageChange") );
- }
- }
-
- private var _htmlMessage:String;
-
- /**
- * The HTML message to display.
- *
- * @copy org.apache.flex.core.IAlertModel#htmlMessage
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get htmlMessage():String
- {
- return _htmlMessage;
- }
- public function set htmlMessage(value:String):void
- {
- if( value != _htmlMessage )
- {
- _htmlMessage = value;
- dispatchEvent( new Event("htmlMessageChange") );
- }
- }
-
- private var _flags:uint;
-
- /**
- * Which buttons to display (see Alert for details).
- *
- * @copy org.apache.flex.core.IAlertModel#flags
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get flags():uint
- {
- return _flags;
- }
- public function set flags(value:uint):void
- {
- if( value != _flags )
- {
- _flags = value;
- dispatchEvent( new Event("flagsChange") );
- }
- }
-
- private var _okLabel:String = "OK";
-
- /**
- * The label to use for the OK button.
- *
- * @copy org.apache.flex.core.IAlertModel#okLabel
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get okLabel():String
- {
- return _okLabel;
- }
- public function set okLabel(value:String):void
- {
- if( value != _okLabel )
- {
- _okLabel = value;
- dispatchEvent( new Event("okLabelChange") );
- }
- }
-
- private var _cancelLabel:String = "Cancel";
-
- /**
- * The label to use for the Cancel button.
- *
- * @copy org.apache.flex.core.IAlertModel#cancelLabel
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get cancelLabel():String
- {
- return _cancelLabel;
- }
- public function set cancelLabel(value:String):void
- {
- if( value != _cancelLabel )
- {
- _cancelLabel = value;
- dispatchEvent( new Event("cancelLabelChange") );
- }
- }
-
- private var _yesLabel:String = "YES";
-
- /**
- * The label to use for the Yes button.
- *
- * @copy org.apache.flex.core.IAlertModel#yesLabel
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get yesLabel():String
- {
- return _yesLabel;
- }
- public function set yesLabel(value:String):void
- {
- if( value != _yesLabel )
- {
- _yesLabel = value;
- dispatchEvent( new Event("yesLabelChange") );
- }
- }
-
- private var _noLabel:String = "NO";
-
- /**
- * The label to use for the NO button.
- *
- * @copy org.apache.flex.core.IAlertModel#noLabel
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get noLabel():String
- {
- return _noLabel;
- }
- public function set noLabel(value:String):void
- {
- if( value != _noLabel )
- {
- _noLabel = value;
- dispatchEvent( new Event("noLabelChange") );
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArrayListSelectionModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
deleted file mode 100644
index 7366677..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
+++ /dev/null
@@ -1,244 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.collections.ArrayList;
- import org.apache.flex.core.IRollOverModel;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The ArrayListSelectionModel class is a selection model for
- * a dataProvider that is an ArrayList. It assumes that items
- * can be fetched from the dataProvider using dataProvider.getItemAt(index).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ArrayListSelectionModel extends EventDispatcher implements ISelectionModel, IRollOverModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ArrayListSelectionModel()
- {
- }
-
- 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 _dataProvider:ArrayList;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#dataProvider
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return _dataProvider;
- }
-
- /**
- * @private
- */
- public function set dataProvider(value:Object):void
- {
- if (value === _dataProvider) return;
-
- _dataProvider = value as ArrayList;
- if (_selectedIndex != -1)
- _selectedItem = (_dataProvider == null || _selectedIndex >= _dataProvider.length) ? null :
- _dataProvider.getItemAt(_selectedIndex);
- dispatchEvent(new Event("dataProviderChanged"));
- }
-
- private var _selectedIndex:int = -1;
- private var _rollOverIndex:int = -1;
- private var _labelField:String = null;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#labelField
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get labelField():String
- {
- return _labelField;
- }
-
- /**
- * @private
- */
- public function set labelField(value:String):void
- {
- if (value != _labelField) {
- _labelField = value;
- dispatchEvent(new Event("labelFieldChanged"));
- }
- }
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return _selectedIndex;
- }
-
- /**
- * @private
- */
- public function set selectedIndex(value:int):void
- {
- if (value === _selectedIndex) return;
-
- _selectedIndex = value;
- _selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length) ? _dataProvider.getItemAt(value) : null;
- dispatchEvent(new Event("selectedIndexChanged"));
- }
-
- /**
- * @copy org.apache.flex.core.IRollOverModel#rollOverIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rollOverIndex():int
- {
- return _rollOverIndex;
- }
-
- /**
- * @private
- */
- public function set rollOverIndex(value:int):void
- {
- if (value != _rollOverIndex) {
- _rollOverIndex = value;
- dispatchEvent(new Event("rollOverIndexChanged"));
- }
- }
-
- private var _selectedItem:Object;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedItem
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return _selectedItem;
- }
-
- /**
- * @private
- */
- public function set selectedItem(value:Object):void
- {
- if (value === _selectedItem) return;
-
- _selectedItem = value;
- var n:int = _dataProvider.length;
- for (var i:int = 0; i < n; i++)
- {
- if (_dataProvider.getItemAt(i) == value)
- {
- _selectedIndex = i;
- break;
- }
- }
- dispatchEvent(new Event("selectedItemChanged"));
- dispatchEvent(new Event("selectedIndexChanged"));
- }
-
- private var _selectedString:String;
-
- /**
- * An alternative to selectedItem for strongly typing the
- * the selectedItem if the Array is an Array of Strings.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedString():String
- {
- return String(_selectedItem);
- }
-
- /**
- * @private
- */
- public function set selectedString(value:String):void
- {
- _selectedString = value;
- var n:int = _dataProvider.length;
- for (var i:int = 0; i < n; i++)
- {
- if (String(_dataProvider.getItemAt(i)) == value)
- {
- _selectedIndex = i;
- break;
- }
- }
- dispatchEvent(new Event("selectedItemChanged"));
- dispatchEvent(new Event("selectedIndexChanged"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
deleted file mode 100644
index a6c0a31..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
+++ /dev/null
@@ -1,243 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IRollOverModel;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The ArraySelectionModel class is a selection model for
- * a dataProvider that is an array. It assumes that items
- * can be fetched from the dataProvider
- * dataProvider[index]. Other selection models
- * would support other kinds of data providers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ArraySelectionModel extends EventDispatcher implements ISelectionModel, IRollOverModel
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ArraySelectionModel()
- {
- }
-
- 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 _dataProvider:Object;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#dataProvider
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return _dataProvider;
- }
-
- /**
- * @private
- */
- public function set dataProvider(value:Object):void
- {
- if (value === _dataProvider) return;
-
- _dataProvider = value;
- if (_selectedIndex != -1)
- _selectedItem = (_dataProvider == null || _selectedIndex >= _dataProvider.length) ? null :
- _dataProvider[_selectedIndex];
- dispatchEvent(new Event("dataProviderChanged"));
- }
-
- private var _selectedIndex:int = -1;
- private var _rollOverIndex:int = -1;
- private var _labelField:String = null;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#labelField
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get labelField():String
- {
- return _labelField;
- }
-
- /**
- * @private
- */
- public function set labelField(value:String):void
- {
- if (value != _labelField) {
- _labelField = value;
- dispatchEvent(new Event("labelFieldChanged"));
- }
- }
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return _selectedIndex;
- }
-
- /**
- * @private
- */
- public function set selectedIndex(value:int):void
- {
- if (value === _selectedIndex) return;
-
- _selectedIndex = value;
- _selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length) ? _dataProvider[value] : null;
- dispatchEvent(new Event("selectedIndexChanged"));
- }
-
- /**
- * @copy org.apache.flex.core.IRollOverModel#rollOverIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rollOverIndex():int
- {
- return _rollOverIndex;
- }
-
- /**
- * @private
- */
- public function set rollOverIndex(value:int):void
- {
- _rollOverIndex = value;
- dispatchEvent(new Event("rollOverIndexChanged"));
- }
-
- private var _selectedItem:Object;
-
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedItem
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return _selectedItem;
- }
-
- /**
- * @private
- */
- public function set selectedItem(value:Object):void
- {
- if (value === _selectedItem) return;
-
- _selectedItem = value;
- var n:int = _dataProvider.length;
- for (var i:int = 0; i < n; i++)
- {
- if (_dataProvider[i] == value)
- {
- _selectedIndex = i;
- break;
- }
- }
- dispatchEvent(new Event("selectedItemChanged"));
- dispatchEvent(new Event("selectedIndexChanged"));
- }
-
- private var _selectedString:String;
-
- /**
- * An alternative to selectedItem for strongly typing the
- * the selectedItem if the Array is an Array of Strings.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedString():String
- {
- return String(_selectedItem);
- }
-
- /**
- * @private
- */
- public function set selectedString(value:String):void
- {
- _selectedString = value;
- var n:int = _dataProvider.length;
- for (var i:int = 0; i < n; i++)
- {
- if (String(_dataProvider[i]) == value)
- {
- _selectedIndex = i;
- break;
- }
- }
- dispatchEvent(new Event("selectedItemChanged"));
- dispatchEvent(new Event("selectedIndexChanged"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ComboBoxModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ComboBoxModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ComboBoxModel.as
deleted file mode 100644
index 35a60a8..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ComboBoxModel.as
+++ /dev/null
@@ -1,100 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IComboBoxModel;
- import org.apache.flex.events.Event;
-
- /**
- * The ComboBoxModel class bead extends org.apache.flex.html.beads.models.ArraySelectionModel
- * and adds the text being displayed by the org.apache.flex.html.ComboBox's input field.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ComboBoxModel extends ArraySelectionModel implements IBead, IComboBoxModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ComboBoxModel()
- {
- }
-
- private var _text:String;
-
- /**
- * The string to display in the org.apache.flex.html.ComboBox input field.
- *
- * @copy org.apache.flex.core.IComboBoxModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return _text;
- }
-
- public function set text(value:String):void
- {
- if (value != _text)
- {
- _text = value;
- dispatchEvent(new Event("textChange"));
- }
- }
-
- private var _html:String;
-
- /**
- * The HTML string to display in the org.apache.flex.html.ComboBox input field.
- *
- * @copy org.apache.flex.core.IComboBoxModel#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return _html;
- }
-
- public function set html(value:String):void
- {
- if (value != _html)
- {
- _html = value;
- dispatchEvent(new Event("htmlChange"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
deleted file mode 100644
index 531edac..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridModel.as
+++ /dev/null
@@ -1,71 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IDataGridModel;
- import org.apache.flex.events.Event;
-
- /**
- * The DataGridModel class bead extends org.apache.flex.html.beads.models.ArrayListSelectionModel
- * to facilitate using an ArrayList as the dataProvider for the DataGrid.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridModel extends ArrayListSelectionModel implements IDataGridModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridModel()
- {
- super();
- }
-
- private var _columns:Array;
-
- /**
- * The array of org.apache.flex.html.supportClasses.DataGridColumns used to
- * define each column of the org.apache.flex.html.DataGrid.
- *
- * @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
- {
- if (_columns != value) {
- _columns = value;
- dispatchEvent( new Event("columnsChanged"));
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
deleted file mode 100644
index 0a00edb..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DataGridPresentationModel.as
+++ /dev/null
@@ -1,88 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IDataGridPresentationModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The DataGridPresentationModel class contains the data to label the columns
- * of the org.apache.flex.html.DataGrid along with the height of the rows.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGridPresentationModel extends ListPresentationModel implements IDataGridPresentationModel
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGridPresentationModel()
- {
- super();
-
- separatorThickness = 1;
- }
-
- private var _columnLabels:Array;
-
- /**
- * The labels for each column.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get columnLabels():Array
- {
- return _columnLabels;
- }
- public function set columnLabels(value:Array):void
- {
- if (value != _columnLabels) {
- _columnLabels = value;
- dispatchEvent(new Event("columnsChanged"));
- }
- }
-
- 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
- */
- override public function set strand(value:IStrand):void
- {
- _strand = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
deleted file mode 100644
index 4b6fc18..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/DateChooserModel.as
+++ /dev/null
@@ -1,189 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.models
-{
- import org.apache.flex.core.IDateChooserModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The DateChooserModel is a bead class that manages the data for a DataChooser.
- * This includes arrays of names for the months and days of the week as well the
- * currently selected date.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DateChooserModel extends EventDispatcher implements IDateChooserModel
- {
- public function DateChooserModel()
- {
- // default displayed year and month to "today"
- var today:Date = new Date();
- displayedYear = today.getFullYear();
- displayedMonth = today.getMonth();
- }
-
- 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 _dayNames:Array = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
- private var _monthNames:Array = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
- private var _displayedYear:Number;
- private var _displayedMonth:Number;
- private var _firstDayOfWeek:Number = 0;
- private var _selectedDate:Date;
-
- /**
- * An array of strings used to name the days of the week with Sunday being the
- * first element of the array.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dayNames():Array
- {
- return _dayNames;
- }
- public function set dayNames(value:Array):void
- {
- _dayNames = value;
- dispatchEvent( new Event("dayNamesChanged") );
- }
-
- /**
- * An array of strings used to name the months of the year with January being
- * the first element of the array.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get monthNames():Array
- {
- return _monthNames;
- }
- public function set monthNames(value:Array):void
- {
- _monthNames = value;
- dispatchEvent( new Event("monthNames") );
- }
-
- /**
- * The year currently displayed by the DateChooser.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get displayedYear():Number
- {
- return _displayedYear;
- }
- public function set displayedYear(value:Number):void
- {
- if (value != _displayedYear) {
- _displayedYear = value;
- dispatchEvent( new Event("displayedYearChanged") );
- }
- }
-
- /**
- * The month currently displayed by the DateChooser.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get displayedMonth():Number
- {
- return _displayedMonth;
- }
- public function set displayedMonth(value:Number):void
- {
- if (_displayedMonth != value) {
- _displayedMonth = value;
- dispatchEvent( new Event("displayedMonthChanged") );
- }
- }
-
- /**
- * The index of the first day of the week, Sunday = 0.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get firstDayOfWeek():Number
- {
- return _firstDayOfWeek;
- }
- public function set firstDayOfWeek(value:Number):void
- {
- if (value != _firstDayOfWeek) {
- _firstDayOfWeek = value;
- dispatchEvent( new Event("firstDayOfWeekChanged") );
- }
- }
-
- /**
- * The currently selected date or null if no date has been selected.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedDate():Date
- {
- return _selectedDate;
- }
- public function set selectedDate(value:Date):void
- {
- if (value != _selectedDate) {
- _selectedDate = value;
- dispatchEvent( new Event("selectedDateChanged") );
-
- displayedMonth = value.getMonth();
- displayedYear = value.getFullYear();
- }
- }
- }
-}
[02/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
new file mode 100644
index 0000000..64a9e43
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.as
@@ -0,0 +1,137 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IItemRenderer;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.TextButton;
+ import org.apache.flex.html.beads.ITextItemRenderer;
+
+ /**
+ * The ButtonBarButtonItemRenderer class handles the display of each item for the
+ * org.apache.flex.html.ButtonBar component. This class uses a
+ * org.apache.flex.html.Button to represent the data.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ButtonBarButtonItemRenderer extends UIItemRendererBase implements ITextItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ButtonBarButtonItemRenderer()
+ {
+ super();
+ }
+
+ private var textButton:TextButton;
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+ }
+
+ /**
+ * @private
+ */
+ private function handleClickEvent(event:Event):void
+ {
+ var parent:Object = itemRendererParent;
+ (parent as UIBase).dispatchEvent(new Event("selected", this));
+ }
+
+ /**
+ * The string version of the data associated with the instance of the itemRenderer.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return data as String;
+ }
+ public function set text(value:String):void
+ {
+ data = value;
+ }
+
+ /**
+ * The data to be displayed by the itemRenderer instance. For ButtonBarItemRenderer, the
+ * data's string version is used as the label for the Button.
+ *
+ * @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 added:Boolean = false;
+ if (textButton == null) {
+ textButton = new TextButton();
+ textButton.addEventListener('click',handleClickEvent);
+ added = true;
+ }
+
+ var valueAsString:String;
+
+ if (value is String) {
+ valueAsString = value as String;
+ }
+ else if (value.hasOwnProperty("label")) {
+ valueAsString = String(value["label"]);
+ }
+ else if (value.hasOwnProperty("title")) {
+ valueAsString = String(value["title"]);
+ }
+
+ if (valueAsString) textButton.text = valueAsString;
+
+ if (added) addElement(textButton);
+ }
+
+ /**
+ * @private
+ */
+ override public function adjustSize():void
+ {
+ textButton.width = this.width;
+ textButton.height = this.height;
+
+ updateRenderer();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ContainerContentArea.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ContainerContentArea.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ContainerContentArea.as
new file mode 100644
index 0000000..bd0c016
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ContainerContentArea.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.supportClasses
+{
+ import org.apache.flex.core.IContentView;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The ContainerContentArea class implements the contentView for
+ * a Container. Container's don't always parent their children directly as
+ * that makes it harder to handle scrolling.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ContainerContentArea extends UIBase implements IContentView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ContainerContentArea()
+ {
+ super();
+ addEventListener("layoutNeeded", forwardEventHandler);
+ }
+
+ private function forwardEventHandler(event:Event):void
+ {
+ if (parent)
+ parent.dispatchEvent(event);
+ }
+
+ /**
+ * @copy org.apache.flex.core.IItemRendererParent#removeAllElements()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function removeAllElements():void
+ {
+ COMPILE::AS3
+ {
+ removeChildren(0);
+ }
+ COMPILE::JS
+ {
+ while (element.hasChildNodes())
+ {
+ element.removeChild(element.lastChild);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumn.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumn.as
new file mode 100644
index 0000000..24e16fd
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGridColumn.as
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IFactory;
+
+ /**
+ * The DataGridColumn class is the collection of properties that describe
+ * a column of the org.apache.flex.html.DataGrid: which renderer
+ * to use for each cell in the column, the width of the column, the label for the
+ * column, and the name of the field in the data containing the value to display
+ * in the column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridColumn
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridColumn()
+ {
+ }
+
+ private var _itemRenderer:IFactory;
+
+ /**
+ * The itemRenderer class or factory to use to make instances of itemRenderers for
+ * display of data.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get itemRenderer():IFactory
+ {
+ return _itemRenderer;
+ }
+ public function set itemRenderer(value:IFactory):void
+ {
+ _itemRenderer = value;
+ }
+
+ private var _columnWidth:Number = Number.NaN;
+
+ /**
+ * The width of the column (default is 100 pixels).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columnWidth():Number
+ {
+ return _columnWidth;
+ }
+ public function set columnWidth(value:Number):void
+ {
+ _columnWidth = value;
+ }
+
+ private var _label:String;
+
+ /**
+ * The label for the column (appears in the header area).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get label():String
+ {
+ return _label;
+ }
+ public function set label(value:String):void
+ {
+ _label = value;
+ }
+
+ private var _dataField:String;
+
+ /**
+ * The name of the field containing the data value presented by the column. This value is used
+ * by the itemRenderer is select the property from the data.
+ *
+ * @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;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as
new file mode 100644
index 0000000..c156a6f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataGroup.as
@@ -0,0 +1,151 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IStrand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+
+ /**
+ * 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 dispatcher:IEventDispatcher = c as IEventDispatcher;
+ dispatcher.addEventListener("itemRendererRollOver", handleRollOver);
+ dispatcher.addEventListener("itemRendererRollOut", handleRollOut);
+ }
+
+ /**
+ * @private
+ */
+ override public function removeElement(c:Object, dispatchEvent:Boolean = true):void
+ {
+ var dispatcher:IEventDispatcher = c as IEventDispatcher;
+ dispatcher.removeEventListener("itemRendererRollOver", handleRollOver);
+ dispatcher.removeEventListener("itemRendererRollOut", handleRollOut);
+
+ super.removeElement(c, dispatchEvent);
+ }
+
+ /**
+ * @private
+ */
+ private function handleRollOver(event:Event):void
+ {
+ var strand:IStrand = parent as IStrand;
+ var rollModel:IRollOverModel = strand.getBeadByType(IRollOverModel) as IRollOverModel;
+ if (rollModel) {
+ var n:int = numElements;
+ for (var i:int=0; i < n; i++) {
+ var renderer:Object = getElementAt(i);
+ if (renderer == event.currentTarget) {
+ rollModel.rollOverIndex = i;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function handleRollOut(event:Event):void
+ {
+ var strand:IStrand = parent as IStrand;
+ var rollModel:IRollOverModel = strand.getBeadByType(IRollOverModel) as IRollOverModel;
+ if (rollModel) {
+ var n:int = numElements;
+ for (var i:int=0; i < n; i++) {
+ var renderer:Object = getElementAt(i);
+ if (renderer == event.currentTarget) {
+ rollModel.rollOverIndex = -1;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * @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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
new file mode 100644
index 0000000..ac15dcf
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DataItemRenderer.as
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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::AS3
+ {
+ import flash.display.Sprite;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ import org.apache.flex.html.beads.controllers.ItemRendererMouseController;
+ }
+
+ /**
+ * 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::AS3
+ private var background:Sprite;
+
+ COMPILE::JS
+ private var controller:ItemRendererMouseController;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ background = new Sprite();
+ addChild(background);
+ }
+
+ /**
+ * @private
+ */
+ override public function updateRenderer():void
+ {
+ COMPILE::AS3
+ {
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DateChooserButton.as
new file mode 100644
index 0000000..2d80b2f
--- /dev/null
+++ b/frameworks/projects/HTML/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/DropDownListList.as
new file mode 100644
index 0000000..6bc1d43
--- /dev/null
+++ b/frameworks/projects/HTML/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
new file mode 100644
index 0000000..4d90c03
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
@@ -0,0 +1,295 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.core.graphics.GraphicsContainer;
+ 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 GraphicsContainer 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 _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
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/HScrollBar.as
new file mode 100644
index 0000000..0b56925
--- /dev/null
+++ b/frameworks/projects/HTML/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollBar.as
new file mode 100644
index 0000000..0bef2e6
--- /dev/null
+++ b/frameworks/projects/HTML/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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/ScrollingViewport.as
new file mode 100644
index 0000000..395fea0
--- /dev/null
+++ b/frameworks/projects/HTML/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::AS3
+ {
+ 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::AS3
+ {
+ 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::AS3
+ private var _verticalScroller:ScrollBar;
+
+ COMPILE::AS3
+ public function get verticalScroller():IViewportScroller
+ {
+ return _verticalScroller;
+ }
+
+ COMPILE::AS3
+ private var _horizontalScroller:ScrollBar
+
+ COMPILE::AS3
+ public function get horizontalScroller():IViewportScroller
+ {
+ return _horizontalScroller;
+ }
+
+ COMPILE::AS3
+ private var _verticalScrollPosition:Number = 0;
+
+ public function get verticalScrollPosition():Number
+ {
+ COMPILE::AS3
+ {
+ return _verticalScrollPosition;
+ }
+ COMPILE::JS
+ {
+ return this.contentView.positioner.scrollTop;
+ }
+ }
+ public function set verticalScrollPosition(value:Number):void
+ {
+ COMPILE::AS3
+ {
+ _verticalScrollPosition = value;
+ handleVerticalScrollChange();
+ }
+ COMPILE::JS
+ {
+ this.contentView.positioner.scrollTop = value;
+ }
+ }
+
+ COMPILE::AS3
+ private var _horizontalScrollPosition:Number = 0;
+
+ public function get horizontalScrollPosition():Number
+ {
+ COMPILE::AS3
+ {
+ return _horizontalScrollPosition;
+ }
+ COMPILE::JS
+ {
+ return this.contentView.positioner.scrollLeft;
+ }
+ }
+ public function set horizontalScrollPosition(value:Number):void
+ {
+ COMPILE::AS3
+ {
+ _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::AS3
+ {
+ 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::AS3
+ 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::AS3
+ 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::AS3
+ 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::AS3
+ 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::AS3
+ private function handleVerticalScrollChange():void
+ {
+ if (_verticalScroller) {
+ ScrollBarModel(_verticalScroller.model).value = verticalScrollPosition;
+ }
+ }
+
+ COMPILE::AS3
+ private function handleHorizontalScrollChange():void
+ {
+ if (_horizontalScroller) {
+ ScrollBarModel(_horizontalScroller.model).value = horizontalScrollPosition;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
new file mode 100644
index 0000000..9568932
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/StringItemRenderer.as
@@ -0,0 +1,183 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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::AS3
+ {
+ 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::AS3
+ {
+ textField = new CSSTextField();
+ textField.type = TextFieldType.DYNAMIC;
+ textField.autoSize = TextFieldAutoSize.LEFT;
+ textField.selectable = false;
+ textField.parentDrawsBackground = true;
+ }
+ }
+
+ COMPILE::AS3
+ public var textField:CSSTextField;
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ addChild(textField);
+
+ adjustSize();
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ 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::AS3
+ {
+ return textField.text;
+ }
+ COMPILE::JS
+ {
+ return this.element.innerHTML;
+ }
+ }
+
+ public function set text(value:String):void
+ {
+ COMPILE::AS3
+ {
+ 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;
+
+ controller = new ItemRendererMouseController();
+ controller.strand = this;
+
+ return element;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
new file mode 100644
index 0000000..a19fc2f
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
@@ -0,0 +1,541 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+ */
+ 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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
new file mode 100644
index 0000000..90c66fa
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/UIItemRendererBase.as
@@ -0,0 +1,282 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 _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/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/VScrollBar.as
new file mode 100644
index 0000000..a72c64c
--- /dev/null
+++ b/frameworks/projects/HTML/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();
+ }
+ }
+}
[19/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderView.as
deleted file mode 100644
index 071dd8d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SliderView.as
+++ /dev/null
@@ -1,179 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Sprite;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IRangeModel;
- 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.Button;
-
- /**
- * The SliderView class creates the visual elements of the org.apache.flex.html.Slider
- * component. The Slider has a track and a thumb control which are also created with view beads.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SliderView extends BeadViewBase implements ISliderView, IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SliderView()
- {
- }
-
- private var rangeModel:IRangeModel;
-
- /**
- * @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;
-
- _track = new Button();
- Button(_track).addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iTrackView")) as IBead);
-
- _thumb = new Button();
- Button(_thumb).addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iThumbView")) as IBead);
-
- UIBase(_strand).addChild(_track);
- UIBase(_strand).addChild(_thumb);
-
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
-
- rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
-
- // listen for changes to the model and adjust the UI accordingly.
- IEventDispatcher(rangeModel).addEventListener("valueChange",modelChangeHandler);
- IEventDispatcher(rangeModel).addEventListener("minimumChange",modelChangeHandler);
- IEventDispatcher(rangeModel).addEventListener("maximumChange",modelChangeHandler);
- IEventDispatcher(rangeModel).addEventListener("stepSizeChange",modelChangeHandler);
- IEventDispatcher(rangeModel).addEventListener("snapIntervalChange",modelChangeHandler);
-
- // set a minimum size to trigger the size change handler
- var needsSizing:Boolean = true;
- if( UIBase(_strand).width < 100 ) {
- UIBase(_strand).width = 100;
- needsSizing = false;
- }
- if( UIBase(_strand).height < 30 ) {
- UIBase(_strand).height = 30;
- needsSizing = false;
- }
-
- if( needsSizing ) sizeChangeHandler(null);
- }
-
- private var _track:DisplayObject;
- private var _thumb:DisplayObject;
-
- /**
- * The track component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get track():DisplayObject
- {
- return _track;
- }
-
- /**
- * The thumb component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get thumb():DisplayObject
- {
- return _thumb;
- }
-
- /**
- * @private
- */
- private function sizeChangeHandler( event:Event ) : void
- {
- var w:Number = UIBase(_strand).width;
- var h:Number = UIBase(_strand).height;
-
- _thumb.width = 20;
- _thumb.height = UIBase(_strand).height;
-
- _thumb.x = 10;
- _thumb.y = 0;
-
- // the track is inset 1/2 of the thumbwidth so the thumb can
- // overlay the track on either end with the thumb center being
- // on the track's edge
- _track.width = UIBase(_strand).width - _thumb.width;
- _track.height = 5;
- _track.x = _thumb.width/2;
- _track.y = (UIBase(_strand).height - _track.height)/2;
- }
-
- /**
- * @private
- */
- private function modelChangeHandler( event:Event ) : void
- {
- setThumbPositionFromValue(rangeModel.value);
- }
-
- /**
- * @private
- */
- private function setThumbPositionFromValue( value:Number ) : void
- {
- var p:Number = (value-rangeModel.minimum)/(rangeModel.maximum-rangeModel.minimum);
- var xloc:Number = p*(UIBase(_strand).width - _thumb.width);
-
- _thumb.x = xloc;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
deleted file mode 100644
index a42a23d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
+++ /dev/null
@@ -1,191 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.Sprite;
- import flash.display.Graphics;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The SolidBackgroundBead class draws a solid filled background.
- * The color and opacity can be specified in CSS.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SolidBackgroundBead implements IBead, IBackgroundBead, IGraphicsDrawing
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SolidBackgroundBead()
- {
- }
-
- private var _strand:IStrand;
-
- private var host:IUIBase;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- if (value is IUIBase)
- host = IUIBase(value);
- else if (value is IBeadView)
- host = IUIBase(IBeadView(value).host);
-
- IEventDispatcher(host).addEventListener("heightChanged", changeHandler);
- IEventDispatcher(host).addEventListener("widthChanged", changeHandler);
- IEventDispatcher(host).addEventListener("sizeChanged", changeHandler);
- IEventDispatcher(host).addEventListener("initComplete", changeHandler);
-
- var bgColor:Object = ValuesManager.valuesImpl.getValue(host, "background-color");
- if( bgColor != null ) {
- backgroundColor = ValuesManager.valuesImpl.convertColor(bgColor);
- }
-
- var bgAlpha:Object = ValuesManager.valuesImpl.getValue(host, "opacity");
- if( bgAlpha != null ) {
- opacity = Number(bgAlpha);
- }
-
- var corner:Object = ValuesManager.valuesImpl.getValue(host, "border-radius");
- if( corner != null ) {
- borderRadius = Number(corner);
- }
-
- changeHandler(null);
- }
-
- private var _backgroundColor:uint;
-
- /**
- * The background color
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get backgroundColor():uint
- {
- return _backgroundColor;
- }
-
- /**
- * @private
- */
- public function set backgroundColor(value:uint):void
- {
- _backgroundColor = value;
- if (_strand)
- changeHandler(null);
- }
-
- private var _opacity:Number = 1.0;
-
- /**
- * The opacity (alpha).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get opacity():Number
- {
- return _opacity;
- }
-
- /**
- * @private
- */
- public function set opacity(value:Number):void
- {
- _opacity = value;
- if( _strand )
- changeHandler(null);
- }
-
- private var _borderRadius:Number;
-
- /**
- * The opacity (alpha).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get borderRadius():Number
- {
- return _borderRadius;
- }
-
- /**
- * @private
- */
- public function set borderRadius(value:Number):void
- {
- _borderRadius = value;
- if( _strand )
- changeHandler(null);
- }
-
- private function changeHandler(event:Event):void
- {
- var g:Graphics = Sprite(host).graphics;
- var w:Number = host.width;
- var h:Number = host.height;
-
- var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
- if( this == gd ) g.clear();
-
- g.beginFill(backgroundColor,opacity);
- if (isNaN(borderRadius))
- g.drawRect(0, 0, w, h);
- else
- g.drawRoundRect(0, 0, w, h, borderRadius * 2);
- g.endFill();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SpinnerView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SpinnerView.as
deleted file mode 100644
index 44d3da8..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SpinnerView.as
+++ /dev/null
@@ -1,135 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IRangeModel;
- 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.Button;
- import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-
- /**
- * The SpinnerView class creates the visual elements of the org.apache.flex.html.Spinner
- * component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SpinnerView extends BeadViewBase implements ISpinnerView, IBeadView
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SpinnerView()
- {
- }
-
- private var rangeModel:IRangeModel;
-
- /**
- * @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;
-
- _increment = new Button();
- Button(_increment).addBead(new UpArrowButtonView());
- Button(_increment).addBead(new ButtonAutoRepeatController());
- _decrement = new Button();
- Button(_decrement).addBead(new DownArrowButtonView());
- Button(_decrement).addBead(new ButtonAutoRepeatController());
-
- Button(_increment).x = 0;
- Button(_increment).y = 0;
- Button(_decrement).x = 0;
- Button(_decrement).y = Button(_increment).height;
-
- UIBase(_strand).addChild(_decrement);
- UIBase(_strand).addChild(_increment);
- rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel;
-
- IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private var _decrement:DisplayObject;
- private var _increment:DisplayObject;
-
- /**
- * The component for decrementing the org.apache.flex.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get decrement():DisplayObject
- {
- return _decrement;
- }
-
- /**
- * The component for incrementing the org.apache.flex.html.Spinner value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get increment():DisplayObject
- {
- return _increment;
- }
-
- /**
- * @private
- */
- private function sizeChangeHandler( event:Event ) : void
- {
- var w:Number = UIBase(_strand).width;
- var h:Number = UIBase(_strand).height / 2;
- _increment.width = w;
- _increment.height = h;
- _increment.y = 0;
- _decrement.width = w;
- _decrement.height = h;
- _decrement.y = h;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
deleted file mode 100644
index ef25539..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
+++ /dev/null
@@ -1,263 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.events.Event;
- import flash.events.IEventDispatcher;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.html.beads.models.ScrollBarModel;
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.html.supportClasses.VScrollBar;
-
- /**
- * The TextAreaView class is the default view for
- * the org.apache.flex.html.TextArea class.
- * It implements the classic desktop-like TextArea with
- * a border and scrollbars. It does not support right-to-left text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextAreaView extends TextFieldViewBase implements IStrand
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextAreaView()
- {
- super();
-
- textField.selectable = true;
- textField.type = TextFieldType.INPUT;
- textField.mouseEnabled = true;
- textField.multiline = true;
- textField.wordWrap = true;
- }
-
- private var _border:Border;
-
- /**
- * The border.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get border():Border
- {
- return _border;
- }
-
- private var _vScrollBar:VScrollBar;
-
- /**
- * The vertical ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get vScrollBar():VScrollBar
- {
- if (!_vScrollBar)
- _vScrollBar = createScrollBar();
- return _vScrollBar;
- }
-
- /**
- * @private
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- for each (var bead:IBead in beads)
- addBead(bead);
-
- // add a border to this
- _border = new Border();
- _border.model = new (ValuesManager.valuesImpl.getValue(value, "iBorderModel")) as IBeadModel;
- _border.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
- IParent(host).addElement(border);
-
- var vb:VScrollBar = vScrollBar;
-
- // Default size
- var ww:Number = DisplayObject(host).width;
- if( isNaN(ww) || ww == 0 ) DisplayObject(host).width = 100;
- var hh:Number = DisplayObject(host).height;
- if( isNaN(hh) || hh == 0 ) DisplayObject(host).height = 42;
-
- // for input, listen for changes to the _textField and update
- // the model
- textField.addEventListener(Event.SCROLL, textScrollHandler);
-
- IEventDispatcher(host).addEventListener("widthChanged", sizeChangedHandler);
- IEventDispatcher(host).addEventListener("heightChanged", sizeChangedHandler);
- sizeChangedHandler(null);
- }
-
- private function createScrollBar():VScrollBar
- {
- var vsb:VScrollBar;
- vsb = new VScrollBar();
- var vsbm:ScrollBarModel = new ScrollBarModel();
- vsbm.maximum = 100;
- vsbm.minimum = 0;
- vsbm.pageSize = 10;
- vsbm.pageStepSize = 10;
- vsbm.snapInterval = 1;
- vsbm.stepSize = 1;
- vsbm.value = 0;
- vsb.model = vsbm;
- IParent(host).addElement(vsb);
-
- vsb.addEventListener("scroll", scrollHandler);
-
- return vsb;
- }
-
- private function textScrollHandler(event:Event):void
- {
- var visibleLines:int = textField.bottomScrollV - textField.scrollV + 1;
- var scrollableLines:int = textField.numLines - visibleLines + 1;
- var vsbm:ScrollBarModel = ScrollBarModel(vScrollBar.model);
- vsbm.minimum = 0;
- vsbm.maximum = textField.numLines+1;
- vsbm.value = textField.scrollV;
- vsbm.pageSize = visibleLines;
- vsbm.pageStepSize = visibleLines;
- }
-
- private function sizeChangedHandler(event:Event):void
- {
- var ww:Number = DisplayObject(host).width;
- if( !isNaN(ww) && ww > 0 )
- _border.width = ww;
-
- ww -= DisplayObject(vScrollBar).width;
- if( !isNaN(ww) && ww > 0 )
- textField.width = ww;
-
- var hh:Number = DisplayObject(host).height;
- if( !isNaN(hh) && hh > 0 )
- {
- textField.height = hh;
- _border.height = hh;
- }
-
- var sb:DisplayObject = DisplayObject(vScrollBar);
- sb.y = 1;
- sb.x = textField.width - 1;
- sb.height = textField.height;
- }
-
- private function scrollHandler(event:Event):void
- {
- var vpos:Number = IScrollBarModel(vScrollBar.model).value;
- textField.scrollV = vpos;
- }
-
- /**
- * @copy org.apache.flex.core.UIBase#beads
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var beads:Array;
-
- private var _beads:Vector.<IBead>;
-
- /**
- * @copy org.apache.flex.core.UIBase#addBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addBead(bead:IBead):void
- {
- if (!_beads)
- _beads = new Vector.<IBead>;
- _beads.push(bead);
- bead.strand = this;
- }
-
- /**
- * @copy org.apache.flex.core.UIBase#getBeadByType()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getBeadByType(classOrInterface:Class):IBead
- {
- for each (var bead:IBead in _beads)
- {
- if (bead is classOrInterface)
- return bead;
- }
- return null;
- }
-
- /**
- * @copy org.apache.flex.core.UIBase#removeBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- 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;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonMeasurementBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonMeasurementBead.as
deleted file mode 100644
index 1341389..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonMeasurementBead.as
+++ /dev/null
@@ -1,86 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
-
- /**
- * The TextButtonMeasurementBead class helps measure a org.apache.flex.html.TextButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextButtonMeasurementBead implements IMeasurementBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextButtonMeasurementBead()
- {
- }
-
- /**
- * The overall width of the org.apache.flex.html.TextButton.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredWidth():Number
- {
- var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
- if( view ) return Math.max(view.upTextField.textWidth,view.downTextField.textWidth,view.overTextField.textWidth);
- else return 0;
- }
-
- /**
- * The overall height of the org.apache.flex.html.TextButton
- */
- public function get measuredHeight():Number
- {
- var view:TextButtonView = _strand.getBeadByType(TextButtonView) as TextButtonView;
- if( view ) return Math.max(view.upTextField.textHeight,view.downTextField.textHeight,view.overTextField.textHeight);
- else return 0;
- }
-
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonView.as
deleted file mode 100644
index b1ab648..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextButtonView.as
+++ /dev/null
@@ -1,217 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The TextButtonView class is the default view for
- * the org.apache.flex.html.TextButton class.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextButtonView()
- {
- upTextField = new CSSTextField();
- downTextField = new CSSTextField();
- overTextField = new CSSTextField();
- upTextField.border = true;
- downTextField.border = true;
- overTextField.border = true;
- upTextField.background = true;
- downTextField.background = true;
- overTextField.background = true;
- upTextField.borderColor = 0;
- downTextField.borderColor = 0;
- overTextField.borderColor = 0;
- upTextField.backgroundColor = 0xCCCCCC;
- downTextField.backgroundColor = 0x808080;
- overTextField.backgroundColor = 0xFFCCCC;
- upTextField.selectable = false;
- upTextField.type = TextFieldType.DYNAMIC;
- downTextField.selectable = false;
- downTextField.type = TextFieldType.DYNAMIC;
- overTextField.selectable = false;
- overTextField.type = TextFieldType.DYNAMIC;
- upTextField.autoSize = "left";
- downTextField.autoSize = "left";
- overTextField.autoSize = "left";
-
- }
-
- private var textModel:ITextModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- textModel = value.getBeadByType(ITextModel) as ITextModel;
- textModel.addEventListener("textChange", textChangeHandler);
- textModel.addEventListener("htmlChange", htmlChangeHandler);
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upTextField;
- SimpleButton(value).downState = downTextField;
- SimpleButton(value).overState = overTextField;
- SimpleButton(value).hitTestState = shape;
- upTextField.styleParent = value;
- downTextField.styleParent = value;
- overTextField.styleParent = value;
- if (textModel.text !== null)
- text = textModel.text;
- if (textModel.html !== null)
- html = textModel.html;
-
- IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private function textChangeHandler(event:Event):void
- {
- text = textModel.text;
- }
-
- private function htmlChangeHandler(event:Event):void
- {
- html = textModel.html;
- }
-
- private function sizeChangeHandler(event:Event):void
- {
- upTextField.width = downTextField.width = overTextField.width = DisplayObject(_strand).width;
- upTextField.height= downTextField.height= overTextField.height= DisplayObject(_strand).height;
- }
-
- /**
- * The CSSTextField in the up state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var upTextField:CSSTextField;
-
- /**
- * The CSSTextField in the down state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var downTextField:CSSTextField;
-
- /**
- * The CSSTextField in the over state
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var overTextField:CSSTextField;
-
- /**
- * @copy org.apache.flex.html.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return upTextField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- upTextField.text = value;
- downTextField.text = value;
- overTextField.text = value;
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upTextField.textWidth, upTextField.textHeight);
- shape.graphics.endFill();
-
- }
-
- /**
- * @copy org.apache.flex.html.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return upTextField.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- upTextField.htmlText = value;
- downTextField.htmlText = value;
- overTextField.htmlText = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
deleted file mode 100644
index ca38a0b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldLabelMeasurementBead.as
+++ /dev/null
@@ -1,92 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IMeasurementBead;
- import org.apache.flex.core.IStrand;
-
- /**
- * The TextFieldLabelMeasurementBead class helps to measure org.apache.flex.html.Label
- * components.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextFieldLabelMeasurementBead implements IMeasurementBead
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextFieldLabelMeasurementBead()
- {
- }
-
- /**
- * The overall width of the org.apache.flex.html.Label.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredWidth():Number
- {
- var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
- if( view ) return view.textField.textWidth;
- else return 0;
- }
-
- /**
- * The overall height of the org.apache.flex.html.Label.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get measuredHeight():Number
- {
- var view:TextFieldView = _strand.getBeadByType(TextFieldView) as TextFieldView;
- if( view ) return view.textField.textHeight;
- else return 0;
- }
-
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldView.as
deleted file mode 100644
index 61b6edb..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldView.as
+++ /dev/null
@@ -1,54 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.text.TextFieldType;
-
- /**
- * The TextFieldView class is the default view for
- * the org.apache.flex.html.Label class.
- * It displays text using a TextField, so there is no
- * right-to-left text support in this view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextFieldView extends TextFieldViewBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextFieldView()
- {
- super();
-
- textField.selectable = false;
- textField.type = TextFieldType.DYNAMIC;
- textField.mouseEnabled = false;
- textField.autoSize = "left";
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
deleted file mode 100644
index 3ab2874..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
+++ /dev/null
@@ -1,404 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.DisplayObjectContainer;
- import flash.text.StyleSheet;
-
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- 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 TextFieldViewBase class is the base class for
- * the components that display text.
- * It displays text using a TextField, so there is no
- * right-to-left text support in this view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextFieldViewBase implements IBeadView, ITextFieldView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextFieldViewBase()
- {
- _textField = new CSSTextField();
- }
-
- private var _textField:CSSTextField;
-
- /**
- * @copy org.apache.flex.core.ITextModel#textField
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get textField() : CSSTextField
- {
- return _textField;
- }
-
- private var _textModel:ITextModel;
-
- protected 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;
- _textModel = value.getBeadByType(ITextModel) as ITextModel;
- _textModel.addEventListener("textChange", textChangeHandler);
- _textModel.addEventListener("htmlChange", htmlChangeHandler);
- IEventDispatcher(_strand).addEventListener("widthChanged", widthChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged", heightChangeHandler);
- IEventDispatcher(_strand).addEventListener("sizeChanged", sizeChangeHandler);
- DisplayObjectContainer(value).addChild(_textField);
- if (_textModel.text !== null)
- text = _textModel.text;
- if (_textModel.html !== null)
- html = _textModel.html;
-
- var ilc:ILayoutChild = host as ILayoutChild;
- autoHeight = ilc.isHeightSizedToContent();
- autoWidth = ilc.isWidthSizedToContent();
- if (!autoWidth && !isNaN(ilc.explicitWidth))
- {
- widthChangeHandler(null);
- }
- if (!autoHeight && !isNaN(ilc.explicitHeight))
- {
- heightChangeHandler(null);
- }
-
- // textfield's collapse to height==4 if no text
- if (autoHeight && _textModel.text === null)
- {
- var fontHeight:Number = ValuesManager.valuesImpl.getValue(_strand, "fontSize") + 4;
- if (textField.height != fontHeight)
- {
- textField.autoSize = "none";
- textField.height = fontHeight;
- }
- }
- }
-
- /**
- * @private
- */
- public function get host() : IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @copy org.apache.flex.core.ITextModel#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return _textField.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- if (value == null)
- value = "";
- _textField.text = value;
- autoSizeIfNeeded();
- }
-
- /**
- * Handle autosizing. The built-in player algorithm
- * doesn't work the way we would like, especially
- * when it collapses Textfields with empty strings.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function autoSizeIfNeeded():void
- {
- var host:UIBase = UIBase(_strand);
- if (autoHeight)
- {
- if (textField.text != "")
- {
- if (textField.height != textField.textHeight + 4)
- {
- textField.height = textField.textHeight + 4;
- inHeightChange = true;
- host.dispatchEvent(new Event("heightChanged"));
- inHeightChange = false;
- }
- }
- else
- {
- var fontHeight:Number = ValuesManager.valuesImpl.getValue(_strand, "fontSize") + 4;
- if (textField.height != fontHeight)
- {
- textField.height = fontHeight;
- inHeightChange = true;
- host.dispatchEvent(new Event("heightChanged"));
- inHeightChange = false;
- }
- }
- }
- if (autoWidth)
- {
- if (textField.width != textField.textWidth + 4)
- {
- textField.width = textField.textWidth + 4;
- inWidthChange = true;
- host.dispatchEvent(new Event("widthChanged"));
- inWidthChange = false;
- }
- }
- }
-
- /**
- * @copy org.apache.flex.core.ITextModel#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- return _textField.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- convertToTextFieldHTML(value);
- autoSizeIfNeeded();
- }
-
- private function convertToTextFieldHTML(input:String):void
- {
- var classCount:int = 0;
- var ss:StyleSheet;
- var c:int = input.indexOf("<span");
- while (c != -1)
- {
- var c1:int = input.indexOf(">", c);
- if (c1 == -1)
- {
- trace("did not parse span correctly");
- return;
- }
- var tag:String = input.substring(c, c1 + 1);
- var c2:int = tag.indexOf("style=");
- if (c2 != -1)
- {
- var quote:String = tag.charAt(c2 + 6);
- var c3:int = tag.indexOf(quote, c2 + 7);
- if (c3 != -1)
- {
- var styles:String = tag.substring(c2 + 7, c3);
- if (!ss)
- ss = new StyleSheet();
- var styleObject:Object = {};
- var list:Array = styles.split(";");
- for each (var pair:String in list)
- {
- var parts:Array = pair.split(":");
- var name:String = parts[0];
- var c4:int = name.indexOf("-");
- if (c4 != -1)
- {
- var firstChar:String = name.charAt(c4 + 1);
- firstChar = firstChar.toUpperCase();
- var tail:String = name.substring(c4 + 2);
- name = name.substring(0, c4) + firstChar + tail;
- }
- styleObject[name] = parts[1];
- }
- var className:String = "css" + classCount++;
- ss.setStyle("." + className, styleObject);
- var newTag:String = "<span class='" + className + "'>";
- input = input.replace(tag, newTag);
- c1 += newTag.length - tag.length;
- }
- }
- c = input.indexOf("<span", c1);
- }
- _textField.styleSheet = ss;
- _textField.htmlText = input;
- }
-
- private function textChangeHandler(event:Event):void
- {
- text = _textModel.text;
- }
-
- private function htmlChangeHandler(event:Event):void
- {
- html = _textModel.html;
- }
-
- /**
- * Whether we are autosizing the height.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var autoHeight:Boolean;
-
- /**
- * Whether we are autosizing the width.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var autoWidth:Boolean;
-
- /**
- * A flag to prevent looping.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var inHeightChange:Boolean = false;
-
- /**
- * A flag to prevent looping.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var inWidthChange:Boolean = false;
-
- /**
- * Determine the width of the TextField.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function widthChangeHandler(event:Event):void
- {
- if (!inWidthChange)
- {
- textField.autoSize = "none";
- autoWidth = false;
- textField.width = host.width;
- if (autoHeight)
- autoSizeIfNeeded()
- else
- textField.height = host.height;
- }
- }
-
- /**
- * Determine the height of the TextField.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function heightChangeHandler(event:Event):void
- {
- if (!inHeightChange)
- {
- textField.autoSize = "none";
- autoHeight = false;
- textField.height = host.height;
- if (autoWidth)
- autoSizeIfNeeded();
- else
- textField.width = host.width;
- }
- }
-
- /**
- * Determine the size of the TextField.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function sizeChangeHandler(event:Event):void
- {
- var ilc:ILayoutChild = host as ILayoutChild;
- autoHeight = ilc.isHeightSizedToContent();
- if (!autoHeight)
- {
- textField.autoSize = "none";
- textField.height = host.height;
- }
-
- autoWidth = ilc.isWidthSizedToContent();
- if (!autoWidth)
- {
- textField.autoSize = "none";
- textField.width = host.width;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
deleted file mode 100644
index a6f1438..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
+++ /dev/null
@@ -1,135 +0,0 @@
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The TextInputView class is the view for
- * the org.apache.flex.html.TextInput in
- * a ComboBox and other controls
- * because it does not display a border.
- * It displays text using a TextField, so there is no
- * right-to-left text support in this view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextInputView extends TextFieldViewBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextInputView()
- {
- super();
-
- textField.selectable = true;
- textField.type = TextFieldType.INPUT;
- textField.mouseEnabled = true;
- textField.multiline = false;
- textField.wordWrap = false;
- }
-
- /**
- * @private
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- autoWidth = autoHeight = false;
-
- var w:Number;
- var h:Number;
- var uiMetrics:Rectangle;
- var ilc:ILayoutChild = host as ILayoutChild;
- if (ilc.isWidthSizedToContent())
- {
- uiMetrics = CSSContainerUtils.getBorderAndPaddingMetrics(host);
- // use default width of 20
- var s:String = textField.text;
- textField.text = "0";
- w = textField.textWidth * 20;
- h = textField.textHeight;
- textField.text = s;
- ilc.setWidth(w + uiMetrics.left + uiMetrics.right, true);
- }
- if (ilc.isHeightSizedToContent())
- {
- if (!uiMetrics)
- uiMetrics = CSSContainerUtils.getBorderAndPaddingMetrics(host);
- if (isNaN(h))
- {
- s = textField.text;
- textField.text = "0";
- h = textField.textHeight;
- textField.text = s;
- }
- ilc.setHeight(h + uiMetrics.top + uiMetrics.bottom, true);
- }
-
- heightChangeHandler(null);
- }
-
- /**
- * @private
- */
- override protected function heightChangeHandler(event:Event):void
- {
- var hh:Number = host.height;
- if( !isNaN(hh) && hh > 0 )
- {
- textField.height = textField.textHeight + 5;
- }
-
- textField.y = ((hh - textField.height) / 2);
- }
-
- /**
- * @private
- */
- override protected function sizeChangeHandler(event:Event):void
- {
- var ww:Number = host.width;
- if( !isNaN(ww) && ww > 0 ) textField.width = ww;
-
- var hh:Number = host.height;
- if( !isNaN(hh) && hh > 0 )
- {
- textField.height = textField.textHeight + 5;
- textField.y = ((hh - textField.height) / 2);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputWithBorderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputWithBorderView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputWithBorderView.as
deleted file mode 100644
index fbab13e..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputWithBorderView.as
+++ /dev/null
@@ -1,100 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The TextInputWithBorderView class is the default view for
- * the org.apache.flex.html.TextInput.
- * It displays text using a TextField, so there is no
- * right-to-left text support in this view.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextInputWithBorderView extends TextInputView
- {
- public function TextInputWithBorderView()
- {
- super();
- textField.parentDrawsBackground = true;
- textField.parentHandlesPadding = true;
- }
-
- /**
- * @private
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBackgroundBead")) as IBead);
- value.addBead(new (ValuesManager.valuesImpl.getValue(value, "iBorderBead")) as IBead);
- }
-
- /**
- * Determine the width of the TextField.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override protected function widthChangeHandler(event:Event):void
- {
- if (!inWidthChange)
- {
- textField.autoSize = "none";
- autoWidth = false;
- var uiMetrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(host);
- textField.width = host.width - uiMetrics.left - uiMetrics.right;
- textField.x = uiMetrics.left;
- }
- }
-
- /**
- * Determine the size of the TextField.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override protected function sizeChangeHandler(event:Event):void
- {
- super.sizeChangeHandler(event);
- widthChangeHandler(event);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
deleted file mode 100644
index f500094..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.as
+++ /dev/null
@@ -1,144 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The TextItemRendererFactoryForArrayData class is the
- * IDataProviderItemRendererMapper for creating
- * ITextItemRenderers and assigning them data from an array.
- * Other IDataProviderItemRendererMapper implementations
- * assign specific array or vector types to item
- * renderers expecting those types.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextItemRendererFactoryForArrayData implements IBead, IDataProviderItemRendererMapper
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextItemRendererFactoryForArrayData()
- {
- }
-
- private var selectionModel:ISelectionModel;
-
- 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;
- selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
- var listView:IListView = value.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- selectionModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
- if (!itemRendererFactory)
- {
- _itemRendererFactory = new (ValuesManager.valuesImpl.getValue(_strand, "iItemRendererClassFactory")) as IItemRendererClassFactory;
- _strand.addBead(_itemRendererFactory);
- }
-
- dataProviderChangeHandler(null);
- }
-
- private var _itemRendererFactory:IItemRendererClassFactory;
-
- /**
- * An IItemRendererClassFactory that should generate ITextItemRenderers
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRendererFactory():IItemRendererClassFactory
- {
- return _itemRendererFactory
- }
-
- /**
- * @private
- */
- public function set itemRendererFactory(value:IItemRendererClassFactory):void
- {
- _itemRendererFactory = value;
- }
-
- /**
- * The IItemRendererParent that should parent the ITextItemRenderers
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- private function dataProviderChangeHandler(event:Event):void
- {
- var dp:Array = selectionModel.dataProvider as Array;
- if (!dp)
- return;
-
- dataGroup.removeAllElements();
-
- var n:int = dp.length;
- for (var i:int = 0; i < n; i++)
- {
- var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
- tf.index = i;
- dataGroup.addElement(tf);
- if (selectionModel.labelField)
- tf.text = dp[i][selectionModel.labelField];
- else
- tf.text = dp[i];
- }
-
- IEventDispatcher(_strand).dispatchEvent(new Event("itemsCreated"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
deleted file mode 100644
index 5c034d9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextItemRendererFactoryForStringVectorData.as
+++ /dev/null
@@ -1,128 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The TextItemRendererFactoryForStringVectorData class is the
- * IDataProviderItemRendererMapper for creating
- * ITextItemRenderers and assigning them data from an vector
- * of Strings. Other IDataProviderItemRendererMapper implementations
- * assign specific array or vector types to item
- * renderers expecting those types.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TextItemRendererFactoryForStringVectorData implements IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TextItemRendererFactoryForStringVectorData()
- {
- }
-
- private var selectionModel:ISelectionModel;
-
- 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;
- selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
- var listView:IListView = value.getBeadByType(IListView) as IListView;
- dataGroup = listView.dataGroup;
- selectionModel.addEventListener("dataProviderChange", dataProviderChangeHandler);
- dataProviderChangeHandler(null);
- }
-
- private var _itemRendererFactory:IItemRendererClassFactory;
-
- /**
- * An IItemRendererClassFactory that should generate ITextItemRenderers
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRendererFactory():IItemRendererClassFactory
- {
- return _itemRendererFactory
- }
-
- /**
- * @private
- */
- public function set itemRendererFactory(value:IItemRendererClassFactory):void
- {
- _itemRendererFactory = value;
- }
-
- /**
- * The IItemRendererParent that should parent the ITextItemRenderers
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var dataGroup:IItemRendererParent;
-
- private function dataProviderChangeHandler(event:Event):void
- {
- var dp:Vector.<String> = selectionModel.dataProvider as Vector.<String>;
-
- dataGroup.removeAllElements();
-
- var n:int = dp.length;
- for (var i:int = 0; i < n; i++)
- {
- var tf:ITextItemRenderer = itemRendererFactory.createItemRenderer(dataGroup) as ITextItemRenderer;
- tf.index = i;
- dataGroup.addElement(tf);
- tf.text = dp[i];
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
deleted file mode 100644
index 8195f70..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarMeasurementBead.as
+++ /dev/null
@@ -1,108 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarView.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarView.mxml b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarView.mxml
deleted file mode 100644
index cebd24b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TitleBarView.mxml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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
--->
-<js:MXMLBeadViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:js="library://ns.apache.org/flexjs/basic">
-
- <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>
- <js:beads>
- <js:MXMLBeadViewBaseDataBinding />
- <js:LayoutChangeNotifier watchedProperty="{titleLabel.text}" />
- </js:beads>
-
- <js:Label id="titleLabel" text="{ITitleBarModel(model).title}" >
- <js:style>
- <js:SimpleCSSStyles fontWeight="inherit" margin="5" />
- </js:style>
- </js:Label>
- <js:CloseButton id="closeButton" click="clickHandler()"
- visible="{ITitleBarModel(model).showCloseButton}"/>
-
-</js:MXMLBeadViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
deleted file mode 100644
index 8e6ff4a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
+++ /dev/null
@@ -1,112 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Graphics;
- import flash.display.Shape;
- import flash.display.SimpleButton;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
-
- /**
- * The UpArrowButtonView class is the view for
- * the up arrow button in a ScrollBar and other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class UpArrowButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function UpArrowButtonView()
- {
- upView = new Shape();
- downView = new Shape();
- overView = new Shape();
-
- drawView(upView.graphics, 0xf8f8f8);
- drawView(downView.graphics, 0xd8d8d8);
- drawView(overView.graphics, 0xe8e8e8);
- }
-
- private function drawView(g:Graphics, bgColor:uint):void
- {
- g.lineStyle(1);
- g.beginFill(bgColor);
- g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
- g.endFill();
- g.lineStyle(0);
- g.beginFill(0);
- g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
- g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.ThreeQuarterSize);
- g.lineTo(ScrollBarView.HalfSize, ScrollBarView.QuarterSize);
- g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.ThreeQuarterSize);
- g.endFill();
- }
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
- shape.graphics.endFill();
- SimpleButton(value).upState = upView;
- SimpleButton(value).downState = downView;
- SimpleButton(value).overState = overView;
- SimpleButton(value).hitTestState = shape;
-
- SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
- SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private var upView:Shape;
- private var downView:Shape;
- private var overView:Shape;
-
- private function sizeChangeHandler(event:Event):void
- {
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
- }
- }
-}
[14/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
deleted file mode 100644
index 4d90c03..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/GraphicsItemRenderer.as
+++ /dev/null
@@ -1,295 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.core.graphics.GraphicsContainer;
- 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 GraphicsContainer 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 _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
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
deleted file mode 100644
index 0b56925..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/HScrollBar.as
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollBar.as
deleted file mode 100644
index 0bef2e6..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollBar.as
+++ /dev/null
@@ -1,50 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
deleted file mode 100644
index 395fea0..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/ScrollingViewport.as
+++ /dev/null
@@ -1,351 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- COMPILE::AS3
- {
- 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::AS3
- {
- 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::AS3
- private var _verticalScroller:ScrollBar;
-
- COMPILE::AS3
- public function get verticalScroller():IViewportScroller
- {
- return _verticalScroller;
- }
-
- COMPILE::AS3
- private var _horizontalScroller:ScrollBar
-
- COMPILE::AS3
- public function get horizontalScroller():IViewportScroller
- {
- return _horizontalScroller;
- }
-
- COMPILE::AS3
- private var _verticalScrollPosition:Number = 0;
-
- public function get verticalScrollPosition():Number
- {
- COMPILE::AS3
- {
- return _verticalScrollPosition;
- }
- COMPILE::JS
- {
- return this.contentView.positioner.scrollTop;
- }
- }
- public function set verticalScrollPosition(value:Number):void
- {
- COMPILE::AS3
- {
- _verticalScrollPosition = value;
- handleVerticalScrollChange();
- }
- COMPILE::JS
- {
- this.contentView.positioner.scrollTop = value;
- }
- }
-
- COMPILE::AS3
- private var _horizontalScrollPosition:Number = 0;
-
- public function get horizontalScrollPosition():Number
- {
- COMPILE::AS3
- {
- return _horizontalScrollPosition;
- }
- COMPILE::JS
- {
- return this.contentView.positioner.scrollLeft;
- }
- }
- public function set horizontalScrollPosition(value:Number):void
- {
- COMPILE::AS3
- {
- _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::AS3
- {
- 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::AS3
- 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::AS3
- 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::AS3
- 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::AS3
- 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::AS3
- private function handleVerticalScrollChange():void
- {
- if (_verticalScroller) {
- ScrollBarModel(_verticalScroller.model).value = verticalScrollPosition;
- }
- }
-
- COMPILE::AS3
- private function handleHorizontalScrollChange():void
- {
- if (_horizontalScroller) {
- ScrollBarModel(_horizontalScroller.model).value = horizontalScrollPosition;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/StringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/StringItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/StringItemRenderer.as
deleted file mode 100644
index 9568932..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/StringItemRenderer.as
+++ /dev/null
@@ -1,183 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- COMPILE::AS3
- {
- 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::AS3
- {
- textField = new CSSTextField();
- textField.type = TextFieldType.DYNAMIC;
- textField.autoSize = TextFieldAutoSize.LEFT;
- textField.selectable = false;
- textField.parentDrawsBackground = true;
- }
- }
-
- COMPILE::AS3
- public var textField:CSSTextField;
-
- /**
- * @private
- */
- COMPILE::AS3
- override public function addedToParent():void
- {
- super.addedToParent();
-
- addChild(textField);
-
- adjustSize();
- }
-
- /**
- * @private
- */
- COMPILE::AS3
- 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::AS3
- {
- return textField.text;
- }
- COMPILE::JS
- {
- return this.element.innerHTML;
- }
- }
-
- public function set text(value:String):void
- {
- COMPILE::AS3
- {
- 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;
-
- controller = new ItemRendererMouseController();
- controller.strand = this;
-
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
deleted file mode 100644
index a19fc2f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
+++ /dev/null
@@ -1,541 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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
- */
- 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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/UIItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/UIItemRendererBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/UIItemRendererBase.as
deleted file mode 100644
index 90c66fa..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/UIItemRendererBase.as
+++ /dev/null
@@ -1,282 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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 _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/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
deleted file mode 100644
index a72c64c..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/VScrollBar.as
+++ /dev/null
@@ -1,49 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.IViewportScroller;
-
- /**
- * The ScrollBar class represents either a vertical or horizontal control
- * that allows the user to quickly scan through a component that does not
- * wholly fit within its container.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBar extends ScrollBar implements IChrome, IViewportScroller
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBar()
- {
- super();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Viewport.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Viewport.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Viewport.as
deleted file mode 100644
index 285282a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/Viewport.as
+++ /dev/null
@@ -1,151 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.supportClasses
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IContentView;
- 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;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.geom.Size;
- import org.apache.flex.html.beads.models.ScrollBarModel;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * A Viewport is the area of a Container set aside for displaying
- * content and any scrolling controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Viewport implements IBead, IViewport
- {
- /**
- * Constructor
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Viewport()
- {
- }
-
- protected var contentArea:UIBase;
-
- /**
- * Get the actual parent of the container's content.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get contentView():IUIBase
- {
- return contentArea;
- }
-
- protected var _strand:IStrand;
-
- /**
- * @flexjsignorecoercion Class
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- contentArea = _strand.getBeadByType(IContentView) as UIBase;
- if (!contentArea)
- {
- var c:Class = ValuesManager.valuesImpl.getValue(_strand, 'iContentView') as Class;
- contentArea = new c() as UIBase;
- }
- }
-
- /**
- * @copy org.apache.flex.core.IViewport#setPosition()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function setPosition(x:Number, y:Number):void
- {
- contentArea.x = x;
- contentArea.y = y;
- }
-
- /**
- * @copy org.apache.flex.core.IViewport#layoutViewportBeforeContentLayout()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function layoutViewportBeforeContentLayout(width:Number, height:Number):void
- {
- if (!isNaN(width))
- contentArea.width = width;
- if (!isNaN(height))
- contentArea.height = height;
- }
-
- /**
- * @copy org.apache.flex.core.IViewport#layoutViewportAfterContentLayout()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function layoutViewportAfterContentLayout():Size
- {
- // pass through all of the children and determine the maxWidth and maxHeight
- // note: this is not done on the JavaScript side because the browser handles
- // this automatically.
- var maxWidth:Number = 0;
- var maxHeight:Number = 0;
- var num:Number = contentArea.numElements;
-
- for (var i:int=0; i < num; i++) {
- var child:IUIBase = contentArea.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- var childXMax:Number = child.x + child.width;
- var childYMax:Number = child.y + child.height;
- maxWidth = Math.max(maxWidth, childXMax);
- maxHeight = Math.max(maxHeight, childYMax);
- }
-
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(this._strand);
- return new Size(maxWidth + padding.right, maxHeight + padding.bottom);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/svg/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/svg/TextButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/svg/TextButton.as
deleted file mode 100644
index 83a2821..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/svg/TextButton.as
+++ /dev/null
@@ -1,30 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.svg
-{
- import org.apache.flex.html.TextButton;
-
- public class TextButton extends org.apache.flex.html.TextButton
- {
- public function TextButton()
- {
- super();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/tests/FlexUnitFlexJSApplication.mxml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/tests/FlexUnitFlexJSApplication.mxml b/frameworks/projects/HTML/as/tests/FlexUnitFlexJSApplication.mxml
deleted file mode 100644
index 06ad1d6..0000000
--- a/frameworks/projects/HTML/as/tests/FlexUnitFlexJSApplication.mxml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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.
-
--->
-
-<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:js="library://ns.apache.org/flexjs/basic"
- applicationComplete="runTests()"
- >
- <fx:Script>
- <![CDATA[
- import flexUnitTests.DataGridColumnTesterTest;
- import flexUnitTests.DataGridColumnTester;
-
- import org.flexunit.listeners.CIListener;
- import org.flexunit.runner.FlexUnitCore;
-
- public function runTests() : void
- {
- var core : FlexUnitCore = new FlexUnitCore();
- core.addListener(new CIListener());
- core.run(DataGridColumnTester);
- }
-
- ]]>
- </fx:Script>
- <js:valuesImpl>
- <js:SimpleValuesImpl />
- </js:valuesImpl>
-
-</js:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/tests/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/tests/build.xml b/frameworks/projects/HTML/as/tests/build.xml
deleted file mode 100644
index fda6c62..0000000
--- a/frameworks/projects/HTML/as/tests/build.xml
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-
-<project name="HTML.test" default="main" basedir=".">
- <property name="FLEXJS_HOME" location="../../../../.."/>
-
- <property file="${FLEXJS_HOME}/env.properties"/>
- <property environment="env"/>
- <property file="${FLEXJS_HOME}/build.properties"/>
- <property name="FLEX_HOME" value="${env.FLEX_HOME}"/>
- <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
-
- <condition property="browser" value="C:/Program Files/Internet Explorer/iexplore.exe">
- <os family="windows"/>
- </condition>
- <condition property="browser" value="/Applications/Safari.app/Contents/MacOS/Safari">
- <os family="mac"/>
- </condition>
-
- <property name="report.dir" value="${basedir}/out" />
-
- <available file="${FLEXJS_HOME}/../flex-flexunit"
- type="dir"
- property="FLEXUNIT_HOME"
- value="${FLEXJS_HOME}/../flex-flexunit" />
-
- <available file="${FLEXJS_HOME}/../flexunit"
- type="dir"
- property="FLEXUNIT_HOME"
- value="${FLEXJS_HOME}/../flexunit" />
-
- <available file="${env.FLEXUNIT_HOME}"
- type="dir"
- property="FLEXUNIT_HOME"
- value="${env.FLEXUNIT_HOME}"/>
-
- <available file="${FLEXUNIT_HOME}/FlexUnit4/target"
- type="dir"
- property="FLEXUNIT_LIBPATH1"
- value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4/target/flexunit-4.3.0-20140410-as3_4.12.0.swc" />
- <property name="FLEXUNIT_LIBPATH1" value="-library-path+=${FLEXUNIT_HOME}/flexunit" />
-
- <available file="${FLEXUNIT_HOME}/FlexUnit4CIListener/target"
- type="dir"
- property="FLEXUNIT_LIBPATH2"
- value="-library-path+=${FLEXUNIT_HOME}/FlexUnit4CIListener/target" />
- <property name="FLEXUNIT_LIBPATH2" value="-define=CONFIG::dummy,false" />
-
- <available file="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target"
- type="dir"
- property="FLEXUNIT_CLASSPATH"
- value="${FLEXUNIT_HOME}/FlexUnit4AntTasks/target" />
- <property name="FLEXUNIT_CLASSPATH" value="${FLEXUNIT_HOME}/flexunit" />
-
- <target name="main" depends="clean,compile,test" description="Clean test of FlexJSUI.swc">
- </target>
-
- <target name="clean">
- <delete failonerror="false">
- <fileset dir="${basedir}">
- <include name="FlexUnitFlexJSApplication.swf"/>
- </fileset>
- </delete>
- </target>
-
- <path id="lib.path">
- <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
- </path>
-
- <target name="compile" description="Compiles FlexUnitApplication.swf">
- <echo message="Compiling FlexUnitFlexJSApplication.swf"/>
- <echo message="FLEX_HOME: ${FLEX_HOME}"/>
- <echo message="FALCON_HOME: ${FALCON_HOME}"/>
- <echo message="FLEXUNIT_HOME: ${FLEXUNIT_HOME}"/>
- <echo message="playerglobal.version: ${playerglobal.version}"/>
-
- <!-- Load the <compc> task. We can't do this at the <project> level -->
- <!-- because targets that run before flexTasks.jar gets built would fail. -->
- <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
- <!--
- Link in the classes (and their dependencies) for the MXML tags
- listed in this project's manifest.xml.
- Also link the additional classes (and their dependencies)
- listed in FlexJSUIClasses.as,
- because these aren't referenced by the manifest classes.
- Keep the standard metadata when compiling.
- Include the appropriate CSS files and assets in the SWC.
- Don't include any resources in the SWC.
- Write a bundle list of referenced resource bundles
- into the file bundles.properties in this directory.
- -->
- <mxmlc fork="true"
- file="${basedir}/FlexUnitFlexJSApplication.mxml"
- output="${basedir}/FlexUnitFlexJSApplication.swf">
- <jvmarg line="${mxmlc.jvm.args}"/>
- <arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
- <arg value="-debug" />
- <arg value="-compiler.mxml.children-as-data" />
- <arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent" />
- <arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent" />
- <arg value="-compiler.binding-value-change-event-type=valueChange" />
- <arg value="+playerglobal.version=${playerglobal.version}" />
- <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
- <arg value="-source-path+=${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
- <arg value="-library-path+=${FLEXJS_HOME}/frameworks/libs" />
- <arg value="${FLEXUNIT_LIBPATH1}" />
- <arg value="${FLEXUNIT_LIBPATH2}" />
- </mxmlc>
- </target>
-
- <target name="test">
- <taskdef resource="flexUnitTasks.tasks">
- <classpath>
- <fileset dir="${FLEXUNIT_CLASSPATH}">
- <include name="flexUnitTasks*.jar" />
- </fileset>
- </classpath>
- </taskdef>
- <mkdir dir="${report.dir}" />
- <flexunit
- swf="${basedir}/FlexUnitFlexJSApplication.swf"
- workingDir="${basedir}"
- toDir="${report.dir}"
- haltonfailure="false"
- verbose="true"
- localTrusted="true"
- timeout="90000">
- <source dir="${FLEXJS_HOME}/frameworks/projects/HTML/as/src" />
- <library dir="${FLEXJS_HOME}/frameworks/libs" />
- </flexunit>
-
- <!-- Generate readable JUnit-style reports -->
- <junitreport todir="${report.dir}">
- <fileset dir="${report.dir}">
- <include name="TEST-*.xml" />
- </fileset>
- <report format="frames" todir="${report.dir}/html" />
- </junitreport>
-
- </target>
-</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTester.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTester.as b/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTester.as
deleted file mode 100644
index e060b1f..0000000
--- a/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTester.as
+++ /dev/null
@@ -1,27 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests
-{
- [Suite]
- [RunWith("org.flexunit.runners.Suite")]
- public class DataGridColumnTester
- {
- public var dataGridColumnTesterTest:DataGridColumnTesterTest;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTesterTest.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTesterTest.as b/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTesterTest.as
deleted file mode 100644
index 1a3cc0f..0000000
--- a/frameworks/projects/HTML/as/tests/flexUnitTests/DataGridColumnTesterTest.as
+++ /dev/null
@@ -1,55 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package flexUnitTests
-{
- import flexunit.framework.Assert;
-
- import org.apache.flex.html.supportClasses.DataGridColumn;
-
- public class DataGridColumnTesterTest
- {
- [Before]
- public function setUp():void
- {
- }
-
- [After]
- public function tearDown():void
- {
- }
-
- [BeforeClass]
- public static function setUpBeforeClass():void
- {
- }
-
- [AfterClass]
- public static function tearDownAfterClass():void
- {
- }
-
- [Test]
- public function testLabelProperty():void
- {
- var column:DataGridColumn = new DataGridColumn();
- column.label = "foo";
- Assert.assertEquals("Error testing DataGridColumn.label", column.label, "foo");
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/basic-as-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-as-manifest.xml b/frameworks/projects/HTML/basic-as-manifest.xml
deleted file mode 100644
index 26b7d42..0000000
--- a/frameworks/projects/HTML/basic-as-manifest.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-
-<componentPackage>
-
- <!-- component id="ListViewNoSelectionState" class="org.apache.flex.html.beads.ListViewNoSelectionState"/ -->
- <!--<component id="MultilineTextFieldView" class="org.apache.flex.html.beads.MultilineTextFieldView"/>-->
-
- <component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer"/>
- <component id="HScrollBar" class="org.apache.flex.html.supportClasses.HScrollBar"/>
- <component id="VScrollBar" class="org.apache.flex.html.supportClasses.VScrollBar"/>
- <!--
- <component id="HRuleView" class="org.apache.flex.html.beads.HRuleView" />
- <component id="VRuleView" class="org.apache.flex.html.beads.VRuleView" />
- -->
- <!--
- <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
- -->
-</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml b/frameworks/projects/HTML/basic-manifest.xml
deleted file mode 100644
index 23dcccc..0000000
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-
-<componentPackage>
-
- <component id="Button" class="org.apache.flex.html.Button"/>
- <component id="CloseButton" class="org.apache.flex.html.CloseButton"/>
- <component id="ButtonBar" class="org.apache.flex.html.ButtonBar"/>
- <component id="DropDownList" class="org.apache.flex.html.DropDownList"/>
- <component id="DropDownListList" class="org.apache.flex.html.supportClasses.DropDownListList"/>
- <component id="Image" class="org.apache.flex.html.Image"/>
- <component id="Label" class="org.apache.flex.html.Label"/>
- <component id="MultilineLabel" class="org.apache.flex.html.MultilineLabel"/>
- <component id="ImageAndTextButton" class="org.apache.flex.html.ImageAndTextButton"/>
- <component id="TextButton" class="org.apache.flex.html.TextButton"/>
- <component id="ToggleTextButton" class="org.apache.flex.html.ToggleTextButton"/>
- <component id="TextInput" class="org.apache.flex.html.TextInput"/>
- <component id="TextArea" class="org.apache.flex.html.TextArea"/>
- <component id="List" class="org.apache.flex.html.List"/>
- <component id="SimpleList" class="org.apache.flex.html.SimpleList"/>
- <component id="CheckBox" class="org.apache.flex.html.CheckBox"/>
- <component id="RadioButton" class="org.apache.flex.html.RadioButton"/>
- <component id="ComboBox" class="org.apache.flex.html.ComboBox"/>
- <component id="Container" class="org.apache.flex.html.Container"/>
- <component id="HContainer" class="org.apache.flex.html.HContainer"/>
- <component id="VContainer" class="org.apache.flex.html.VContainer"/>
- <component id="Panel" class="org.apache.flex.html.Panel"/>
- <component id="PanelView" class="org.apache.flex.html.beads.PanelView"/>
- <component id="PanelWithControlBar" class="org.apache.flex.html.PanelWithControlBar"/>
- <component id="ControlBar" class="org.apache.flex.html.ControlBar"/>
- <component id="TitleBar" class="org.apache.flex.html.TitleBar"/>
- <component id="TitleBarModel" class="org.apache.flex.html.beads.models.TitleBarModel"/>
- <component id="ToolTip" class="org.apache.flex.html.ToolTip"/>
- <component id="BasicLayout" class="org.apache.flex.html.beads.layouts.BasicLayout"/>
- <component id="VerticalLayout" class="org.apache.flex.html.beads.layouts.VerticalLayout"/>
- <component id="HorizontalLayout" class="org.apache.flex.html.beads.layouts.HorizontalLayout"/>
- <component id="TileLayout" class="org.apache.flex.html.beads.layouts.TileLayout"/>
- <component id="ListView" class="org.apache.flex.html.beads.ListView"/>
- <!--<component id="MultilineTextFieldView" class="org.apache.flex.html.beads.MultilineTextFieldView"/>-->
-
- <component id="SimpleAlert" class="org.apache.flex.html.SimpleAlert"/>
- <component id="Alert" class="org.apache.flex.html.Alert"/>
- <component id="Spinner" class="org.apache.flex.html.Spinner"/>
- <component id="Slider" class="org.apache.flex.html.Slider"/>
- <component id="NumericStepper" class="org.apache.flex.html.NumericStepper" />
- <component id="StringItemRenderer" class="org.apache.flex.html.supportClasses.StringItemRenderer"/>
- <component id="DataItemRenderer" class="org.apache.flex.html.supportClasses.DataItemRenderer"/>
- <component id="ButtonBarButtonItemRenderer" class="org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer"/>
- <!--
- <component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer"/>
- <component id="HScrollBar" class="org.apache.flex.html.supportClasses.HScrollBar"/>
- <component id="VScrollBar" class="org.apache.flex.html.supportClasses.VScrollBar"/>
- <component id="HRuleView" class="org.apache.flex.html.beads.HRuleView" />
- <component id="VRuleView" class="org.apache.flex.html.beads.VRuleView" />
- -->
- <component id="NumericOnlyTextInputBead" class="org.apache.flex.html.accessories.NumericOnlyTextInputBead" />
- <component id="PasswordInputBead" class="org.apache.flex.html.accessories.PasswordInputBead" />
- <component id="TextPromptBead" class="org.apache.flex.html.accessories.TextPromptBead" />
- <component id="HRule" class="org.apache.flex.html.HRule" />
- <component id="VRule" class="org.apache.flex.html.VRule" />
- <component id="Spacer" class="org.apache.flex.html.Spacer" />
- <!--
- <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
- -->
- <component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" />
-
- <component id="DataGrid" class="org.apache.flex.html.DataGrid"/>
- <component id="DataProviderChangeNotifier" class="org.apache.flex.html.beads.DataProviderChangeNotifier"/>
- <component id="DataGridColumn" class="org.apache.flex.html.supportClasses.DataGridColumn"/>
- <component id="DataGridLinesBead" class="org.apache.flex.html.beads.DataGridLinesBead"/>
-
- <component id="DateChooser" class="org.apache.flex.html.DateChooser"/>
- <component id="DateField" class="org.apache.flex.html.DateField"/>
- <component id="VerticalColumnLayout" class="org.apache.flex.html.beads.layouts.VerticalColumnLayout" />
-
- <component id="ToolTipBead" class="org.apache.flex.html.accessories.ToolTipBead" />
-
- <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier"/>
- <component id="ImageButton" class="org.apache.flex.html.ImageButton"/>
- <component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout"/>
- <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout"/>
- <component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout"/>
- <component id="MXMLBeadViewBase" class="org.apache.flex.html.MXMLBeadViewBase"/>
-
- <component id="Border" class="org.apache.flex.html.supportClasses.Border"/>
-
-</componentPackage>
[03/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArrayListSelectionModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
new file mode 100644
index 0000000..7366677
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArrayListSelectionModel.as
@@ -0,0 +1,244 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.collections.ArrayList;
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The ArrayListSelectionModel class is a selection model for
+ * a dataProvider that is an ArrayList. It assumes that items
+ * can be fetched from the dataProvider using dataProvider.getItemAt(index).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ArrayListSelectionModel extends EventDispatcher implements ISelectionModel, IRollOverModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ArrayListSelectionModel()
+ {
+ }
+
+ 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 _dataProvider:ArrayList;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#dataProvider
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return _dataProvider;
+ }
+
+ /**
+ * @private
+ */
+ public function set dataProvider(value:Object):void
+ {
+ if (value === _dataProvider) return;
+
+ _dataProvider = value as ArrayList;
+ if (_selectedIndex != -1)
+ _selectedItem = (_dataProvider == null || _selectedIndex >= _dataProvider.length) ? null :
+ _dataProvider.getItemAt(_selectedIndex);
+ dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ private var _selectedIndex:int = -1;
+ private var _rollOverIndex:int = -1;
+ private var _labelField:String = null;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#labelField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return _labelField;
+ }
+
+ /**
+ * @private
+ */
+ public function set labelField(value:String):void
+ {
+ if (value != _labelField) {
+ _labelField = value;
+ dispatchEvent(new Event("labelFieldChanged"));
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return _selectedIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedIndex(value:int):void
+ {
+ if (value === _selectedIndex) return;
+
+ _selectedIndex = value;
+ _selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length) ? _dataProvider.getItemAt(value) : null;
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IRollOverModel#rollOverIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rollOverIndex():int
+ {
+ return _rollOverIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set rollOverIndex(value:int):void
+ {
+ if (value != _rollOverIndex) {
+ _rollOverIndex = value;
+ dispatchEvent(new Event("rollOverIndexChanged"));
+ }
+ }
+
+ private var _selectedItem:Object;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedItem
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return _selectedItem;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedItem(value:Object):void
+ {
+ if (value === _selectedItem) return;
+
+ _selectedItem = value;
+ var n:int = _dataProvider.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (_dataProvider.getItemAt(i) == value)
+ {
+ _selectedIndex = i;
+ break;
+ }
+ }
+ dispatchEvent(new Event("selectedItemChanged"));
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+
+ private var _selectedString:String;
+
+ /**
+ * An alternative to selectedItem for strongly typing the
+ * the selectedItem if the Array is an Array of Strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedString():String
+ {
+ return String(_selectedItem);
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedString(value:String):void
+ {
+ _selectedString = value;
+ var n:int = _dataProvider.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (String(_dataProvider.getItemAt(i)) == value)
+ {
+ _selectedIndex = i;
+ break;
+ }
+ }
+ dispatchEvent(new Event("selectedItemChanged"));
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArraySelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArraySelectionModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArraySelectionModel.as
new file mode 100644
index 0000000..a6c0a31
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ArraySelectionModel.as
@@ -0,0 +1,243 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The ArraySelectionModel class is a selection model for
+ * a dataProvider that is an array. It assumes that items
+ * can be fetched from the dataProvider
+ * dataProvider[index]. Other selection models
+ * would support other kinds of data providers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ArraySelectionModel extends EventDispatcher implements ISelectionModel, IRollOverModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ArraySelectionModel()
+ {
+ }
+
+ 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 _dataProvider:Object;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#dataProvider
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return _dataProvider;
+ }
+
+ /**
+ * @private
+ */
+ public function set dataProvider(value:Object):void
+ {
+ if (value === _dataProvider) return;
+
+ _dataProvider = value;
+ if (_selectedIndex != -1)
+ _selectedItem = (_dataProvider == null || _selectedIndex >= _dataProvider.length) ? null :
+ _dataProvider[_selectedIndex];
+ dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ private var _selectedIndex:int = -1;
+ private var _rollOverIndex:int = -1;
+ private var _labelField:String = null;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#labelField
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return _labelField;
+ }
+
+ /**
+ * @private
+ */
+ public function set labelField(value:String):void
+ {
+ if (value != _labelField) {
+ _labelField = value;
+ dispatchEvent(new Event("labelFieldChanged"));
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return _selectedIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedIndex(value:int):void
+ {
+ if (value === _selectedIndex) return;
+
+ _selectedIndex = value;
+ _selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length) ? _dataProvider[value] : null;
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+
+ /**
+ * @copy org.apache.flex.core.IRollOverModel#rollOverIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rollOverIndex():int
+ {
+ return _rollOverIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set rollOverIndex(value:int):void
+ {
+ _rollOverIndex = value;
+ dispatchEvent(new Event("rollOverIndexChanged"));
+ }
+
+ private var _selectedItem:Object;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedItem
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return _selectedItem;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedItem(value:Object):void
+ {
+ if (value === _selectedItem) return;
+
+ _selectedItem = value;
+ var n:int = _dataProvider.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (_dataProvider[i] == value)
+ {
+ _selectedIndex = i;
+ break;
+ }
+ }
+ dispatchEvent(new Event("selectedItemChanged"));
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+
+ private var _selectedString:String;
+
+ /**
+ * An alternative to selectedItem for strongly typing the
+ * the selectedItem if the Array is an Array of Strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedString():String
+ {
+ return String(_selectedItem);
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedString(value:String):void
+ {
+ _selectedString = value;
+ var n:int = _dataProvider.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (String(_dataProvider[i]) == value)
+ {
+ _selectedIndex = i;
+ break;
+ }
+ }
+ dispatchEvent(new Event("selectedItemChanged"));
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ComboBoxModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ComboBoxModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ComboBoxModel.as
new file mode 100644
index 0000000..35a60a8
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ComboBoxModel.as
@@ -0,0 +1,100 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IComboBoxModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The ComboBoxModel class bead extends org.apache.flex.html.beads.models.ArraySelectionModel
+ * and adds the text being displayed by the org.apache.flex.html.ComboBox's input field.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ComboBoxModel extends ArraySelectionModel implements IBead, IComboBoxModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ComboBoxModel()
+ {
+ }
+
+ private var _text:String;
+
+ /**
+ * The string to display in the org.apache.flex.html.ComboBox input field.
+ *
+ * @copy org.apache.flex.core.IComboBoxModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ if (value != _text)
+ {
+ _text = value;
+ dispatchEvent(new Event("textChange"));
+ }
+ }
+
+ private var _html:String;
+
+ /**
+ * The HTML string to display in the org.apache.flex.html.ComboBox input field.
+ *
+ * @copy org.apache.flex.core.IComboBoxModel#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return _html;
+ }
+
+ public function set html(value:String):void
+ {
+ if (value != _html)
+ {
+ _html = value;
+ dispatchEvent(new Event("htmlChange"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
new file mode 100644
index 0000000..531edac
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridModel.as
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IDataGridModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The DataGridModel class bead extends org.apache.flex.html.beads.models.ArrayListSelectionModel
+ * to facilitate using an ArrayList as the dataProvider for the DataGrid.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridModel extends ArrayListSelectionModel implements IDataGridModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridModel()
+ {
+ super();
+ }
+
+ private var _columns:Array;
+
+ /**
+ * The array of org.apache.flex.html.supportClasses.DataGridColumns used to
+ * define each column of the org.apache.flex.html.DataGrid.
+ *
+ * @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
+ {
+ if (_columns != value) {
+ _columns = value;
+ dispatchEvent( new Event("columnsChanged"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridPresentationModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridPresentationModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridPresentationModel.as
new file mode 100644
index 0000000..0a00edb
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DataGridPresentationModel.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IDataGridPresentationModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The DataGridPresentationModel class contains the data to label the columns
+ * of the org.apache.flex.html.DataGrid along with the height of the rows.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DataGridPresentationModel extends ListPresentationModel implements IDataGridPresentationModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DataGridPresentationModel()
+ {
+ super();
+
+ separatorThickness = 1;
+ }
+
+ private var _columnLabels:Array;
+
+ /**
+ * The labels for each column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columnLabels():Array
+ {
+ return _columnLabels;
+ }
+ public function set columnLabels(value:Array):void
+ {
+ if (value != _columnLabels) {
+ _columnLabels = value;
+ dispatchEvent(new Event("columnsChanged"));
+ }
+ }
+
+ 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
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DateChooserModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DateChooserModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DateChooserModel.as
new file mode 100644
index 0000000..4b6fc18
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/DateChooserModel.as
@@ -0,0 +1,189 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IDateChooserModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The DateChooserModel is a bead class that manages the data for a DataChooser.
+ * This includes arrays of names for the months and days of the week as well the
+ * currently selected date.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DateChooserModel extends EventDispatcher implements IDateChooserModel
+ {
+ public function DateChooserModel()
+ {
+ // default displayed year and month to "today"
+ var today:Date = new Date();
+ displayedYear = today.getFullYear();
+ displayedMonth = today.getMonth();
+ }
+
+ 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 _dayNames:Array = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
+ private var _monthNames:Array = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
+ private var _displayedYear:Number;
+ private var _displayedMonth:Number;
+ private var _firstDayOfWeek:Number = 0;
+ private var _selectedDate:Date;
+
+ /**
+ * An array of strings used to name the days of the week with Sunday being the
+ * first element of the array.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dayNames():Array
+ {
+ return _dayNames;
+ }
+ public function set dayNames(value:Array):void
+ {
+ _dayNames = value;
+ dispatchEvent( new Event("dayNamesChanged") );
+ }
+
+ /**
+ * An array of strings used to name the months of the year with January being
+ * the first element of the array.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get monthNames():Array
+ {
+ return _monthNames;
+ }
+ public function set monthNames(value:Array):void
+ {
+ _monthNames = value;
+ dispatchEvent( new Event("monthNames") );
+ }
+
+ /**
+ * The year currently displayed by the DateChooser.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get displayedYear():Number
+ {
+ return _displayedYear;
+ }
+ public function set displayedYear(value:Number):void
+ {
+ if (value != _displayedYear) {
+ _displayedYear = value;
+ dispatchEvent( new Event("displayedYearChanged") );
+ }
+ }
+
+ /**
+ * The month currently displayed by the DateChooser.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get displayedMonth():Number
+ {
+ return _displayedMonth;
+ }
+ public function set displayedMonth(value:Number):void
+ {
+ if (_displayedMonth != value) {
+ _displayedMonth = value;
+ dispatchEvent( new Event("displayedMonthChanged") );
+ }
+ }
+
+ /**
+ * The index of the first day of the week, Sunday = 0.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get firstDayOfWeek():Number
+ {
+ return _firstDayOfWeek;
+ }
+ public function set firstDayOfWeek(value:Number):void
+ {
+ if (value != _firstDayOfWeek) {
+ _firstDayOfWeek = value;
+ dispatchEvent( new Event("firstDayOfWeekChanged") );
+ }
+ }
+
+ /**
+ * The currently selected date or null if no date has been selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedDate():Date
+ {
+ return _selectedDate;
+ }
+ public function set selectedDate(value:Date):void
+ {
+ if (value != _selectedDate) {
+ _selectedDate = value;
+ dispatchEvent( new Event("selectedDateChanged") );
+
+ displayedMonth = value.getMonth();
+ displayedYear = value.getFullYear();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageAndTextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageAndTextModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageAndTextModel.as
new file mode 100644
index 0000000..01dd3e9
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageAndTextModel.as
@@ -0,0 +1,77 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The ImageAndTextModel class is associates and image
+ * with some text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageAndTextModel extends TextModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageAndTextModel()
+ {
+ }
+
+
+ private var _image:String;
+
+ /**
+ * The URL of an icon to use in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get image():String
+ {
+ return _image;
+ }
+
+ /**
+ * @private
+ */
+ public function set image(value:String):void
+ {
+ _image = value;
+ dispatchEvent(new Event("imageChange"));
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageModel.as
new file mode 100644
index 0000000..7742c2b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ImageModel.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IImageModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The ImageModel class bead defines the data associated with an org.apache.flex.html.Image
+ * component, namely the source of the image.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageModel extends EventDispatcher implements IImageModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageModel()
+ {
+ super();
+ }
+
+ 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 _source:String;
+
+ /**
+ * The source of the image.
+ *
+ * @copy org.apache.flex.core.IImageModel#source
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get source():String
+ {
+ return _source;
+ }
+ public function set source(value:String):void
+ {
+ if (value != _source) {
+ _source = value;
+ dispatchEvent( new Event("urlChanged") );
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ListPresentationModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ListPresentationModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ListPresentationModel.as
new file mode 100644
index 0000000..897d8d6
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ListPresentationModel.as
@@ -0,0 +1,107 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IListPresentationModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The ListPresentationModel holds values used by list controls for presenting
+ * their user interfaces.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ListPresentationModel extends EventDispatcher implements IListPresentationModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ListPresentationModel()
+ {
+ super();
+ }
+
+ private var _rowHeight:Number = 30;
+
+ /**
+ * The height of each row.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rowHeight():Number
+ {
+ return _rowHeight;
+ }
+
+ public function set rowHeight(value:Number):void
+ {
+ _rowHeight = value;
+ dispatchEvent(new Event("rowHeightChanged"));
+ }
+
+ private var _separatorThickness:Number = 0;
+
+ /**
+ * The distance between rows.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get separatorThickness():Number
+ {
+ return _separatorThickness;
+ }
+
+ public function set separatorThickness(value:Number):void
+ {
+ _separatorThickness = value;
+ dispatchEvent(new Event("separatorThicknessChanged"));
+ }
+
+ 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;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/PanelModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/PanelModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/PanelModel.as
new file mode 100644
index 0000000..5741fdd
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/PanelModel.as
@@ -0,0 +1,158 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IPanelModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The PanelModel bead class holds the values for a org.apache.flex.html.Panel, such as its
+ * title.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class PanelModel extends EventDispatcher implements IBead, IPanelModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function PanelModel()
+ {
+ super();
+ }
+
+ 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 _controlBar:Array;
+
+ /**
+ * The items in the org.apache.flex.html.ControlBar. Setting this property automatically
+ * causes the ControlBar to display if you are using a View bead that supports it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get controlBar():Array
+ {
+ return _controlBar;
+ }
+ public function set controlBar(value:Array):void
+ {
+ _controlBar = value;
+ }
+
+ private var _title:String;
+
+ /**
+ * The title string for the org.apache.flex.html.Panel.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#title
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return _title;
+ }
+ public function set title(value:String):void
+ {
+ if( value != _title ) {
+ _title = value;
+ dispatchEvent( new Event('titleChange') );
+ }
+ }
+
+ private var _htmlTitle:String;
+
+ /**
+ * The HTML string for the title.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#htmlTitle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return _htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ if( value != _htmlTitle ) {
+ _htmlTitle = value;
+ dispatchEvent( new Event('htmlTitleChange') );
+ }
+ }
+
+ private var _showCloseButton:Boolean = false;
+
+ /**
+ * Indicates whether or not there is a Close button for the org.apache.flex.html.Panel.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#showCloseButton
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get showCloseButton():Boolean
+ {
+ return _showCloseButton;
+ }
+ public function set showCloseButton(value:Boolean):void
+ {
+ if( value != _showCloseButton ) {
+ _showCloseButton = value;
+ dispatchEvent( new Event('showCloseButtonChange') );
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/RangeModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/RangeModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/RangeModel.as
new file mode 100644
index 0000000..5e46e41
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/RangeModel.as
@@ -0,0 +1,222 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IRangeModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The RangeModel class bead defines a set of for a numeric range of values
+ * which includes a minimum, maximum, and current value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RangeModel extends EventDispatcher implements IBead, IRangeModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RangeModel()
+ {
+ }
+
+ 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 _maximum:Number = 100;
+
+ /**
+ * The maximum value for the range (defaults to 100).
+ *
+ * @copy org.apache.flex.core.IRangeModel#maximum
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maximum():Number
+ {
+ return _maximum;
+ }
+
+ public function set maximum(value:Number):void
+ {
+ if (value != _maximum)
+ {
+ _maximum = value;
+ dispatchEvent(new Event("maximumChange"));
+ }
+ }
+
+ private var _minimum:Number = 0;
+
+ /**
+ * The minimum value for the range (defaults to 0).
+ *
+ * @copy org.apache.flex.core.IRangeModel#minimum
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get minimum():Number
+ {
+ return _minimum;
+ }
+
+ public function set minimum(value:Number):void
+ {
+ if (value != _minimum)
+ {
+ _minimum = value;
+ dispatchEvent(new Event("minimumChange"));
+ }
+ }
+
+ private var _snapInterval:Number = 1;
+
+ /**
+ * The modulus value for the range.
+ *
+ * @copy org.apache.flex.core.IRangeModel#snapInterval
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get snapInterval():Number
+ {
+ return _snapInterval;
+ }
+
+ public function set snapInterval(value:Number):void
+ {
+ if (value != _snapInterval)
+ {
+ _snapInterval = value;
+ dispatchEvent(new Event("snapIntervalChange"));
+ }
+ }
+
+ private var _stepSize:Number = 1;
+
+ /**
+ * The amount to adjust the value either up or down toward the edge of the range.
+ *
+ * @copy org.apache.flex.core.IRangeModel#stepSize
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get stepSize():Number
+ {
+ return _stepSize;
+ }
+
+ public function set stepSize(value:Number):void
+ {
+ if (value != _stepSize)
+ {
+ _stepSize = value;
+ dispatchEvent(new Event("stepSizeChange"));
+ }
+ }
+
+ private var _value:Number = 0;
+
+ /**
+ * The current value of the range, between the minimum and maximum values. Attempting
+ * to set the value outside of the minimum-maximum range changes the value to still be
+ * within the range. Note that the value is adjusted by the stepSize.
+ *
+ * @copy org.apache.flex.core.IRangeModel#value
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Number
+ {
+ return _value;
+ }
+
+ public function set value(newValue:Number):void
+ {
+ if (newValue != _value)
+ {
+ // value must lie within the boundaries of minimum & maximum
+ // and be on a step interval, so the value is adjusted to
+ // what is coming in.
+ newValue = Math.max(minimum, newValue - stepSize);
+ newValue = Math.min(maximum, newValue + stepSize);
+ _value = snap(newValue);
+ dispatchEvent(new Event("valueChange"));
+ }
+ }
+
+ /**
+ * @private
+ */
+ protected function snap(value:Number):Number
+ {
+ var si:Number = snapInterval;
+ var n:Number = Math.round((value - minimum) / si) * si + minimum;
+ if (value > 0)
+ {
+ if (value - n < n + si - value)
+ return n;
+ return n + si;
+
+ }
+ if (value - n > n + si - value)
+ return n + si;
+ return n;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ScrollBarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ScrollBarModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ScrollBarModel.as
new file mode 100644
index 0000000..582df91
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ScrollBarModel.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The ScrollBarModel class bead extends the org.apache.flex.html.beads.models.RangeModel
+ * and adds page size and page step sizes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ScrollBarModel extends RangeModel implements IScrollBarModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ScrollBarModel()
+ {
+ }
+
+ private var _pageSize:Number;
+
+ /**
+ * The amount represented by the thumb control of the org.apache.flex.html.ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get pageSize():Number
+ {
+ return _pageSize;
+ }
+
+ public function set pageSize(value:Number):void
+ {
+ if (value != _pageSize)
+ {
+ _pageSize = value;
+ dispatchEvent(new Event("pageSizeChange"));
+ }
+ }
+
+ private var _pageStepSize:Number;
+
+ /**
+ * The amount to adjust the org.apache.flex.html.ScrollBar if the scroll bar's
+ * track area is selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get pageStepSize():Number
+ {
+ return _pageStepSize;
+ }
+
+ public function set pageStepSize(value:Number):void
+ {
+ if (value != _pageStepSize)
+ {
+ _pageStepSize = value;
+ dispatchEvent(new Event("pageStepSizeChange"));
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/SingleLineBorderModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/SingleLineBorderModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/SingleLineBorderModel.as
new file mode 100644
index 0000000..99c3a0d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/SingleLineBorderModel.as
@@ -0,0 +1,85 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import flash.geom.Rectangle;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBorderModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The SingleLineBorderModel class is a data model for
+ * a single line border. This model is very simple,
+ * it only stores the offsets from the edges of the
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class SingleLineBorderModel extends EventDispatcher implements IBead, IBorderModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function SingleLineBorderModel()
+ {
+ }
+
+ 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;
+ }
+
+ static private var rect:Rectangle = new Rectangle(1, 1, 1, 1);
+
+ /**
+ * The offsets of the border from the edges of the
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get offsets():Rectangle
+ {
+ return rect;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/StringSelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/StringSelectionModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/StringSelectionModel.as
new file mode 100644
index 0000000..be3d7c8
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/StringSelectionModel.as
@@ -0,0 +1,221 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The StringSelectionModel class is a selection model for
+ * selecting a single string from a vector of strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class StringSelectionModel extends EventDispatcher implements ISelectionModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function StringSelectionModel()
+ {
+ }
+
+ 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 _strings:Vector.<String>;
+
+ /**
+ * The vector of strings. This is the same
+ * as the dataProvider property but is
+ * strongly typed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get strings():Vector.<String>
+ {
+ return _strings;
+ }
+
+ /**
+ * @private
+ */
+ public function set strings(value:Vector.<String>):void
+ {
+ _strings = value;
+ dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ /**
+ * The dataProvider, which is a
+ * Vector.<String>.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataProvider():Object
+ {
+ return _strings;
+ }
+
+ /**
+ * @private
+ */
+ public function set dataProvider(value:Object):void
+ {
+ _strings = value as Vector.<String>;
+ dispatchEvent(new Event("dataProviderChanged"));
+ }
+
+ private var _selectedIndex:int = -1;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedIndex
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedIndex():int
+ {
+ return _selectedIndex;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedIndex(value:int):void
+ {
+ _selectedIndex = value;
+ _selectedString = (value == -1) ? null : (value < _strings.length) ? _strings[value] : null;
+ dispatchEvent(new Event("selectedIndexChanged"));
+ }
+ private var _selectedString:String;
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#selectedItem
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedItem():Object
+ {
+ return _selectedString;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedItem(value:Object):void
+ {
+ selectedString = String(value);
+ }
+
+ /**
+ * The selected string. This is the same as the
+ * selectedItem, but is strongly-typed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedString():String
+ {
+ return _selectedString;
+ }
+
+ /**
+ * @private
+ */
+ public function set selectedString(value:String):void
+ {
+ _selectedString = value;
+ var n:int = _strings.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (_strings[i] == value)
+ {
+ _selectedIndex = i;
+ break;
+ }
+ }
+ dispatchEvent(new Event("selectedItemChanged"));
+ }
+
+
+ private var _labelField:String;
+
+ /**
+ * The labelField, which is not used in this
+ * implementation.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get labelField():String
+ {
+ return _labelField;
+ }
+
+ /**
+ * @private
+ */
+ public function set labelField(value:String):void
+ {
+ if (value != _labelField) {
+ _labelField = value;
+ dispatchEvent(new Event("labelFieldChanged"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TextModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TextModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TextModel.as
new file mode 100644
index 0000000..eaf2cf4
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TextModel.as
@@ -0,0 +1,125 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The TextModel class is most basic data model for a
+ * component that displays text. All FlexJS components
+ * that display text should also support HTML, although
+ * the Flash Player implementations may only support
+ * a subset of HTML.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TextModel extends EventDispatcher implements IBead, ITextModel
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TextModel()
+ {
+ }
+
+ 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 _text:String;
+
+ /**
+ * @copy org.apache.flex.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ if (value == null)
+ value = "";
+ if (value != _text)
+ {
+ _text = value;
+ dispatchEvent(new Event("textChange"));
+ }
+ }
+
+ private var _html:String;
+
+ /**
+ * @copy org.apache.flex.core.ITextModel#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return _html;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ if (value != _html)
+ {
+ _html = value;
+ dispatchEvent(new Event("htmlChange"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TitleBarModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TitleBarModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TitleBarModel.as
new file mode 100644
index 0000000..d9f6ff2
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/TitleBarModel.as
@@ -0,0 +1,136 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITitleBarModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The TitleBarModel class bead holds the values for the org.apache.flex.html.TitleBar's
+ * properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TitleBarModel extends EventDispatcher implements IBead, ITitleBarModel
+ {
+ public function TitleBarModel()
+ {
+ super();
+ }
+
+ 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 _title:String;
+
+ [Bindable("titleChange")]
+ /**
+ * The string title for the org.apache.flex.html.TitleBar.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#title
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return _title;
+ }
+
+ public function set title(value:String):void
+ {
+ if( value != _title ) {
+ _title = value;
+ dispatchEvent( new Event('titleChange') );
+ }
+ }
+
+ private var _htmlTitle:String;
+
+ [Bindable("htmlTitleChange")]
+ /**
+ * The HTML string for the title.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#htmlTitle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return _htmlTitle;
+ }
+
+ public function set htmlTitle(value:String):void
+ {
+ if( value != _htmlTitle ) {
+ _htmlTitle = value;
+ dispatchEvent( new Event('htmlTitleChange') );
+ }
+ }
+
+ private var _showCloseButton:Boolean = false;
+
+ [Bindable("showCloseButtonChange")]
+ /**
+ * Whether or not to show a close button.
+ *
+ * @copy org.apache.flex.core.ITitleBarModel#showCloseButton
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get showCloseButton():Boolean
+ {
+ return _showCloseButton;
+ }
+
+ public function set showCloseButton(value:Boolean):void
+ {
+ if( value != _showCloseButton ) {
+ _showCloseButton = value;
+ dispatchEvent( new Event('showCloseButtonChange') );
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ToggleButtonModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ToggleButtonModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ToggleButtonModel.as
new file mode 100644
index 0000000..a4c1a91
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ToggleButtonModel.as
@@ -0,0 +1,145 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The ToggleButtonModel class bead holds values for org.apache.flex.html.Buttons
+ * that have a state.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ToggleButtonModel extends EventDispatcher implements IBead, IToggleButtonModel, ITextModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ToggleButtonModel()
+ {
+ super();
+ }
+
+ 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 _text:String;
+
+ /**
+ * The text string for the org.apache.flex.html.Button's label.
+ *
+ * @copy org.apache.flex.core.IToggleButtonModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return _text;
+ }
+
+ public function set text(value:String):void
+ {
+ if (value != _text)
+ {
+ _text = value;
+ dispatchEvent(new Event("textChange"));
+ }
+ }
+
+ private var _html:String;
+
+ /**
+ * The HTML string for the Button's label.
+ *
+ * @copy org.apache.flex.core.IToggleButtonModel#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return _html;
+ }
+
+ public function set html(value:String):void
+ {
+ if( value != html )
+ {
+ _html = value;
+ dispatchEvent(new Event("htmlChange"));
+ }
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * Whether or not the org.apache.flex.html.Button is selected.
+ *
+ * @copy org.apache.flex.core.IToggleButtonModel#selected
+ *
+ * @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
+ {
+ if( value != _selected )
+ {
+ _selected = value;
+ dispatchEvent(new Event("selectedChange"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ValueToggleButtonModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
new file mode 100644
index 0000000..27b0a95
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ValueToggleButtonModel.as
@@ -0,0 +1,123 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+
+ import org.apache.flex.core.IValueToggleButtonModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The ValueToggleButtonModel class bead extends the
+ * org.apache.flex.html.beads.models.ToggleButtonModel and adds
+ * value intended to represent a collection of similar org.apache.flex.html.Buttons
+ * such as org.apache.flex.html.RadioButtons.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ValueToggleButtonModel extends ToggleButtonModel implements IValueToggleButtonModel
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ValueToggleButtonModel()
+ {
+ super();
+ }
+
+ private var _value:Object;
+
+ /**
+ * The current value of the button collection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get value():Object
+ {
+ return _value;
+ }
+
+ public function set value(newValue:Object):void
+ {
+ if( newValue != _value )
+ {
+ _value = newValue;
+ dispatchEvent(new Event("valueChange"));
+ }
+ }
+
+ private var _groupName:String;
+
+ /**
+ * The name of the collection has shared by all of the buttons in the collection.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get groupName():String
+ {
+ return _groupName;
+ }
+
+ public function set groupName(value:String):void
+ {
+ if( value != _groupName )
+ {
+ _groupName = value;
+ dispatchEvent(new Event("groupNameChange"));
+ }
+ }
+
+ private var _selectedValue:Object;
+
+ /**
+ * The value that is currently selected.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selectedValue():Object
+ {
+ return _selectedValue;
+ }
+
+ public function set selectedValue(newValue:Object):void
+ {
+ if( _selectedValue != newValue )
+ {
+ _selectedValue = newValue;
+ dispatchEvent(new Event("selectedValueChange"));
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ViewportModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ViewportModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ViewportModel.as
new file mode 100644
index 0000000..c15c5d8
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/ViewportModel.as
@@ -0,0 +1,72 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IViewportModel;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+
+ /**
+ * @copy org.apache.flex.core.IViewportModel
+ */
+ public class ViewportModel extends EventDispatcher implements IViewportModel
+ {
+ public function ViewportModel()
+ {
+ super();
+ }
+
+ private var _borderMetrics:Rectangle;
+ private var _chromeMetrics:Rectangle;
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IViewportModel
+ */
+ public function get borderMetrics():Rectangle
+ {
+ return _borderMetrics;
+ }
+ public function set borderMetrics(value:Rectangle):void
+ {
+ _borderMetrics = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IViewportModel
+ */
+ public function get chromeMetrics():Rectangle
+ {
+ return _chromeMetrics;
+ }
+ public function set chromeMetrics(value:Rectangle):void
+ {
+ _chromeMetrics = value;
+ }
+
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Border.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Border.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Border.as
new file mode 100644
index 0000000..f7277d0
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/supportClasses/Border.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.UIBase;
+
+ /**
+ * The Border class is a class used internally by many
+ * controls to draw a border. The border actually drawn
+ * is dictated by the IBeadView in the CSS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class Border extends UIBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function Border()
+ {
+ super();
+ }
+
+ }
+}
[26/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
rename/refactor folders to be more maven-friendly
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7853ef15
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7853ef15
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7853ef15
Branch: refs/heads/mavenfolders
Commit: 7853ef156028d651fbd3728a114d5718d916cdb3
Parents: 9282af8
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 11 13:40:59 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 11 13:40:59 2016 -0800
----------------------------------------------------------------------
frameworks/projects/HTML/as/defaults.css | 623 -------------------
frameworks/projects/HTML/as/src/HTMLClasses.as | 176 ------
.../apache/flex/core/IScrollingLayoutParent.as | 68 --
.../HTML/as/src/org/apache/flex/html/Alert.as | 287 ---------
.../HTML/as/src/org/apache/flex/html/Button.as | 112 ----
.../as/src/org/apache/flex/html/ButtonBar.as | 76 ---
.../as/src/org/apache/flex/html/CheckBox.as | 180 ------
.../as/src/org/apache/flex/html/CloseButton.as | 66 --
.../as/src/org/apache/flex/html/ComboBox.as | 277 ---------
.../as/src/org/apache/flex/html/Container.as | 108 ----
.../as/src/org/apache/flex/html/ControlBar.as | 99 ---
.../as/src/org/apache/flex/html/DataGrid.as | 164 -----
.../as/src/org/apache/flex/html/DateChooser.as | 74 ---
.../as/src/org/apache/flex/html/DateField.as | 95 ---
.../as/src/org/apache/flex/html/DropDownList.as | 235 -------
.../as/src/org/apache/flex/html/HContainer.as | 61 --
.../HTML/as/src/org/apache/flex/html/HRule.as | 63 --
.../HTML/as/src/org/apache/flex/html/Image.as | 99 ---
.../org/apache/flex/html/ImageAndTextButton.as | 128 ----
.../as/src/org/apache/flex/html/ImageButton.as | 89 ---
.../HTML/as/src/org/apache/flex/html/Label.as | 163 -----
.../HTML/as/src/org/apache/flex/html/List.as | 311 ---------
.../org/apache/flex/html/MXMLBeadViewBase.as | 317 ----------
.../src/org/apache/flex/html/MultilineLabel.as | 76 ---
.../src/org/apache/flex/html/NumericStepper.as | 214 -------
.../HTML/as/src/org/apache/flex/html/Panel.as | 121 ----
.../org/apache/flex/html/PanelWithControlBar.as | 121 ----
.../as/src/org/apache/flex/html/RadioButton.as | 347 -----------
.../as/src/org/apache/flex/html/SimpleAlert.as | 140 -----
.../as/src/org/apache/flex/html/SimpleList.as | 79 ---
.../HTML/as/src/org/apache/flex/html/Slider.as | 233 -------
.../HTML/as/src/org/apache/flex/html/Spacer.as | 64 --
.../HTML/as/src/org/apache/flex/html/Spinner.as | 187 ------
.../as/src/org/apache/flex/html/TextArea.as | 126 ----
.../as/src/org/apache/flex/html/TextButton.as | 120 ----
.../as/src/org/apache/flex/html/TextInput.as | 185 ------
.../as/src/org/apache/flex/html/TitleBar.as | 146 -----
.../org/apache/flex/html/ToggleTextButton.as | 170 -----
.../HTML/as/src/org/apache/flex/html/ToolTip.as | 60 --
.../as/src/org/apache/flex/html/VContainer.as | 62 --
.../HTML/as/src/org/apache/flex/html/VRule.as | 68 --
.../accessories/NumericOnlyTextInputBead.as | 199 ------
.../flex/html/accessories/PasswordInputBead.as | 102 ---
.../flex/html/accessories/TextPromptBead.as | 148 -----
.../apache/flex/html/accessories/ToolTipBead.as | 141 -----
.../flex/html/beads/AlertMeasurementBead.as | 88 ---
.../src/org/apache/flex/html/beads/AlertView.as | 226 -------
.../flex/html/beads/BackgroundImageBead.as | 112 ----
.../org/apache/flex/html/beads/ButtonBarView.as | 69 --
.../org/apache/flex/html/beads/CSSButtonView.as | 167 -----
.../html/beads/CSSImageAndTextButtonView.as | 367 -----------
.../apache/flex/html/beads/CSSTextButtonView.as | 347 -----------
.../flex/html/beads/CSSTextToggleButtonView.as | 105 ----
.../org/apache/flex/html/beads/CheckBoxView.as | 296 ---------
.../apache/flex/html/beads/CloseButtonView.as | 101 ---
.../org/apache/flex/html/beads/ComboBoxView.as | 247 --------
.../org/apache/flex/html/beads/ContainerView.as | 553 ----------------
.../html/beads/ControlBarMeasurementBead.as | 116 ----
.../flex/html/beads/DataGridColumnView.as | 101 ---
.../apache/flex/html/beads/DataGridLinesBead.as | 199 ------
.../org/apache/flex/html/beads/DataGridView.as | 294 ---------
.../DataItemRendererFactoryForArrayData.as | 161 -----
.../DataItemRendererFactoryForArrayList.as | 174 ------
.../DataItemRendererFactoryForColumnData.as | 142 -----
.../html/beads/DataProviderChangeNotifier.as | 154 -----
.../apache/flex/html/beads/DateChooserView.as | 256 --------
.../org/apache/flex/html/beads/DateFieldView.as | 192 ------
.../flex/html/beads/DownArrowButtonView.as | 111 ----
.../apache/flex/html/beads/DropDownListView.as | 300 ---------
.../src/org/apache/flex/html/beads/HRuleView.as | 87 ---
.../flex/html/beads/HScrollBarThumbView.as | 120 ----
.../flex/html/beads/HScrollBarTrackView.as | 118 ----
.../apache/flex/html/beads/HScrollBarView.as | 99 ---
.../apache/flex/html/beads/IBackgroundBead.as | 35 --
.../org/apache/flex/html/beads/IBorderBead.as | 35 --
.../org/apache/flex/html/beads/IComboBoxView.as | 78 ---
.../org/apache/flex/html/beads/IDataGridView.as | 36 --
.../apache/flex/html/beads/IDropDownListView.as | 57 --
.../apache/flex/html/beads/IGraphicsDrawing.as | 36 --
.../src/org/apache/flex/html/beads/IListView.as | 48 --
.../apache/flex/html/beads/IScrollBarView.as | 80 ---
.../org/apache/flex/html/beads/ISliderView.as | 60 --
.../org/apache/flex/html/beads/ISpinnerView.as | 61 --
.../apache/flex/html/beads/ITextFieldView.as | 44 --
.../apache/flex/html/beads/ITextItemRenderer.as | 45 --
.../flex/html/beads/ImageAndTextButtonView.as | 276 --------
.../apache/flex/html/beads/ImageButtonView.as | 158 -----
.../src/org/apache/flex/html/beads/ImageView.as | 223 -------
.../flex/html/beads/LeftArrowButtonView.as | 112 ----
.../src/org/apache/flex/html/beads/ListView.as | 210 -------
.../flex/html/beads/MultilineTextFieldView.as | 56 --
.../flex/html/beads/NumericStepperView.as | 186 ------
.../src/org/apache/flex/html/beads/PanelView.as | 168 -----
.../flex/html/beads/PanelWithControlBarView.as | 207 ------
.../apache/flex/html/beads/RadioButtonView.as | 281 ---------
.../flex/html/beads/RightArrowButtonView.as | 112 ----
.../org/apache/flex/html/beads/ScrollBarView.as | 216 -------
.../apache/flex/html/beads/SimpleAlertView.as | 149 -----
.../flex/html/beads/SingleLineBorderBead.as | 91 ---
.../apache/flex/html/beads/SliderThumbView.as | 156 -----
.../apache/flex/html/beads/SliderTrackView.as | 153 -----
.../org/apache/flex/html/beads/SliderView.as | 179 ------
.../flex/html/beads/SolidBackgroundBead.as | 191 ------
.../org/apache/flex/html/beads/SpinnerView.as | 135 ----
.../org/apache/flex/html/beads/TextAreaView.as | 263 --------
.../html/beads/TextButtonMeasurementBead.as | 86 ---
.../apache/flex/html/beads/TextButtonView.as | 217 -------
.../html/beads/TextFieldLabelMeasurementBead.as | 92 ---
.../org/apache/flex/html/beads/TextFieldView.as | 54 --
.../apache/flex/html/beads/TextFieldViewBase.as | 404 ------------
.../org/apache/flex/html/beads/TextInputView.as | 135 ----
.../flex/html/beads/TextInputWithBorderView.as | 100 ---
.../TextItemRendererFactoryForArrayData.as | 144 -----
...extItemRendererFactoryForStringVectorData.as | 128 ----
.../flex/html/beads/TitleBarMeasurementBead.as | 108 ----
.../apache/flex/html/beads/TitleBarView.mxml | 58 --
.../apache/flex/html/beads/UpArrowButtonView.as | 112 ----
.../src/org/apache/flex/html/beads/VRuleView.as | 87 ---
.../flex/html/beads/VScrollBarThumbView.as | 119 ----
.../flex/html/beads/VScrollBarTrackView.as | 118 ----
.../apache/flex/html/beads/VScrollBarView.as | 99 ---
.../html/beads/controllers/AlertController.as | 88 ---
.../controllers/ButtonAutoRepeatController.as | 147 -----
.../beads/controllers/ComboBoxController.as | 104 ----
.../controllers/DateChooserMouseController.as | 126 ----
.../controllers/DateFieldMouseController.as | 95 ---
.../beads/controllers/DropDownListController.as | 116 ----
.../EditableTextKeyboardController.as | 86 ---
.../controllers/HScrollBarMouseController.as | 101 ---
.../controllers/ItemRendererMouseController.as | 203 ------
.../ListSingleSelectionMouseController.as | 127 ----
.../controllers/ScrollBarMouseControllerBase.as | 184 ------
.../beads/controllers/SliderMouseController.as | 286 ---------
.../beads/controllers/SpinnerMouseController.as | 125 ----
.../controllers/VScrollBarMouseController.as | 101 ---
.../flex/html/beads/layouts/BasicLayout.as | 445 -------------
.../flex/html/beads/layouts/ButtonBarLayout.as | 143 -----
.../flex/html/beads/layouts/DataGridLayout.as | 156 -----
.../FlexibleFirstChildHorizontalLayout.as | 244 --------
.../flex/html/beads/layouts/HScrollBarLayout.as | 121 ----
.../flex/html/beads/layouts/HorizontalLayout.as | 325 ----------
.../html/beads/layouts/LayoutChangeNotifier.as | 103 ---
.../layouts/OneFlexibleChildHorizontalLayout.as | 332 ----------
.../layouts/OneFlexibleChildVerticalLayout.as | 459 --------------
.../flex/html/beads/layouts/TileLayout.as | 246 --------
.../flex/html/beads/layouts/VScrollBarLayout.as | 122 ----
.../html/beads/layouts/VerticalColumnLayout.as | 199 ------
.../flex/html/beads/layouts/VerticalLayout.as | 362 -----------
.../apache/flex/html/beads/models/AlertModel.as | 288 ---------
.../beads/models/ArrayListSelectionModel.as | 244 --------
.../html/beads/models/ArraySelectionModel.as | 243 --------
.../flex/html/beads/models/ComboBoxModel.as | 100 ---
.../flex/html/beads/models/DataGridModel.as | 71 ---
.../beads/models/DataGridPresentationModel.as | 88 ---
.../flex/html/beads/models/DateChooserModel.as | 189 ------
.../flex/html/beads/models/ImageAndTextModel.as | 77 ---
.../apache/flex/html/beads/models/ImageModel.as | 89 ---
.../html/beads/models/ListPresentationModel.as | 107 ----
.../apache/flex/html/beads/models/PanelModel.as | 158 -----
.../apache/flex/html/beads/models/RangeModel.as | 222 -------
.../flex/html/beads/models/ScrollBarModel.as | 98 ---
.../html/beads/models/SingleLineBorderModel.as | 85 ---
.../html/beads/models/StringSelectionModel.as | 221 -------
.../apache/flex/html/beads/models/TextModel.as | 125 ----
.../flex/html/beads/models/TitleBarModel.as | 136 ----
.../flex/html/beads/models/ToggleButtonModel.as | 145 -----
.../html/beads/models/ValueToggleButtonModel.as | 123 ----
.../flex/html/beads/models/ViewportModel.as | 72 ---
.../apache/flex/html/supportClasses/Border.as | 49 --
.../ButtonBarButtonItemRenderer.as | 137 ----
.../html/supportClasses/ContainerContentArea.as | 80 ---
.../flex/html/supportClasses/DataGridColumn.as | 127 ----
.../flex/html/supportClasses/DataGroup.as | 151 -----
.../html/supportClasses/DataItemRenderer.as | 178 ------
.../html/supportClasses/DateChooserButton.as | 67 --
.../html/supportClasses/DropDownListList.as | 63 --
.../html/supportClasses/GraphicsItemRenderer.as | 295 ---------
.../flex/html/supportClasses/HScrollBar.as | 49 --
.../flex/html/supportClasses/ScrollBar.as | 50 --
.../html/supportClasses/ScrollingViewport.as | 351 -----------
.../html/supportClasses/StringItemRenderer.as | 183 ------
.../supportClasses/TextFieldItemRenderer.as | 541 ----------------
.../html/supportClasses/UIItemRendererBase.as | 282 ---------
.../flex/html/supportClasses/VScrollBar.as | 49 --
.../apache/flex/html/supportClasses/Viewport.as | 151 -----
.../as/src/org/apache/flex/svg/TextButton.as | 30 -
.../as/tests/FlexUnitFlexJSApplication.mxml | 46 --
frameworks/projects/HTML/as/tests/build.xml | 159 -----
.../tests/flexUnitTests/DataGridColumnTester.as | 27 -
.../flexUnitTests/DataGridColumnTesterTest.as | 55 --
frameworks/projects/HTML/basic-as-manifest.xml | 37 --
frameworks/projects/HTML/basic-manifest.xml | 105 ----
.../projects/HTML/compile-asjs-config.xml | 90 ---
frameworks/projects/HTML/compile-config.xml | 94 ---
.../projects/HTML/src/main/flex/HTMLClasses.as | 176 ++++++
.../apache/flex/core/IScrollingLayoutParent.as | 68 ++
.../src/main/flex/org/apache/flex/html/Alert.as | 287 +++++++++
.../main/flex/org/apache/flex/html/Button.as | 112 ++++
.../main/flex/org/apache/flex/html/ButtonBar.as | 76 +++
.../main/flex/org/apache/flex/html/CheckBox.as | 180 ++++++
.../flex/org/apache/flex/html/CloseButton.as | 66 ++
.../main/flex/org/apache/flex/html/ComboBox.as | 277 +++++++++
.../main/flex/org/apache/flex/html/Container.as | 108 ++++
.../flex/org/apache/flex/html/ControlBar.as | 99 +++
.../main/flex/org/apache/flex/html/DataGrid.as | 164 +++++
.../flex/org/apache/flex/html/DateChooser.as | 74 +++
.../main/flex/org/apache/flex/html/DateField.as | 95 +++
.../flex/org/apache/flex/html/DropDownList.as | 235 +++++++
.../flex/org/apache/flex/html/HContainer.as | 61 ++
.../src/main/flex/org/apache/flex/html/HRule.as | 63 ++
.../src/main/flex/org/apache/flex/html/Image.as | 99 +++
.../org/apache/flex/html/ImageAndTextButton.as | 128 ++++
.../flex/org/apache/flex/html/ImageButton.as | 89 +++
.../src/main/flex/org/apache/flex/html/Label.as | 163 +++++
.../src/main/flex/org/apache/flex/html/List.as | 311 +++++++++
.../org/apache/flex/html/MXMLBeadViewBase.as | 317 ++++++++++
.../flex/org/apache/flex/html/MultilineLabel.as | 76 +++
.../flex/org/apache/flex/html/NumericStepper.as | 214 +++++++
.../src/main/flex/org/apache/flex/html/Panel.as | 121 ++++
.../org/apache/flex/html/PanelWithControlBar.as | 121 ++++
.../flex/org/apache/flex/html/RadioButton.as | 347 +++++++++++
.../flex/org/apache/flex/html/SimpleAlert.as | 140 +++++
.../flex/org/apache/flex/html/SimpleList.as | 79 +++
.../main/flex/org/apache/flex/html/Slider.as | 233 +++++++
.../main/flex/org/apache/flex/html/Spacer.as | 64 ++
.../main/flex/org/apache/flex/html/Spinner.as | 187 ++++++
.../main/flex/org/apache/flex/html/TextArea.as | 126 ++++
.../flex/org/apache/flex/html/TextButton.as | 120 ++++
.../main/flex/org/apache/flex/html/TextInput.as | 185 ++++++
.../main/flex/org/apache/flex/html/TitleBar.as | 146 +++++
.../org/apache/flex/html/ToggleTextButton.as | 170 +++++
.../main/flex/org/apache/flex/html/ToolTip.as | 60 ++
.../flex/org/apache/flex/html/VContainer.as | 62 ++
.../src/main/flex/org/apache/flex/html/VRule.as | 68 ++
.../accessories/NumericOnlyTextInputBead.as | 199 ++++++
.../flex/html/accessories/PasswordInputBead.as | 102 +++
.../flex/html/accessories/TextPromptBead.as | 148 +++++
.../apache/flex/html/accessories/ToolTipBead.as | 141 +++++
.../flex/html/beads/AlertMeasurementBead.as | 88 +++
.../org/apache/flex/html/beads/AlertView.as | 226 +++++++
.../flex/html/beads/BackgroundImageBead.as | 112 ++++
.../org/apache/flex/html/beads/ButtonBarView.as | 69 ++
.../org/apache/flex/html/beads/CSSButtonView.as | 167 +++++
.../html/beads/CSSImageAndTextButtonView.as | 367 +++++++++++
.../apache/flex/html/beads/CSSTextButtonView.as | 347 +++++++++++
.../flex/html/beads/CSSTextToggleButtonView.as | 105 ++++
.../org/apache/flex/html/beads/CheckBoxView.as | 296 +++++++++
.../apache/flex/html/beads/CloseButtonView.as | 101 +++
.../org/apache/flex/html/beads/ComboBoxView.as | 247 ++++++++
.../org/apache/flex/html/beads/ContainerView.as | 553 ++++++++++++++++
.../html/beads/ControlBarMeasurementBead.as | 116 ++++
.../flex/html/beads/DataGridColumnView.as | 101 +++
.../apache/flex/html/beads/DataGridLinesBead.as | 199 ++++++
.../org/apache/flex/html/beads/DataGridView.as | 294 +++++++++
.../DataItemRendererFactoryForArrayData.as | 161 +++++
.../DataItemRendererFactoryForArrayList.as | 174 ++++++
.../DataItemRendererFactoryForColumnData.as | 142 +++++
.../html/beads/DataProviderChangeNotifier.as | 154 +++++
.../apache/flex/html/beads/DateChooserView.as | 256 ++++++++
.../org/apache/flex/html/beads/DateFieldView.as | 192 ++++++
.../flex/html/beads/DownArrowButtonView.as | 111 ++++
.../apache/flex/html/beads/DropDownListView.as | 300 +++++++++
.../org/apache/flex/html/beads/HRuleView.as | 87 +++
.../flex/html/beads/HScrollBarThumbView.as | 120 ++++
.../flex/html/beads/HScrollBarTrackView.as | 118 ++++
.../apache/flex/html/beads/HScrollBarView.as | 99 +++
.../apache/flex/html/beads/IBackgroundBead.as | 35 ++
.../org/apache/flex/html/beads/IBorderBead.as | 35 ++
.../org/apache/flex/html/beads/IComboBoxView.as | 78 +++
.../org/apache/flex/html/beads/IDataGridView.as | 36 ++
.../apache/flex/html/beads/IDropDownListView.as | 57 ++
.../apache/flex/html/beads/IGraphicsDrawing.as | 36 ++
.../org/apache/flex/html/beads/IListView.as | 48 ++
.../apache/flex/html/beads/IScrollBarView.as | 80 +++
.../org/apache/flex/html/beads/ISliderView.as | 60 ++
.../org/apache/flex/html/beads/ISpinnerView.as | 61 ++
.../apache/flex/html/beads/ITextFieldView.as | 44 ++
.../apache/flex/html/beads/ITextItemRenderer.as | 45 ++
.../flex/html/beads/ImageAndTextButtonView.as | 276 ++++++++
.../apache/flex/html/beads/ImageButtonView.as | 158 +++++
.../org/apache/flex/html/beads/ImageView.as | 223 +++++++
.../flex/html/beads/LeftArrowButtonView.as | 112 ++++
.../flex/org/apache/flex/html/beads/ListView.as | 210 +++++++
.../flex/html/beads/MultilineTextFieldView.as | 56 ++
.../flex/html/beads/NumericStepperView.as | 186 ++++++
.../org/apache/flex/html/beads/PanelView.as | 168 +++++
.../flex/html/beads/PanelWithControlBarView.as | 207 ++++++
.../apache/flex/html/beads/RadioButtonView.as | 281 +++++++++
.../flex/html/beads/RightArrowButtonView.as | 112 ++++
.../org/apache/flex/html/beads/ScrollBarView.as | 216 +++++++
.../apache/flex/html/beads/SimpleAlertView.as | 149 +++++
.../flex/html/beads/SingleLineBorderBead.as | 91 +++
.../apache/flex/html/beads/SliderThumbView.as | 156 +++++
.../apache/flex/html/beads/SliderTrackView.as | 153 +++++
.../org/apache/flex/html/beads/SliderView.as | 179 ++++++
.../flex/html/beads/SolidBackgroundBead.as | 191 ++++++
.../org/apache/flex/html/beads/SpinnerView.as | 135 ++++
.../org/apache/flex/html/beads/TextAreaView.as | 263 ++++++++
.../html/beads/TextButtonMeasurementBead.as | 86 +++
.../apache/flex/html/beads/TextButtonView.as | 217 +++++++
.../html/beads/TextFieldLabelMeasurementBead.as | 92 +++
.../org/apache/flex/html/beads/TextFieldView.as | 54 ++
.../apache/flex/html/beads/TextFieldViewBase.as | 404 ++++++++++++
.../org/apache/flex/html/beads/TextInputView.as | 135 ++++
.../flex/html/beads/TextInputWithBorderView.as | 100 +++
.../TextItemRendererFactoryForArrayData.as | 144 +++++
...extItemRendererFactoryForStringVectorData.as | 128 ++++
.../flex/html/beads/TitleBarMeasurementBead.as | 108 ++++
.../apache/flex/html/beads/TitleBarView.mxml | 58 ++
.../apache/flex/html/beads/UpArrowButtonView.as | 112 ++++
.../org/apache/flex/html/beads/VRuleView.as | 87 +++
.../flex/html/beads/VScrollBarThumbView.as | 119 ++++
.../flex/html/beads/VScrollBarTrackView.as | 118 ++++
.../apache/flex/html/beads/VScrollBarView.as | 99 +++
.../html/beads/controllers/AlertController.as | 88 +++
.../controllers/ButtonAutoRepeatController.as | 147 +++++
.../beads/controllers/ComboBoxController.as | 104 ++++
.../controllers/DateChooserMouseController.as | 126 ++++
.../controllers/DateFieldMouseController.as | 95 +++
.../beads/controllers/DropDownListController.as | 116 ++++
.../EditableTextKeyboardController.as | 86 +++
.../controllers/HScrollBarMouseController.as | 101 +++
.../controllers/ItemRendererMouseController.as | 203 ++++++
.../ListSingleSelectionMouseController.as | 127 ++++
.../controllers/ScrollBarMouseControllerBase.as | 184 ++++++
.../beads/controllers/SliderMouseController.as | 286 +++++++++
.../beads/controllers/SpinnerMouseController.as | 125 ++++
.../controllers/VScrollBarMouseController.as | 101 +++
.../flex/html/beads/layouts/BasicLayout.as | 445 +++++++++++++
.../flex/html/beads/layouts/ButtonBarLayout.as | 143 +++++
.../flex/html/beads/layouts/DataGridLayout.as | 156 +++++
.../FlexibleFirstChildHorizontalLayout.as | 244 ++++++++
.../flex/html/beads/layouts/HScrollBarLayout.as | 121 ++++
.../flex/html/beads/layouts/HorizontalLayout.as | 325 ++++++++++
.../html/beads/layouts/LayoutChangeNotifier.as | 103 +++
.../layouts/OneFlexibleChildHorizontalLayout.as | 332 ++++++++++
.../layouts/OneFlexibleChildVerticalLayout.as | 459 ++++++++++++++
.../flex/html/beads/layouts/TileLayout.as | 246 ++++++++
.../flex/html/beads/layouts/VScrollBarLayout.as | 122 ++++
.../html/beads/layouts/VerticalColumnLayout.as | 199 ++++++
.../flex/html/beads/layouts/VerticalLayout.as | 362 +++++++++++
.../apache/flex/html/beads/models/AlertModel.as | 288 +++++++++
.../beads/models/ArrayListSelectionModel.as | 244 ++++++++
.../html/beads/models/ArraySelectionModel.as | 243 ++++++++
.../flex/html/beads/models/ComboBoxModel.as | 100 +++
.../flex/html/beads/models/DataGridModel.as | 71 +++
.../beads/models/DataGridPresentationModel.as | 88 +++
.../flex/html/beads/models/DateChooserModel.as | 189 ++++++
.../flex/html/beads/models/ImageAndTextModel.as | 77 +++
.../apache/flex/html/beads/models/ImageModel.as | 89 +++
.../html/beads/models/ListPresentationModel.as | 107 ++++
.../apache/flex/html/beads/models/PanelModel.as | 158 +++++
.../apache/flex/html/beads/models/RangeModel.as | 222 +++++++
.../flex/html/beads/models/ScrollBarModel.as | 98 +++
.../html/beads/models/SingleLineBorderModel.as | 85 +++
.../html/beads/models/StringSelectionModel.as | 221 +++++++
.../apache/flex/html/beads/models/TextModel.as | 125 ++++
.../flex/html/beads/models/TitleBarModel.as | 136 ++++
.../flex/html/beads/models/ToggleButtonModel.as | 145 +++++
.../html/beads/models/ValueToggleButtonModel.as | 123 ++++
.../flex/html/beads/models/ViewportModel.as | 72 +++
.../apache/flex/html/supportClasses/Border.as | 49 ++
.../ButtonBarButtonItemRenderer.as | 137 ++++
.../html/supportClasses/ContainerContentArea.as | 80 +++
.../flex/html/supportClasses/DataGridColumn.as | 127 ++++
.../flex/html/supportClasses/DataGroup.as | 151 +++++
.../html/supportClasses/DataItemRenderer.as | 178 ++++++
.../html/supportClasses/DateChooserButton.as | 67 ++
.../html/supportClasses/DropDownListList.as | 63 ++
.../html/supportClasses/GraphicsItemRenderer.as | 295 +++++++++
.../flex/html/supportClasses/HScrollBar.as | 49 ++
.../flex/html/supportClasses/ScrollBar.as | 50 ++
.../html/supportClasses/ScrollingViewport.as | 351 +++++++++++
.../html/supportClasses/StringItemRenderer.as | 183 ++++++
.../supportClasses/TextFieldItemRenderer.as | 541 ++++++++++++++++
.../html/supportClasses/UIItemRendererBase.as | 282 +++++++++
.../flex/html/supportClasses/VScrollBar.as | 49 ++
.../apache/flex/html/supportClasses/Viewport.as | 151 +++++
.../main/flex/org/apache/flex/svg/TextButton.as | 30 +
.../src/main/resources/basic-as-manifest.xml | 37 ++
.../HTML/src/main/resources/basic-manifest.xml | 105 ++++
.../src/main/resources/compile-asjs-config.xml | 90 +++
.../HTML/src/main/resources/compile-config.xml | 94 +++
.../HTML/src/main/resources/defaults.css | 623 +++++++++++++++++++
.../HTML/src/main/resources/svg-manifest.xml | 24 +
.../test/flex/FlexUnitFlexJSApplication.mxml | 46 ++
.../projects/HTML/src/test/flex/build.xml | 159 +++++
.../flex/flexUnitTests/DataGridColumnTester.as | 27 +
.../flexUnitTests/DataGridColumnTesterTest.as | 55 ++
frameworks/projects/HTML/svg-manifest.xml | 24 -
390 files changed, 29977 insertions(+), 29977 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
deleted file mode 100644
index bb8ca6e..0000000
--- a/frameworks/projects/HTML/as/defaults.css
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-@namespace "library://ns.apache.org/flexjs/basic";
-@namespace svg "library://ns.apache.org/flexjs/svg";
-
-/* Global style declaration */
-*
-{
- font-family: "Arial";
- font-size: 12px;
- border-width: 1px;
-}
-
-.flexjs *, . flexjs *:before, . flexjs *:after {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-Application
-{
- padding: 0px;
- margin: 0px;
-}
-
-Button
-{
- background-color: #f8f8f8;
- border: 1px solid #808080;
- border-radius: 2px;
- padding: 4px;
- margin: 0px;
-}
-
-Button:hover
-{
- background-color: #e8e8e8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-Button:active
-{
- background-color: #d8d8d8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-ButtonBar
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ButtonBarView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.ButtonBarLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer");
-
- border-style: none;
-}
-
-ButtonBarButtonItemRenderer
-{
- width: 80;
- height: 30;
-}
-
-Container
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.ContainerContentArea");
- IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
- IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
-}
-
-ControlBar
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
-
- background-color: #CECECE;
- border-style: none;
- /*border-style: solid;
- border-color: #000000;
- border-width: 1px;*/
-}
-
-/* ASJS */
-DataGrid
-{
- IDataGridPresentationModel: ClassReference("org.apache.flex.html.beads.models.DataGridPresentationModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.DataGridView");
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel");
-
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #222222;
- border-width: 1px;
-}
-
-.DataGridColumn {
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayList");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
- IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
- IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
- border-style: none;
- background-color: #FFFFFF;
-}
-
-.DataGridListArea {
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #333333;
-}
-
-DateChooser {
- IBeadView: ClassReference("org.apache.flex.html.beads.DateChooserView");
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateChooserMouseController");
- width: 280px;
- height: 240px;
-}
-
-DateField {
- IBeadView: ClassReference("org.apache.flex.html.beads.DateFieldView");
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateFieldMouseController");
- IFormatBead: ClassReference("org.apache.flex.html.accessories.DateFormatMMDDYYYYBead");
-}
-
-HContainer
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.HorizontalLayout");
-}
-
-Image
-{
- vertical-align: top;
-}
-
-ImageAndTextButton
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageAndTextModel");
-}
-
-ImageButton
-{
- border-style: none;
-}
-
-ImageButton:hover
-{
- border-style: none;
-}
-
-ImageButton:active
-{
- border-style: none;
-}
-
-VContainer
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
-}
-
-List
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
- IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
- IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
- border-style: solid;
- border-color: #222222;
-}
-
-NumericStepper
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
-}
-
-Panel
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.PanelView");
-
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
- padding: 2px;
-}
-
-PanelWithControlBar
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.PanelWithControlBarView");
-
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
- padding: 2px;
-}
-
-SimpleList
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
- IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
- IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
-}
-
-Slider
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
-}
-
-Spinner
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
-}
-
-
-StringItemRenderer
-{
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
- height: 16;
-}
-
-TextInput
-{
- border: 1px solid #808080;
- border-radius: 2px;
- padding: 4px;
- margin: 0px;
-}
-
-TextArea
-{
- border: 1px solid #808080;
- border-radius: 2px;
- padding: 4px;
- resize: none;
-}
-
-TitleBar
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.TitleBarView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.TitleBarMeasurementBead");
- background-color: #E2E2E2;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
-}
-
-.toggleTextButton
-{
- background-color: #f8f8f8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-.toggleTextButton:hover
-{
- background-color: #e8e8e8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-.toggleTextButton_Selected
-{
- background-color: #d8d8d8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-.toggleTextButton_Selected:hover
-{
- background-color: #e8e8e8;
- border: 1px solid #808080;
- padding: 4px;
-}
-
-ToolTip
-{
- background-color: #FFFFCC;
-}
-
-ViewBase
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
- IContentView: ClassReference("org.apache.flex.html.supportClasses.ContainerContentArea");
- IViewport: ClassReference("org.apache.flex.html.supportClasses.Viewport");
- IViewportModel: ClassReference("org.apache.flex.html.beads.models.ViewportModel");
-}
-
-
-/* Global Style Declaration */
-global
-{
- IStatesImpl: ClassReference("org.apache.flex.core.SimpleStatesImpl");
- IEffectTimer: ClassReference("org.apache.flex.utils.EffectTimer");
- effectTimerInterval: 10;
-}
-
-@media -flex-flash
-{
-
-Alert
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.AlertView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
-
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
-}
-
-Border
-{
- border-color: inherit;
- border-style: inherit;
- border-radius: inherit;
- border-width: inherit;
- border: inherit;
-}
-
-Button
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSButtonView");
-}
-
-CheckBox
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CheckBoxView");
-}
-
-CloseButton
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.CloseButtonView");
-}
-
-ComboBox
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ComboBoxModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ComboBoxView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ComboBoxController");
- IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
-}
-
-Container
-{
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
-}
-
-ControlBar
-{
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.ControlBarMeasurementBead");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
-}
-
-DropDownList
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.DropDownListView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DropDownListController");
- IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
-}
-
-DropDownListList
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
- IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
- iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
- border-style: solid;
- border-radius: 4px;
- border-color: #000000;
- border-width: 1px;
- background-color: #FFFFFF;
-}
-
-HRule
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.HRuleView");
-}
-
-Image
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ImageView");
-}
-
-ImageButton
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.ImageButtonView");
-}
-
-ImageAndTextButton
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSImageAndTextButtonView");
-}
-
-Label
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.TextFieldView");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextFieldLabelMeasurementBead");
-}
-
-List
-{
- iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
- iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
-}
-
-MultilineLabel
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.MultilineTextFieldView");
-}
-
-NumericStepper
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.NumericStepperView");
-
- padding: 0px;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
- background-color: #FFFFFF;
- iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
- iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
-}
-
-Panel
-{
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
-}
-
-PanelWithControlBar
-{
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
-}
-
-RadioButton
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.RadioButtonView");
-}
-
-VScrollBar
-{
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.VScrollBarView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
-}
-
-HScrollBar
-{
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.HScrollBarLayout");
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.HScrollBarView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.HScrollBarMouseController");
-}
-
-SimpleAlert
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.SimpleAlertView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
-
- background-color: #FFFFFF;
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
-}
-
-Slider
-{
- iBeadView: ClassReference("org.apache.flex.html.beads.SliderView");
- iBeadController: ClassReference("org.apache.flex.html.beads.controllers.SliderMouseController");
- iThumbView: ClassReference("org.apache.flex.html.beads.SliderThumbView");
- iTrackView: ClassReference("org.apache.flex.html.beads.SliderTrackView");
-}
-
-Spinner
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.SpinnerView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.SpinnerMouseController");
-}
-
-TextArea
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.TextAreaView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
- iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
- iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
- background-color: #FFFFFF;
-}
-
-TextButton
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextButtonMeasurementBead");
-}
-
-TextFieldItemRenderer
-{
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
- height: 16;
-}
-
-TextInput
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.TextInputWithBorderView");
- IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
- iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
- iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
- border-style: solid;
- border-color: #000000;
- border-width: 1px;
- background-color: #FFFFFF;
-}
-
-TitleBar
-{
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
-}
-
-ToggleTextButton
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextToggleButtonView");
-}
-
-ViewBase
-{
- iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
- iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
-}
-
-VRule
-{
- IBeadView: ClassReference("org.apache.flex.html.beads.VRuleView");
-}
-
-/* SVG */
-
-svg|TextButton
-{
- IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
- iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextButtonMeasurementBead");
-}
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/HTMLClasses.as b/frameworks/projects/HTML/as/src/HTMLClasses.as
deleted file mode 100644
index 052ab95..0000000
--- a/frameworks/projects/HTML/as/src/HTMLClasses.as
+++ /dev/null
@@ -1,176 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package
-{
-
-/**
- * @private
- * This class is used to link additional classes into rpc.swc
- * beyond those that are found by dependecy analysis starting
- * from the classes specified in manifest.xml.
- */
-internal class HTMLClasses
-{
-
- import org.apache.flex.html.ToolTip; ToolTip;
- import org.apache.flex.html.accessories.NumericOnlyTextInputBead; NumericOnlyTextInputBead;
- import org.apache.flex.html.accessories.PasswordInputBead; PasswordInputBead;
- import org.apache.flex.html.accessories.TextPromptBead; TextPromptBead;
- import org.apache.flex.html.beads.AlertView; AlertView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.BackgroundImageBead; BackgroundImageBead;
- }
- import org.apache.flex.html.beads.ButtonBarView; ButtonBarView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.CheckBoxView; CheckBoxView;
- import org.apache.flex.html.beads.ComboBoxView; ComboBoxView;
- }
- import org.apache.flex.html.beads.ContainerView; ContainerView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.ControlBarMeasurementBead; ControlBarMeasurementBead;
- import org.apache.flex.html.beads.CSSButtonView; CSSButtonView;
- import org.apache.flex.html.beads.CSSImageAndTextButtonView; CSSImageAndTextButtonView;
- import org.apache.flex.html.beads.CSSTextButtonView; CSSTextButtonView;
- import org.apache.flex.html.beads.CSSTextToggleButtonView; CSSTextToggleButtonView;
- import org.apache.flex.html.beads.DropDownListView; DropDownListView;
- import org.apache.flex.html.beads.CloseButtonView; CloseButtonView;
- import org.apache.flex.html.beads.ImageAndTextButtonView; ImageAndTextButtonView;
- import org.apache.flex.html.beads.ImageView; ImageView;
- }
- import org.apache.flex.html.beads.ImageButtonView; ImageButtonView;
- import org.apache.flex.html.beads.ListView; ListView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.NumericStepperView; NumericStepperView;
- }
- import org.apache.flex.html.beads.PanelView; PanelView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.PanelWithControlBarView; PanelWithControlBarView;
- import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
- import org.apache.flex.html.beads.VScrollBarView; VScrollBarView;
- import org.apache.flex.html.beads.HScrollBarView; HScrollBarView;
- import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
- import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
- import org.apache.flex.html.beads.SingleLineBorderBead; SingleLineBorderBead;
- import org.apache.flex.html.beads.SliderView; SliderView;
- }
- import org.apache.flex.html.beads.SliderThumbView; SliderThumbView;
- import org.apache.flex.html.beads.SliderTrackView; SliderTrackView;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.SolidBackgroundBead; SolidBackgroundBead;
- import org.apache.flex.html.beads.SpinnerView; SpinnerView;
- import org.apache.flex.html.beads.TextButtonMeasurementBead; TextButtonMeasurementBead;
- import org.apache.flex.html.beads.TextFieldLabelMeasurementBead; TextFieldLabelMeasurementBead;
- import org.apache.flex.html.beads.TextAreaView; TextAreaView;
- import org.apache.flex.html.beads.TextButtonView; TextButtonView;
- import org.apache.flex.html.beads.TextFieldView; TextFieldView;
- import org.apache.flex.html.beads.TextInputView; TextInputView;
- import org.apache.flex.html.beads.TextInputWithBorderView; TextInputWithBorderView;
- import org.apache.flex.html.beads.models.AlertModel; AlertModel;
- }
- import org.apache.flex.html.beads.models.ArraySelectionModel; ArraySelectionModel;
- import org.apache.flex.html.beads.models.RangeModel; RangeModel;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.models.ComboBoxModel; ComboBoxModel;
- }
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.models.ImageModel; ImageModel;
- import org.apache.flex.html.beads.models.ImageAndTextModel; ImageAndTextModel;
- }
- import org.apache.flex.html.beads.models.PanelModel; PanelModel;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.models.SingleLineBorderModel; SingleLineBorderModel;
- }
- import org.apache.flex.html.beads.models.TextModel; TextModel;
- import org.apache.flex.html.beads.models.TitleBarModel; TitleBarModel;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.models.ToggleButtonModel; ToggleButtonModel;
- import org.apache.flex.html.beads.models.ValueToggleButtonModel; ValueToggleButtonModel;
- }
- import org.apache.flex.html.beads.models.ViewportModel; ViewportModel;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.controllers.AlertController; AlertController;
- import org.apache.flex.html.beads.controllers.ComboBoxController; ComboBoxController;
- import org.apache.flex.html.beads.controllers.DropDownListController; DropDownListController;
- import org.apache.flex.html.beads.controllers.EditableTextKeyboardController; EditableTextKeyboardController;
- }
- import org.apache.flex.html.beads.controllers.ItemRendererMouseController; ItemRendererMouseController;
- import org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController; ListSingleSelectionMouseController;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.controllers.SliderMouseController; SliderMouseController;
- import org.apache.flex.html.beads.controllers.SpinnerMouseController; SpinnerMouseController;
- import org.apache.flex.html.beads.controllers.VScrollBarMouseController; VScrollBarMouseController;
- import org.apache.flex.html.beads.controllers.HScrollBarMouseController; HScrollBarMouseController;
- }
- import org.apache.flex.html.beads.layouts.ButtonBarLayout; ButtonBarLayout;
- import org.apache.flex.html.beads.layouts.VerticalLayout; VerticalLayout;
- import org.apache.flex.html.beads.layouts.HorizontalLayout; HorizontalLayout;
- import org.apache.flex.html.beads.layouts.BasicLayout; BasicLayout;
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.layouts.HScrollBarLayout; HScrollBarLayout;
- import org.apache.flex.html.beads.layouts.VScrollBarLayout; VScrollBarLayout;
- }
- import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
- import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
- import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
- import org.apache.flex.html.beads.DataItemRendererFactoryForArrayList; DataItemRendererFactoryForArrayList;
- import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
- import org.apache.flex.html.supportClasses.Viewport; Viewport;
- import org.apache.flex.html.supportClasses.ScrollingViewport; ScrollingViewport;
-
- import org.apache.flex.html.beads.DataGridColumnView; DataGridColumnView;
- import org.apache.flex.html.beads.DataGridView; DataGridView;
- import org.apache.flex.html.beads.DateChooserView; DateChooserView;
- import org.apache.flex.html.beads.DateFieldView; DateFieldView;
- import org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout; FlexibleFirstChildHorizontalLayout;
- import org.apache.flex.html.beads.models.DataGridModel; DataGridModel;
- import org.apache.flex.html.beads.models.DateChooserModel; DateChooserModel;
- import org.apache.flex.html.beads.models.DataGridPresentationModel; DataGridPresentationModel;
- import org.apache.flex.html.beads.controllers.DateChooserMouseController; DateChooserMouseController;
- import org.apache.flex.html.beads.controllers.DateFieldMouseController; DateFieldMouseController;
- import org.apache.flex.html.supportClasses.DataGridColumn; DataGridColumn;
- import org.apache.flex.html.supportClasses.DateChooserButton; DateChooserButton;
- import org.apache.flex.html.supportClasses.GraphicsItemRenderer; GraphicsItemRenderer;
-
- import org.apache.flex.html.MXMLBeadViewBase; MXMLBeadViewBase;
- import org.apache.flex.html.beads.TitleBarView; TitleBarView;
- import org.apache.flex.html.beads.TitleBarMeasurementBead; TitleBarMeasurementBead;
-
- COMPILE::AS3
- {
- import org.apache.flex.html.beads.HRuleView; HRuleView;
- import org.apache.flex.html.beads.VRuleView; VRuleView;
- import org.apache.flex.html.beads.MultilineTextFieldView; MultilineTextFieldView;
- }
-}
-
-}
-
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/core/IScrollingLayoutParent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/core/IScrollingLayoutParent.as b/frameworks/projects/HTML/as/src/org/apache/flex/core/IScrollingLayoutParent.as
deleted file mode 100644
index 5e9768e..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/core/IScrollingLayoutParent.as
+++ /dev/null
@@ -1,68 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.core
-{
- import org.apache.flex.html.supportClasses.Border;
- import org.apache.flex.html.supportClasses.ScrollBar;
-
- /**
- * The IScrollingLayoutParent interface is an ILayoutParent
- * that has traditional scrollbars. The layout implementation
- * often needs to know certain things about other objects in
- * the component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public interface IScrollingLayoutParent
- {
- /**
- * The border.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get border():Border;
-
- /**
- * The vertical ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get vScrollBar():ScrollBar;
-
- /**
- * The horizontal ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- function get hScrollBar():ScrollBar;
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Alert.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Alert.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Alert.as
deleted file mode 100644
index b7f50dc..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Alert.as
+++ /dev/null
@@ -1,287 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IAlertModel;
- import org.apache.flex.core.IPopUp;
- import org.apache.flex.core.UIBase;
-
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.events.Event;
- }
-
- /**
- * The Alert class is a component that displays a message and one or more buttons
- * in a view that pops up over all other controls and views. The Alert component
- * uses the AlertView bead to display a modal dialog with a title and a variety
- * of buttons configured through the flag property of its show() static function.
- * The Alert component uses the following beads:
- *
- * org.apache.flex.core.IBeadModel: the data model for the Alert.
- * org.apache.flex.core.IBeadView: the bead used to create the parts of the Alert.
- * org.apache.flex.core.IBeadController: the bead used to handle input events.
- * org.apache.flex.core.IBorderBead: if present, draws a border around the Alert.
- * org.apache.flex.core.IBackgroundBead: if present, places a solid color background below the Alert.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Alert extends UIBase implements IPopUp
- {
- /**
- * The bitmask button flag to show the YES button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static const YES:uint = 0x000001;
-
- /**
- * The bitmask button flag to show the NO button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static const NO:uint = 0x000002;
-
- /**
- * The bitmask button flag to show the OK button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static const OK:uint = 0x000004;
-
- /**
- * The bitmask button flag to show the Cancel button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static const CANCEL:uint = 0x000008;
-
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Alert()
- {
- super();
-
- className = "Alert";
- }
-
- COMPILE::JS
- private var titleBar:TitleBar;
-
- COMPILE::JS
- private var label:Label;
-
- COMPILE::JS
- private var buttonArea:Container;
-
- /**
- * @override
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- super.createElement();
-
- element.className = 'Alert';
-
- // add in a title bar
- titleBar = new TitleBar();
- addElement(titleBar);
- titleBar.element.id = 'titleBar';
-
- label = new Label();
- addElement(label);
- label.element.id = 'message';
-
- // add a place for the buttons
- buttonArea = new Container();
- addElement(buttonArea);
- buttonArea.element.id = 'buttonArea';
-
- return element;
- };
-
- // note: only passing parent to this function as I don't see a way to identify
- // the 'application' or top level view without supplying a place to start to
- // look for it.
- /**
- * This static method is a convenience function to quickly create and display an Alert. The
- * text and parent paramters are required, the others will default.
- *
- * @param String text The message content of the Alert.
- * @param Object parent The object that hosts the pop-up.
- * @param String title An optional title for the Alert.
- * @param uint flags Identifies which buttons to display in the alert.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- static public function show( text:String, parent:Object, title:String="", flags:uint=Alert.OK ) : void
- {
- var alert:Alert = new Alert();
- alert.message = text;
- alert.title = title;
- alert.flags = flags;
-
- alert.show(parent);
-
- COMPILE::JS
- {
- alert.positioner.style.position = 'relative';
- alert.positioner.style.width = '200px';
- alert.positioner.style.margin = 'auto';
- alert.positioner.style.top = '100px';
- }
- }
-
- /**
- * Shows the Alert anchored to the given parent object which is usally a root component such
- * as a UIView..
- *
- * @param Object parent The object that hosts the pop-up.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function show(parent:Object) : void
- {
- parent.addElement(this);
- }
-
- /**
- * The tile of the Alert.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get title():String
- {
- return IAlertModel(model).title;
- }
- public function set title(value:String):void
- {
- IAlertModel(model).title = value;
- }
-
- /**
- * The message to display in the Alert body.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get message():String
- {
- return IAlertModel(model).message;
- }
- public function set message(value:String):void
- {
- IAlertModel(model).message = value;
- }
-
- /**
- * The buttons to display on the Alert as bit-mask values.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get flags():uint
- {
- return IAlertModel(model).flags;
- }
- public function set flags(value:uint):void
- {
- IAlertModel(model).flags = value;
-
- COMPILE::JS
- {
- // add buttons based on flags
- if (flags & Alert.OK) {
- var ok:TextButton = new TextButton();
- buttonArea.addElement(ok);
- ok.text = 'OK';
- goog.events.listen(ok.element, 'click', dismissAlert);
- }
- if (flags & Alert.CANCEL) {
- var cancel:TextButton = new TextButton();
- buttonArea.addElement(cancel);
- cancel.text = 'Cancel';
- goog.events.listen(cancel.element, 'click', dismissAlert);
- }
- if (flags & Alert.YES) {
- var yes:TextButton = new TextButton();
- buttonArea.addElement(yes);
- yes.text = 'YES';
- goog.events.listen(yes.element, 'click', dismissAlert);
- }
- if (flags & Alert.NO) {
- var nob:TextButton = new TextButton();
- buttonArea.addElement(nob);
- nob.text = 'NO';
- goog.events.listen(nob.element, 'click', dismissAlert);
- }
-
- }
- }
-
- /**
- * @param event The event object.
- * @flexjsignorecoercion HTMLElement
- */
- COMPILE::JS
- private function dismissAlert(event:Event):void
- {
- var htmlElement:HTMLElement = element as HTMLElement;
- htmlElement.parentElement.removeChild(element);
- };
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Button.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Button.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Button.as
deleted file mode 100644
index d4c2001..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Button.as
+++ /dev/null
@@ -1,112 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- COMPILE::AS3
- {
- import org.apache.flex.core.UIButtonBase;
- }
- COMPILE::JS
- {
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
-
-
- //--------------------------------------
- // Events
- //--------------------------------------
-
- /**
- * Dispatched when the user clicks on a button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- [Event(name="click", type="org.apache.flex.events.Event")]
-
- /**
- * The Button class is a simple button. Use TextButton for
- * buttons that should show text. This is the lightest weight
- * button used for non-text buttons like the arrow buttons
- * in a Scrollbar or NumericStepper.
- *
- * The most common view for this button is CSSButtonView that
- * allows you to specify a backgroundImage in CSS that defines
- * the look of the button.
- *
- * However, when used in ScrollBar and when composed in many
- * other components, it is more common to assign a custom view
- * to the button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public class Button extends UIButtonBase implements IStrand, IEventDispatcher, IUIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Button()
- {
- super();
- }
- }
-
- COMPILE::JS
- public class Button extends UIBase implements IStrand, IEventDispatcher, IUIBase
- {
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('button') as WrappedHTMLElement;
- element.setAttribute('type', 'button');
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- /* AJH comment out until we figure out why it is needed
- if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) {
- var impl:Object = org.apache.flex.core.ValuesManager.valuesImpl.
- getValue(this, 'iStatesImpl');
- }*/
-
- return element;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ButtonBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ButtonBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ButtonBar.as
deleted file mode 100644
index e4c58e7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ButtonBar.as
+++ /dev/null
@@ -1,76 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The ButtonBar class is a component that displays a set of Buttons. The ButtonBar
- * is actually a List with a default horizontal layout and an itemRenderer that
- * produces Buttons. The ButtonBar uses the following beads:
- *
- * org.apache.flex.core.IBeadModel: the data model for the ButtonBar, including the dataProvider.
- * org.apache.flex.core.IBeadView: constructs the parts of the component.
- * org.apache.flex.core.IBeadController: handles input events.
- * org.apache.flex.core.IBeadLayout: sizes and positions the component parts.
- * org.apache.flex.core.IDataProviderItemRendererMapper: produces itemRenderers.
- * org.apache.flex.core.IItemRenderer: the class or class factory to use.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ButtonBar extends List
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ButtonBar()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
- element.style.overflow = 'auto';
- positioner = element;
- positioner.style.position = 'relative';
-
- className = 'ButtonBar';
-
- element.flexjs_wrapper = this;
-
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/CheckBox.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/CheckBox.as
deleted file mode 100644
index 6405ab5..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/CheckBox.as
+++ /dev/null
@@ -1,180 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- COMPILE::AS3
- {
- import flash.events.MouseEvent;
- }
-
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.core.IUIBase;
- COMPILE::AS3
- {
- import org.apache.flex.core.UIButtonBase;
- }
- COMPILE::JS
- {
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
-
- //--------------------------------------
- // Events
- //--------------------------------------
-
- /**
- * Dispatched when the user checks or un-checks the CheckBox.
- *
- * @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 CheckBox class implements the common user interface
- * control. The CheckBox includes its text label.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public class CheckBox extends UIButtonBase implements IStrand
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CheckBox()
- {
- super();
-
- addEventListener(MouseEvent.CLICK, internalMouseHandler);
- }
-
- /**
- * The text label for the CheckBox.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- return IToggleButtonModel(model).text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- IToggleButtonModel(model).text = value;
- }
-
- [Bindable("change")]
- /**
- * <code>true</code> if the check mark is displayed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selected():Boolean
- {
- return IToggleButtonModel(model).selected;
- }
-
- /**
- * @private
- */
- public function set selected(value:Boolean):void
- {
- IToggleButtonModel(model).selected = value;
- }
-
- private function internalMouseHandler(event:Event) : void
- {
- selected = !selected;
- dispatchEvent(new Event("change"));
- }
- }
-
- COMPILE::JS
- public class CheckBox extends UIBase
- {
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- override protected function createElement():WrappedHTMLElement
- {
- var cb:HTMLInputElement;
-
- element = document.createElement('label') as WrappedHTMLElement;
-
- cb = document.createElement('input') as HTMLInputElement;
- cb.type = 'checkbox';
- element.appendChild(cb);
- element.appendChild(document.createTextNode(''));
-
- element.className = 'CheckBox';
- typeNames = 'CheckBox';
-
- positioner = element;
- positioner.style.position = 'relative';
- (cb as WrappedHTMLElement).flexjs_wrapper = this;
- element.flexjs_wrapper = this;
-
- return element;
- }
-
- public function get text():String
- {
- return element.childNodes.item(1).nodeValue;
- }
-
- public function set text(value:String):void
- {
- element.childNodes.item(1).nodeValue = value;
- }
-
- public function get selected():Boolean
- {
- return (element.childNodes.item(0) as HTMLInputElement).checked;
- }
-
- public function set selected(value:Boolean):void
- {
- (element.childNodes.item(0) as HTMLInputElement).checked = value;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/CloseButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/CloseButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/CloseButton.as
deleted file mode 100644
index 8306915..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/CloseButton.as
+++ /dev/null
@@ -1,66 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The CloseButton class is Button that displays an X
- * and is commonly used in a Panel's TitleBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CloseButton extends Button
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CloseButton()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- super.createElement();
- element.innerHTML = 'x';
-
- element.style.padding = 0;
- height = 11;
- width = 11;
- return element;
- }
-
- }
-}
[29/29] git commit: [flex-asjs] [refs/heads/mavenfolders] - update
-config.xml files after folder rename/refactor
Posted by ah...@apache.org.
update -config.xml files after folder rename/refactor
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ea6a4819
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ea6a4819
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ea6a4819
Branch: refs/heads/mavenfolders
Commit: ea6a4819e0a9c7f90a07cd03843963972b0bc258
Parents: 980ee4d
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jan 11 14:22:39 2016 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jan 11 14:22:39 2016 -0800
----------------------------------------------------------------------
frameworks/air-config-template.xml | 2 +-
frameworks/air-config.xml | 2 +-
frameworks/flex-config-template.xml | 2 +-
frameworks/flex-config.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ea6a4819/frameworks/air-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/air-config-template.xml b/frameworks/air-config-template.xml
index 8e897ca..eb3c3d3 100644
--- a/frameworks/air-config-template.xml
+++ b/frameworks/air-config-template.xml
@@ -154,7 +154,7 @@
<namespace>
<uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>projects/HTML/basic-manifest.xml</manifest>
+ <manifest>projects/HTML/src/main/resources/basic-manifest.xml</manifest>
</namespace>
<namespace>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ea6a4819/frameworks/air-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/air-config.xml b/frameworks/air-config.xml
index 82ed363..6b7a441 100644
--- a/frameworks/air-config.xml
+++ b/frameworks/air-config.xml
@@ -154,7 +154,7 @@
<namespace>
<uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>projects/HTML/basic-manifest.xml</manifest>
+ <manifest>projects/HTML/src/main/resources/basic-manifest.xml</manifest>
</namespace>
<namespace>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ea6a4819/frameworks/flex-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config-template.xml b/frameworks/flex-config-template.xml
index ee8c56a..a36a269 100644
--- a/frameworks/flex-config-template.xml
+++ b/frameworks/flex-config-template.xml
@@ -157,7 +157,7 @@
<namespace>
<uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>projects/HTML/basic-manifest.xml</manifest>
+ <manifest>projects/HTML/src/main/resources/basic-manifest.xml</manifest>
</namespace>
<namespace>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ea6a4819/frameworks/flex-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config.xml b/frameworks/flex-config.xml
index f257601..4662442 100644
--- a/frameworks/flex-config.xml
+++ b/frameworks/flex-config.xml
@@ -157,7 +157,7 @@
<namespace>
<uri>library://ns.apache.org/flexjs/basic</uri>
- <manifest>projects/HTML/basic-manifest.xml</manifest>
+ <manifest>projects/HTML/src/main/resources/basic-manifest.xml</manifest>
</namespace>
<namespace>
[04/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalLayout.as
new file mode 100644
index 0000000..13c8c8b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/HorizontalLayout.as
@@ -0,0 +1,325 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBeadModel;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.utils.CSSContainerUtils;
+ import org.apache.flex.utils.CSSUtils;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The HorizontalLayout 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 vertical-align styles.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class HorizontalLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function HorizontalLayout()
+ {
+ }
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ COMPILE::JS
+ {
+ (value as IUIBase).element.style.display = 'block';
+ }
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ public function layout():Boolean
+ {
+ COMPILE::AS3
+ {
+ //trace(DOMPathUtil.getPath(host), event ? event.type : "fixed size");
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent.contentView;
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+
+ var n:int = contentView.numElements;
+ var hostSizedToContent:Boolean = host.isHeightSizedToContent();
+ var ilc:ILayoutChild;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ var maxHeight:Number = 0;
+ // asking for contentView.height can result in infinite loop if host isn't sized already
+ var h:Number = hostSizedToContent ? 0 : contentView.height;
+ var w:Number = contentView.width;
+ var verticalMargins:Array = [];
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
+ var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ 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");
+ var ml:Number = CSSUtils.getLeftValue(marginLeft, margin, w);
+ var mr:Number = CSSUtils.getRightValue(marginRight, margin, w);
+ var mt:Number = CSSUtils.getTopValue(marginTop, margin, h);
+ var mb:Number = CSSUtils.getBottomValue(marginBottom, margin, h);
+
+ ilc = child as ILayoutChild;
+ var lastmr:Number;
+ if (marginLeft == "auto")
+ ml = 0;
+ if (marginRight == "auto")
+ mr = 0;
+ var xx:Number;
+ if (i == 0)
+ {
+ if (ilc)
+ ilc.setX(ml + padding.left);
+ else
+ child.x = ml + padding.left;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setX(xx + ml + lastmr);
+ else
+ child.x = xx + ml + lastmr;
+ }
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+ }
+ lastmr = mr;
+ var marginObject:Object = {};
+ verticalMargins[i] = marginObject;
+ var valign:* = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+ marginObject.valign = valign;
+ if (!hostSizedToContent)
+ {
+ // if host is sized by parent,
+ // we can position and size children horizontally now
+ setPositionAndHeight(child, top, mt, padding.top, bottom, mb, padding.bottom, h, valign);
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ }
+ else
+ {
+ if (!isNaN(top))
+ {
+ mt = top;
+ marginObject.top = mt;
+ }
+ if (!isNaN(bottom))
+ {
+ mb = bottom;
+ marginObject.bottom = mb;
+ }
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ }
+ xx = child.x + child.width;
+ }
+ if (hostSizedToContent)
+ {
+ ILayoutChild(contentView).setHeight(maxHeight, true);
+ if (host.isWidthSizedToContent())
+ ILayoutChild(contentView).setWidth(xx, true);
+ for (i = 0; i < n; i++)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ var obj:Object = verticalMargins[i];
+ setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
+ obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
+ }
+ }
+
+ // Only return true if the contentView needs to be larger; that new
+ // size is stored in the model.
+ var sizeChanged:Boolean = true;
+
+ host.dispatchEvent( new Event("layoutComplete") );
+
+ return sizeChanged;
+
+ }
+ COMPILE::JS
+ {
+ var children:Array;
+ var i:int;
+ var n:int;
+
+ var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = viewBead.contentView;
+ children = contentView.internalChildren();
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ var maxHeight:Number = 0;
+ var computedWidth:Number = 0;
+ n = children.length;
+ for (i = 0; i < n; i++)
+ {
+ var child:WrappedHTMLElement = children[i] as WrappedHTMLElement;
+ child.flexjs_wrapper.internalDisplay = 'inline-block';
+ if (child.style.display == 'none')
+ child.flexjs_wrapper.setDisplayStyleForLayout('inline-block');
+ else
+ child.style.display = 'inline-block';
+ maxHeight = Math.max(maxHeight, child.offsetHeight);
+ if (!hasWidth) {
+ var cv:Object = getComputedStyle(child);
+ var mls:String = cv['margin-left'];
+ var ml:Number = Number(mls.substring(0, mls.length - 2));
+ var mrs:String = cv['margin-right'];
+ var mr:Number = Number(mrs.substring(0, mrs.length - 2));
+ computedWidth += ml + child.offsetWidth + mr;
+ }
+ child.flexjs_wrapper.dispatchEvent('sizeChanged');
+ }
+ // if there are children and maxHeight is ok, use it.
+ // maxHeight can be NaN if the child hasn't been rendered yet.
+ if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
+ contentView.height = maxHeight;
+ }
+ if (!hasWidth && n > 0 && !isNaN(computedWidth)) {
+ contentView.width = computedWidth + 1; // some browser need one more pixel
+ }
+ return true;
+ }
+ }
+
+ COMPILE::AS3
+ private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
+ bottom:Number, mb:Number, pb:Number, h:Number,
+ valign:*):void
+ {
+ var heightSet:Boolean = false;
+
+ var hh:Number = h;
+ var ilc:ILayoutChild = child as ILayoutChild;
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(h * ilc.percentHeight / 100, true);
+ }
+ if (valign == "top")
+ {
+ if (!isNaN(top))
+ {
+ if (ilc)
+ ilc.setY(top + mt);
+ else
+ child.y = top + mt;
+ hh -= top + mt;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setY(mt + pt);
+ else
+ child.y = mt + pt;
+ hh -= mt + pt;
+ }
+ if (ilc.isHeightSizedToContent())
+ {
+ if (!isNaN(bottom))
+ {
+ if (!isNaN(top))
+ {
+ if (ilc)
+ ilc.setHeight(hh - bottom - mb, true);
+ else
+ {
+ child.height = hh - bottom - mb;
+ heightSet = true;
+ }
+ }
+ }
+ }
+ }
+ else if (valign == "bottom")
+ {
+ if (!isNaN(bottom))
+ {
+ if (ilc)
+ ilc.setY(h - bottom - mb - child.height);
+ else
+ child.y = h - bottom - mb - child.height;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setY(h - mb - child.height);
+ else
+ child.y = h - mb - child.height;
+ }
+ }
+ else
+ child.y = (h - child.height) / 2;
+ if (!heightSet)
+ child.dispatchEvent(new Event("sizeChanged"));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
new file mode 100644
index 0000000..00d328b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/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"));
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
new file mode 100644
index 0000000..309ef3b
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
@@ -0,0 +1,332 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IDocument;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ 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.geom.Rectangle;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The OneFlexibleChildHorizontalLayout 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 one 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 OneFlexibleChildHorizontalLayout implements IBeadLayout, IDocument
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function OneFlexibleChildHorizontalLayout()
+ {
+ }
+
+
+ /**
+ * The id of the flexible child
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var flexibleChild:String;
+
+ private var actualChild:ILayoutChild;
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @private
+ * The document.
+ */
+ private var document:Object;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ }
+
+ private var _maxWidth:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxWidth():Number
+ {
+ return _maxWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxWidth(value:Number):void
+ {
+ _maxWidth = value;
+ }
+
+ private var _maxHeight:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxHeight():Number
+ {
+ return _maxHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxHeight(value:Number):void
+ {
+ _maxHeight = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+ actualChild = document[flexibleChild];
+
+ var ilc:ILayoutChild;
+ var n:int = contentView.numElements;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ maxHeight = 0;
+ var verticalMargins:Array = new Array(n);
+
+ var ww:Number = contentView.width - padding.right;
+ var hh:Number = contentView.height;
+ var xx:int = padding.left;
+ var flexChildIndex:int;
+ var ml:Number;
+ var mr:Number;
+ var mt:Number;
+ var mb:Number;
+ var lastmr:Number;
+ var lastml:Number;
+ var valign:Object;
+ var hostSizedToContent:Boolean = host.isHeightSizedToContent();
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ if (child == actualChild)
+ {
+ flexChildIndex = i;
+ break;
+ }
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ 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");
+ mt = CSSUtils.getTopValue(marginTop, margin, hh);
+ mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
+ mr = CSSUtils.getRightValue(marginRight, margin, ww);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+ child.y = mt + padding.top;
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+ }
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ child.x = xx + ml;
+ xx += child.width + ml + mr;
+ lastmr = mr;
+ valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+ verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
+ }
+
+ if (n > 0 && n > flexChildIndex)
+ {
+ for (i = n - 1; i > flexChildIndex; i--)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ 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");
+ mt = CSSUtils.getTopValue(marginTop, margin, hh);
+ mb = CSSUtils.getTopValue(marginBottom, margin, hh);
+ mr = CSSUtils.getRightValue(marginRight, margin, ww);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+ child.y = mt + padding.top;
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+ }
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ child.x = ww - child.width - mr;
+ ww -= child.width + ml + mr;
+ lastml = ml;
+ valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+ verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
+ }
+
+ child = contentView.getElementAt(flexChildIndex) as IUIBase;
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ 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");
+ mt = CSSUtils.getTopValue(marginTop, margin, hh);
+ mb = CSSUtils.getTopValue(marginBottom, margin, hh);
+ mr = CSSUtils.getRightValue(marginRight, margin, ww);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
+ }
+ child.x = xx + ml;
+ child.width = ww - child.x;
+ maxHeight = Math.max(maxHeight, mt + child.height + mb);
+ valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
+ verticalMargins[flexChildIndex] = { marginTop: mt, marginBottom: mb, valign: valign };
+ }
+ if (hostSizedToContent)
+ ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
+
+ for (i = 0; i < n; i++)
+ {
+ var obj:Object = verticalMargins[i]
+ child = contentView.getElementAt(i) as IUIBase;
+ setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
+ obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
+ }
+ return true;
+ }
+
+ private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
+ bottom:Number, mb:Number, pb:Number, h:Number, valign:String):void
+ {
+ var heightSet:Boolean = false; // if we've set the height in a way that gens a change event
+ var ySet:Boolean = false; // if we've set the y yet.
+
+ var hh:Number = h;
+ var ilc:ILayoutChild = child as ILayoutChild;
+ if (!isNaN(top))
+ {
+ child.y = top + mt;
+ ySet = true;
+ hh -= top + mt;
+ }
+ else
+ {
+ hh -= mt;
+ }
+ if (!isNaN(bottom))
+ {
+ if (!isNaN(top))
+ {
+ if (ilc)
+ ilc.setHeight(hh - bottom - mb, true);
+ else
+ {
+ child.height = hh - bottom - mb;
+ heightSet = true;
+ }
+ }
+ else
+ {
+ child.y = h - bottom - mb - child.height - 1; // some browsers don't like going to the edge
+ ySet = true;
+ }
+ }
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(h * ilc.percentHeight / 100, true);
+ }
+ if (valign == "center")
+ child.y = (h - child.height) / 2;
+ else if (valign == "bottom")
+ child.y = h - child.height - mb;
+ else
+ child.y = mt + pt;
+ if (!heightSet)
+ child.dispatchEvent(new Event("sizeChanged"));
+ }
+
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.document = document;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
new file mode 100644
index 0000000..77af305
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/OneFlexibleChildVerticalLayout.as
@@ -0,0 +1,459 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IDocument;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ 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.geom.Rectangle;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The OneFlexibleChildVerticalLayout class is a simple layout
+ * bead. It takes the set of children and lays them out
+ * vertically in one column, separating them according to
+ * CSS layout rules for margin and padding styles. But it
+ * will size the one 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 OneFlexibleChildVerticalLayout implements IBeadLayout, IDocument
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function OneFlexibleChildVerticalLayout()
+ {
+ }
+
+
+ /**
+ * The id of the flexible child
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var flexibleChild:String;
+
+ private var actualChild:ILayoutChild;
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @private
+ * The document.
+ */
+ private var document:Object;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ }
+
+ private var _maxWidth:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxWidth():Number
+ {
+ return _maxWidth;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxWidth(value:Number):void
+ {
+ _maxWidth = value;
+ }
+
+ private var _maxHeight:Number;
+
+ /**
+ * @copy org.apache.flex.core.IBead#maxHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get maxHeight():Number
+ {
+ return _maxHeight;
+ }
+
+ /**
+ * @private
+ */
+ public function set maxHeight(value:Number):void
+ {
+ _maxHeight = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+ actualChild = document[flexibleChild];
+
+ var ilc:ILayoutChild;
+ var n:int = contentView.numElements;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ maxWidth = 0;
+
+ var w:Number = contentView.width;
+ var hh:Number = contentView.height - padding.bottom;
+ var yy:int = padding.top;
+ var flexChildIndex:int;
+ var ml:Number;
+ var mr:Number;
+ var mt:Number;
+ var mb:Number;
+ var lastmb:Number;
+ var lastmt:Number;
+ var halign:Object;
+ var left:Number;
+ var right:Number;
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ ilc = child as ILayoutChild;
+ left = ValuesManager.valuesImpl.getValue(child, "left");
+ right = ValuesManager.valuesImpl.getValue(child, "right");
+ if (child == actualChild)
+ {
+ flexChildIndex = i;
+ break;
+ }
+ 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;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+ }
+ 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;
+ }
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+ }
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+ child.y = yy + mt;
+ yy += child.height + mt + mb;
+ lastmb = mb;
+ }
+
+ if (n > 0 && n > flexChildIndex)
+ {
+ for (i = n - 1; i > flexChildIndex; i--)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ ilc = child as ILayoutChild;
+ left = ValuesManager.valuesImpl.getValue(child, "left");
+ right = ValuesManager.valuesImpl.getValue(child, "right");
+ 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;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+ }
+ 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;
+ }
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+ }
+ setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ child.y = hh - child.height - mb;
+ hh -= child.height + mt + mb;
+ lastmt = mt;
+ }
+ }
+
+ child = contentView.getElementAt(flexChildIndex) as IUIBase;
+ ilc = child as ILayoutChild;
+ left = ValuesManager.valuesImpl.getValue(child, "left");
+ right = ValuesManager.valuesImpl.getValue(child, "right");
+ 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;
+ }
+ mt = Number(marginTop);
+ if (isNaN(mt))
+ mt = 0;
+ mb = Number(marginBottom);
+ if (isNaN(mb))
+ mb = 0;
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+ }
+ 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;
+ }
+ if (child is ILayoutChild)
+ {
+ ilc = child as ILayoutChild;
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
+ }
+ setPositionAndWidth(child, left, ml, padding.left, right, mr, padding.right, w);
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ child.y = yy + mt;
+ child.height = hh - mb - child.y;
+
+ return true;
+ }
+
+ private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
+ right:Number, mr:Number, pr:Number, w:Number):void
+ {
+ var widthSet:Boolean = false;
+
+ var ww:Number = w;
+ var ilc:ILayoutChild = child as ILayoutChild;
+ if (!isNaN(left))
+ {
+ child.x = left + ml;
+ ww -= left + ml;
+ }
+ else
+ {
+ if (isNaN(right))
+ child.x = ml + pl;
+ ww -= ml;
+ }
+ if (!isNaN(right))
+ {
+ if (!isNaN(left))
+ {
+ if (ilc)
+ ilc.setWidth(ww - right - mr, true);
+ else
+ {
+ child.width = ww - right - mr;
+ widthSet = true;
+ }
+ }
+ else
+ child.x = w - right - mr - child.width - 1; // some browsers don't like going all the way to the edge
+ }
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(w * ilc.percentWidth / 100, true);
+ }
+ if (!widthSet)
+ child.dispatchEvent(new Event("sizeChanged"));
+ }
+
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.document = document;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/TileLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/TileLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/TileLayout.as
new file mode 100644
index 0000000..39e70ef
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/TileLayout.as
@@ -0,0 +1,246 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ 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;
+
+ /**
+ * The TileLayout class bead sizes and positions the elements it manages into rows and columns.
+ * The size of each element is determined either by setting TileLayout's columnWidth and rowHeight
+ * properties, or having the tile size determined by factoring the numColumns into the area assigned
+ * for the layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TileLayout implements IBeadLayout
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TileLayout()
+ {
+ }
+
+ 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 _numColumns:Number = 4;
+ private var _columnWidth:Number = Number.NaN;
+ private var _rowHeight:Number = Number.NaN;
+
+ /**
+ * The number of tiles to fit horizontally into the layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get numColumns():Number
+ {
+ return _numColumns;
+ }
+ public function set numColumns(value:Number):void
+ {
+ _numColumns = value;
+ }
+
+ /**
+ * The width of each column, in pixels. If left unspecified, the
+ * columnWidth is determined by dividing the numColumns into the
+ * strand's bounding box width.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get columnWidth():Number
+ {
+ return _columnWidth;
+ }
+ public function set columnWidth(value:Number):void
+ {
+ _columnWidth = value;
+ }
+
+ /**
+ * The height of each row, in pixels. If left unspecified, the
+ * rowHeight is determine by dividing the possible number of rows
+ * into the strand's bounding box height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get rowHeight():Number
+ {
+ return _rowHeight;
+ }
+ public function set rowHeight(value:Number):void
+ {
+ _rowHeight = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ COMPILE::AS3
+ {
+ // this is where the layout is calculated
+ var host:UIBase = _strand as UIBase;
+ var p:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
+ var area:UIBase = p.contentView as UIBase;
+
+ var xpos:Number = 0;
+ var ypos:Number = 0;
+ var useWidth:Number = columnWidth;
+ var useHeight:Number = rowHeight;
+ var n:Number = area.numElements;
+ if (n == 0) return false;
+
+ var realN:Number = n;
+ for(var j:int=0; j < n; j++)
+ {
+ var testChild:IUIBase = area.getElementAt(i) as IUIBase;
+ if (testChild && !testChild.visible) realN--;
+ }
+
+ if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
+ if (isNaN(useHeight)) {
+ // given the width and total number of items, how many rows?
+ var numRows:Number = Math.floor(realN/numColumns);
+ useHeight = Math.floor(host.height / numRows);
+ }
+
+ var maxWidth:Number = useWidth;
+ var maxHeight:Number = useHeight;
+
+ for(var i:int=0; i < n; i++)
+ {
+ var child:IUIBase = area.getElementAt(i) as IUIBase;
+ if (child && !child.visible) continue;
+ child.width = useWidth;
+ child.height = useHeight;
+ child.x = xpos;
+ child.y = ypos;
+
+ xpos += useWidth;
+ maxWidth = Math.max(maxWidth,xpos);
+
+ var test:Number = (i+1)%numColumns;
+
+ if (test == 0) {
+ xpos = 0;
+ ypos += useHeight;
+ maxHeight = Math.max(maxHeight,ypos);
+ }
+ }
+
+ maxWidth = Math.max(maxWidth, numColumns*useWidth);
+ maxHeight = Math.max(maxHeight, numRows*useHeight);
+
+ // Only return true if the contentView needs to be larger; that new
+ // size is stored in the model.
+ var sizeChanged:Boolean = true;
+
+ IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") );
+
+ return sizeChanged;
+ }
+ COMPILE::JS
+ {
+ var children:Array;
+ var i:int;
+ var n:int;
+ var child:UIBase;
+ var xpos:Number;
+ var ypos:Number;
+ var useWidth:Number;
+ var useHeight:Number;
+
+ var host:UIBase = _strand as UIBase;
+ var viewBead:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = viewBead.contentView;
+ children = contentView.internalChildren();
+ n = children.length;
+ if (n === 0) return false;
+
+ var realN:int = n;
+ for (i = 0; i < n; i++)
+ {
+ child = children[i].flexjs_wrapper;
+ if (!child.visible) realN--;
+ }
+
+ xpos = 0;
+ ypos = 0;
+ useWidth = columnWidth;
+ useHeight = rowHeight;
+
+ if (isNaN(useWidth)) useWidth = Math.floor(host.width / numColumns); // + gap
+ if (isNaN(useHeight)) {
+ // given the width and total number of items, how many rows?
+ var numRows:Number = Math.floor(realN / numColumns);
+ useHeight = Math.floor(host.height / numRows);
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ child = children[i].flexjs_wrapper;
+ if (!child.visible) continue;
+ child.setDisplayStyleForLayout('inline-block');
+ child.width = useWidth;
+ child.height = useHeight;
+ }
+ return true;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VScrollBarLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
new file mode 100644
index 0000000..612519a
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
@@ -0,0 +1,122 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads.layouts
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.html.beads.IScrollBarView;
+ import org.apache.flex.html.beads.ScrollBarView;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The VScrollBarLayout class is a layout
+ * bead that displays lays out the pieces of a
+ * vertical ScrollBar like the thumb, track
+ * and arrow buttons.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VScrollBarLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VScrollBarLayout()
+ {
+ }
+
+ private var sbModel:IScrollBarModel;
+ private var sbView:IScrollBarView;
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ sbView = _strand.getBeadByType(IScrollBarView) as IScrollBarView;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ if (!sbModel)
+ sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel
+
+ var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
+
+ var h:Number = DisplayObject(_strand).height + metrics.top + metrics.bottom;
+ var increment:DisplayObject = sbView.increment;
+ var decrement:DisplayObject = sbView.decrement;
+ var track:DisplayObject = sbView.track;
+ var thumb:DisplayObject = sbView.thumb;
+
+ decrement.x = 0;
+ decrement.y = 0;
+
+ increment.x = 0;
+ increment.y = h - increment.height - 1;
+
+ if (track.width < thumb.width)
+ track.x = (thumb.width - track.width) / 2;
+ else if (track.width > thumb.width)
+ thumb.x = (track.width - thumb.width) / 2;
+ else
+ track.x = 0;
+ track.y = decrement.height;
+ track.height = increment.y - decrement.height;
+ thumb.height = sbModel.pageSize / (sbModel.maximum - sbModel.minimum) * track.height;
+ if (track.height > thumb.height)
+ {
+ thumb.visible = true;
+ thumb.y = (sbModel.value / (sbModel.maximum - sbModel.minimum - sbModel.pageSize) * (track.height - thumb.height)) + track.y;
+ }
+ else
+ {
+ thumb.visible = false;
+ }
+
+ return true;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
new file mode 100644
index 0000000..d32777d
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalColumnLayout.as
@@ -0,0 +1,199 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IContainer;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IMeasurementBead;
+ import org.apache.flex.core.IParent;
+ 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.geom.Rectangle;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * ColumnLayout is a class that organizes the positioning of children
+ * of a container into a set of columns where each column's width is set to
+ * the maximum size of all of the children in that column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VerticalColumnLayout implements IBeadLayout
+ {
+ /**
+ * constructor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VerticalColumnLayout()
+ {
+ }
+
+ 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 _numColumns:int;
+
+ /**
+ * The number of columns.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get numColumns():int
+ {
+ return _numColumns;
+ }
+ public function set numColumns(value:int):void
+ {
+ _numColumns = value;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadLayout#layout
+ */
+ public function layout():Boolean
+ {
+ var host:UIBase = UIBase(_strand);
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParent = layoutParent.contentView;
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+ var sw:Number = host.width;
+ var sh:Number = host.height;
+
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ var e:IUIBase;
+ var i:int;
+ var col:int = 0;
+ var columns:Array = [];
+ var rows:Array = [];
+ var data:Array = [];
+ for (i = 0; i < numColumns; i++)
+ columns[i] = 0;
+
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ var ml:Number;
+ var mr:Number;
+ var mt:Number;
+ var mb:Number;
+ var n:int = contentView.numElements;
+ var rowData:Object = { rowHeight: 0 };
+
+ // determine max widths of columns
+ for (i = 0; i < n; i++) {
+ e = contentView.getElementAt(i) as IUIBase;
+ margin = ValuesManager.valuesImpl.getValue(e, "margin");
+ marginLeft = ValuesManager.valuesImpl.getValue(e, "margin-left");
+ marginTop = ValuesManager.valuesImpl.getValue(e, "margin-top");
+ marginRight = ValuesManager.valuesImpl.getValue(e, "margin-right");
+ marginBottom = ValuesManager.valuesImpl.getValue(e, "margin-bottom");
+ mt = CSSUtils.getTopValue(marginTop, margin, sh);
+ mb = CSSUtils.getBottomValue(marginBottom, margin, sh);
+ mr = CSSUtils.getRightValue(marginRight, margin, sw);
+ ml = CSSUtils.getLeftValue(marginLeft, margin, sw);
+ data.push({ mt: mt, mb: mb, mr: mr, ml: ml});
+ var thisPrefWidth:int = 0;
+ if (e is IStrand)
+ {
+ var measure:IMeasurementBead = e.getBeadByType(IMeasurementBead) as IMeasurementBead;
+ if (measure)
+ thisPrefWidth = measure.measuredWidth + ml + mr;
+ else
+ thisPrefWidth = e.width + ml + mr;
+ }
+ else
+ thisPrefWidth = e.width + ml + mr;
+
+ rowData.rowHeight = Math.max(rowData.rowHeight, e.height + mt + mb);
+ columns[col] = Math.max(columns[col], thisPrefWidth);
+ col = col + 1;
+ if (col == numColumns)
+ {
+ rows.push(rowData);
+ rowData = {rowHeight: 0};
+ col = 0;
+ }
+ }
+
+ var lastmb:Number = 0;
+ var curx:int = padding.left;
+ var cury:int = padding.top;
+ var maxHeight:int = 0;
+ var maxWidth:int = 0;
+ col = 0;
+ for (i = 0; i < n; i++)
+ {
+ e = contentView.getElementAt(i) as IUIBase;
+ e.x = curx + ml;
+ e.y = cury + data[i].mt;
+ curx += columns[col++];
+ maxHeight = Math.max(maxHeight, e.y + e.height + data[i].mb);
+ maxWidth = Math.max(maxWidth, e.x + e.width + data[i].mr);
+ if (col == numColumns)
+ {
+ cury += rows[0].rowHeight;
+ rows.shift();
+ col = 0;
+ curx = padding.left;
+ }
+ }
+ if (!hasWidth && n > 0 && !isNaN(maxWidth))
+ {
+ UIBase(contentView).setWidth(maxWidth, true);
+ }
+ if (!hasHeight && n > 0 && !isNaN(maxHeight))
+ {
+ UIBase(contentView).setHeight(maxHeight, true);
+ }
+ return true;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalLayout.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalLayout.as
new file mode 100644
index 0000000..fe43af4
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/VerticalLayout.as
@@ -0,0 +1,362 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.IBeadModel;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.ILayoutHost;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.utils.CSSContainerUtils;
+ import org.apache.flex.utils.CSSUtils;
+
+ /**
+ * The VerticalLayout class is a simple layout
+ * bead. It takes the set of children and lays them out
+ * vertically in one column, separating them according to
+ * CSS layout rules for margin and horizontal-align styles.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class VerticalLayout implements IBeadLayout
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function VerticalLayout()
+ {
+ }
+
+ // the strand/host container is also an ILayoutChild because
+ // can have its size dictated by the host's parent which is
+ // important to know for layout optimization
+ private var host:ILayoutChild;
+
+ /**
+ * @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
+ {
+ host = value as ILayoutChild;
+ }
+
+ /**
+ * Layout children vertically
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
+ */
+ public function layout():Boolean
+ {
+ COMPILE::AS3
+ {
+ var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
+ var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
+
+ var n:int = contentView.numElements;
+ var hasHorizontalFlex:Boolean;
+ var hostSizedToContent:Boolean = host.isWidthSizedToContent();
+ var flexibleHorizontalMargins:Array = [];
+ var ilc:ILayoutChild;
+ var marginLeft:Object;
+ var marginRight:Object;
+ var marginTop:Object;
+ var marginBottom:Object;
+ var margin:Object;
+ var maxWidth:Number = 0;
+ var cssValue:*;
+ // asking for contentView.width can result in infinite loop if host isn't sized already
+ var w:Number = hostSizedToContent ? 0 : contentView.width;
+ var h:Number = contentView.height;
+
+ for (var i:int = 0; i < n; i++)
+ {
+ var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ ilc = child as ILayoutChild;
+ var left:Number = NaN;
+ cssValue = ValuesManager.valuesImpl.getValue(child, "left");
+ if (cssValue !== undefined)
+ left = CSSUtils.toNumber(cssValue);
+ var right:Number = NaN;
+ cssValue = ValuesManager.valuesImpl.getValue(child, "right");
+ if (cssValue !== undefined)
+ right = CSSUtils.toNumber(cssValue);
+ margin = ValuesManager.valuesImpl.getValue(child, "margin");
+ 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");
+ var ml:Number = CSSUtils.getLeftValue(marginLeft, margin, w);
+ var mr:Number = CSSUtils.getRightValue(marginRight, margin, w);
+ var mt:Number = CSSUtils.getTopValue(marginTop, margin, h);
+ var mb:Number = CSSUtils.getBottomValue(marginBottom, margin, h);
+ var lastmb:Number;
+ var yy:Number;
+ if (i == 0)
+ {
+ if (ilc)
+ ilc.setY(mt + padding.top);
+ else
+ child.y = mt + padding.top;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setY(yy + Math.max(mt, lastmb));
+ else
+ child.y = yy + Math.max(mt, lastmb);
+ }
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentHeight))
+ ilc.setHeight(contentView.height * ilc.percentHeight / 100, !isNaN(ilc.percentWidth));
+ }
+ lastmb = mb;
+ var marginObject:Object = {};
+ flexibleHorizontalMargins[i] = marginObject;
+ if (marginLeft == "auto")
+ {
+ ml = 0;
+ marginObject.marginLeft = marginLeft;
+ hasHorizontalFlex = true;
+ }
+ else
+ {
+ ml = Number(marginLeft);
+ if (isNaN(ml))
+ {
+ ml = 0;
+ marginObject.marginLeft = marginLeft;
+ }
+ else
+ marginObject.marginLeft = ml;
+ }
+ if (marginRight == "auto")
+ {
+ mr = 0;
+ marginObject.marginRight = marginRight;
+ hasHorizontalFlex = true;
+ }
+ else
+ {
+ mr = Number(marginRight);
+ if (isNaN(mr))
+ {
+ mr = 0;
+ marginObject.marginRight = marginRight;
+ }
+ else
+ marginObject.marginRight = mr;
+ }
+ if (!hostSizedToContent)
+ {
+ // if host is sized by parent,
+ // we can position and size children horizontally now
+ setPositionAndWidth(child, left, ml, padding.left,
+ right, mr, padding.right, w);
+ }
+ else
+ {
+ if (!isNaN(left))
+ {
+ ml = left;
+ marginObject.left = ml;
+ }
+ if (!isNaN(right))
+ {
+ mr = right;
+ marginObject.right = mr;
+ }
+ maxWidth = Math.max(maxWidth, ml + child.width + mr);
+ }
+ yy = child.y + child.height;
+ }
+ if (hostSizedToContent)
+ {
+ for (i = 0; i < n; i++)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ var obj:Object = flexibleHorizontalMargins[i];
+ setPositionAndWidth(child, obj.left, obj.marginLeft, padding.left,
+ obj.right, obj.marginRight, padding.right, maxWidth);
+ }
+ }
+ if (hasHorizontalFlex)
+ {
+ for (i = 0; i < n; i++)
+ {
+ child = contentView.getElementAt(i) as IUIBase;
+ if (child == null || !child.visible) continue;
+ ilc = child as ILayoutChild;
+ obj = flexibleHorizontalMargins[i];
+ if (hasHorizontalFlex)
+ {
+ if (ilc)
+ {
+ if (obj.marginLeft == "auto" && obj.marginRight == "auto")
+ ilc.setX(maxWidth - child.width / 2);
+ else if (obj.marginLeft == "auto")
+ ilc.setX(maxWidth - child.width - obj.marginRight - padding.right);
+ }
+ else
+ {
+ if (obj.marginLeft == "auto" && obj.marginRight == "auto")
+ child.x = maxWidth - child.width / 2;
+ else if (obj.marginLeft == "auto")
+ child.x = maxWidth - child.width - obj.marginRight - padding.right;
+ }
+ }
+ }
+ }
+
+ // Only return true if the contentView needs to be larger; that new
+ // size is stored in the model.
+ var sizeChanged:Boolean = true;
+
+ host.dispatchEvent( new Event("layoutComplete") );
+
+ return sizeChanged;
+
+ }
+ COMPILE::JS
+ {
+ var children:Array;
+ var i:int;
+ var n:int;
+
+ var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
+ var contentView:IParentIUIBase = viewBead.contentView;
+ children = contentView.internalChildren();
+ var scv:Object = getComputedStyle(host.positioner);
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ var maxWidth:Number = 0;
+ n = children.length;
+ for (i = 0; i < n; i++)
+ {
+ var child:WrappedHTMLElement = children[i];
+ child.flexjs_wrapper.setDisplayStyleForLayout('block');
+ if (child.style.display === 'none')
+ {
+ child.flexjs_wrapper.setDisplayStyleForLayout('block');
+ }
+ else
+ {
+ // block elements don't measure width correctly so set to inline for a second
+ child.style.display = 'inline-block';
+ maxWidth = Math.max(maxWidth, child.offsetLeft + child.offsetWidth);
+ child.style.display = 'block';
+ }
+ child.flexjs_wrapper.dispatchEvent('sizeChanged');
+ }
+ if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
+ var pl:String = scv['padding-left'];
+ var pr:String = scv['padding-right'];
+ var npl:int = parseInt(pl.substring(0, pl.length - 2), 10);
+ var npr:int = parseInt(pr.substring(0, pr.length - 2), 10);
+ maxWidth += npl + npr;
+ contentView.width = maxWidth;
+ }
+ return true;
+ }
+ }
+
+ COMPILE::AS3
+ private function setPositionAndWidth(child:IUIBase, left:Number, ml:Number, pl:Number,
+ right:Number, mr:Number, pr:Number, w:Number):void
+ {
+ var widthSet:Boolean = false;
+
+ var ww:Number = w;
+ var ilc:ILayoutChild = child as ILayoutChild;
+ if (!isNaN(left))
+ {
+ if (ilc)
+ ilc.setX(left + ml);
+ else
+ child.x = left + ml;
+ ww -= left + ml;
+ }
+ else
+ {
+ if (ilc)
+ ilc.setX(ml + pl);
+ else
+ child.x = ml + pl;
+ ww -= ml + pl;
+ }
+ if (!isNaN(right))
+ {
+ if (!isNaN(left))
+ {
+ if (ilc)
+ ilc.setWidth(ww - right - mr, true);
+ else
+ {
+ child.width = ww - right - mr;
+ widthSet = true;
+ }
+ }
+ else
+ {
+ if (ilc)
+ ilc.setX(w - right - mr - child.width);
+ else
+ child.x = w - right - mr - child.width;
+ }
+ }
+ if (ilc)
+ {
+ if (!isNaN(ilc.percentWidth))
+ ilc.setWidth(w * ilc.percentWidth / 100, true);
+ }
+ if (!widthSet)
+ child.dispatchEvent(new Event("sizeChanged"));
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/AlertModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/AlertModel.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/AlertModel.as
new file mode 100644
index 0000000..caa6215
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/models/AlertModel.as
@@ -0,0 +1,288 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.models
+{
+ import org.apache.flex.core.IAlertModel;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ /**
+ * The AlertModel class bead implements the org.apache.flex.core.IAlertModel and holds the properties
+ * for an org.apache.flex.html.Alert such the buttons to use and message to display.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class AlertModel extends EventDispatcher implements IAlertModel, IBead
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function AlertModel()
+ {
+ super();
+ }
+
+ 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 _title:String;
+
+ /**
+ * The title for the Alert.
+ *
+ * @copy org.apache.flex.core.IAlertModel#title
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get title():String
+ {
+ return _title;
+ }
+ public function set title(value:String):void
+ {
+ if( value != _title ) {
+ _title = value;
+ dispatchEvent( new Event("titleChange") );
+ }
+ }
+
+ private var _htmlTitle:String;
+
+ /**
+ * The HTML title for the Alert.
+ *
+ * @copy org.apache.flex.core.IAlertModel#htmlTitle
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlTitle():String
+ {
+ return _htmlTitle;
+ }
+ public function set htmlTitle(value:String):void
+ {
+ if( value != _htmlTitle ) {
+ _htmlTitle = value;
+ dispatchEvent( new Event("htmlTitleChange") );
+ }
+ }
+
+ private var _message:String;
+
+ /**
+ * The message to display.
+ *
+ * @copy org.apache.flex.core.IAlertModel#message
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get message():String
+ {
+ return _message;
+ }
+ public function set message(value:String):void
+ {
+ if( value != _message ) {
+ _message = value;
+ dispatchEvent( new Event("messageChange") );
+ }
+ }
+
+ private var _htmlMessage:String;
+
+ /**
+ * The HTML message to display.
+ *
+ * @copy org.apache.flex.core.IAlertModel#htmlMessage
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get htmlMessage():String
+ {
+ return _htmlMessage;
+ }
+ public function set htmlMessage(value:String):void
+ {
+ if( value != _htmlMessage )
+ {
+ _htmlMessage = value;
+ dispatchEvent( new Event("htmlMessageChange") );
+ }
+ }
+
+ private var _flags:uint;
+
+ /**
+ * Which buttons to display (see Alert for details).
+ *
+ * @copy org.apache.flex.core.IAlertModel#flags
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get flags():uint
+ {
+ return _flags;
+ }
+ public function set flags(value:uint):void
+ {
+ if( value != _flags )
+ {
+ _flags = value;
+ dispatchEvent( new Event("flagsChange") );
+ }
+ }
+
+ private var _okLabel:String = "OK";
+
+ /**
+ * The label to use for the OK button.
+ *
+ * @copy org.apache.flex.core.IAlertModel#okLabel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get okLabel():String
+ {
+ return _okLabel;
+ }
+ public function set okLabel(value:String):void
+ {
+ if( value != _okLabel )
+ {
+ _okLabel = value;
+ dispatchEvent( new Event("okLabelChange") );
+ }
+ }
+
+ private var _cancelLabel:String = "Cancel";
+
+ /**
+ * The label to use for the Cancel button.
+ *
+ * @copy org.apache.flex.core.IAlertModel#cancelLabel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get cancelLabel():String
+ {
+ return _cancelLabel;
+ }
+ public function set cancelLabel(value:String):void
+ {
+ if( value != _cancelLabel )
+ {
+ _cancelLabel = value;
+ dispatchEvent( new Event("cancelLabelChange") );
+ }
+ }
+
+ private var _yesLabel:String = "YES";
+
+ /**
+ * The label to use for the Yes button.
+ *
+ * @copy org.apache.flex.core.IAlertModel#yesLabel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get yesLabel():String
+ {
+ return _yesLabel;
+ }
+ public function set yesLabel(value:String):void
+ {
+ if( value != _yesLabel )
+ {
+ _yesLabel = value;
+ dispatchEvent( new Event("yesLabelChange") );
+ }
+ }
+
+ private var _noLabel:String = "NO";
+
+ /**
+ * The label to use for the NO button.
+ *
+ * @copy org.apache.flex.core.IAlertModel#noLabel
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get noLabel():String
+ {
+ return _noLabel;
+ }
+ public function set noLabel(value:String):void
+ {
+ if( value != _noLabel )
+ {
+ _noLabel = value;
+ dispatchEvent( new Event("noLabelChange") );
+ }
+ }
+ }
+}
[17/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
deleted file mode 100644
index 611f6dd..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/VScrollBarMouseController.as
+++ /dev/null
@@ -1,101 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.controllers
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.events.Event;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The VScrollBarMouseController class is the controller for
- * org.apache.flex.html.supportClasses.ScrollBar
- * that acts as the Vertical ScrollBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class VScrollBarMouseController extends ScrollBarMouseControllerBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function VScrollBarMouseController()
- {
- }
-
- /**
- * @private
- */
- override protected function trackClickHandler(event:MouseEvent):void
- {
- if (sbView.thumb.visible)
- {
- if (event.localY < sbView.thumb.y)
- {
- sbModel.value = snap(Math.max(sbModel.minimum, sbModel.value - sbModel.pageStepSize));
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
- else
- {
- sbModel.value = snap(Math.min(sbModel.maximum - sbModel.pageSize, sbModel.value + sbModel.pageStepSize));
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
- }
- }
-
- private var thumbDownY:Number;
- private var lastThumbY:Number;
-
- /**
- * @private
- */
- override protected function thumbMouseDownHandler(event:MouseEvent):void
- {
- sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
- sbView.thumb.stage.addEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
- thumbDownY = event.screenY;
- lastThumbY = sbView.thumb.y;
- }
-
- private function thumbMouseMoveHandler(event:MouseEvent):void
- {
- var thumb:DisplayObject = sbView.thumb;
- var track:DisplayObject = sbView.track;
- thumb.y = Math.max(track.y, Math.min(lastThumbY + (event.screenY - thumbDownY), track.y + track.height - thumb.height));
- var newValue:Number = snap((thumb.y - track.y) / (track.height - thumb.height) * (sbModel.maximum - sbModel.minimum - sbModel.pageSize));
- sbModel.value = newValue;
- IEventDispatcher(strand).dispatchEvent(new Event("scroll"));
- }
-
- private function thumbMouseUpHandler(event:MouseEvent):void
- {
- sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_MOVE, thumbMouseMoveHandler);
- sbView.thumb.stage.removeEventListener(MouseEvent.MOUSE_UP, thumbMouseUpHandler);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
deleted file mode 100644
index 8a8c0d7..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/BasicLayout.as
+++ /dev/null
@@ -1,445 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
-
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- 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.utils.CSSUtils;
- //import org.apache.flex.utils.dbg.DOMPathUtil;
-
- /**
- * The BasicLayout class is a simple layout
- * bead. It takes the set of children and lays them out
- * as specified by CSS properties like left, right, top
- * and bottom.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class BasicLayout implements IBeadLayout
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function BasicLayout()
- {
- }
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
- * @flexjsignorecoercion org.apache.flex.core.UIBase
- */
- public function layout():Boolean
- {
- COMPILE::AS3
- {
- //trace(DOMPathUtil.getPath(host), event ? event.type : "fixed size");
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
-
- var gotMargin:Boolean;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- var ml:Number;
- var mr:Number;
- var mt:Number;
- var mb:Number;
- var hostWidthSizedToContent:Boolean = host.isWidthSizedToContent();
- var hostHeightSizedToContent:Boolean = host.isHeightSizedToContent();
- var w:Number = hostWidthSizedToContent ? 0 : contentView.width;
- var h:Number = hostHeightSizedToContent ? 0 : contentView.height;
- var n:int = contentView.numElements;
- var maxWidth:Number = 0;
- var maxHeight:Number = 0;
- var childData:Array = [];
- for (var i:int = 0; i < n; i++)
- {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- var left:Number = ValuesManager.valuesImpl.getValue(child, "left");
- var right:Number = ValuesManager.valuesImpl.getValue(child, "right");
- var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
- var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
- var ww:Number = w;
- var hh:Number = h;
-
- var ilc:ILayoutChild = child as ILayoutChild;
- if (!isNaN(left))
- {
- if (ilc)
- ilc.setX(left);
- else
- child.x = left;
- ww -= left;
- }
- if (!isNaN(top))
- {
- if (ilc)
- ilc.setY(top);
- else
- child.y = top;
- hh -= top;
- }
- if (ilc)
- {
- if (!hostWidthSizedToContent)
- {
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth((ww - (isNaN(right) ? 0 : right)) * ilc.percentWidth / 100, true);
- }
- else
- childData[i] = { bottom: bottom, right: right, ww: ww, ilc: ilc, child: child };
- }
- if (!isNaN(right))
- {
- if (!hostWidthSizedToContent)
- {
- if (!isNaN(left))
- {
- if (ilc)
- ilc.setWidth(ww - right, true);
- else
- child.width = ww - right;
- }
- else
- {
- if (ilc)
- ilc.setX( w - right - child.width);
- else
- child.x = w - right - child.width;
- }
- }
- else
- childData[i] = { ww: ww, left: left, right: right, ilc: ilc, child: child };
- }
-
- if (isNaN(right) && isNaN(left))
- {
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- gotMargin = true;
- marginLeft = ValuesManager.valuesImpl.getValue(child, "margin-left");
- marginRight = ValuesManager.valuesImpl.getValue(child, "margin-right");
- var horizontalCenter:Boolean =
- (marginLeft == "auto" && marginRight == "auto") ||
- (margin is String && margin == "auto") ||
- (margin is Array &&
- ((margin.length < 4 && margin[1] == "auto") ||
- (margin.length == 4 && margin[1] == "auto" && margin[3] == "auto")));
- if (!hostWidthSizedToContent)
- {
- if (!horizontalCenter)
- {
- mr = CSSUtils.getRightValue(marginRight, margin, ww);
- ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
- if (ilc)
- ilc.setX(ml);
- else
- child.x = ml;
- if (ilc && isNaN(ilc.percentWidth) && isNaN(ilc.explicitWidth))
- child.width = ww - child.x - mr;
- }
- else
- {
- if (ilc)
- ilc.setX((ww - child.width) / 2);
- else
- child.x = (ww - child.width) / 2;
- }
- }
- else
- {
- if (!horizontalCenter)
- {
- mr = CSSUtils.getRightValue(marginRight, margin, ww);
- ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
- if (ilc)
- ilc.setX(ml);
- else
- child.x = ml;
- if (ilc && isNaN(ilc.percentWidth) && isNaN(ilc.explicitWidth))
- childData[i] = { ww: ww, left: ml, right: mr, ilc: ilc, child: child };
- }
- else
- {
- childData[i] = { ww: ww, center: true, ilc: ilc, child: child };
- }
- }
-
- }
- if (isNaN(top) && isNaN(bottom))
- {
- if (!gotMargin)
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- marginTop = ValuesManager.valuesImpl.getValue(child, "margin-top");
- marginBottom = ValuesManager.valuesImpl.getValue(child, "margin-bottom");
- mt = CSSUtils.getTopValue(marginTop, margin, hh);
- mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
- if (ilc)
- ilc.setY(mt);
- else
- child.y = mt;
- /* browsers don't use margin-bottom to stretch things vertically
- if (!hostHeightSizedToContent)
- {
- if (ilc && isNaN(ilc.percentHeight) && isNaN(ilc.explicitHeight))
- child.height = hh - child.y - mb;
- }
- else
- {
- if (!childData[i])
- childData[i] = { hh: hh, bottom: mb, ilc: ilc, child: child };
- else
- {
- childData[i].hh = hh;
- childData[i].bottom = mb;
- }
- }
- */
- }
-
- if (ilc)
- {
- if (!hostHeightSizedToContent)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight((hh - (isNaN(bottom) ? 0 : bottom)) * ilc.percentHeight / 100, true);
- }
- else
- {
- if (!childData[i])
- childData[i] = { hh: hh, bottom: bottom, ilc: ilc, child: child };
- else
- {
- childData[i].hh = hh;
- childData[i].bottom = bottom;
- }
- }
- }
- if (!isNaN(bottom))
- {
- if (!hostHeightSizedToContent)
- {
- if (!isNaN(top))
- {
- if (ilc)
- ilc.setHeight(hh - bottom, true);
- else
- child.height = hh - bottom;
- }
- else
- {
- if (ilc)
- ilc.setY(h - bottom - child.height);
- else
- child.y = h - bottom - child.height;
- }
- }
- else
- {
- if (!childData[i])
- childData[i] = { top: top, bottom: bottom, hh:hh, ilc: ilc, child: child };
- else
- {
- childData[i].top = top;
- childData[i].bottom = bottom;
- childData[i].hh = hh;
- }
- }
- }
- if (!childData[i])
- child.dispatchEvent(new Event("sizeChanged"));
- maxWidth = Math.max(maxWidth, child.x + child.width);
- maxHeight = Math.max(maxHeight, child.y + child.height);
- }
- if (hostHeightSizedToContent || hostWidthSizedToContent)
- {
- for (i = 0; i < n; i++)
- {
- var data:Object = childData[i];
- if (data)
- {
- if (hostWidthSizedToContent)
- {
- if (data.ilc && !isNaN(data.ilc.percentWidth))
- data.ilc.setWidth((data.ww - (isNaN(data.right) ? 0 : data.right)) * data.ilc.percentWidth / 100, true);
- if (data.center)
- {
- if (data.ilc)
- data.ilc.setX((data.ww - data.child.width) / 2);
- else
- data.child.x = (data.ww - data.child.width) / 2;
- }
- else if (!isNaN(data.right))
- {
- if (!isNaN(data.left))
- {
- if (data.ilc)
- data.ilc.setWidth(data.ww - data.right, true);
- else
- data.child.width = data.ww - data.right;
- }
- else
- {
- if (data.ilc)
- data.ilc.setX(maxWidth - data.right - data.child.width);
- else
- data.child.x = maxWidth - data.right - data.child.width;
- }
- }
- }
- if (hostHeightSizedToContent)
- {
- if (data.ilc && !isNaN(data.ilc.percentHeight))
- data.ilc.setHeight((data.hh - (isNaN(data.bottom) ? 0 : data.bottom)) * data.ilc.percentHeight / 100, true);
- if (!isNaN(data.bottom))
- {
- if (!isNaN(data.top))
- {
- if (data.ilc)
- data.ilc.setHeight(data.hh - data.bottom, true);
- else
- data.child.height = data.hh - data.bottom;
- }
- else
- {
- if (data.ilc)
- data.ilc.setY(maxHeight - data.bottom - data.child.height);
- else
- data.child.y = maxHeight - data.bottom - data.child.height;
- }
- }
- }
- child.dispatchEvent(new Event("sizeChanged"));
- }
- }
- }
-
- host.dispatchEvent( new Event("layoutComplete") );
-
- return true;
-
- }
- COMPILE::JS
- {
- var i:int
- var n:int;
- var h:Number;
- var w:Number;
-
- var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = viewBead.contentView;
- w = contentView.width;
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- h = contentView.height;
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- var maxHeight:Number = 0;
- var maxWidth:Number = 0;
- n = contentView.numElements;
- for (i = 0; i < n; i++) {
- var child:UIBase = contentView.getElementAt(i) as UIBase;
- child.setDisplayStyleForLayout('block');
- var left:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'left');
- var right:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'right');
- var top:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'top');
- var bottom:Number = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'bottom');
- var margin:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin');
- var marginLeft:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-left');
- var marginRight:String = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-right');
- var horizontalCenter:Boolean =
- (marginLeft == 'auto' && marginRight == 'auto') ||
- (typeof(margin) === 'string' && margin == 'auto') ||
- (margin && margin.hasOwnProperty('length') &&
- ((margin.length < 4 && margin[1] == 'auto') ||
- (margin.length == 4 && margin[1] == 'auto' && margin[3] == 'auto')));
-
- if (!isNaN(left)) {
- child.positioner.style.position = 'absolute';
- child.positioner.style.left = left.toString() + 'px';
- }
- if (!isNaN(top)) {
- child.positioner.style.position = 'absolute';
- child.positioner.style.top = top.toString() + 'px';
- }
- if (!isNaN(right)) {
- child.positioner.style.position = 'absolute';
- child.positioner.style.right = right.toString() + 'px';
- }
- if (!isNaN(bottom)) {
- child.positioner.style.position = 'absolute';
- child.positioner.style.bottom = bottom.toString() + 'px';
- }
- if (horizontalCenter)
- {
- child.positioner.style.position = 'absolute';
- child.positioner.style.left = ((w - child.width) / 2).toString() + 'px';
- }
- child.dispatchEvent('sizeChanged');
- maxWidth = Math.max(maxWidth, child.positioner.offsetLeft + child.positioner.offsetWidth);
- maxHeight = Math.max(maxHeight, child.positioner.offsetTop + child.positioner.offsetHeight);
- }
- // if there are children and maxHeight is ok, use it.
- // maxHeight can be NaN if the child hasn't been rendered yet.
- if (!hasWidth && n > 0 && !isNaN(maxWidth)) {
- contentView.width = maxWidth;
- }
- if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
- contentView.height = maxHeight;
- }
- return true;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
deleted file mode 100644
index 5bd1159..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.as
+++ /dev/null
@@ -1,143 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.ISelectableItemRenderer;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.IViewportModel;
- 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.List;
- import org.apache.flex.html.beads.ButtonBarView;
-
- /**
- * The ButtonBarLayout class bead sizes and positions the org.apache.flex.html.Button
- * elements that make up a org.apache.flex.html.ButtonBar. This bead arranges the Buttons
- * horizontally and makes them all the same width unless the buttonWidths property has been set in which case
- * the values stored in that array are used.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ButtonBarLayout implements IBeadLayout
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ButtonBarLayout()
- {
- }
-
- 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 _buttonWidths:Array = null;
-
- /**
- * An array of widths (Number), one per button. These values supersede the
- * default of equally-sized buttons.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get buttonWidths():Array
- {
- return _buttonWidths;
- }
- public function set buttonWidths(value:Array):void
- {
- _buttonWidths = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var layoutParent:ILayoutHost = _strand.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
- var itemRendererParent:IItemRendererParent = contentView as IItemRendererParent;
- var viewportModel:IViewportModel = (layoutParent as ButtonBarView).viewportModel;
-
- var n:int = contentView.numElements;
- var realN:int = n;
-
- for (var j:int=0; j < n; j++)
- {
- var child:IUIBase = itemRendererParent.getElementAt(j) as IUIBase;
- if (child == null || !child.visible) realN--;
- }
-
- var xpos:Number = 0;
- var useWidth:Number = contentView.width / realN;
- var useHeight:Number = contentView.height;
-
- for (var i:int=0; i < n; i++)
- {
- var ir:ISelectableItemRenderer = itemRendererParent.getElementAt(i) as ISelectableItemRenderer;
- if (ir == null || !UIBase(ir).visible) continue;
- UIBase(ir).y = 0;
- UIBase(ir).x = xpos;
- if (!isNaN(useHeight) && useHeight > 0) {
- UIBase(ir).height = useHeight;
- }
-
- if (buttonWidths) UIBase(ir).width = Number(buttonWidths[i]);
- else if (!isNaN(useWidth) && useWidth > 0) {
- UIBase(ir).width = useWidth;
- }
- xpos += UIBase(ir).width;
- }
-
- IEventDispatcher(_strand).dispatchEvent( new Event("layoutComplete") );
-
- return true;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/DataGridLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
deleted file mode 100644
index 33399c3..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/DataGridLayout.as
+++ /dev/null
@@ -1,156 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- 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.ButtonBar;
- 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
- {
- /**
- * 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;
- }
-
- 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;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var sw:Number = UIBase(_strand).width;
- var sh:Number = UIBase(_strand).height;
-
- var columnHeight:Number = Math.floor(sh - header.height);
- var columnWidth:Number = Math.floor(sw / columns.length);
-
- var xpos:Number = 0;
- var ypos:Number = Math.floor(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;
-
- var buttonWidths:Array = new Array();
-
- 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;
-
- buttonWidths.push(column.width);
- }
-
- var bar:ButtonBar = header as ButtonBar;
- var barLayout:ButtonBarLayout = bar.getBeadByType(ButtonBarLayout) as ButtonBarLayout;
- barLayout.buttonWidths = buttonWidths;
-
- header.x = 0;
- header.y = 0;
- header.width = sw;
- header.dispatchEvent(new Event("layoutNeeded"));
-
- return true;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
deleted file mode 100644
index 4198fea..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/FlexibleFirstChildHorizontalLayout.as
+++ /dev/null
@@ -1,244 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- 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;
- 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.geom.Rectangle;
- import org.apache.flex.html.supportClasses.Viewport;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * 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()
- {
- }
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- }
-
- private var _maxWidth:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxWidth
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxWidth():Number
- {
- return _maxWidth;
- }
-
- /**
- * @private
- */
- public function set maxWidth(value:Number):void
- {
- _maxWidth = value;
- }
-
- private var _maxHeight:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxHeight
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxHeight():Number
- {
- return _maxHeight;
- }
-
- /**
- * @private
- */
- public function set maxHeight(value:Number):void
- {
- _maxHeight = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent.contentView as IParentIUIBase;
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
- var hostSizedToContent:Boolean = host.isHeightSizedToContent();
-
- var n:int = contentView.numElements;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- maxHeight = 0;
- var verticalMargins:Array = [];
-
- var xx:Number = contentView.width;
- if (isNaN(xx) || xx <= 0)
- return true;
- xx -= padding.right + 1; // some browsers won't layout to the edge
-
- 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 + padding.top;
- if (i == 0)
- {
- child.x = ml + padding.left;
- child.width = xx - mr - child.x;
- }
- else
- child.x = xx - child.width - mr;
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- 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;
- }
- if (hostSizedToContent)
- ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
-
- return true;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
deleted file mode 100644
index 38b97ec..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HScrollBarLayout.as
+++ /dev/null
@@ -1,121 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.html.beads.IScrollBarView;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The HScrollBarLayout class is a layout
- * bead that displays lays out the pieces of a
- * horizontal ScrollBar like the thumb, track
- * and arrow buttons.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HScrollBarLayout implements IBeadLayout
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HScrollBarLayout()
- {
- }
-
- private var sbModel:IScrollBarModel;
- private var sbView:IScrollBarView;
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- sbView = _strand.getBeadByType(IScrollBarView) as IScrollBarView;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- if (!sbModel)
- sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel
-
- var metrics:Rectangle = CSSContainerUtils.getBorderAndPaddingMetrics(_strand);
-
- var w:Number = DisplayObject(_strand).width + metrics.left + metrics.right;
- var increment:DisplayObject = sbView.increment;
- var decrement:DisplayObject = sbView.decrement;
- var track:DisplayObject = sbView.track;
- var thumb:DisplayObject = sbView.thumb;
-
- decrement.x = 0;
- decrement.y = 0;
- decrement.height = DisplayObject(_strand).height;
- decrement.width = DisplayObject(_strand).height;
-
- increment.height = DisplayObject(_strand).height;
- increment.width = DisplayObject(_strand).height;
- increment.x = w - increment.width - 1;
- increment.y = 0;
-
- track.x = decrement.width;
- track.y = 0;
- track.height = DisplayObject(_strand).height;
- track.width = increment.x - decrement.width;
- thumb.width = sbModel.pageSize / (sbModel.maximum - sbModel.minimum) * track.width;
- if (track.width > thumb.width)
- {
- thumb.visible = true;
- thumb.x = (sbModel.value / (sbModel.maximum - sbModel.minimum - sbModel.pageSize) * (track.width - thumb.width)) + track.x;
- }
- else
- {
- thumb.visible = false;
- }
-
- return true;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
deleted file mode 100644
index 13c8c8b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/HorizontalLayout.as
+++ /dev/null
@@ -1,325 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadModel;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.geom.Rectangle;
- import org.apache.flex.utils.CSSContainerUtils;
- import org.apache.flex.utils.CSSUtils;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The HorizontalLayout 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 vertical-align styles.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HorizontalLayout implements IBeadLayout
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HorizontalLayout()
- {
- }
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- COMPILE::JS
- {
- (value as IUIBase).element.style.display = 'block';
- }
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- * @flexjsignorecoercion org.apache.flex.core.ILayoutHost
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- public function layout():Boolean
- {
- COMPILE::AS3
- {
- //trace(DOMPathUtil.getPath(host), event ? event.type : "fixed size");
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent.contentView;
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
-
- var n:int = contentView.numElements;
- var hostSizedToContent:Boolean = host.isHeightSizedToContent();
- var ilc:ILayoutChild;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- var maxHeight:Number = 0;
- // asking for contentView.height can result in infinite loop if host isn't sized already
- var h:Number = hostSizedToContent ? 0 : contentView.height;
- var w:Number = contentView.width;
- var verticalMargins:Array = [];
-
- for (var i:int = 0; i < n; i++)
- {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- var top:Number = ValuesManager.valuesImpl.getValue(child, "top");
- var bottom:Number = ValuesManager.valuesImpl.getValue(child, "bottom");
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- 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");
- var ml:Number = CSSUtils.getLeftValue(marginLeft, margin, w);
- var mr:Number = CSSUtils.getRightValue(marginRight, margin, w);
- var mt:Number = CSSUtils.getTopValue(marginTop, margin, h);
- var mb:Number = CSSUtils.getBottomValue(marginBottom, margin, h);
-
- ilc = child as ILayoutChild;
- var lastmr:Number;
- if (marginLeft == "auto")
- ml = 0;
- if (marginRight == "auto")
- mr = 0;
- var xx:Number;
- if (i == 0)
- {
- if (ilc)
- ilc.setX(ml + padding.left);
- else
- child.x = ml + padding.left;
- }
- else
- {
- if (ilc)
- ilc.setX(xx + ml + lastmr);
- else
- child.x = xx + ml + lastmr;
- }
- if (ilc)
- {
- if (!isNaN(ilc.percentWidth))
- ilc.setWidth(contentView.width * ilc.percentWidth / 100, !isNaN(ilc.percentHeight));
- }
- lastmr = mr;
- var marginObject:Object = {};
- verticalMargins[i] = marginObject;
- var valign:* = ValuesManager.valuesImpl.getValue(child, "vertical-align");
- marginObject.valign = valign;
- if (!hostSizedToContent)
- {
- // if host is sized by parent,
- // we can position and size children horizontally now
- setPositionAndHeight(child, top, mt, padding.top, bottom, mb, padding.bottom, h, valign);
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- }
- else
- {
- if (!isNaN(top))
- {
- mt = top;
- marginObject.top = mt;
- }
- if (!isNaN(bottom))
- {
- mb = bottom;
- marginObject.bottom = mb;
- }
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- }
- xx = child.x + child.width;
- }
- if (hostSizedToContent)
- {
- ILayoutChild(contentView).setHeight(maxHeight, true);
- if (host.isWidthSizedToContent())
- ILayoutChild(contentView).setWidth(xx, true);
- for (i = 0; i < n; i++)
- {
- child = contentView.getElementAt(i) as IUIBase;
- if (child == null || !child.visible) continue;
- var obj:Object = verticalMargins[i];
- setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
- obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
- }
- }
-
- // Only return true if the contentView needs to be larger; that new
- // size is stored in the model.
- var sizeChanged:Boolean = true;
-
- host.dispatchEvent( new Event("layoutComplete") );
-
- return sizeChanged;
-
- }
- COMPILE::JS
- {
- var children:Array;
- var i:int;
- var n:int;
-
- var viewBead:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = viewBead.contentView;
- children = contentView.internalChildren();
- var hasHeight:Boolean = !host.isHeightSizedToContent();
- var hasWidth:Boolean = !host.isWidthSizedToContent();
- var maxHeight:Number = 0;
- var computedWidth:Number = 0;
- n = children.length;
- for (i = 0; i < n; i++)
- {
- var child:WrappedHTMLElement = children[i] as WrappedHTMLElement;
- child.flexjs_wrapper.internalDisplay = 'inline-block';
- if (child.style.display == 'none')
- child.flexjs_wrapper.setDisplayStyleForLayout('inline-block');
- else
- child.style.display = 'inline-block';
- maxHeight = Math.max(maxHeight, child.offsetHeight);
- if (!hasWidth) {
- var cv:Object = getComputedStyle(child);
- var mls:String = cv['margin-left'];
- var ml:Number = Number(mls.substring(0, mls.length - 2));
- var mrs:String = cv['margin-right'];
- var mr:Number = Number(mrs.substring(0, mrs.length - 2));
- computedWidth += ml + child.offsetWidth + mr;
- }
- child.flexjs_wrapper.dispatchEvent('sizeChanged');
- }
- // if there are children and maxHeight is ok, use it.
- // maxHeight can be NaN if the child hasn't been rendered yet.
- if (!hasHeight && n > 0 && !isNaN(maxHeight)) {
- contentView.height = maxHeight;
- }
- if (!hasWidth && n > 0 && !isNaN(computedWidth)) {
- contentView.width = computedWidth + 1; // some browser need one more pixel
- }
- return true;
- }
- }
-
- COMPILE::AS3
- private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
- bottom:Number, mb:Number, pb:Number, h:Number,
- valign:*):void
- {
- var heightSet:Boolean = false;
-
- var hh:Number = h;
- var ilc:ILayoutChild = child as ILayoutChild;
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(h * ilc.percentHeight / 100, true);
- }
- if (valign == "top")
- {
- if (!isNaN(top))
- {
- if (ilc)
- ilc.setY(top + mt);
- else
- child.y = top + mt;
- hh -= top + mt;
- }
- else
- {
- if (ilc)
- ilc.setY(mt + pt);
- else
- child.y = mt + pt;
- hh -= mt + pt;
- }
- if (ilc.isHeightSizedToContent())
- {
- if (!isNaN(bottom))
- {
- if (!isNaN(top))
- {
- if (ilc)
- ilc.setHeight(hh - bottom - mb, true);
- else
- {
- child.height = hh - bottom - mb;
- heightSet = true;
- }
- }
- }
- }
- }
- else if (valign == "bottom")
- {
- if (!isNaN(bottom))
- {
- if (ilc)
- ilc.setY(h - bottom - mb - child.height);
- else
- child.y = h - bottom - mb - child.height;
- }
- else
- {
- if (ilc)
- ilc.setY(h - mb - child.height);
- else
- child.y = h - mb - child.height;
- }
- }
- else
- child.y = (h - child.height) / 2;
- if (!heightSet)
- child.dispatchEvent(new Event("sizeChanged"));
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
deleted file mode 100644
index 00d328b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/LayoutChangeNotifier.as
+++ /dev/null
@@ -1,103 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.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"));
- }
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
deleted file mode 100644
index 309ef3b..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/OneFlexibleChildHorizontalLayout.as
+++ /dev/null
@@ -1,332 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html.beads.layouts
-{
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IDocument;
- import org.apache.flex.core.ILayoutChild;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParentIUIBase;
- 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.geom.Rectangle;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.CSSContainerUtils;
-
- /**
- * The OneFlexibleChildHorizontalLayout 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 one 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 OneFlexibleChildHorizontalLayout implements IBeadLayout, IDocument
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function OneFlexibleChildHorizontalLayout()
- {
- }
-
-
- /**
- * The id of the flexible child
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var flexibleChild:String;
-
- private var actualChild:ILayoutChild;
-
- // the strand/host container is also an ILayoutChild because
- // can have its size dictated by the host's parent which is
- // important to know for layout optimization
- private var host:ILayoutChild;
-
- /**
- * @private
- * The document.
- */
- private var document:Object;
-
- /**
- * @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
- {
- host = value as ILayoutChild;
- }
-
- private var _maxWidth:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxWidth
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxWidth():Number
- {
- return _maxWidth;
- }
-
- /**
- * @private
- */
- public function set maxWidth(value:Number):void
- {
- _maxWidth = value;
- }
-
- private var _maxHeight:Number;
-
- /**
- * @copy org.apache.flex.core.IBead#maxHeight
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get maxHeight():Number
- {
- return _maxHeight;
- }
-
- /**
- * @private
- */
- public function set maxHeight(value:Number):void
- {
- _maxHeight = value;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadLayout#layout
- */
- public function layout():Boolean
- {
- var layoutParent:ILayoutHost = host.getBeadByType(ILayoutHost) as ILayoutHost;
- var contentView:IParentIUIBase = layoutParent ? layoutParent.contentView : IParentIUIBase(host);
- var padding:Rectangle = CSSContainerUtils.getPaddingMetrics(host);
- actualChild = document[flexibleChild];
-
- var ilc:ILayoutChild;
- var n:int = contentView.numElements;
- var marginLeft:Object;
- var marginRight:Object;
- var marginTop:Object;
- var marginBottom:Object;
- var margin:Object;
- maxHeight = 0;
- var verticalMargins:Array = new Array(n);
-
- var ww:Number = contentView.width - padding.right;
- var hh:Number = contentView.height;
- var xx:int = padding.left;
- var flexChildIndex:int;
- var ml:Number;
- var mr:Number;
- var mt:Number;
- var mb:Number;
- var lastmr:Number;
- var lastml:Number;
- var valign:Object;
- var hostSizedToContent:Boolean = host.isHeightSizedToContent();
-
- for (var i:int = 0; i < n; i++)
- {
- var child:IUIBase = contentView.getElementAt(i) as IUIBase;
- if (child == actualChild)
- {
- flexChildIndex = i;
- break;
- }
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- 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");
- mt = CSSUtils.getTopValue(marginTop, margin, hh);
- mb = CSSUtils.getBottomValue(marginBottom, margin, hh);
- mr = CSSUtils.getRightValue(marginRight, margin, ww);
- ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
- child.y = mt + padding.top;
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
- }
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- child.x = xx + ml;
- xx += child.width + ml + mr;
- lastmr = mr;
- valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
- verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
- }
-
- if (n > 0 && n > flexChildIndex)
- {
- for (i = n - 1; i > flexChildIndex; i--)
- {
- child = contentView.getElementAt(i) as IUIBase;
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- 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");
- mt = CSSUtils.getTopValue(marginTop, margin, hh);
- mb = CSSUtils.getTopValue(marginBottom, margin, hh);
- mr = CSSUtils.getRightValue(marginRight, margin, ww);
- ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
- child.y = mt + padding.top;
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
- }
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- child.x = ww - child.width - mr;
- ww -= child.width + ml + mr;
- lastml = ml;
- valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
- verticalMargins[i] = { marginTop: mt, marginBottom: mb, valign: valign };
- }
-
- child = contentView.getElementAt(flexChildIndex) as IUIBase;
- margin = ValuesManager.valuesImpl.getValue(child, "margin");
- 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");
- mt = CSSUtils.getTopValue(marginTop, margin, hh);
- mb = CSSUtils.getTopValue(marginBottom, margin, hh);
- mr = CSSUtils.getRightValue(marginRight, margin, ww);
- ml = CSSUtils.getLeftValue(marginLeft, margin, ww);
- if (child is ILayoutChild)
- {
- ilc = child as ILayoutChild;
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(contentView.height * ilc.percentHeight / 100, true);
- }
- child.x = xx + ml;
- child.width = ww - child.x;
- maxHeight = Math.max(maxHeight, mt + child.height + mb);
- valign = ValuesManager.valuesImpl.getValue(child, "vertical-align");
- verticalMargins[flexChildIndex] = { marginTop: mt, marginBottom: mb, valign: valign };
- }
- if (hostSizedToContent)
- ILayoutChild(contentView).setHeight(maxHeight + padding.top + padding.bottom, true);
-
- for (i = 0; i < n; i++)
- {
- var obj:Object = verticalMargins[i]
- child = contentView.getElementAt(i) as IUIBase;
- setPositionAndHeight(child, obj.top, obj.marginTop, padding.top,
- obj.bottom, obj.marginBottom, padding.bottom, maxHeight, obj.valign);
- }
- return true;
- }
-
- private function setPositionAndHeight(child:IUIBase, top:Number, mt:Number, pt:Number,
- bottom:Number, mb:Number, pb:Number, h:Number, valign:String):void
- {
- var heightSet:Boolean = false; // if we've set the height in a way that gens a change event
- var ySet:Boolean = false; // if we've set the y yet.
-
- var hh:Number = h;
- var ilc:ILayoutChild = child as ILayoutChild;
- if (!isNaN(top))
- {
- child.y = top + mt;
- ySet = true;
- hh -= top + mt;
- }
- else
- {
- hh -= mt;
- }
- if (!isNaN(bottom))
- {
- if (!isNaN(top))
- {
- if (ilc)
- ilc.setHeight(hh - bottom - mb, true);
- else
- {
- child.height = hh - bottom - mb;
- heightSet = true;
- }
- }
- else
- {
- child.y = h - bottom - mb - child.height - 1; // some browsers don't like going to the edge
- ySet = true;
- }
- }
- if (ilc)
- {
- if (!isNaN(ilc.percentHeight))
- ilc.setHeight(h * ilc.percentHeight / 100, true);
- }
- if (valign == "center")
- child.y = (h - child.height) / 2;
- else if (valign == "bottom")
- child.y = h - child.height - mb;
- else
- child.y = mt + pt;
- if (!heightSet)
- child.dispatchEvent(new Event("sizeChanged"));
- }
-
- public function setDocument(document:Object, id:String = null):void
- {
- this.document = document;
- }
- }
-
-}
[25/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as
deleted file mode 100644
index fa91fec..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ComboBox.as
+++ /dev/null
@@ -1,277 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IComboBoxModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.events.Event;
-
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- [Event(name="change", type="org.apache.flex.events.Event")]
-
- /**
- * The ComboBox class is a component that displays an input field and
- * pop-up List with selections. Selecting an item from the pop-up List
- * places that item into the input field of the ComboBox. The ComboBox
- * uses the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and
- * so forth.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the component.
- * org.apache.flex.core.IBeadController: the bead that handles input and output.
- * org.apache.flex.core.IPopUp: the bead responsible for displaying the selection list.
- * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders.
- * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ComboBox extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ComboBox()
- {
- super();
- }
-
- /**
- * The data for display by the ComboBox.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return IComboBoxModel(model).dataProvider;
- }
- public function set dataProvider(value:Object):void
- {
- IComboBoxModel(model).dataProvider = value;
- }
-
- /**
- * The index of the currently selected item. Changing this item changes
- * the selectedItem value.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return IComboBoxModel(model).selectedIndex;
- }
- public function set selectedIndex(value:int):void
- {
- IComboBoxModel(model).selectedIndex = value;
- }
-
- /**
- * The item that is currently selected. Changing this item changes
- * the selectedIndex.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return IComboBoxModel(model).selectedItem;
- }
- public function set selectedItem(value:Object):void
- {
- IComboBoxModel(model).selectedItem = value;
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- var button:WrappedHTMLElement;
- var input:WrappedHTMLElement;
-
- element = document.createElement('div') as WrappedHTMLElement;
-
- input = document.createElement('input') as WrappedHTMLElement;
- input.style.position = 'absolute';
- input.style.width = '80px';
- element.appendChild(input);
-
- button = document.createElement('div') as WrappedHTMLElement;
- button.style.position = 'absolute';
- button.style.top = '0px';
- button.style.right = '0px';
- button.style.background = '#bbb';
- button.style.width = '16px';
- button.style.height = '20px';
- button.style.margin = '0';
- button.style.border = 'solid #609 1px';
- goog.events.listen(button, 'click', buttonClicked);
- element.appendChild(button);
-
- positioner = element;
- positioner.style.position = 'relative';
-
- // add a click handler so that a click outside of the combo box can
- // dismiss the pop-up should it be visible.
- goog.events.listen(document, 'click',
- dismissPopup);
-
- input.flexjs_wrapper = this;
-
- return element;
- }
-
- COMPILE::JS
- private var popup:HTMLElement;
-
- /**
- * @param event The event.
- * @flexjsignorecoercion HTMLSelectElement
- */
- COMPILE::JS
- private function selectChanged(event:Event):void
- {
- var select:HTMLSelectElement;
-
- select = event.currentTarget as HTMLSelectElement;
-
- selectedItem = select.options[select.selectedIndex].value;
-
- popup.parentNode.removeChild(popup);
- popup = null;
-
- dispatchEvent(event);
- }
-
-
- /**
- * @param event The event.
- */
- COMPILE::JS
- private function dismissPopup(event:Event):void
- {
- // remove the popup if it already exists
- if (popup) {
- popup.parentNode.removeChild(popup);
- popup = null;
- }
- }
-
-
- /**
- * @export
- * @param {Object} event The event.
- * @flexjsignorecoercion HTMLInputElement
- * @flexjsignorecoercion HTMLElement
- * @flexjsignorecoercion HTMLSelectElement
- * @flexjsignorecoercion HTMLOptionElement
- * @flexjsignorecoercion Array
- */
- COMPILE::JS
- private function buttonClicked(event:Event):void
- {
- var dp:Array;
- var i:int;
- var input:HTMLInputElement;
- var left:Number;
- var n:int;
- var opt:HTMLOptionElement;
- var pn:HTMLElement;
- var popup:HTMLElement;
- var select:HTMLSelectElement;
- var si:int;
- var top:Number;
- var width:Number;
-
- event.stopPropagation();
-
- if (popup) {
- dismissPopup(null);
-
- return;
- }
-
- input = element.childNodes.item(0) as HTMLInputElement;
-
- pn = element;
- top = pn.offsetTop + input.offsetHeight;
- left = pn.offsetLeft;
- width = pn.offsetWidth;
-
- popup = document.createElement('div') as HTMLElement;
- popup.className = 'popup';
- popup.id = 'test';
- popup.style.position = 'absolute';
- popup.style.top = top.toString() + 'px';
- popup.style.left = left.toString() + 'px';
- popup.style.width = width.toString() + 'px';
- popup.style.margin = '0px auto';
- popup.style.padding = '0px';
- popup.style.zIndex = '10000';
-
- select = document.createElement('select') as HTMLSelectElement;
- select.style.width = width.toString() + 'px';
- goog.events.listen(select, 'change', selectChanged);
-
- dp = dataProvider as Array;
- n = dp.length;
- for (i = 0; i < n; i++) {
- opt = document.createElement('option') as HTMLOptionElement;
- opt.text = dp[i];
- select.add(opt, null);
- }
-
- select.size = n;
-
- si = selectedIndex;
- if (si < 0) {
- select.value = null;
- } else {
- select.value = dp[si];
- }
-
- this.popup = popup;
-
- popup.appendChild(select);
- document.body.appendChild(popup);
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as
deleted file mode 100644
index ee30b7f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Container.as
+++ /dev/null
@@ -1,108 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.IUIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
- import org.apache.flex.events.Event;
-
- [DefaultProperty("mxmlContent")]
-
- /**
- * The Container class implements a basic container for
- * other controls and containers. The position and size
- * of the children are determined by a layout while the size of
- * a Container can either be determined by its children or by
- * specifying an exact size in pixels or as a percentage of the
- * parent element.
- *
- * This Container does not have a built-in scroll bar or clipping of
- * its content should the content exceed the Container's boundaries. To
- * have scroll bars and clipping, add the ScrollingView bead.
- *
- * While the container is relatively lightweight, it should
- * generally not be used as the base class for other controls,
- * even if those controls are composed of children. That's
- * because the fundamental API of Container is to support
- * an arbitrary set of children, and most controls only
- * support a specific set of children.
- *
- * And that's one of the advantages of beads: that functionality
- * used in a Container can also be used in a Control as long
- * as that bead doesn't assume that its strand is a Container.
- *
- * For example, even though you can use a Panel to create the
- * equivalent of an Alert control, the Alert is a
- * control and not a Container because the Alert does not
- * support an arbitrary set of children.
- *
- * @see org.apache.flex.html.beads.layout
- * @see org.apache.flex.html.supportClasses.ScrollingViewport
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Container extends ContainerBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Container()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
-
- positioner = element;
-
- // absolute positioned children need a non-null
- // position value in the parent. It might
- // get set to 'absolute' if the container is
- // also absolutely positioned
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- /*addEventListener('childrenAdded',
- runLayoutHandler);
- addEventListener('elementRemoved',
- runLayoutHandler);*/
-
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as
deleted file mode 100644
index da65539..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ControlBar.as
+++ /dev/null
@@ -1,99 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
-
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.ValuesManager;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The ControlBar class is used within a Panel as a place to position
- * additional controls. The ControlBar appears at the bottom of the
- * org.apache.flex.html.Panel
- * and is not part of the Panel's scrollable content area. The ControlBar
- * is a Container and implements the org.apache.flex.core.IChrome interface, indicating that is
- * outside of the Container's content area. The ControlBar uses the following
- * beads:
- *
- * org.apache.flex.core.IBeadModel: the data model for the component.
- * org.apache.flex.core.IMeasurementBead: helps determine the overlay size of the ControlBar for layout.
- * org.apache.flex.core.IBorderBead: if present, displays a border around the component.
- * org.apache.flex.core.IBackgroundBead: if present, displays a solid background below the ControlBar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ControlBar extends Container implements IContainer, IChrome
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ControlBar()
- {
- super();
-
- className = "ControlBar";
- }
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- if( getBeadByType(IBeadLayout) == null ) {
- var layout:IBeadLayout = new (ValuesManager.valuesImpl.getValue(this, "iBeadLayout")) as IBeadLayout;
- addBead(layout);
- }
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
- element.className = 'ControlBar';
- element.style.display = 'inline';
- typeNames = 'ControlBar';
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as
deleted file mode 100644
index 8cba078..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DataGrid.as
+++ /dev/null
@@ -1,164 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDataGridModel;
- import org.apache.flex.core.IDataGridPresentationModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.html.beads.models.DataGridPresentationModel;
-
- [Event(name="change", type="org.apache.flex.events.Event")]
-
- /**
- * The DataGrid class displays a collection of data using columns and rows. Each
- * column represents a specific field in the data set; each row represents a specific
- * datum. The DataGrid is a composite component built with a org.apache.flex.html.ButtonBar
- * for the column headers and a org.apache.flex.html.List for each column. The DataGrid's
- * view bead (usually org.apache.flex.html.beads.DataGridView) constructs these parts while
- * itemRenderer factories contruct the elements to display the data in each cell.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DataGrid extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DataGrid()
- {
- super();
- }
-
- /**
- * The array of org.apache.flex.html.supportClasses.DataGridColumns used to
- * describe each column.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get columns():Array
- {
- return IDataGridModel(model).columns;
- }
- public function set columns(value:Array):void
- {
- IDataGridModel(model).columns = value;
- }
-
- /**
- * The object used to provide data to the org.apache.flex.html.DataGrid.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return IDataGridModel(model).dataProvider;
- }
- public function set dataProvider(value:Object):void
- {
- IDataGridModel(model).dataProvider = value;
- }
-
- /**
- * The currently selected row.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return IDataGridModel(model).selectedIndex;
- }
-
- /**
- * The DataGrid's presentation model
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get presentationModel():IDataGridPresentationModel
- {
- var beadMod:IBead = getBeadByType(IDataGridPresentationModel);
- var presModel:IDataGridPresentationModel;
-
- if (beadMod == null) {
- presModel = new DataGridPresentationModel();
- addBead(presModel);
- } else {
- presModel = beadMod as IDataGridPresentationModel;
- }
- return presModel;
- }
-
- /**
- * The default height of each cell in every column
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rowHeight():Number
- {
- return presentationModel.rowHeight;
- }
- public function set rowHeight(value:Number):void
- {
- presentationModel.rowHeight = value;
- }
-
- /**
- * @private
- * The DataGrid needs to know whenever its size is being changed so the columns can be
- * be aligned properly, so the noEvent value must always be false.
- */
- override public function setWidth(value:Number, noEvent:Boolean=false):void
- {
- super.setWidth(value,false);
- }
-
- /**
- * @private
- * The DataGrid needs to know whenever its size is being changed so the columns can be
- * be aligned properly, so the noEvent value must always be false.
- */
- override public function setHeight(value:Number, noEvent:Boolean=false):void
- {
- super.setHeight(value,false);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as
deleted file mode 100644
index 33615ea..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateChooser.as
+++ /dev/null
@@ -1,74 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IDateChooserModel;
- import org.apache.flex.core.UIBase;
-
- /**
- * The change event is dispatched when the selectedDate is changed.
- */
- [Event(name="change", type="org.apache.flex.events.Event")]
-
- /**
- * The DateChooser class is a component that displays a calendar.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DateChooser extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DateChooser()
- {
- super();
- className = "DateChooser";
-
- // fix the DateChooser's size
-// width = 280;
-// height = 240;
- }
-
- /**
- * The currently selected date (or null if no date has been selected).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedDate():Date
- {
- return IDateChooserModel(model).selectedDate;
- }
- public function set selectedDate(value:Date):void
- {
- IDateChooserModel(model).selectedDate = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as
deleted file mode 100644
index f46e453..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DateField.as
+++ /dev/null
@@ -1,95 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IDateChooserModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
-
- /**
- * The change event is dispatched when the selectedDate is changed.
- */
- [Event(name="change", type="org.apache.flex.events.Event")]
-
- /**
- * The DateField class provides an input field where a date can be entered
- * and a pop-up calendar control for picking a date as an alternative to
- * the text field.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DateField extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DateField()
- {
- super();
-
- className = "DateField";
- }
-
- /**
- * The method called when added to a parent. The DateField class uses
- * this opportunity to install additional beads.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function addedToParent():void
- {
- var klass:* = ValuesManager.valuesImpl.getValue(this,"iFormatBead");
- var bead:IBead = new klass() as IBead;
- if (bead) {
- addBead(bead);
- }
-
- super.addedToParent();
- }
-
- /**
- * The currently selected date (or null if no date has been selected).
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedDate():Date
- {
- return IDateChooserModel(model).selectedDate;
- }
- public function set selectedDate(value:Date):void
- {
- IDateChooserModel(model).selectedDate = value;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as
deleted file mode 100644
index dd069b2..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/DropDownList.as
+++ /dev/null
@@ -1,235 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ISelectionModel;
-
- COMPILE::JS
- {
- import goog.events;
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.html.beads.models.ArraySelectionModel;
- }
-
- //--------------------------------------
- // Events
- //--------------------------------------
-
- /**
- * Dispatched when the user selects an item.
- *
- * @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 DropDownList class implements the basic equivalent of
- * the <code><select></code> tag in HTML.
- * The default implementation only lets the user see and
- * choose from an array of strings. More complex controls
- * would display icons as well as strings, or colors instead
- * of strings or just about anything.
- *
- * The default behavior only lets the user choose one and
- * only one item. More complex controls would allow
- * mutiple selection by not dismissing the dropdown as soon
- * as a selection is made.
- *
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DropDownList extends Button
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DropDownList()
- {
- COMPILE::JS
- {
- model = new ArraySelectionModel();
- }
- }
-
- /**
- * The data set to be displayed. Usually a simple
- * array of strings. A more complex component
- * would allow more complex data and data sets.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return ISelectionModel(model).dataProvider;
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLOptionElement
- * @flexjsignorecoercion HTMLSelectElement
- */
- public function set dataProvider(value:Object):void
- {
- ISelectionModel(model).dataProvider = value;
- COMPILE::JS
- {
- var dp:HTMLOptionsCollection;
- var i:int;
- var n:int;
- var opt:HTMLOptionElement;
- var dd:HTMLSelectElement = element as HTMLSelectElement;
-
- model.dataProvider = value;
- dp = dd.options;
- n = dp.length;
- for (i = 0; i < n; i++) {
- dd.remove(0);
- }
-
- var lf:String = labelField;
- n = value.length;
- for (i = 0; i < n; i++) {
- opt = document.createElement('option') as HTMLOptionElement;
- if (lf)
- opt.text = value[i][lf];
- else
- opt.text = value[i];
- dd.add(opt, null);
- }
-
- }
- }
-
- [Bindable("change")]
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedIndex
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return ISelectionModel(model).selectedIndex;
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLSelectElement
- */
- public function set selectedIndex(value:int):void
- {
- ISelectionModel(model).selectedIndex = value;
- COMPILE::JS
- {
- (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex;
- }
- }
-
-
- [Bindable("change")]
- /**
- * @copy org.apache.flex.core.ISelectionModel#selectedItem
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return ISelectionModel(model).selectedItem;
- }
-
- /**
- * @private
- * @flexjsignorecoercion HTMLSelectElement
- */
- public function set selectedItem(value:Object):void
- {
- ISelectionModel(model).selectedItem = value;
- COMPILE::JS
- {
- (element as HTMLSelectElement).selectedIndex = ISelectionModel(model).selectedIndex;
- }
- }
-
- /**
- * The name of field within the data used for display. Each item of the
- * data should have a property with this name.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get labelField():String
- {
- return ISelectionModel(model).labelField;
- }
- public function set labelField(value:String):void
- {
- ISelectionModel(model).labelField = value;
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- * @flexjsignorecoercion HTMLSelectElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('select') as WrappedHTMLElement;
- (element as HTMLSelectElement).size = 1;
- goog.events.listen(element, 'change',
- changeHandler);
-
- positioner = element;
- positioner.style.position = 'relative';
-
- element.flexjs_wrapper = this;
-
- return element;
- }
-
- /**
- * @flexjsignorecoercion HTMLSelectElement
- */
- COMPILE::JS
- protected function changeHandler(event:Event):void
- {
- model.selectedIndex = (element as HTMLSelectElement).selectedIndex;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as
deleted file mode 100644
index 9f38883..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/HContainer.as
+++ /dev/null
@@ -1,61 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ContainerBase;
- import org.apache.flex.core.IChrome;
- import org.apache.flex.core.IContainer;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.events.Event;
-
- [DefaultProperty("mxmlContent")]
-
- /**
- * A Container that has a HorizontalLayout.
- *
- * This is effectively the same as the pattern
- * <code>
- * <basic:Container xmlns:basic="library://ns.apache.org/flexjs/basic">
- * <basic:layout>
- * <basic:HorizontalLayout />
- * </basic:layout>
- * </basic:Container>
- * </code>
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HContainer extends Container implements IContainer
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HContainer()
- {
- super();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as
deleted file mode 100644
index 7c2fb2f..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/HRule.as
+++ /dev/null
@@ -1,63 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The HRule class displays a horizontal line
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class HRule extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function HRule()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('hr') as WrappedHTMLElement;
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
- return element;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as
deleted file mode 100644
index ae81c18..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Image.as
+++ /dev/null
@@ -1,99 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.IImageModel;
- import org.apache.flex.core.UIBase;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.html.beads.models.ImageModel;
- import org.apache.flex.html.beads.ImageView;
- }
-
- /**
- * The Image class is a component that displays a bitmap. The Image uses
- * the following beads:
- *
- * org.apache.flex.core.IBeadModel: the data model for the Image, including the source property.
- * org.apache.flex.core.IBeadView: constructs the visual elements of the component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Image extends UIBase
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Image()
- {
- super();
- }
-
- /**
- * The location of the bitmap, usually a URL.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion org.apache.flex.core.IImageModel
- */
- public function get source():String
- {
- return (model as IImageModel).source;
- }
- public function set source(value:String):void
- {
- (model as IImageModel).source = value;
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('img') as WrappedHTMLElement;
- element.className = 'Image';
- typeNames = 'Image';
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- model = new
- ImageModel();
-
- addBead(new
- ImageView());
-
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as
deleted file mode 100644
index 8bdcc6a..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageAndTextButton.as
+++ /dev/null
@@ -1,128 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.html.beads.models.ImageAndTextModel;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The ImageTextButton class implements a basic button that
- * displays and image and text.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageAndTextButton extends TextButton
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageAndTextButton()
- {
- super();
- }
-
- /**
- * @private
- */
- COMPILE::JS
- override public function get text():String
- {
- return ImageAndTextModel(model).text;
- }
-
- /**
- * @private
- */
- COMPILE::JS
- override public function set text(value:String):void
- {
- ImageAndTextModel(model).text = value;
- COMPILE::JS
- {
- setInnerHTML();
- }
- }
-
- /**
- * The URL of an icon to use in the button
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get image():String
- {
- return ImageAndTextModel(model).image;
- }
-
- /**
- * @private
- */
- public function set image(value:String):void
- {
- ImageAndTextModel(model).image = value;
- COMPILE::JS
- {
- setInnerHTML();
- }
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('button') as WrappedHTMLElement;
- element.setAttribute('type', 'button');
-
- positioner = element;
- positioner.style.position = 'relative';
- element.flexjs_wrapper = this;
-
- return element;
- }
-
- /**
- */
- COMPILE::JS
- protected function setInnerHTML():void
- {
- var inner:String = '';
- if (image != null)
- inner += "<img src='" + image + "'/>";
- inner += ' ';
- inner += text;
- element.innerHTML = inner;
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as
deleted file mode 100644
index de563a1..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/ImageButton.as
+++ /dev/null
@@ -1,89 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.SimpleCSSStyles;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /**
- * The ImageButton class presents an image as a button.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ImageButton extends Button
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ImageButton()
- {
- super();
- typeNames = "ImageButton";
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement("input") as WrappedHTMLElement;
- positioner = element;
- element.flexjs_wrapper = this;
-
- var inputElement:HTMLInputElement = element as HTMLInputElement;
- inputElement.type = "image";
-
- return element;
- }
-
- /**
- * Sets the image for the button. This is a URL.
- * TODO: figure out how to set the source in the style, rather than using
- * backgroundImage behind the scenes.
- */
- public function get source():String
- {
- return style.backgroundImage;
- }
-
- public function set source(url:String):void
- {
- if (!style)
- style = new SimpleCSSStyles();
- style.backgroundImage = url;
-
- COMPILE::JS {
- var inputElement:HTMLInputElement = element as HTMLInputElement;
- inputElement.src = url;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as
deleted file mode 100644
index 392dcca..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/Label.as
+++ /dev/null
@@ -1,163 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /*
- * Label probably should extend TextField directly,
- * but the player's APIs for TextLine do not allow
- * direct instantiation, and we might want to allow
- * Labels to be declared and have their actual
- * view be swapped out.
- */
-
- /**
- * The Label class implements the basic control for labeling
- * other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Label extends UIBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Label()
- {
- super();
- }
-
- [Bindable("textChange")]
- /**
- * The text to display in the label.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).text;
- }
- COMPILE::JS
- {
- return element.innerHTML;
- }
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).text = value;
- }
- COMPILE::JS
- {
- this.element.innerHTML = value;
- this.dispatchEvent('textChange');
- }
-
- }
-
- [Bindable("htmlChange")]
- /**
- * The html-formatted text to display in the label.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- COMPILE::AS3
- {
- return ITextModel(model).html;
- }
- COMPILE::JS
- {
- return element.innerHTML;
- }
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- COMPILE::AS3
- {
- ITextModel(model).html = value;
- }
- COMPILE::JS
- {
- this.element.innerHTML = value;
- this.dispatchEvent('textChange');
- }
- }
-
-
- /**
- * @private
- */
- COMPILE::AS3
- override public function addedToParent():void
- {
- super.addedToParent();
- model.addEventListener("textChange", repeaterListener);
- model.addEventListener("htmlChange", repeaterListener);
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('span') as WrappedHTMLElement;
- positioner = element;
- element.flexjs_wrapper = this;
- return element;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as
deleted file mode 100644
index 63bcf02..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/List.as
+++ /dev/null
@@ -1,311 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ContainerBaseStrandChildren;
- import org.apache.flex.core.IContentViewHost;
- import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IFactory;
- import org.apache.flex.core.IItemRendererClassFactory;
- import org.apache.flex.core.IItemRendererProvider;
- import org.apache.flex.core.IListPresentationModel;
- import org.apache.flex.core.IRollOverModel;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.ListBase;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- import org.apache.flex.html.beads.ListView;
- import org.apache.flex.html.supportClasses.DataGroup;
- }
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.beads.models.ListPresentationModel;
-
- /**
- * Indicates that the initialization of the list is complete.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- [Event(name="initComplete", type="org.apache.flex.events.Event")]
-
- /**
- * The change event is dispatched whenever the list's selection changes.
- *
- * @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 List class is a component that displays multiple data items. The List uses
- * the following bead types:
- *
- * org.apache.flex.core.IBeadModel: the data model, which includes the dataProvider, selectedItem, and
- * so forth.
- * org.apache.flex.core.IBeadView: the bead that constructs the visual parts of the list.
- * org.apache.flex.core.IBeadController: the bead that handles input and output.
- * org.apache.flex.core.IBeadLayout: the bead responsible for the size and position of the itemRenderers.
- * org.apache.flex.core.IDataProviderItemRendererMapper: the bead responsible for creating the itemRenders.
- * org.apache.flex.core.IItemRenderer: the class or factory used to display an item in the list.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class List extends ListBase implements IItemRendererProvider
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function List()
- {
- super();
- }
-
- /**
- * The name of field within the data used for display. Each item of the
- * data should have a property with this name.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get labelField():String
- {
- return ISelectionModel(model).labelField;
- }
- public function set labelField(value:String):void
- {
- ISelectionModel(model).labelField = value;
- }
-
- /**
- * The data being display by the List.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get dataProvider():Object
- {
- return ISelectionModel(model).dataProvider;
- }
- public function set dataProvider(value:Object):void
- {
- ISelectionModel(model).dataProvider = value;
- }
-
- /**
- * The index of the currently selected item. Changing this value
- * also changes the selectedItem property.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedIndex():int
- {
- return ISelectionModel(model).selectedIndex;
- }
- public function set selectedIndex(value:int):void
- {
- ISelectionModel(model).selectedIndex = value;
- }
-
- /**
- * The index of the item currently below the pointer.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rollOverIndex():int
- {
- return IRollOverModel(model).rollOverIndex;
- }
- public function set rollOverIndex(value:int):void
- {
- IRollOverModel(model).rollOverIndex = value;
- }
-
- /**
- * The presentation model for the list.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get presentationModel():IListPresentationModel
- {
- var presModel:IListPresentationModel = getBeadByType(IListPresentationModel) as IListPresentationModel;
- if (presModel == null) {
- presModel = new ListPresentationModel();
- addBead(presModel);
- }
- return presModel;
- }
-
- /**
- * The default height of each cell in every column
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get rowHeight():Number
- {
- return presentationModel.rowHeight;
- }
- public function set rowHeight(value:Number):void
- {
- presentationModel.rowHeight = value;
- }
-
- /**
- * The item currently selected. Changing this value also
- * changes the selectedIndex property.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selectedItem():Object
- {
- return ISelectionModel(model).selectedItem;
- }
- public function set selectedItem(value:Object):void
- {
- ISelectionModel(model).selectedItem = value;
- }
-
- private var _itemRenderer:IFactory;
-
- /**
- * The class or factory used to display each item.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get itemRenderer():IFactory
- {
- return _itemRenderer;
- }
- public function set itemRenderer(value:IFactory):void
- {
- _itemRenderer = value;
- }
-
- /**
- * Returns whether or not the itemRenderer property has been set.
- *
- * @see org.apache.flex.core.IItemRendererProvider
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get hasItemRenderer():Boolean
- {
- var result:Boolean = false;
-
- COMPILE::AS3 {
- result = _itemRenderer != null;
- }
-
- COMPILE::JS {
- var test:* = _itemRenderer;
- result = _itemRenderer !== null && test !== undefined;
- }
-
- return result;
- }
-
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- if (getBeadByType(IDataProviderItemRendererMapper) == null)
- {
- var mapper:IDataProviderItemRendererMapper = new (ValuesManager.valuesImpl.getValue(this, "iDataProviderItemRendererMapper")) as IDataProviderItemRendererMapper;
- addBead(mapper);
- }
- var itemRendererFactory:IItemRendererClassFactory = getBeadByType(IItemRendererClassFactory) as IItemRendererClassFactory;
- if (!itemRendererFactory)
- {
- itemRendererFactory = new (ValuesManager.valuesImpl.getValue(this, "iItemRendererClassFactory")) as IItemRendererClassFactory;
- addBead(itemRendererFactory);
- }
-
- dispatchEvent(new Event("initComplete"));
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- super.createElement();
- className = 'List';
-
- return element;
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.html.beads.ListView
- * @flexjsignorecoercion org.apache.flex.html.supportClasses.DataGroup
- */
- COMPILE::JS
- override public function internalChildren():Array
- {
- var listView:ListView = getBeadByType(ListView) as ListView;
- var dg:DataGroup = listView.dataGroup as DataGroup;
- var renderers:Array = dg.internalChildren();
- return renderers;
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as
deleted file mode 100644
index 301e430..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/MXMLBeadViewBase.as
+++ /dev/null
@@ -1,317 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.states.State;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IStatesImpl;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.html.beads.ContainerView;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.ValueChangeEvent;
- import org.apache.flex.utils.MXMLDataInterpreter;
-
- [DefaultProperty("mxmlContent")]
-
- /**
- * The MXMLBeadViewBase class extends BeadViewBase
- * and adds support for databinding and specification
- * of children in MXML.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class MXMLBeadViewBase extends ContainerView implements IStrand, ILayoutHost
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function MXMLBeadViewBase()
- {
- super();
- }
-
- [Bindable("strandChanged")]
- /**
- * An MXMLBeadViewBase doesn't create its children until it is added to
- * the 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;
- // each MXML file can also have styles in fx:Style block
- ValuesManager.valuesImpl.init(this);
-
- dispatchEvent(new Event("strandChanged"));
-
- for each (var bead:IBead in beads)
- addBead(bead);
-
- dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
-
- MXMLDataInterpreter.generateMXMLInstances(this, IParent(value), MXMLDescriptor);
-
- dispatchEvent(new Event("initBindings"))
- dispatchEvent(new Event("initComplete"))
- dispatchEvent(new Event("childrenAdded"));
- }
-
- [Bindable("__NoChangeEvent__")]
- /**
- * The model object.
- */
- public function get model():Object
- {
- return _strand["model"];
- }
-
- /**
- * @copy org.apache.flex.core.Application#MXMLDescriptor
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get MXMLDescriptor():Array
- {
- return null;
- }
-
- /**
- * @copy org.apache.flex.core.Application#generateMXMLAttributes()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function generateMXMLAttributes(data:Array):void
- {
- MXMLDataInterpreter.generateMXMLProperties(this, data);
- }
-
- /**
- * @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 var _states:Array;
-
- /**
- * The array of view states. These should
- * be instances of org.apache.flex.states.State.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get states():Array
- {
- return _states;
- }
-
- /**
- * @private
- */
- public function set states(value:Array):void
- {
- _states = value;
- _currentState = _states[0].name;
-
- try{
- if (getBeadByType(IStatesImpl) == null)
- addBead(new (ValuesManager.valuesImpl.getValue(this, "iStatesImpl")) as IBead);
- }
- //TODO: Need to handle this case more gracefully
- catch(e:Error)
- {
- COMPILE::AS3
- {
- trace(e.message);
- }
- }
-
- }
-
- /**
- * <code>true</code> if the array of states
- * contains a state with this name.
- *
- * @param state The state namem.
- * @return True if state in state array
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function hasState(state:String):Boolean
- {
- for each (var s:State in _states)
- {
- if (s.name == state)
- return true;
- }
- return false;
- }
-
- private var _currentState:String;
-
- [Bindable("currentStateChange")]
- /**
- * The name of the current state.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get currentState():String
- {
- return _currentState;
- }
-
- /**
- * @private
- */
- public function set currentState(value:String):void
- {
- var event:ValueChangeEvent = new ValueChangeEvent("currentStateChange", false, false, _currentState, value)
- _currentState = value;
- dispatchEvent(event);
- }
-
- private var _transitions:Array;
-
- /**
- * The array of transitions.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get transitions():Array
- {
- return _transitions;
- }
-
- /**
- * @private
- */
- public function set transitions(value:Array):void
- {
- _transitions = value;
- }
-
- /**
- * @copy org.apache.flex.core.Application#beads
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var beads:Array;
-
- private var _beads:Array;
-
- /**
- * @copy org.apache.flex.core.IStrand#addBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addBead(bead:IBead):void
- {
- if (!_beads)
- _beads = [];
- _beads.push(bead);
- bead.strand = this;
- }
-
- /**
- * @copy org.apache.flex.core.IStrand#getBeadByType()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getBeadByType(classOrInterface:Class):IBead
- {
- for each (var bead:IBead in _beads)
- {
- if (bead is classOrInterface)
- return bead;
- }
- return null;
- }
-
- /**
- * @copy org.apache.flex.core.IStrand#removeBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- 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;
- }
-
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as
deleted file mode 100644
index 5149237..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/MultilineLabel.as
+++ /dev/null
@@ -1,76 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.html
-{
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- /*
- * Label probably should extend TextField directly,
- * but the player's APIs for TextLine do not allow
- * direct instantiation, and we might want to allow
- * Labels to be declared and have their actual
- * view be swapped out.
- */
-
- /**
- * The Label class implements the basic control for labeling
- * other controls.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class MultilineLabel extends Label
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function MultilineLabel()
- {
- super();
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- element = document.createElement('div') as WrappedHTMLElement;
- positioner = element;
- element.flexjs_wrapper = this;
- return element;
- }
-
- }
-}
[08/29] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/refactor folders to be more maven-friendly
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDropDownListView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDropDownListView.as
new file mode 100644
index 0000000..688bcc5
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IDropDownListView.as
@@ -0,0 +1,57 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+ import org.apache.flex.core.IStrand;
+
+ /**
+ * The IDropDownListView interface is the interface for views for
+ * the org.apache.flex.html.DropDownList.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IDropDownListView extends IBeadView
+ {
+
+ /**
+ * @copy org.apache.flex.html.beads.DropDownListView#popup
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get popUp():IStrand;
+
+ /**
+ * @copy org.apache.flex.html.beads.DropDownListView#popupVisible
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get popUpVisible():Boolean;
+ function set popUpVisible(value:Boolean):void;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IGraphicsDrawing.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IGraphicsDrawing.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IGraphicsDrawing.as
new file mode 100644
index 0000000..91d1838
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IGraphicsDrawing.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
+{
+ /**
+ * The IGraphicsDrawing interface is a marker interface for beads
+ * that draw into the graphics layer. This helps a bead determine
+ * if it is the first of many graphics drawing beads so it can
+ * know whether or not to clear the graphics layer before drawing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IGraphicsDrawing
+ {
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IListView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IListView.as
new file mode 100644
index 0000000..f9159ce
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IListView.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.beads
+{
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IStrand;
+
+ /**
+ * The IListView interface provides the protocol for any bead that
+ * creates the visual parts for a org.apache.flex.html.List control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IListView extends IBeadView
+ {
+ /**
+ * The component which parents all of the itemRenderers for each
+ * datum being displayed by the List component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get dataGroup():IItemRendererParent;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IScrollBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IScrollBarView.as
new file mode 100644
index 0000000..c42daa7
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/IScrollBarView.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+
+ /**
+ * The IScrollBarView interface is the interface for views for
+ * the org.apache.flex.html.supportClasses.ScrollBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface IScrollBarView
+ {
+ /**
+ * The down arrow button in a vertical ScrollBar or right arrow
+ * button in a horizontal ScrollBar
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get increment():DisplayObject;
+
+ /**
+ * The up arrow button in a vertical ScrollBar or left arrow
+ * button in a horizontal ScrollBar
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get decrement():DisplayObject;
+
+ /**
+ * The track in a ScrollBar
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get track():DisplayObject;
+
+ /**
+ * The thumb in a ScrollBar
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get thumb():DisplayObject;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISliderView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISliderView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISliderView.as
new file mode 100644
index 0000000..3ad1743
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISliderView.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.DisplayObject;
+ }
+ import org.apache.flex.core.IBead;
+
+ /**
+ * The ISliderView interface provides the protocol for any bead that
+ * creates the visual parts for a org.apache.flex.html.Slider control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ISliderView extends IBead
+ {
+ /**
+ * The component used for the track area of the org.apache.flex.html.Slider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ function get track():DisplayObject;
+
+ /**
+ * The component used for the thumb button of the org.apache.flex.html.Slider.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ function get thumb():DisplayObject;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
new file mode 100644
index 0000000..eb6adaa
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ISpinnerView.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.DisplayObject;
+ }
+
+ import org.apache.flex.core.IBead;
+
+ /**
+ * The ISpinnerView interface provides the protocol for any bead that
+ * creates the visual parts for a org.apache.flex.html.Spinner control.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ISpinnerView extends IBead
+ {
+ /**
+ * The component used to increment the org.apache.flex.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ function get increment():DisplayObject;
+
+ /**
+ * The component used to decrement the org.apache.flex.html.Spinner value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ COMPILE::AS3
+ function get decrement():DisplayObject;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextFieldView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextFieldView.as
new file mode 100644
index 0000000..e94ee34
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextFieldView.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.CSSTextField;
+
+ /**
+ * The ITextFieldView interface is the interface for views for
+ * the use a CSSTextField to display text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITextFieldView
+ {
+ /**
+ * The org.apache.flex.core.CSSTextField used to display text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get textField():CSSTextField;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextItemRenderer.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextItemRenderer.as
new file mode 100644
index 0000000..0877b05
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ITextItemRenderer.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ISelectableItemRenderer;
+
+ /**
+ * The ITextItemRenderer interface is the interface for
+ * for org.apache.flex.core.IItemRenderer that display text.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public interface ITextItemRenderer extends ISelectableItemRenderer
+ {
+ /**
+ * The text to be displayed in the item renderer.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ function get text():String;
+ function set text(value:String):void;
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageAndTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageAndTextButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageAndTextButtonView.as
new file mode 100644
index 0000000..b0ee998
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageAndTextButtonView.as
@@ -0,0 +1,276 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+ import flash.text.TextField;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IStrandWithModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.html.beads.models.ImageAndTextModel;
+ import org.apache.flex.utils.SolidBorderUtil;
+
+ /**
+ * The ImageButtonView class provides an image-only view
+ * for the standard Button. Unlike the CSSButtonView, this
+ * class does not support background and border; only images
+ * for the up, over, and active states.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageAndTextButtonView extends BeadViewBase implements IBeadView, IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageAndTextButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upTextField.selectable = false;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.type = TextFieldType.DYNAMIC;
+ upTextField.autoSize = "left";
+ downTextField.autoSize = "left";
+ overTextField.autoSize = "left";
+ }
+
+ /**
+ * @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;
+ textModel = IStrandWithModel(value).model as ImageAndTextModel;
+ textModel.addEventListener("textChange", textChangeHandler);
+ textModel.addEventListener("htmlChange", htmlChangeHandler);
+ textModel.addEventListener("imageChange", imageChangeHandler);
+
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+
+ setupBackground(upSprite, upTextField, 0xCCCCCC);
+ setupBackground(overSprite, overTextField, 0xFFCCCC, "hover");
+ setupBackground(downSprite, downTextField, 0x808080, "active");
+ upTextField.styleParent = value;
+ downTextField.styleParent = value;
+ overTextField.styleParent = value;
+
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var shape:Shape;
+
+ private var textModel:ImageAndTextModel;
+
+ /**
+ * The URL of an icon to use in the button
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get image():String
+ {
+ return textModel.image;
+ }
+
+ /**
+ * @private
+ */
+ private function setupBackground(sprite:Sprite, textField:CSSTextField, color:uint, state:String = null):void
+ {
+ var backgroundImage:Object = image;
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ sprite.addChild(textField);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ var padding:int = 2;
+ var borderWidth:int = 1;
+ updateHitArea();
+ loader.x = padding;
+ textField.x = loader.width + padding;
+ textField.y = padding;
+ loader.y = (textField.height + padding + padding - loader.height) / 2;
+ sprite.graphics.clear();
+ sprite.graphics.beginFill(color);
+ sprite.graphics.drawRect(0, 0, sprite.width, sprite.height);
+ sprite.graphics.endFill();
+ SolidBorderUtil.drawBorder(sprite.graphics,
+ 0, 0, textField.x + textField.width + padding, textField.height + padding + padding,
+ 0x000000, color, borderWidth);
+ });
+ }
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = textModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = textModel.html;
+ }
+
+ private function imageChangeHandler(event:Event):void
+ {
+ setupBackground(upSprite, upTextField, 0xCCCCCC);
+ setupBackground(overSprite, overTextField, 0xFFCCCC, "hover");
+ setupBackground(downSprite, downTextField, 0x808080, "active");
+ }
+
+ /**
+ * The CSSTextField in the up state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var upTextField:CSSTextField;
+
+ /**
+ * The CSSTextField in the down state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var downTextField:CSSTextField;
+
+ /**
+ * The CSSTextField in the over state
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var overTextField:CSSTextField;
+
+ /**
+ * @copy org.apache.flex.html.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+
+ }
+
+ /**
+ * @copy org.apache.flex.html.core.ITextModel#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ return upTextField.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ upTextField.htmlText = value;
+ downTextField.htmlText = value;
+ overTextField.htmlText = value;
+ }
+
+ /**
+ * @private
+ */
+ private function updateHitArea():void
+ {
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as
new file mode 100644
index 0000000..7e81263
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageButtonView.as
@@ -0,0 +1,158 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+COMPILE::AS3 {
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.UIButtonBase;
+}
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The ImageButtonView class provides an image-only view
+ * for the standard Button. Unlike the CSSButtonView, this
+ * class does not support background and border; only images
+ * for the up, over, and active states.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageButtonView extends BeadViewBase implements IBeadView, IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageButtonView()
+ {
+ COMPILE::AS3 {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ }
+ }
+
+ /**
+ * @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;
+
+ COMPILE::AS3 {
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+
+ setupBackground(upSprite);
+ setupBackground(overSprite, "hover");
+ setupBackground(downSprite, "active");
+ }
+ }
+
+ COMPILE::AS3 {
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var shape:Shape;
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function setupBackground(sprite:Sprite, state:String = null):void
+ {
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+ trace(e);
+ e.preventDefault();
+ });
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ var host:UIButtonBase = UIButtonBase(_strand);
+ if (isNaN(host.explicitWidth) && isNaN(host.percentWidth))
+ {
+ host.setWidth(loader.content.width);
+ if (host.parent)
+ host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+ }
+ else
+ loader.content.width = host.width;
+
+ if (isNaN(host.explicitHeight) && isNaN(host.percentHeight))
+ {
+ host.setHeight(loader.content.height);
+ if (host.parent)
+ host.parent.dispatchEvent(new org.apache.flex.events.Event("layoutNeeded"));
+ }
+ else
+ loader.content.height = host.height;
+ updateHitArea();
+ });
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function updateHitArea():void
+ {
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as
new file mode 100644
index 0000000..9c4875c
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ImageView.as
@@ -0,0 +1,223 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ COMPILE::AS3
+ {
+ import flash.display.Bitmap;
+ import flash.display.Loader;
+ import flash.display.LoaderInfo;
+ import flash.events.IOErrorEvent;
+ import flash.net.URLRequest;
+ }
+ COMPILE::JS
+ {
+ import goog.events;
+ }
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IImageModel;
+ 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;
+
+ /**
+ * The ImageView class creates the visual elements of the org.apache.flex.html.Image component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ImageView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ImageView()
+ {
+ }
+
+ COMPILE::AS3
+ private var bitmap:Bitmap;
+ COMPILE::AS3
+ private var loader:Loader;
+
+ private var _model:IImageModel;
+
+ /**
+ * @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;
+
+ COMPILE::AS3
+ {
+ IEventDispatcher(_strand).addEventListener("widthChanged",handleSizeChange);
+ IEventDispatcher(_strand).addEventListener("heightChanged",handleSizeChange);
+ }
+
+ _model = value.getBeadByType(IImageModel) as IImageModel;
+ _model.addEventListener("urlChanged",handleUrlChange);
+
+ handleUrlChange(null);
+ }
+
+ /**
+ * @private
+ */
+ private function handleUrlChange(event:Event):void
+ {
+ COMPILE::AS3
+ {
+ if (_model.source) {
+ loader = new Loader();
+ loader.contentLoaderInfo.addEventListener("complete",onComplete);
+ loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (e:IOErrorEvent):void {
+ trace(e);
+ e.preventDefault();
+ });
+ loader.load(new URLRequest(_model.source));
+ }
+ }
+ COMPILE::JS
+ {
+ if (_model.source) {
+ var host:IUIBase = _strand as IUIBase;
+ host.element.addEventListener('load',
+ loadHandler, false);
+ host.addEventListener('sizeChanged',
+ sizeChangedHandler);
+ (host.element as HTMLImageElement).src = _model.source;
+ }
+ }
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function onComplete(event:Object):void
+ {
+ var host:UIBase = UIBase(_strand);
+ if (bitmap) {
+ host.removeChild(bitmap);
+ }
+
+ bitmap = Bitmap(LoaderInfo(event.target).content);
+
+ host.addChild(bitmap);
+
+ if (host.isWidthSizedToContent())
+ {
+ host.dispatchEvent(new Event("widthChanged"));
+ if (host.parent)
+ host.parent.dispatchEvent(new Event("layoutNeeded"));
+ }
+ else
+ bitmap.width = UIBase(_strand).width;
+
+ if (host.isHeightSizedToContent())
+ {
+ host.dispatchEvent(new Event("heightChanged"));
+ if (host.parent)
+ host.parent.dispatchEvent(new Event("layoutNeeded"));
+ }
+ else
+ bitmap.height = UIBase(_strand).height;
+
+ }
+
+ /**
+ * @private
+ */
+ COMPILE::AS3
+ private function handleSizeChange(event:Object):void
+ {
+ var host:UIBase = UIBase(_strand);
+ if (bitmap) {
+ if (!isNaN(host.explicitWidth) || !isNaN(host.percentWidth))
+ bitmap.width = UIBase(_strand).width;
+ if (!isNaN(host.explicitHeight) || !isNaN(host.percentHeight))
+ bitmap.height = UIBase(_strand).height;
+ }
+ }
+
+ COMPILE::JS
+ private function loadHandler(event:Object):void
+ {
+ var host:UIBase = UIBase(_strand);
+ host.parent.dispatchEvent(new Event("layoutNeeded"));
+ }
+
+ /**
+ * @flexjsignorecoercion HTMLElement
+ */
+ COMPILE::JS
+ private function sizeChangedHandler(event:Object):void
+ {
+ var host:UIBase = _strand as UIBase;
+ var s:Object = host.positioner.style;
+ var l:Number = NaN;
+ var ls:String = s.left;
+ if (typeof(ls) === 'string' && ls.length > 0)
+ l = parseFloat(ls.substring(0, ls.length - 2));
+ var r:Number = NaN;
+ var rs:String = s.right;
+ if (typeof(rs) === 'string' && rs.length > 0)
+ r = parseFloat(rs.substring(0, rs.length - 2));
+ if (!isNaN(l) &&
+ !isNaN(r)) {
+ // if just using size constraints and image will not shrink or grow
+ var computedWidth:Number = (host.positioner.offsetParent as HTMLElement).offsetWidth -
+ l - r;
+ s.width = computedWidth.toString() + 'px';
+ }
+ var t:Number = NaN;
+ var ts:String = s.top;
+ if (typeof(ts) === 'string' && ts.length > 0)
+ t = parseFloat(ts.substring(0, ts.length - 2));
+ var b:Number = NaN;
+ var bs:String = s.right;
+ if (typeof(bs) === 'string' && bs.length > 0)
+ b = parseFloat(bs.substring(0, bs.length - 2));
+ if (!isNaN(t) &&
+ !isNaN(b)) {
+ // if just using size constraints and image will not shrink or grow
+ var computedHeight:Number = (host.positioner.offsetParent as HTMLElement).offsetHeight -
+ t - b;
+ s.height = computedHeight.toString() + 'px';
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/LeftArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/LeftArrowButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/LeftArrowButtonView.as
new file mode 100644
index 0000000..9fca051
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/LeftArrowButtonView.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The LeftArrowButtonView class is the view for
+ * the left arrow button in a ScrollBar and other controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class LeftArrowButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function LeftArrowButtonView()
+ {
+ upView = new Shape();
+ downView = new Shape();
+ overView = new Shape();
+
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
+ }
+
+ private function drawView(g:Graphics, bgColor:uint):void
+ {
+ g.lineStyle(1, 0x808080);
+ g.beginFill(bgColor);
+ g.drawRoundRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize, ScrollBarView.ThirdSize);
+ g.endFill();
+ g.lineStyle(0);
+ g.beginFill(0);
+ g.moveTo(ScrollBarView.QuarterSize, ScrollBarView.HalfSize);
+ g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.ThreeQuarterSize);
+ g.lineTo(ScrollBarView.ThreeQuarterSize, ScrollBarView.QuarterSize);
+ g.lineTo(ScrollBarView.QuarterSize, ScrollBarView.HalfSize);
+ g.endFill();
+ }
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ScrollBarView.FullSize, ScrollBarView.FullSize);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upView;
+ SimpleButton(value).downState = downView;
+ SimpleButton(value).overState = overView;
+ SimpleButton(value).hitTestState = shape;
+
+ SimpleButton(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ SimpleButton(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private var upView:Shape;
+ private var downView:Shape;
+ private var overView:Shape;
+
+ private function sizeChangeHandler(event:Event):void
+ {
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / ScrollBarView.FullSize;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / ScrollBarView.FullSize;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
new file mode 100644
index 0000000..a38afec
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/ListView.as
@@ -0,0 +1,210 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.ContainerBase;
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadModel;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.ISelectableItemRenderer;
+ import org.apache.flex.core.IItemRenderer;
+ import org.apache.flex.core.IItemRendererParent;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IRollOverModel;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.beads.models.ArraySelectionModel;
+ import org.apache.flex.html.beads.models.ScrollBarModel;
+ import org.apache.flex.html.beads.models.SingleLineBorderModel;
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.html.supportClasses.DataGroup;
+ import org.apache.flex.html.supportClasses.ScrollBar;
+
+ /**
+ * The List class creates the visual elements of the org.apache.flex.html.List
+ * component. A List consists of the area to display the data (in the dataGroup), any
+ * scrollbars, and so forth.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ListView extends ContainerView implements IListView
+ {
+ public function ListView()
+ {
+ }
+
+ private var listModel:ISelectionModel;
+
+ private var _border:Border;
+
+ /**
+ * The border surrounding the org.apache.flex.html.List.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get border():Border
+ {
+ return _border;
+ }
+
+ /**
+ * The area holding the itemRenderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get dataGroup():IItemRendererParent
+ {
+ return contentView as IItemRendererParent;
+ }
+
+ /**
+ * @private
+ */
+ override public function get resizableView():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @private
+ */
+ override public function get host():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ super.strand = value;
+ }
+
+ override protected function completeSetup():void
+ {
+ super.completeSetup();
+
+ // list is not interested in UI children, it wants to know when new items
+ // have been added or the dataProvider has changed.
+
+ host.removeEventListener("childrenAdded", childrenChangedHandler);
+ host.removeEventListener("childrenAdded", performLayout);
+ host.addEventListener("itemsCreated", itemsCreatedHandler);
+
+ listModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
+ listModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+ listModel.addEventListener("rollOverIndexChanged", rollOverIndexChangeHandler);
+ listModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
+ }
+
+ private var lastSelectedIndex:int = -1;
+
+ /**
+ * @private
+ */
+ protected function itemsCreatedHandler(event:Event):void
+ {
+ performLayout(event);
+ }
+
+ /**
+ * @private
+ */
+ protected function dataProviderChangeHandler(event:Event):void
+ {
+ performLayout(event);
+ }
+
+ /**
+ * @private
+ */
+ private function selectionChangeHandler(event:Event):void
+ {
+ if (lastSelectedIndex != -1)
+ {
+ var ir:ISelectableItemRenderer = dataGroup.getItemRendererForIndex(lastSelectedIndex) as ISelectableItemRenderer;
+ ir.selected = false;
+ }
+ if (listModel.selectedIndex != -1)
+ {
+ ir = dataGroup.getItemRendererForIndex(listModel.selectedIndex) as ISelectableItemRenderer;
+ ir.selected = true;
+ }
+ lastSelectedIndex = listModel.selectedIndex;
+ }
+
+ private var lastRollOverIndex:int = -1;
+
+ /**
+ * @private
+ */
+ private function rollOverIndexChangeHandler(event:Event):void
+ {
+ if (lastRollOverIndex != -1)
+ {
+ var ir:ISelectableItemRenderer = dataGroup.getItemRendererForIndex(lastRollOverIndex) as ISelectableItemRenderer;
+ ir.hovered = false;
+ }
+ if (IRollOverModel(listModel).rollOverIndex != -1)
+ {
+ ir = dataGroup.getItemRendererForIndex(IRollOverModel(listModel).rollOverIndex) as ISelectableItemRenderer;
+ ir.hovered = true;
+ }
+ lastRollOverIndex = IRollOverModel(listModel).rollOverIndex;
+ }
+
+ /**
+ * respond to a change in size or request to re-layout everything
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override protected function resizeHandler(event:Event):void
+ {
+ super.resizeHandler(event);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/MultilineTextFieldView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/MultilineTextFieldView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/MultilineTextFieldView.as
new file mode 100644
index 0000000..72dc588
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/MultilineTextFieldView.as
@@ -0,0 +1,56 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.text.TextFieldType;
+
+ /**
+ * The TextFieldView class is the default view for
+ * the org.apache.flex.html.Label class.
+ * It displays text using a TextField, so there is no
+ * right-to-left text support in this view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class MultilineTextFieldView extends TextFieldViewBase
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function MultilineTextFieldView()
+ {
+ super();
+
+ textField.selectable = false;
+ textField.type = TextFieldType.DYNAMIC;
+ textField.mouseEnabled = false;
+ textField.autoSize = "left";
+ textField.multiline = true;
+ textField.wordWrap = true;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/NumericStepperView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/NumericStepperView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/NumericStepperView.as
new file mode 100644
index 0000000..6ebdbf4
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/NumericStepperView.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.IBead;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IParent;
+ import org.apache.flex.core.IParentIUIBase;
+ import org.apache.flex.core.IRangeModel;
+ 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.Label;
+ import org.apache.flex.html.Spinner;
+ import org.apache.flex.html.TextInput;
+ import org.apache.flex.html.supportClasses.Border;
+ import org.apache.flex.html.supportClasses.ScrollBar;
+
+ /**
+ * The NumericStepperView class creates the visual elements of the
+ * org.apache.flex.html.NumericStepper component. A NumberStepper consists of a
+ * org.apache.flex.html.TextInput component to display the value and a
+ * org.apache.flex.html.Spinner to change the value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class NumericStepperView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function NumericStepperView()
+ {
+ }
+
+ private var label:Label;
+ private var input:TextInput;
+ private var spinner:Spinner;
+
+ /**
+ * @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;
+
+ // add an input field
+ input = new TextInput();
+ IParent(value).addElement(input);
+
+ // add a spinner
+ spinner = new Spinner();
+ spinner.addBead( UIBase(value).model as IBead );
+ IParent(value).addElement(spinner);
+ spinner.height = input.height;
+
+ // listen for changes to the text input field which will reset the
+ // value. ideally, we should either set the input to accept only
+ // numeric values or, barring that, reject non-numeric entries. we
+ // cannot do that right now however.
+ input.model.addEventListener("textChange",inputChangeHandler);
+
+ // listen for change events on the spinner so the value can be updated as
+ // as resizing the component
+ spinner.addEventListener("valueChange",spinnerValueChanged);
+ IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler);
+ IEventDispatcher(value).addEventListener("sizeChanged",sizeChangeHandler);
+
+ // listen for changes to the model itself and update the UI accordingly
+ IEventDispatcher(UIBase(value).model).addEventListener("valueChange",modelChangeHandler);
+ IEventDispatcher(UIBase(value).model).addEventListener("minimumChange",modelChangeHandler);
+ IEventDispatcher(UIBase(value).model).addEventListener("maximumChange",modelChangeHandler);
+ IEventDispatcher(UIBase(value).model).addEventListener("stepSizeChange",modelChangeHandler);
+ IEventDispatcher(UIBase(value).model).addEventListener("snapIntervalChange",modelChangeHandler);
+
+ input.text = String(spinner.value);
+
+ var host:ILayoutChild = ILayoutChild(value);
+ if ((host.isWidthSizedToContent() || isNaN(host.explicitWidth)) &&
+ (host.isHeightSizedToContent() || isNaN(host.explicitHeight)))
+ sizeChangeHandler(null);
+ }
+
+ /**
+ * @private
+ */
+ private function sizeChangeHandler(event:Event) : void
+ {
+ input.x = 2;
+ input.y = (UIBase(_strand).height - input.height)/2;
+ input.width = UIBase(_strand).width-spinner.width-2;
+ spinner.x = input.width+2;
+ spinner.y = 0;
+ }
+
+ /**
+ * @private
+ */
+ private function spinnerValueChanged(event:Event) : void
+ {
+ input.text = String(spinner.value);
+
+ var newEvent:Event = new Event(event.type,event.bubbles);
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+
+ /**
+ * @private
+ */
+ private function inputChangeHandler(event:Event) : void
+ {
+ var newValue:Number = Number(input.text);
+
+ if( !isNaN(newValue) ) {
+ spinner.value = newValue;
+ }
+ else {
+ input.text = String(spinner.value);
+ }
+ }
+
+ /**
+ * @private
+ */
+ private function modelChangeHandler( event:Event ) : void
+ {
+ var n:Number = IRangeModel(UIBase(_strand).model).value;
+ input.text = String(IRangeModel(UIBase(_strand).model).value);
+ }
+
+ /**
+ * The area containing the TextInput and Spinner controls.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get contentView():IParentIUIBase
+ {
+ return _strand as IParentIUIBase;
+ }
+
+ /**
+ * @private
+ */
+ public function get resizableView():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as
new file mode 100644
index 0000000..c52fe93
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelView.as
@@ -0,0 +1,168 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IContentViewHost;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IViewportModel;
+ 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.geom.Rectangle;
+ import org.apache.flex.geom.Size;
+ import org.apache.flex.html.Container;
+ import org.apache.flex.html.Panel;
+ import org.apache.flex.html.TitleBar;
+ import org.apache.flex.utils.CSSContainerUtils;
+ import org.apache.flex.utils.CSSUtils;
+
+ /**
+ * The Panel class creates the visual elements of the org.apache.flex.html.Panel
+ * component. A Panel has a org.apache.flex.html.TitleBar, and content. A
+ * different View, PanelWithControlBarView, can display a ControlBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class PanelView extends ContainerView implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function PanelView()
+ {
+ super();
+ }
+
+ private var _titleBar:TitleBar;
+
+ /**
+ * The org.apache.flex.html.TitleBar component of the
+ * org.apache.flex.html.Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get titleBar():TitleBar
+ {
+ return _titleBar;
+ }
+
+ /**
+ * @private
+ */
+ public function set titleBar(value:TitleBar):void
+ {
+ _titleBar = value;
+ }
+
+ /**
+ * @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
+ {
+ var host:UIBase = UIBase(value);
+
+ if (!_titleBar) {
+ _titleBar = new TitleBar();
+ _titleBar.id = "panelTitleBar";
+ _titleBar.height = 30;
+ }
+ // replace the TitleBar's model with the Panel's model (it implements ITitleBarModel) so that
+ // any changes to values in the Panel's model that correspond values in the TitleBar will
+ // be picked up automatically by the TitleBar.
+ titleBar.model = host.model;
+
+ super.strand = value;
+ }
+
+ override protected function completeSetup():void
+ {
+ (host as IContentViewHost).strandChildren.addElement(titleBar);
+ super.completeSetup();
+ }
+
+ /**
+ * Calculate the space taken up by non-content children like a TItleBar in a Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override protected function getChromeMetrics():Rectangle
+ {
+ return new Rectangle(0, titleBar.height, 0, 0 - titleBar.height);
+ }
+
+ override protected function layoutViewBeforeContentLayout():void
+ {
+ var vm:IViewportModel = viewportModel;
+ var host:ILayoutChild = this.host as ILayoutChild;
+ vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
+ titleBar.x = vm.borderMetrics.left;
+ titleBar.y = vm.borderMetrics.top;
+ if (!host.isWidthSizedToContent())
+ titleBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
+ vm.chromeMetrics = getChromeMetrics();
+ viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
+ vm.borderMetrics.top + vm.chromeMetrics.top);
+ viewport.layoutViewportBeforeContentLayout(
+ !host.isWidthSizedToContent() ?
+ host.width - vm.borderMetrics.left - vm.borderMetrics.right -
+ vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
+ !host.isHeightSizedToContent() ?
+ host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
+ vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
+ }
+
+ override protected function layoutViewAfterContentLayout():void
+ {
+ var vm:IViewportModel = viewportModel;
+ var viewportSize:Size = this.viewport.layoutViewportAfterContentLayout();
+ var host:ILayoutChild = this.host as ILayoutChild;
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ if (!hasWidth) {
+ titleBar.width = viewportSize.width; // should get titlebar to layout and get new height
+ vm.chromeMetrics = this.getChromeMetrics();
+ vm.chromeMetrics.top = titleBar.height;
+ }
+ super.layoutViewAfterContentLayout();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelWithControlBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelWithControlBarView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelWithControlBarView.as
new file mode 100644
index 0000000..8dfcd42
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/PanelWithControlBarView.as
@@ -0,0 +1,207 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Sprite;
+
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IContentViewHost;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IPanelModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITitleBarModel;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IViewportModel;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.geom.Rectangle;
+ import org.apache.flex.geom.Size;
+ import org.apache.flex.html.Container;
+ import org.apache.flex.html.ControlBar;
+ import org.apache.flex.html.TitleBar;
+ import org.apache.flex.utils.CSSContainerUtils;
+
+ /**
+ * The Panel class creates the visual elements of the org.apache.flex.html.Panel
+ * component. A Panel has a org.apache.flex.html.TitleBar, content, and an
+ * optional org.apache.flex.html.ControlBar.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class PanelWithControlBarView extends ContainerView implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function PanelWithControlBarView()
+ {
+ }
+
+ private var _titleBar:TitleBar;
+
+ /**
+ * The org.apache.flex.html.TitleBar component of the
+ * org.apache.flex.html.Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get titleBar():TitleBar
+ {
+ return _titleBar;
+ }
+
+ private var _controlBar:ControlBar;
+
+ /**
+ * The org.apache.flex.html.ControlBar for the Panel; may be null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get controlBar():ControlBar
+ {
+ return _controlBar;
+ }
+
+ /**
+ * @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
+ {
+ var host:UIBase = UIBase(value);
+
+ // TODO: (aharui) get class to instantiate from CSS
+ if (!_titleBar) {
+ _titleBar = new TitleBar();
+ _titleBar.id = "panelTitleBar";
+ _titleBar.height = 30;
+ }
+ // replace the TitleBar's model with the Panel's model (it implements ITitleBarModel) so that
+ // any changes to values in the Panel's model that correspond values in the TitleBar will
+ // be picked up automatically by the TitleBar.
+ _titleBar.model = host.model;
+
+ var controlBarItems:Array = (host.model as IPanelModel).controlBar;
+ if( controlBarItems && controlBarItems.length > 0 ) {
+ _controlBar = new ControlBar();
+ _controlBar.id = "panelControlBar";
+ _controlBar.height = 30;
+
+ for each(var comp:IUIBase in controlBarItems) {
+ _controlBar.addElement(comp, false);
+ }
+ }
+
+ super.strand = value;
+ }
+
+ override protected function completeSetup():void
+ {
+ super.completeSetup();
+
+ (_strand as IContentViewHost).strandChildren.addElement(titleBar, false);
+
+ if (controlBar) {
+ (_strand as IContentViewHost).strandChildren.addElement(_controlBar, false);
+ }
+ }
+
+ /**
+ * Calculate the space taken up by non-content children like a TItleBar in a Panel.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override protected function getChromeMetrics():Rectangle
+ {
+ return new Rectangle(0, titleBar.height, 0, controlBar.height - titleBar.height);
+ }
+
+ override protected function layoutViewBeforeContentLayout():void
+ {
+ var vm:IViewportModel = viewportModel;
+ var host:ILayoutChild = this.host as ILayoutChild;
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ vm.borderMetrics = CSSContainerUtils.getBorderMetrics(host);
+ titleBar.x = vm.borderMetrics.left;
+ titleBar.y = vm.borderMetrics.top;
+ if (hasWidth)
+ {
+ titleBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
+ controlBar.width = host.width - vm.borderMetrics.left - vm.borderMetrics.right;
+ }
+ vm.chromeMetrics = getChromeMetrics();
+ controlBar.x = vm.borderMetrics.left;
+ if (hasHeight && hasWidth)
+ controlBar.y = host.height - vm.borderMetrics.bottom - controlBar.height;
+
+ viewport.setPosition(vm.borderMetrics.left + vm.chromeMetrics.left,
+ vm.borderMetrics.top + vm.chromeMetrics.top);
+ viewport.layoutViewportBeforeContentLayout(
+ hasWidth ?
+ host.width - vm.borderMetrics.left - vm.borderMetrics.right -
+ vm.chromeMetrics.left - vm.chromeMetrics.right : NaN,
+ hasHeight ?
+ host.height - vm.borderMetrics.top - vm.borderMetrics.bottom -
+ vm.chromeMetrics.top - vm.chromeMetrics.bottom : NaN);
+ }
+
+ override protected function layoutViewAfterContentLayout():void
+ {
+ var vm:IViewportModel = viewportModel;
+ var viewportSize:Size = this.viewport.layoutViewportAfterContentLayout();
+ var host:ILayoutChild = this.host as ILayoutChild;
+ var hasWidth:Boolean = !host.isWidthSizedToContent();
+ var hasHeight:Boolean = !host.isHeightSizedToContent();
+ if (!hasWidth) {
+ titleBar.width = viewportSize.width; // should get titlebar to layout and get new height
+ vm.chromeMetrics = this.getChromeMetrics();
+ vm.chromeMetrics.top = titleBar.height;
+ controlBar.width = viewportSize.width; // should get controlbar to layout and get new height
+ vm.chromeMetrics.bottom = controlBar.height;
+ }
+ super.layoutViewAfterContentLayout();
+ if (!hasHeight) {
+ controlBar.y = host.height - vm.borderMetrics.bottom - controlBar.height;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7853ef15/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RadioButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RadioButtonView.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RadioButtonView.as
new file mode 100644
index 0000000..245c3d3
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/RadioButtonView.as
@@ -0,0 +1,281 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.html.beads
+{
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IValueToggleButtonModel;
+ import org.apache.flex.events.Event;
+
+ /**
+ * The RadioButtonView class creates the visual elements of the org.apache.flex.html.RadioButton
+ * component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RadioButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RadioButtonView()
+ {
+ sprites = [ upSprite = new Sprite(),
+ downSprite = new Sprite(),
+ overSprite = new Sprite(),
+ upAndSelectedSprite = new Sprite(),
+ downAndSelectedSprite = new Sprite(),
+ overAndSelectedSprite = new Sprite() ];
+
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = new CSSTextField();
+ tf.type = TextFieldType.DYNAMIC;
+ tf.autoSize = TextFieldAutoSize.LEFT;
+ tf.name = "textField";
+ var icon:Shape = new Shape();
+ icon.name = "icon";
+ s.addChild(icon);
+ s.addChild(tf);
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upAndSelectedSprite:Sprite;
+ private var downAndSelectedSprite:Sprite;
+ private var overAndSelectedSprite:Sprite;
+
+ private var sprites:Array;
+
+ private var _toggleButtonModel:IValueToggleButtonModel;
+
+ /**
+ * The model used for the RadioButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get toggleButtonModel() : IValueToggleButtonModel
+ {
+ return _toggleButtonModel;
+ }
+
+ /**
+ * @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;
+ _toggleButtonModel = value.getBeadByType(IValueToggleButtonModel) as IValueToggleButtonModel;
+ _toggleButtonModel.addEventListener("textChange", textChangeHandler);
+ _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
+ _toggleButtonModel.addEventListener("selectedValueChange", selectedValueChangeHandler);
+ if (_toggleButtonModel.text != null)
+ text = _toggleButtonModel.text;
+ if (_toggleButtonModel.html != null)
+ html = _toggleButtonModel.html;
+
+ layoutControl();
+
+ var hitArea:Shape = new Shape();
+ hitArea.graphics.beginFill(0x000000);
+ hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
+ hitArea.graphics.endFill();
+
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = hitArea;
+
+ if (toggleButtonModel.text !== null)
+ text = toggleButtonModel.text;
+ if (toggleButtonModel.html !== null)
+ html = toggleButtonModel.html;
+
+ if (toggleButtonModel.selected && toggleButtonModel.value == value) {
+ selected = true;
+ }
+ }
+
+ /**
+ * The string label for the org.apache.flex.html.RadioButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.text;
+ }
+ public function set text(value:String):void
+ {
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.text = value;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * The HTML string for the org.apache.flex.html.RadioButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.htmlText;
+ }
+ public function set html(value:String):void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.htmlText = value;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * @private
+ */
+ private function textChangeHandler(event:Event):void
+ {
+ text = toggleButtonModel.text;
+ }
+
+ /**
+ * @private
+ */
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = toggleButtonModel.html;
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * The selection state of the RadioButton
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+
+ if( value ) {
+ SimpleButton(_strand).upState = upAndSelectedSprite;
+ SimpleButton(_strand).downState = downAndSelectedSprite;
+ SimpleButton(_strand).overState = overAndSelectedSprite;
+
+ } else {
+ SimpleButton(_strand).upState = upSprite;
+ SimpleButton(_strand).downState = downSprite;
+ SimpleButton(_strand).overState = overSprite;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * @private
+ */
+ private function selectedValueChangeHandler(event:Event):void
+ {
+ selected = _toggleButtonModel.value == _toggleButtonModel.selectedValue;
+ }
+
+ /**
+ * @private
+ */
+ protected function layoutControl() : void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var icon:Shape = s.getChildByName("icon") as Shape;
+ var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
+
+ drawRadioButton(icon);
+
+ var mh:Number = Math.max(icon.height,tf.height);
+
+ icon.x = 0;
+ icon.y = (mh - icon.height)/2;
+
+ tf.x = icon.x + icon.width + 1;
+ tf.y = (mh - tf.height)/2;
+ }
+
+ }
+
+ /**
+ * @private
+ */
+ protected function drawRadioButton(icon:Shape) : void
+ {
+ icon.graphics.clear();
+ icon.graphics.beginFill(0xf8f8f8);
+ icon.graphics.lineStyle(1,0x808080);
+ icon.graphics.drawEllipse(0,0,10,10);
+ icon.graphics.endFill();
+
+ if( selected ) {
+ icon.graphics.beginFill(0);
+ icon.graphics.drawEllipse(3,3,4,4);
+ icon.graphics.endFill();
+ }
+ }
+ }
+}