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; - } - } -}
