Repository: flex-asjs Updated Branches: refs/heads/develop 3f055ac6a -> 3970d514c
Use _strand instead of strand_ so it can be a protected var instead of private (the linters think that vars ending with '_' are meant to be private). This also saves on having to supply a getter for every override of the strand setter Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c71ca2f6 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c71ca2f6 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c71ca2f6 Branch: refs/heads/develop Commit: c71ca2f65aa026c3900cb77972b8cf2e33487fa1 Parents: 3f055ac Author: Alex Harui <[email protected]> Authored: Wed Jul 29 11:37:03 2015 -0700 Committer: Alex Harui <[email protected]> Committed: Wed Jul 29 11:37:03 2015 -0700 ---------------------------------------------------------------------- .../js/src/org/apache/flex/core/BeadViewBase.js | 9 ++-- .../org/apache/flex/html/beads/ButtonBarView.js | 1 - .../org/apache/flex/html/beads/ContainerView.js | 51 +++++++++----------- .../src/org/apache/flex/html/beads/ListView.js | 17 +++---- .../src/org/apache/flex/html/beads/PanelView.js | 12 ++--- 5 files changed, 41 insertions(+), 49 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c71ca2f6/frameworks/projects/Core/js/src/org/apache/flex/core/BeadViewBase.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/BeadViewBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/BeadViewBase.js index 2587162..f2efed2 100644 --- a/frameworks/projects/Core/js/src/org/apache/flex/core/BeadViewBase.js +++ b/frameworks/projects/Core/js/src/org/apache/flex/core/BeadViewBase.js @@ -44,10 +44,9 @@ org.apache.flex.core.BeadViewBase.prototype.FLEXJS_CLASS_INFO = /** - * @private * @type {Object} */ -org.apache.flex.core.BeadViewBase.prototype.strand_ = null; +org.apache.flex.core.BeadViewBase.prototype._strand = null; Object.defineProperties(org.apache.flex.core.BeadViewBase.prototype, { @@ -55,8 +54,8 @@ Object.defineProperties(org.apache.flex.core.BeadViewBase.prototype, { strand: { /** @this {org.apache.flex.core.BeadViewBase} */ set: function(value) { - if (this.strand_ !== value) { - this.strand_ = value; + if (this._strand !== value) { + this._strand = value; } } }, @@ -64,7 +63,7 @@ Object.defineProperties(org.apache.flex.core.BeadViewBase.prototype, { host: { /** @this {org.apache.flex.core.BeadViewBase} */ get: function() { - return this.strand_; + return this._strand; } } }); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c71ca2f6/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ButtonBarView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ButtonBarView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ButtonBarView.js index 5cfb51d..1585cbb 100644 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ButtonBarView.js +++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ButtonBarView.js @@ -51,7 +51,6 @@ Object.defineProperties(org.apache.flex.html.beads.ButtonBarView.prototype, { set: function(value) { org.apache.flex.utils.Language.superSetter( org.apache.flex.html.beads.ButtonBarView, this, 'strand', value); - this.strand_ = value; } } }); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c71ca2f6/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js index 0de6320..e2c0629 100644 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js +++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/ContainerView.js @@ -50,13 +50,12 @@ org.apache.flex.html.beads.ContainerView.prototype.FLEXJS_CLASS_INFO = /** - * @private * @type {Object} * This is also defined as protected on BeadViewBase, but GCC * doesn't seem to allow the Object.defineProperties to use it * without re-declaring it here. */ -org.apache.flex.html.beads.ContainerView.prototype.strand_ = null; +org.apache.flex.html.beads.ContainerView.prototype._strand = null; /** @@ -85,13 +84,13 @@ org.apache.flex.html.beads.ContainerView.prototype.contentArea_ = null; */ org.apache.flex.html.beads.ContainerView. prototype.addOtherListeners = function() { - this.strand_.addEventListener('childrenAdded', + this._strand.addEventListener('childrenAdded', goog.bind(this.changeHandler, this)); - this.strand_.addEventListener('elementAdded', + this._strand.addEventListener('elementAdded', goog.bind(this.changeHandler, this)); - this.strand_.addEventListener('layoutNeeded', + this._strand.addEventListener('layoutNeeded', goog.bind(this.changeHandler, this)); - this.strand_.addEventListener('itemsCreated', + this._strand.addEventListener('itemsCreated', goog.bind(this.changeHandler, this)); }; @@ -101,7 +100,7 @@ org.apache.flex.html.beads.ContainerView. */ org.apache.flex.html.beads.ContainerView. prototype.createContentView = function() { - return this.strand_; + return this._strand; }; @@ -132,11 +131,11 @@ org.apache.flex.html.beads.ContainerView. org.apache.flex.html.beads.ContainerView. prototype.performLayout = function(event) { if (this.layout_ == null) { - this.layout_ = this.strand_.getBeadByType(org.apache.flex.core.IBeadLayout); + this.layout_ = this._strand.getBeadByType(org.apache.flex.core.IBeadLayout); if (this.layout_ == null) { - var m3 = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this.strand_, 'iBeadLayout'); + var m3 = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this._strand, 'iBeadLayout'); this.layout_ = new m3(); - this.strand_.addBead(this.layout_); + this._strand.addBead(this.layout_); } } this.layout_.layout(); @@ -177,15 +176,15 @@ org.apache.flex.html.beads.ContainerView. this.viewportModel_ = new org.apache.flex.html.beads.models.ViewportModel(); this.viewportModel_.contentArea = this.contentView; this.viewportModel_.contentIsHost = true; - this.viewportModel_.contentWidth = this.strand_.width; - this.viewportModel_.contentHeight = this.strand_.height; + this.viewportModel_.contentWidth = this._strand.width; + this.viewportModel_.contentHeight = this._strand.height; this.viewportModel_.contentX = 0; this.viewportModel_.contentY = 0; } if (this.viewport_ == null) { this.viewport_ = new org.apache.flex.html.supportClasses.Viewport(); this.viewport_.model = this.viewportModel_; - this.strand_.addBead(this.viewport_); + this._strand.addBead(this.viewport_); } this.resizeViewport(); }; @@ -197,8 +196,8 @@ org.apache.flex.html.beads.ContainerView. */ org.apache.flex.html.beads.ContainerView. prototype.resizeViewport = function() { - this.viewportModel_.viewportHeight = this.strand_.height; - this.viewportModel_.viewportWidth = this.strand_.width; + this.viewportModel_.viewportHeight = this._strand.height; + this.viewportModel_.viewportWidth = this._strand.width; this.viewportModel_.viewportX = 0; this.viewportModel_.viewportY = 0; }; @@ -216,7 +215,7 @@ Object.defineProperties(org.apache.flex.html.beads.ContainerView.prototype, { resizableView: { /** @this {org.apache.flex.html.beads.ContainerView} */ get: function() { - return this.strand_; + return this._strand; }, set: function(value) { } @@ -227,25 +226,21 @@ Object.defineProperties(org.apache.flex.html.beads.ContainerView.prototype, { set: function(value) { org.apache.flex.utils.Language.superSetter(org.apache.flex.html.beads.ContainerView, this, 'strand', value); this.contentArea_ = this.createContentView(); - if (this.strand_.isWidthSizedToContent() && - this.strand_.isHeightSizedToContent()) + if (this._strand.isWidthSizedToContent() && + this._strand.isHeightSizedToContent()) this.addOtherListeners(); else { - this.strand_.addEventListener('heightChanged', + this._strand.addEventListener('heightChanged', goog.bind(this.changeHandler, this)); - this.strand_.addEventListener('widthChanged', + this._strand.addEventListener('widthChanged', goog.bind(this.changeHandler, this)); - this.strand_.addEventListener('sizeChanged', + this._strand.addEventListener('sizeChanged', goog.bind(this.sizeChangeHandler, this)); - if (!isNaN(this.strand_.explicitWidth) && - !isNaN(this.strand_.explicitHeight)) + if (!isNaN(this._strand.explicitWidth) && + !isNaN(this._strand.explicitHeight)) this.addOtherListeners(); } - }, - /** @this {org.apache.flex.html.beads.ContainerView} */ - get: function() { - return this.strand_; - } + } }, /** @export */ viewport: { http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c71ca2f6/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 index 23a70b8..98e1146 100644 --- 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 @@ -61,11 +61,10 @@ Object.defineProperties(org.apache.flex.html.beads.ListView.prototype, { strand: { /** @this {org.apache.flex.html.beads.ListView} */ set: function(value) { - this.strand_ = value; org.apache.flex.utils.Language.superSetter( org.apache.flex.html.beads.ListView, this, 'strand', value); - this.model = this.strand_.model; + this.model = this._strand.model; this.model.addEventListener('selectedIndexChanged', goog.bind(this.selectionChangeHandler, this)); this.model.addEventListener('dataProviderChanged', @@ -73,16 +72,16 @@ Object.defineProperties(org.apache.flex.html.beads.ListView.prototype, { if (this.dataGroup_ == null) { var m2 = org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this.strand_, 'iDataGroup'); + getValue(this._strand, 'iDataGroup'); this.dataGroup_ = new m2(); } this.dataGroup_.strand = this; - this.strand_.addElement(this.dataGroup_); + this._strand.addElement(this.dataGroup_); - if (this.strand_.getBeadByType(org.apache.flex.core.IBeadLayout) == null) { - var m3 = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this.strand_, 'iBeadLayout'); + 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._strand.addBead(this.layout_); } } }, @@ -171,6 +170,6 @@ Object.defineProperties(org.apache.flex.html.beads.ListView.prototype, { * @param {Object} 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; + this.dataGroup_.width = this._strand.width; + this.dataGroup_.height = this._strand.height; }; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c71ca2f6/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 index 8cea3a0..69db3e2 100644 --- 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 @@ -72,16 +72,16 @@ Object.defineProperties(org.apache.flex.html.beads.PanelView.prototype, { if (!this.titleBar_) this.titleBar_ = new org.apache.flex.html.TitleBar(); - this.strand_.titleBar = this.titleBar_; + this._strand.titleBar = this.titleBar_; this.titleBar_.id = 'titleBar'; - this.titleBar_.model = this.strand_.model; + this.titleBar_.model = this._strand.model; - this.strand_.controlBar = + this._strand.controlBar = new org.apache.flex.html.ControlBar(); // listen for changes to the strand's model so items can be changed // in the view - this.strand_.model.addEventListener('titleChange', + this._strand.model.addEventListener('titleChange', goog.bind(this.changeHandler, this)); } }, @@ -105,7 +105,7 @@ Object.defineProperties(org.apache.flex.html.beads.PanelView.prototype, { */ org.apache.flex.html.beads.PanelView.prototype.changeHandler = function(event) { - var strand = this.strand_; + var strand = this._strand; if (!this.titleBarAdded_) { this.titleBarAdded_ = true; @@ -118,7 +118,7 @@ org.apache.flex.html.beads.PanelView.prototype.changeHandler = this.titleBar_.title = strand.model.title; } - var p = this.strand_.positioner; + var p = this._strand.positioner; if (!strand.isWidthSizedToContent()) { var w = strand.width; w -= p.offsetWidth - p.clientWidth;
