http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js deleted file mode 100644 index 4971449..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/DataItemRendererFactoryForArrayData.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.DataItemRendererFactoryForArrayData'); - -goog.require('org.apache.flex.core.IDataProviderItemRendererMapper'); -goog.require('org.apache.flex.core.IListPresentationModel'); -goog.require('org.apache.flex.events.EventDispatcher'); -goog.require('org.apache.flex.html.beads.ListView'); -goog.require('org.apache.flex.html.beads.models.ArraySelectionModel'); -goog.require('org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IDataProviderItemRendererMapper} - */ -org.apache.flex.html.beads.DataItemRendererFactoryForArrayData = - function() { -}; - - -/** - * @export - */ -org.apache.flex.html.beads.DataItemRendererFactoryForArrayData.prototype.itemRendererFactory = null; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.DataItemRendererFactoryForArrayData. - prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'DataItemRendererFactoryForArrayData', - qName: 'org.apache.flex.html.beads.DataItemRendererFactoryForArrayData' }], - interfaces: [org.apache.flex.core.IDataProviderItemRendererMapper] }; - - -/** - * @private - * @type {Object} - */ -org.apache.flex.html.beads.DataItemRendererFactoryForArrayData. - prototype.itemRendererClass_ = null; - - -Object.defineProperties(org.apache.flex.html.beads.DataItemRendererFactoryForArrayData.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.DataItemRendererFactoryForArrayData} */ - set: function(value) { - this.strand_ = value; - - this.model = value.getBeadByType( - org.apache.flex.html.beads.models.ArraySelectionModel); - - this.listView = value.getBeadByType( - org.apache.flex.html.beads.ListView); - this.dataGroup = this.listView.dataGroup; - - this.model.addEventListener('dataProviderChanged', - goog.bind(this.dataProviderChangedHandler, this)); - - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue && !this.itemRendererFactory_) { - /** - * @type {Function} - */ - var c = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl.getValue(this.strand_, - 'iItemRendererClassFactory')); - this.itemRendererFactory_ = new c(); - this.strand_.addBead(this.itemRendererFactory_); - } - - this.dataProviderChangedHandler(null); - } - }, - /** @export */ - itemRendererClass: { - /** @this {org.apache.flex.html.beads.DataItemRendererFactoryForArrayData} */ - get: function() { - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue && !this.itemRendererClass_) { - var c = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this.strand_, 'iItemRenderer'); - if (c) { - this.itemRendererClass_ = c; - } - } - return this.itemRendererClass_; - }, - /** @this {org.apache.flex.html.beads.DataItemRendererFactoryForArrayData} */ - set: function(value) { - this.itemRendererClass_ = value; - } - } -}); - - -/** - * @export - * @param {Object} event The event that triggered the dataProvider change. - */ -org.apache.flex.html.beads.DataItemRendererFactoryForArrayData. - prototype.dataProviderChangedHandler = function(event) { - var dp, i, n, opt; - - this.dataGroup.removeAllElements(); - - var presModel = this.strand_.getBeadByType(org.apache.flex.core.IListPresentationModel); - - dp = this.model.dataProvider; - if (dp === undefined) return; - - n = dp.length; - for (i = 0; i < n; i++) { - var ir = this.itemRendererFactory_.createItemRenderer(this.dataGroup); - ir.index = i; - ir.labelField = this.model.labelField; - ir.data = dp[i]; - if (presModel) { - ir.element.style['margin-bottom'] = presModel.separatorThickness; - ir.height = presModel.rowHeight; - } - } - - var newEvent = new org.apache.flex.events.Event('itemsCreated'); - this.strand_.dispatchEvent(newEvent); -};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/IListView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/IListView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/IListView.js deleted file mode 100644 index b1c8458..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/IListView.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @fileoverview - * @suppress {checkTypes} - */ - -goog.provide('org.apache.flex.html.beads.IListView'); - -goog.require('org.apache.flex.core.IBeadView'); - - - -/** - * IListView - * - * @interface - */ -org.apache.flex.html.beads.IListView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.IListView.prototype.FLEXJS_CLASS_INFO = -{ names: [{ name: 'IListView', - qName: 'org.apache.flex.html.beads.IListView'}], - interfaces: [org.apache.flex.core.IBeadView] }; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageButtonView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageButtonView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageButtonView.js deleted file mode 100644 index 2e262bc..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageButtonView.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.ImageButtonView'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.ImageButtonView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.ImageButtonView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ImageButtonView', - qName: 'org.apache.flex.html.beads.ImageButtonView'}] }; - - -Object.defineProperties(org.apache.flex.html.beads.ImageButtonView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.ImageButtonView} */ - set: function(value) { - this.strand_ = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageView.js deleted file mode 100644 index 5ada7bc..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ImageView.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.ImageView'); - - -goog.require('org.apache.flex.html.beads.models.ImageModel'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.ImageView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.ImageView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ImageView', - qName: 'org.apache.flex.html.beads.ImageView'}] }; - - -Object.defineProperties(org.apache.flex.html.beads.ImageView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.ImageView} */ - set: function(value) { - this.strand_ = value; - - this.model = value.getBeadByType( - org.apache.flex.html.beads.models.ImageModel); - this.model.addEventListener('sourceChanged', - goog.bind(this.sourceChangeHandler, this)); - } - } -}); - - -/** - * @export - * @param {Object} event The event triggered by the source change. - */ -org.apache.flex.html.beads.ImageView.prototype. - sourceChangeHandler = function(event) { - this.strand_.element.addEventListener('load', - goog.bind(this.loadHandler, this)); - this.strand_.addEventListener('sizeChanged', - goog.bind(this.sizeChangedHandler, this)); - this.strand_.element.src = this.model.source; -}; - - -/** - * @export - * @param {Object} event The event triggered by the load. - */ -org.apache.flex.html.beads.ImageView.prototype. - loadHandler = function(event) { - this.strand_.parent.dispatchEvent('layoutNeeded'); -}; - - -/** - * @export - * @param {Object} event The event triggered by the size change. - */ -org.apache.flex.html.beads.ImageView.prototype. - sizeChangedHandler = function(event) { - var s = this.strand_.positioner.style; - var l = NaN; - var ls = s.left; - if (typeof(ls) === 'string' && ls.length > 0) - l = parseFloat(ls.substring(0, ls.length - 2)); - var r = NaN; - var rs = 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 = this.strand_.positioner.offsetParent.offsetWidth - - l - r; - s.width = computedWidth.toString() + 'px'; - } - var t = NaN; - var ts = s.top; - if (typeof(ts) === 'string' && ts.length > 0) - t = parseFloat(ts.substring(0, ts.length - 2)); - var b = NaN; - var bs = 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 = this.strand_.positioner.offsetParent.offsetHeight - - t - b; - s.height = computedHeight.toString() + 'px'; - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ListView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ListView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ListView.js deleted file mode 100644 index 89401f2..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ListView.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.ListView'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.IBeadView'); -goog.require('org.apache.flex.core.IItemRendererParent'); -goog.require('org.apache.flex.core.ILayoutHost'); -goog.require('org.apache.flex.core.ValuesManager'); -goog.require('org.apache.flex.html.beads.ContainerView'); -goog.require('org.apache.flex.html.beads.IListView'); -goog.require('org.apache.flex.html.beads.TextItemRendererFactoryForArrayData'); -goog.require('org.apache.flex.html.beads.models.ArraySelectionModel'); -goog.require('org.apache.flex.html.supportClasses.DataGroup'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.beads.ContainerView} - * @implements {org.apache.flex.core.ILayoutHost} - * @implements {org.apache.flex.html.beads.IListView} - */ -org.apache.flex.html.beads.ListView = function() { - this.lastSelectedIndex = -1; - - this.className = 'ListView'; - org.apache.flex.html.beads.ListView.base(this, 'constructor'); -}; -goog.inherits( - org.apache.flex.html.beads.ListView, - org.apache.flex.html.beads.ContainerView); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.ListView.prototype. - FLEXJS_CLASS_INFO = - { names: [{ name: 'ListView', - qName: 'org.apache.flex.html.beads.ListView' }], - interfaces: [org.apache.flex.html.beads.IListView, org.apache.flex.core.ILayoutHost] }; - - -/** - * @override - */ -org.apache.flex.html.beads.ListView. - prototype.completeSetup = function() { - org.apache.flex.html.beads.ListView.base(this, 'completeSetup'); - this._strand.addEventListener('itemsCreated', - goog.bind(this.changeHandler, this)); -}; - - -Object.defineProperties(org.apache.flex.html.beads.ListView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.ListView} */ - set: function(value) { - org.apache.flex.utils.Language.superSetter( - org.apache.flex.html.beads.ListView, this, 'strand', value); - - this.model = this._strand.model; - this.model.addEventListener('selectedIndexChanged', - goog.bind(this.selectionChangeHandler, this)); - this.model.addEventListener('dataProviderChanged', - goog.bind(this.dataProviderChangeHandler, this)); - - this.dataGroup.strand = this; - - /*if (this._strand.getBeadByType(org.apache.flex.core.IBeadLayout) == null) { - var m3 = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this._strand, 'iBeadLayout'); - this.layout_ = new m3(); - this._strand.addBead(this.layout_); - }*/ - }, - /** @this {org.apache.flex.html.beads.ListView} */ - get: function() { - return this._strand; - } - }, - /** @export */ - dataGroup: { - /** @this {org.apache.flex.html.beads.ListView} */ - get: function() { - return this.contentView; - } - }, - /** @export */ - border: { - /** @this {org.apache.flex.html.beads.ListView} */ - get: function() { - return null; - } - }, - /** @export */ - vScrollBar: { - /** @this {org.apache.flex.html.beads.ListView} */ - get: function() { - return null; - }, - /** @this {org.apache.flex.html.beads.ListView} */ - set: function(value) { - } - }, - /** @export */ - resizeableView: { - /** @this {org.apache.flex.html.beads.ListView} */ - get: function() { - return this; - } - } -}); - - -/** - * @export - * @param {org.apache.flex.events.Event} value The event that triggered the selection. - */ -org.apache.flex.html.beads.ListView.prototype. - selectionChangeHandler = function(value) { - var ir; - if (this.lastSelectedIndex != -1) { - ir = this.dataGroup.getItemRendererForIndex(this.lastSelectedIndex); - if (ir) ir.selected = false; - } - if (this.model.selectedIndex != -1) { - ir = this.dataGroup.getItemRendererForIndex( - this.model.selectedIndex); - if (ir) ir.selected = true; - } - this.lastSelectedIndex = this.model.selectedIndex; -}; - - -/** - * @export - * @param {org.apache.flex.events.Event} value The event that triggered the selection. - */ -org.apache.flex.html.beads.ListView.prototype. - dataProviderChangeHandler = function(value) { - // override in subclass - this.changeHandler(value); -}; - - -/** - * @export - * @param {org.apache.flex.events.Event} event The event that triggered the resize. - */ -org.apache.flex.html.beads.ListView.prototype.handleSizeChange = function(event) { - this.dataGroup.width = this._strand.width; - this.dataGroup.height = this._strand.height; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js deleted file mode 100644 index f0e02b7..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/PanelView.js +++ /dev/null @@ -1,204 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.PanelView'); - -goog.require('org.apache.flex.html.TitleBar'); -goog.require('org.apache.flex.html.beads.ContainerView'); -goog.require('org.apache.flex.utils.CSSContainerUtils'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.beads.ContainerView} - */ -org.apache.flex.html.beads.PanelView = function() { - org.apache.flex.html.beads.PanelView.base(this, 'constructor'); - /** - * @private - * @type {boolean} - */ - this.titleBarAdded_ = false; - - /** - * @private - * @type {?Object} - */ - this.titleBar_ = null; - - this.className = 'PanelView'; -}; -goog.inherits( - org.apache.flex.html.beads.PanelView, - org.apache.flex.html.beads.ContainerView); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.PanelView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'PanelView', - qName: 'org.apache.flex.html.beads.PanelView'}]}; - - -/** - * @override - */ -org.apache.flex.html.beads.PanelView. - prototype.completeSetup = function() { - org.apache.flex.html.beads.PanelView.base(this, 'completeSetup'); - // listen for changes to the strand's model so items can be changed - // in the view - this._strand.model.addEventListener('titleChange', - goog.bind(this.changeHandler, this)); -}; - - -Object.defineProperties(org.apache.flex.html.beads.PanelView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.PanelView} */ - set: function(value) { - if (!this.titleBar_) - this.titleBar_ = new org.apache.flex.html.TitleBar(); - - value.titleBar = this.titleBar_; - this.titleBar_.id = 'panelTitleBar'; - this.titleBar_.model = value.model; - this.titleBarAdded_ = true; - value.strandChildren.addElement(this.titleBar_); - -// this._strand.controlBar = -// new org.apache.flex.html.ControlBar(); - - org.apache.flex.utils.Language.superSetter(org.apache.flex.html.beads.PanelView, this, 'strand', value); - } - }, - /** @export */ - titleBar: { - /** @this {org.apache.flex.html.beads.PanelView} */ - get: function() { - return this.titleBar_; - }, - /** @this {org.apache.flex.html.beads.PanelView} */ - set: function(value) { - this.titleBar_ = value; - } - } -}); - - -/** - * @override - */ -org.apache.flex.html.beads.PanelView. - prototype.layoutViewBeforeContentLayout = function() { - var vm = this.viewportModel; - var host = this._strand; - var w = host.width; - var s = window.getComputedStyle(host.element); - var sw = Number(s.width.substring(0, s.width.length - 2)); - if (sw > w) w = sw; - vm.borderMetrics = org.apache.flex.utils.CSSContainerUtils.getBorderMetrics(host); - this.titleBar.x = 0; - this.titleBar.y = 0; - if (!host.isWidthSizedToContent()) - this.titleBar.width = w - vm.borderMetrics.left - vm.borderMetrics.right; - vm.chromeMetrics = this.getChromeMetrics(); - this.viewport.setPosition(vm.chromeMetrics.left, - vm.chromeMetrics.top); - this.viewport.layoutViewportBeforeContentLayout( - !host.isWidthSizedToContent() ? - w - 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 - */ -org.apache.flex.html.beads.PanelView. - prototype.layoutViewAfterContentLayout = function() { - var vm = this.viewportModel; - var host = this._strand; - var viewportSize = this.viewport.layoutViewportAfterContentLayout(); - var hasWidth = !host.isWidthSizedToContent(); - var hasHeight = !host.isHeightSizedToContent(); - if (!hasWidth) { - this.titleBar.width = viewportSize.width; // should get titlebar to layout and get new height - vm.chromeMetrics = this.getChromeMetrics(); - } - org.apache.flex.html.beads.PanelView.base(this, 'layoutViewAfterContentLayout'); -}; - - -/** - * @override - * Returns the chrome metrics - */ -org.apache.flex.html.beads.PanelView. - prototype.getChromeMetrics = function() { - return new org.apache.flex.geom.Rectangle(0, this.titleBar.height, 0, 0 - this.titleBar.height); -}; - - - - -/** - * @override - * @param {org.apache.flex.events.Event} event The event that triggered this handler. - */ -/**org.apache.flex.html.beads.PanelView.prototype.changeHandler = - function(event) { - var strand = this._strand; - if (!this.titleBarAdded_) - { - this.titleBarAdded_ = true; - strand.addElement(this.titleBar_); - if (strand.controlBar != null) - strand.addElement(strand.controlBar); - } - - if (event.type == 'titleChange') { - this.titleBar_.title = strand.model.title; - } - - var p = this._strand.positioner; - if (!strand.isWidthSizedToContent()) { - var w = strand.width; - w -= p.offsetWidth - p.clientWidth; - this.titleBar_.setWidth(w); - strand.contentArea.style.width = w.toString() + 'px'; - if (strand.controlBar) - strand.controlBar.setWidth(w); - } - if (!strand.isHeightSizedToContent()) { - var t = this.titleBar_.height; - var b = 0; - if (strand.controlBar) - b = strand.controlBar.height; - strand.contentArea.style.top = t.toString() + 'px'; - var h = strand.height - t - b; - h -= p.offsetHeight - p.clientHeight; - strand.contentArea.style.height = h.toString() + 'px'; - } - org.apache.flex.html.beads.PanelView.base(this, 'changeHandler', event); -};**/ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ScrollingContainerView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ScrollingContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ScrollingContainerView.js deleted file mode 100644 index c4a7eac..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ScrollingContainerView.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.ScrollingContainerView'); - -goog.require('org.apache.flex.html.beads.ContainerView'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.beads.ContainerView} - */ -org.apache.flex.html.beads.ScrollingContainerView = function() { - this.lastSelectedIndex = -1; - org.apache.flex.html.beads.ScrollingContainerView.base(this, 'constructor'); - - this.className = 'ScrollingContainerView'; -}; -goog.inherits( - org.apache.flex.html.beads.ScrollingContainerView, - org.apache.flex.html.beads.ContainerView); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.ScrollingContainerView.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ScrollingContainerView', - qName: 'org.apache.flex.html.beads.ScrollingContainerView' }], - interfaces: [org.apache.flex.core.ILayoutHost] - }; - - -Object.defineProperties(org.apache.flex.html.beads.ScrollingContainerView.prototype, { - /** @export */ - contentView: { - /** @this {org.apache.flex.html.beads.ScrollingContainerView} */ - get: function() { - return this._strand; - } - }, - /** @export */ - resizableView: { - /** @this {org.apache.flex.html.beads.ScrollingContainerView} */ - get: function() { - return this._strand; - } - }, - /** @export */ - verticalScrollPosition: { - /** @this {org.apache.flex.html.beads.ScrollingContainerView} */ - get: function() { - return this._strand.scrollTop; - }, - /** @this {org.apache.flex.html.beads.ScrollingContainerView} */ - set: function(value) { - this._strand.scrollTop = value; - } - }, - /** @export */ - maxVerticalScrollPosition: { - /** @this {org.apache.flex.html.beads.ScrollingContainerView} */ - get: function() { - return this._strand.scrollHeight - this._strand.clientHeight; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderThumbView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderThumbView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderThumbView.js deleted file mode 100644 index 4ec086a..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderThumbView.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.SliderThumbView'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.SliderThumbView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.SliderThumbView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SliderThumbView', - qName: 'org.apache.flex.html.beads.SliderThumbView'}] }; - - -Object.defineProperties(org.apache.flex.html.beads.SliderThumbView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.SliderThumbView} */ - set: function(value) { - this.strand_ = value; - - this.element = document.createElement('div'); - this.element.className = 'SliderThumb'; - this.element.id = 'thumb'; - this.element.style.backgroundColor = '#949494'; - this.element.style.border = 'thin solid #747474'; - this.element.style.position = 'relative'; - this.element.style.height = '30px'; - this.element.style.width = '10px'; - this.element.style.zIndex = '2'; - this.element.style.top = '-10px'; - this.element.style.left = '20px'; - - this.strand_.element.appendChild(this.element); - - this.positioner = this.element; - this.element.flexjs_wrapper = this; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderTrackView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderTrackView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderTrackView.js deleted file mode 100644 index 9bdcd5f..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/SliderTrackView.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.SliderTrackView'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.SliderTrackView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.SliderTrackView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SliderTrackView', - qName: 'org.apache.flex.html.beads.SliderTrackView'}] }; - - -Object.defineProperties(org.apache.flex.html.beads.SliderTrackView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.SliderTrackView} */ - set: function(value) { - this.strand_ = value; - - this.element = document.createElement('div'); - this.element.className = 'SliderTrack'; - this.element.id = 'track'; - this.element.style.backgroundColor = '#E4E4E4'; - this.element.style.height = '10px'; - this.element.style.width = '200px'; - this.element.style.border = 'thin solid #C4C4C4'; - this.element.style.position = 'relative'; - this.element.style.left = '0px'; - this.element.style.top = '10px'; - this.element.style.zIndex = '1'; - - this.strand_.element.appendChild(this.element); - - this.positioner = this.element; - this.element.flexjs_wrapper = this; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextInputWithBorderView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextInputWithBorderView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextInputWithBorderView.js deleted file mode 100644 index 830fec5..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextInputWithBorderView.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.TextInputWithBorderView'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.TextInputWithBorderView = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.TextInputWithBorderView - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'TextInputWithBorderView', - qName: 'org.apache.flex.html.beads.TextInputWithBorderView'}] }; - - -Object.defineProperties(org.apache.flex.html.beads.TextInputWithBorderView.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.TextInputWithBorderView} */ - set: function(value) { - this.strand_ = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.js deleted file mode 100644 index de7dde4..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/TextItemRendererFactoryForArrayData.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.TextItemRendererFactoryForArrayData'); - -goog.require('org.apache.flex.core.IDataProviderItemRendererMapper'); -goog.require('org.apache.flex.core.IItemRenderer'); -goog.require('org.apache.flex.core.ValuesManager'); -goog.require('org.apache.flex.events.Event'); -goog.require('org.apache.flex.events.EventDispatcher'); -goog.require('org.apache.flex.html.beads.models.ArraySelectionModel'); -goog.require('org.apache.flex.html.supportClasses.StringItemRenderer'); - - - -/** - * @constructor - * @extends {org.apache.flex.events.EventDispatcher} - * @implements {org.apache.flex.core.IItemRenderer} - */ -org.apache.flex.html.beads.TextItemRendererFactoryForArrayData = - function() { - org.apache.flex.html.beads.TextItemRendererFactoryForArrayData.base(this, 'constructor'); -}; -goog.inherits( - org.apache.flex.html.beads.TextItemRendererFactoryForArrayData, - org.apache.flex.events.EventDispatcher); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.TextItemRendererFactoryForArrayData. - prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'TextItemRendererFactoryForArrayData', - qName: 'org.apache.flex.html.beads.TextItemRendererFactoryForArrayData' }], - interfaces: [org.apache.flex.core.IItemRenderer] }; - - -Object.defineProperties(org.apache.flex.html.beads.TextItemRendererFactoryForArrayData.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.TextItemRendererFactoryForArrayData} */ - set: function(value) { - this.strand_ = value; - - this.model = value.getBeadByType( - org.apache.flex.html.beads.models.ArraySelectionModel); - - this.listView = value.getBeadByType( - org.apache.flex.html.beads.ListView); - this.dataGroup = this.listView.dataGroup; - - this.model.addEventListener('dataProviderChanged', - goog.bind(this.dataProviderChangedHandler, this)); - - if (!this.itemRendererFactory) - { - var m2 = org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this.strand_, 'iItemRendererClassFactory'); - this.itemRendererFactory = new m2(); - this.strand_.addBead(this.itemRendererFactory); - } - - this.dataProviderChangedHandler(null); - }, - /** @this {org.apache.flex.html.beads.TextItemRendererFactoryForArrayData} */ - get: function() { - return this.strand_; - } - }, - itemRendererFactory: { - /** @this {org.apache.flex.html.beads.TextItemRendererFactoryForArrayData} */ - set: function(value) { - this.itemRendererFactory_ = value; - }, - /** @this {org.apache.flex.html.beads.TextItemRendererFactoryForArrayData} */ - get: function() { - return this.itemRendererFactory_; - } - } -}); - - -/** - * @export - * @param {Object} event The event that triggered the dataProvider change. - */ -org.apache.flex.html.beads.TextItemRendererFactoryForArrayData. - prototype.dataProviderChangedHandler = function(event) { - var dp, i, n, opt; - - dp = this.model.dataProvider; - n = dp.length; - for (i = 0; i < n; i++) { - var tf = this.itemRendererFactory.createItemRenderer(this.dataGroup); - this.dataGroup.addElement(tf); - tf.data = dp[i]; - tf.index = i; - } - - var newEvent = new org.apache.flex.events.Event('itemsCreated'); - this.strand_.dispatchEvent(newEvent); -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.js deleted file mode 100644 index ea2362c..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ItemRendererMouseController.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.controllers.ItemRendererMouseController'); - -goog.require('goog.events.Event'); -goog.require('goog.events.EventType'); -goog.require('org.apache.flex.core.IBeadController'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadController} - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ItemRendererMouseController', - qName: 'org.apache.flex.html.beads.controllers.ItemRendererMouseController' }], - interfaces: [org.apache.flex.core.IBeadController] }; - - -Object.defineProperties(org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.controllers.ItemRendererMouseController} */ - set: function(value) { - this.strand_ = value; - - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEOVER, - goog.bind(this.handleMouseOver, this)); - - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEOUT, - goog.bind(this.handleMouseOut, this)); - - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEDOWN, - goog.bind(this.handleMouseDown, this)); - - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEUP, - goog.bind(this.handleMouseUp, this)); - } - } -}); - - -/** - * @export - * @param {Object} e The mouse event that triggered the hover. - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype.handleMouseOver = function(e) { - - this.strand_.hovered = true; - - var newEvent = new MouseEvent('rollover'); - newEvent.initMouseEvent('rollover', false, false, - e.view, e.detail, e.screenX, e.screenY, - e.clientX, e.clientY, e.ctrlKey, e.altKey, - e.shiftKey, e.metaKey, e.button, e.relatedTarget); - this.strand_.itemRendererParent.dispatchEvent(newEvent); -}; - - -/** - * @export - * @param {Object} e The mouse-out event. - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype.handleMouseOut = function(e) { - - this.strand_.hovered = false; - - var newEvent = new MouseEvent('rollout'); - newEvent.initMouseEvent('rollout', false, false, - e.view, e.detail, e.screenX, e.screenY, - e.clientX, e.clientY, e.ctrlKey, e.altKey, - e.shiftKey, e.metaKey, e.button, e.relatedTarget); - this.strand_.itemRendererParent.dispatchEvent(newEvent); -}; - - -/** - * @export - * @param {Object} event The mouse-down event. - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype.handleMouseDown = function(event) { - - // ?? -}; - - -/** - * @export - * @param {Object} event The mouse-up event that triggers the selection. - */ -org.apache.flex.html.beads.controllers.ItemRendererMouseController.prototype.handleMouseUp = function(event) { - - var newEvent = new goog.events.Event('selected'); - - // normally you do not - and should not - change the target of an event, - // but these events do not propagate nor bubble up the object tree, so - // we have to force the event's target to be this item renderer instance. - - newEvent.target = this.strand_; - - // since the event is not going to up the chain, we also have to dispatch - // it against its final destination. - - this.strand_.itemRendererParent.dispatchEvent(newEvent); -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.js deleted file mode 100644 index 282e8fd..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/ListSingleSelectionMouseController.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController'); - -goog.require('org.apache.flex.core.IBeadController'); -goog.require('org.apache.flex.core.ISelectableItemRenderer'); -goog.require('org.apache.flex.core.ISelectionModel'); -goog.require('org.apache.flex.html.beads.ListView'); -goog.require('org.apache.flex.utils.Language'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadController} - */ -org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ListSingleSelectionMouseController', - qName: 'org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController' }], - interfaces: [org.apache.flex.core.IBeadController] }; - - -Object.defineProperties(org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController} */ - set: function(value) { - this.strand_ = value; - - this.model = value.getBeadByType( - org.apache.flex.core.ISelectionModel); - this.listView = value.getBeadByType( - org.apache.flex.html.beads.ListView); - - this.dataGroup = this.listView.dataGroup; - this.dataGroup.addEventListener('selected', - goog.bind(this.selectedHandler, this)); - } - } -}); - - -/** - * @export - * ListSingleSelectionMouseController} - * @param {Object} event The event that triggered the selection. - */ -org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController.prototype.selectedHandler = - function(event) { - - var renderer = org.apache.flex.utils.Language.as(event.target, org.apache.flex.core.ISelectableItemRenderer); - var index = renderer.index; - this.model.selectedIndex = index; - - this.strand_.dispatchEvent('change'); -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SliderMouseController.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SliderMouseController.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SliderMouseController.js deleted file mode 100644 index 3801d70..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SliderMouseController.js +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.controllers.SliderMouseController'); - -goog.require('org.apache.flex.html.beads.SliderThumbView'); -goog.require('org.apache.flex.html.beads.SliderTrackView'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.controllers.SliderMouseController = - function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.controllers.SliderMouseController.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SliderMouseController', - qName: 'org.apache.flex.html.beads.controllers.SliderMouseController' }] }; - - -Object.defineProperties(org.apache.flex.html.beads.controllers.SliderMouseController.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.controllers.SliderMouseController} */ - set: function(value) { - this.strand_ = value; - - this.track = this.strand_.getBeadByType( - org.apache.flex.html.beads.SliderTrackView); - this.thumb = this.strand_.getBeadByType( - org.apache.flex.html.beads.SliderThumbView); - - goog.events.listen(this.track.element, goog.events.EventType.CLICK, - this.handleTrackClick, false, this); - - goog.events.listen(this.thumb.element, goog.events.EventType.MOUSEDOWN, - this.handleThumbDown, false, this); - } - } -}); - - -/** - * SliderMouseController} - * @param {Event} event The event triggering the function. - * @return {void} Handles click on track. - */ -org.apache.flex.html.beads.controllers.SliderMouseController. - prototype.handleTrackClick = - function(event) - { - var xloc = event.clientX; - var p = Math.min(1, xloc / parseInt(this.track.element.style.width, 10)); - var n = p * (this.strand_.maximum - this.strand_.minimum) + - this.strand_.minimum; - - this.strand_.value = n; - - this.origin = parseInt(this.thumb.element.style.left, 10); - this.position = parseInt(this.thumb.element.style.left, 10); - - this.calcValFromMousePosition(event, true); - - this.strand_.dispatchEvent(new org.apache.flex.events.Event('valueChange')); -}; - - -/** - * SliderMouseController} - * @param {Event} event The event triggering the function. - * @return {void} Handles mouse-down on the thumb. - */ -org.apache.flex.html.beads.controllers.SliderMouseController. - prototype.handleThumbDown = - function(event) - { - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEUP, - this.handleThumbUp, false, this); - goog.events.listen(this.strand_.element, goog.events.EventType.MOUSEMOVE, - this.handleThumbMove, false, this); - - this.origin = event.clientX; - this.position = parseInt(this.thumb.element.style.left, 10); -}; - - -/** - * SliderMouseController} - * @param {Event} event The event triggering the function. - * @return {void} Handles mouse-up on the thumb. - */ -org.apache.flex.html.beads.controllers.SliderMouseController. - prototype.handleThumbUp = - function(event) - { - goog.events.unlisten(this.strand_.element, goog.events.EventType.MOUSEUP, - this.handleThumbUp, false, this); - goog.events.unlisten(this.strand_.element, goog.events.EventType.MOUSEMOVE, - this.handleThumbMove, false, this); - - this.calcValFromMousePosition(event, false); - - this.strand_.dispatchEvent(new org.apache.flex.events.Event('valueChange')); -}; - - -/** - * SliderMouseController} - * @param {Event} event The event triggering the function. - * @return {void} Handles mouse-move on the thumb. - */ -org.apache.flex.html.beads.controllers.SliderMouseController. - prototype.handleThumbMove = - function(event) - { - this.calcValFromMousePosition(event, false); - - this.strand_.dispatchEvent(new org.apache.flex.events.Event('valueChange')); -}; - - -/** - * SliderMouseController} - * @param {Event} event The event triggering the function. - * @param {boolean} useOffset If true, event.offsetX is used in the calculation. - * @return {void} Determines the new value based on the movement of the mouse - * along the slider. - */ -org.apache.flex.html.beads.controllers.SliderMouseController. - prototype.calcValFromMousePosition = - function(event, useOffset) - { - var deltaX = (useOffset ? event.offsetX : event.clientX) - this.origin; - var thumbW = parseInt(this.thumb.element.style.width, 10) / 2; - var newX = this.position + deltaX; - - var p = newX / parseInt(this.track.element.style.width, 10); - var n = p * (this.strand_.maximum - this.strand_.minimum) + - this.strand_.minimum; - n = this.strand_.snap(n); - if (n < this.strand_.minimum) n = this.strand_.minimum; - else if (n > this.strand_.maximum) n = this.strand_.maximum; - - p = (n - this.strand_.minimum) / (this.strand_.maximum - - this.strand_.minimum); - newX = p * parseInt(this.track.element.style.width, 10); - - this.thumb.element.style.left = String(newX - - parseInt(this.thumb.element.style.width, 10) / 2) + 'px'; - - this.strand_.value = n; -}; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.js deleted file mode 100644 index 48a0ed8..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/controllers/SpinnerMouseController.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.controllers.SpinnerMouseController'); - -goog.require('org.apache.flex.html.TextButton'); - - - -/** - * @constructor - */ -org.apache.flex.html.beads.controllers.SpinnerMouseController = - function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.controllers.SpinnerMouseController.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SpinnerMouseController', - qName: 'org.apache.flex.html.beads.controllers.SpinnerMouseController' }] }; - - -Object.defineProperties(org.apache.flex.html.beads.controllers.SpinnerMouseController.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.controllers.SpinnerMouseController} */ - set: function(value) { - this.strand_ = value; - - this.incrementButton = this.strand_.incrementButton; - this.decrementButton = this.strand_.decrementButton; - - goog.events.listen(this.incrementButton.element, goog.events.EventType.CLICK, - goog.bind(this.handleIncrementClick, this)); - - goog.events.listen(this.decrementButton.element, goog.events.EventType.CLICK, - goog.bind(this.handleDecrementClick, this)); - } - } -}); - - -/** - * SpinnerMouseController} - * @param {Object} event The event object. - */ -org.apache.flex.html.beads.controllers.SpinnerMouseController. - prototype.handleIncrementClick = function(event) - { - var newValue = this.strand_.snap(Math.min(this.strand_.maximum, - this.strand_.value + - this.strand_.stepSize)); - this.strand_.value = newValue; -}; - - -/** - * SpinnerMouseController} - * @param {Event} event The event object. - */ -org.apache.flex.html.beads.controllers.SpinnerMouseController. - prototype.handleDecrementClick = - function(event) - { - var newValue = this.strand_.snap(Math.max(this.strand_.minimum, - this.strand_.value - - this.strand_.stepSize)); - this.strand_.value = newValue; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js deleted file mode 100644 index 4a7401b..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/BasicLayout.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.layouts.BasicLayout'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.ILayoutChild'); -goog.require('org.apache.flex.core.ILayoutHost'); -goog.require('org.apache.flex.core.ValuesManager'); -goog.require('org.apache.flex.utils.Language'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadLayout} - */ -org.apache.flex.html.beads.layouts.BasicLayout = - function() { - this.strand_ = null; - this.className = 'BasicLayout'; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.layouts.BasicLayout.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'BasicLayout', - qName: 'org.apache.flex.html.beads.layouts.BasicLayout'}], - interfaces: [org.apache.flex.core.IBeadLayout] }; - - -Object.defineProperties(org.apache.flex.html.beads.layouts.BasicLayout.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.layouts.BasicLayout} */ - set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - } - } - } -}); - - -/** - */ -org.apache.flex.html.beads.layouts.BasicLayout. - prototype.layout = function() { - var i, n, h, w; - - var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutHost); - var contentView = viewBead.contentView; - w = contentView.width; - var hasWidth = !this.strand_.isWidthSizedToContent(); - h = contentView.height; - var hasHeight = !this.strand_.isHeightSizedToContent(); - var maxHeight = 0; - var maxWidth = 0; - n = contentView.numElements; - for (i = 0; i < n; i++) { - var child = contentView.getElementAt(i); - child.internalDisplay = 'block'; - var left = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'left'); - var right = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'right'); - var top = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'top'); - var bottom = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'bottom'); - var margin = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin'); - var marginLeft = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-left'); - var marginRight = org.apache.flex.core.ValuesManager.valuesImpl.getValue(child, 'margin-right'); - var horizontalCenter = - (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; - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js deleted file mode 100644 index 04a3292..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.layouts.ButtonBarLayout'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.ILayoutHost'); -goog.require('org.apache.flex.html.beads.ListView'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadLayout} - */ -org.apache.flex.html.beads.layouts.ButtonBarLayout = - function() { - this.strand_ = null; - - this.className = 'ButtonBarLayout'; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.layouts.ButtonBarLayout - .prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ButtonBarLayout', - qName: 'org.apache.flex.html.beads.layouts.ButtonBarLayout' }], - interfaces: [org.apache.flex.core.IBeadLayout] }; - - -Object.defineProperties(org.apache.flex.html.beads.layouts.ButtonBarLayout.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.layouts.ButtonBarLayout} */ - set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - this.strand_.element.style.display = 'block'; - } - } - }, - /** @export */ - buttonWidths: { - /** @this {org.apache.flex.html.beads.layouts.ButtonBarLayout} */ - set: function(value) { - this.buttonWidths_ = value; - }, - /** @this {org.apache.flex.html.beads.layouts.ButtonBarLayout} */ - get: function() { - return this.buttonWidths_; - } - } -}); - - -/** - * Performs the layout. - */ -org.apache.flex.html.beads.layouts.ButtonBarLayout. - prototype.layout = function() { - - var layoutParent = this.strand_.getBeadByType(org.apache.flex.core.ILayoutHost); - var contentView = layoutParent.contentView; - var itemRendererParent = contentView; - var viewportModel = layoutParent.viewportModel; - - var n = itemRendererParent.numElements; - var xpos = 0; - var useWidth = contentView.width / n; - var useHeight = contentView.height; - - for (var i = 0; i < n; i++) - { - var ir = itemRendererParent.getElementAt(i); - ir.height = useHeight; - ir.internalDisplay = 'inline-block'; - ir.positioner.style['vertical-align'] = 'middle'; - ir.positioner.style['text-align'] = 'center'; - ir.positioner.style['left-margin'] = 'auto'; - ir.positioner.style['right-margin'] = 'auto'; - ir.positioner.style['top-margin'] = 'auto'; - ir.positioner.style['bottom-margin'] = 'auto'; - - if (this.buttonWidths_ && !isNaN(this.buttonWidths_[i])) ir.width = this.buttonWidths_[i]; - else ir.width = useWidth; - - if (ir.positioner.style.display == 'none') - ir.positioner.lastDisplay_ = 'inline-block'; - else - ir.positioner.style.display = 'inline-block'; - - xpos += ir.width; - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js deleted file mode 100644 index b5ede3d..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.layouts.HorizontalLayout'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.ILayoutHost'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadLayout} - */ -org.apache.flex.html.beads.layouts.HorizontalLayout = - function() { - this.strand_ = null; - this.className = 'HorizontalLayout'; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.layouts.HorizontalLayout. - prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'HorizontalLayout', - qName: 'org.apache.flex.html.beads.layouts.HorizontalLayout' }], - interfaces: [org.apache.flex.core.IBeadLayout] }; - - -Object.defineProperties(org.apache.flex.html.beads.layouts.HorizontalLayout.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.layouts.HorizontalLayout} */ - set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - this.strand_.element.style.display = 'block'; - } - } - } -}); - - -/** - */ -org.apache.flex.html.beads.layouts.HorizontalLayout. - prototype.layout = function() { - var children, i, n; - - var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutHost); - var contentView = viewBead.contentView; - children = contentView.internalChildren(); - var hasHeight = !this.strand_.isHeightSizedToContent(); - var hasWidth = !this.strand_.isWidthSizedToContent(); - var maxHeight = 0; - var computedWidth = 0; - n = children.length; - for (i = 0; i < n; i++) - { - var child = children[i]; - child.flexjs_wrapper.internalDisplay = 'inline-block'; - if (child.style.display == 'none') - child.lastDisplay_ = 'inline-block'; - else - child.style.display = 'inline-block'; - maxHeight = Math.max(maxHeight, child.offsetHeight); - if (!hasWidth) { - var cv = window.getComputedStyle(child); - var mls = cv.getPropertyValue('margin-left'); - var ml = Number(mls.substring(0, mls.length - 2)); - var mrs = cv.getPropertyValue('margin-right'); - var mr = 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 - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js deleted file mode 100644 index a27b630..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/TileLayout.js +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.layouts.TileLayout'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.ILayoutHost'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadLayout} - */ -org.apache.flex.html.beads.layouts.TileLayout = - function() { - this.strand_ = null; - this.className = 'TileLayout'; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.layouts.TileLayout.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'TileLayout', - qName: 'org.apache.flex.html.beads.layouts.TileLayout'}], - interfaces: [org.apache.flex.core.IBeadLayout] }; - - -Object.defineProperties(org.apache.flex.html.beads.layouts.TileLayout.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - } - } - }, - /** @export */ - numColumns: { - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - get: function() { - return this._numColumns; - }, - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - set: function(value) { - this._numColumns = value; - } - }, - /** @export */ - columnWidth: { - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - get: function() { - return this._columnWidth; - }, - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - set: function(value) { - this._columnWidth = value; - } - }, - /** @export */ - rowHeight: { - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - get: function() { - return this._rowHeight; - }, - /** @this {org.apache.flex.html.beads.layouts.TileLayout} */ - set: function(value) { - this._rowHeight = value; - } - } -}); - - -/** - */ -org.apache.flex.html.beads.layouts.TileLayout. - prototype.layout = function() { - var children, i, n, child; - var xpos, ypos, useWidth, useHeight; - - var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutHost); - var contentView = viewBead.contentView; - children = contentView.internalChildren(); - n = children.length; - if (n === 0) return; - - var realN = n; - for (i = 0; i < n; i++) - { - child = children[i].flexjs_wrapper; - if (!child.visible) realN--; - } - - xpos = 0; - ypos = 0; - useWidth = this.columnWidth; - useHeight = this.rowHeight; - - if (isNaN(useWidth)) useWidth = Math.floor(this.strand_.width / this.numColumns); // + gap - if (isNaN(useHeight)) { - // given the width and total number of items, how many rows? - var numRows = Math.floor(realN / this.numColumns); - useHeight = Math.floor(this.strand_.height / numRows); - } - - for (i = 0; i < n; i++) - { - child = children[i].flexjs_wrapper; - if (!child.visible) continue; - child.internalDisplay = 'inline-block'; - child.width = useWidth; - child.height = useHeight; - } -/* - var realN = n; - for (i = 0; i < n; i++) - { - child = children[i].flexjs_wrapper; - if (!child.get_visible()) realN--; - } - - xpos = 0; - ypos = 0; - useWidth = this.columnWidth; - useHeight = this.rowHeight; - - if (isNaN(useWidth)) useWidth = Math.floor(this.strand_.width / this.numColumns); // + gap - if (isNaN(useHeight)) { - // given the width and total number of items, how many rows? - var numRows = Math.floor(realN / this.numColumns); - useHeight = Math.floor(this.strand_.height / numRows); - } - - for (i = 0; i < n; i++) - { - child = children[i].flexjs_wrapper; - if (!child.visible) continue; - child.internalDisplay = 'inline-block'; - child.width = useWidth; - child.height = useHeight; - child.x = xpos; - child.y = ypos; - - xpos += useWidth; - - if (((i + 1) % this.numColumns) === 0) { - xpos = 0; - ypos += useHeight; - } - } -*/ -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js deleted file mode 100644 index b179288..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/VerticalLayout.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.layouts.VerticalLayout'); - -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.ILayoutHost'); -goog.require('org.apache.flex.utils.Language'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IBeadLayout} - */ -org.apache.flex.html.beads.layouts.VerticalLayout = - function() { - this.strand_ = null; - this.className = 'VerticalLayout'; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.layouts.VerticalLayout.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'VerticalLayout', - qName: 'org.apache.flex.html.beads.layouts.VerticalLayout'}], - interfaces: [org.apache.flex.core.IBeadLayout] }; - - -Object.defineProperties(org.apache.flex.html.beads.layouts.VerticalLayout.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.layouts.VerticalLayout} */ - set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; - } - }, - /** @this {org.apache.flex.html.beads.layouts.VerticalLayout} */ - get: function() { - return this.strand_; - } - } -}); - - -/** - */ -org.apache.flex.html.beads.layouts.VerticalLayout. - prototype.layout = function() { - var children, i, n; - - var viewBead = this.strand_.getBeadByType(org.apache.flex.core.ILayoutHost); - var contentView = viewBead.contentView; - children = contentView.internalChildren(); - var scv = getComputedStyle(this.strand_.positioner); - var hasWidth = !this.strand_.isWidthSizedToContent(); - var maxWidth = 0; - n = children.length; - for (i = 0; i < n; i++) - { - var child = children[i]; - child.flexjs_wrapper.internalDisplay = 'block'; - if (child.style.display === 'none') { - child.lastDisplay_ = '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 = scv.getPropertyValue('padding-left'); - var pr = scv.getPropertyValue('padding-right'); - pl = parseInt(pl.substring(0, pl.length - 2), 10); - pr = parseInt(pr.substring(0, pr.length - 2), 10); - maxWidth += pl + pr; - contentView.width = maxWidth; - } -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ArraySelectionModel.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ArraySelectionModel.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ArraySelectionModel.js deleted file mode 100644 index b22cf27..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ArraySelectionModel.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.models.ArraySelectionModel'); - -goog.require('org.apache.flex.core.ISelectionModel'); -goog.require('org.apache.flex.events.EventDispatcher'); - - - -/** - * @constructor - * @extends {org.apache.flex.events.EventDispatcher} - * @implements {org.apache.flex.core.ISelectionModel} - */ -org.apache.flex.html.beads.models.ArraySelectionModel = - function() { - org.apache.flex.html.beads.models.ArraySelectionModel.base(this, 'constructor'); - this.className = 'ArraySelectionModel'; -}; -goog.inherits( - org.apache.flex.html.beads.models.ArraySelectionModel, - org.apache.flex.events.EventDispatcher); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.models.ArraySelectionModel.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ArraySelectionModel', - qName: 'org.apache.flex.html.beads.models.ArraySelectionModel' }], - interfaces: [org.apache.flex.core.ISelectionModel] }; - - -Object.defineProperties(org.apache.flex.html.beads.models.ArraySelectionModel.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - set: function(value) { - this.strand_ = value; - } - }, - /** @export */ - dataProvider: { - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - get: function() { - return this.dataProvider_; - }, - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - set: function(value) { - if (value === this.dataProvider_) return; - this.dataProvider_ = value; - this.dispatchEvent('dataProviderChanged'); - } - }, - /** @export */ - selectedIndex: { - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - get: function() { - return this.selectedIndex_; - }, - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - set: function(value) { - if (value === this.selectedIndex_) return; - this.selectedIndex_ = value; - this.dispatchEvent('selectedIndexChanged'); - } - }, - /** @export */ - selectedItem: { - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - get: function() { - var si; - - si = this.selectedIndex_; - - if (!this.dataProvider_ || si < 0 || - si >= this.dataProvider_.length) { - return null; - } - - return this.dataProvider_[si]; - }, - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - set: function(value) { - // find item in dataProvider and set selectedIndex or -1 if not exists - - this.selectedIndex_ = -1; - var n = this.dataProvider_.length; - for (var i = 0; i < n; i++) { - var item = this.dataProvider_[i]; - if (item == value) { - this.selectedIndex_ = i; - break; - } - } - - this.dispatchEvent('selectedItemChanged'); - this.dispatchEvent('selectedIndexChanged'); - } - }, - /** @export */ - labelField: { - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - get: function() { - return this.labelField_; - }, - /** @this {org.apache.flex.html.beads.models.ArraySelectionModel} */ - set: function(value) { - this.labelField_ = value; - this.dispatchEvent('labelFieldChanged'); - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ImageModel.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ImageModel.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ImageModel.js deleted file mode 100644 index d5db7c9..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/models/ImageModel.js +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.beads.models.ImageModel'); - -goog.require('org.apache.flex.core.IBeadModel'); -goog.require('org.apache.flex.events.EventDispatcher'); - - - -/** - * @constructor - * @extends {org.apache.flex.events.EventDispatcher} - */ -org.apache.flex.html.beads.models.ImageModel = - function() { - org.apache.flex.html.beads.models.ImageModel.base(this, 'constructor'); -}; -goog.inherits( - org.apache.flex.html.beads.models.ImageModel, - org.apache.flex.events.EventDispatcher); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.beads.models.ImageModel.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ImageModel', - qName: 'org.apache.flex.html.beads.models.ImageModel'}], - interfaces: [org.apache.flex.core.IBeadModel]}; - - -Object.defineProperties(org.apache.flex.html.beads.models.ImageModel.prototype, { - /** @export */ - strand: { - /** @this {org.apache.flex.html.beads.models.ImageModel} */ - set: function(value) { - this.strand_ = value; - } - }, - /** @export */ - source: { - /** @this {org.apache.flex.html.beads.models.ImageModel} */ - get: function() { - return this.source_; - }, - /** @this {org.apache.flex.html.beads.models.ImageModel} */ - set: function(value) { - this.source_ = value; - this.dispatchEvent('sourceChanged'); - } - } -});
