You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/08/26 08:16:38 UTC
[2/6] git commit: [flex-asjs] [refs/heads/develop] - clean up warnings
clean up warnings
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/b6cce51a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/b6cce51a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/b6cce51a
Branch: refs/heads/develop
Commit: b6cce51a3256f3b06675d4e058365085a607479a
Parents: ac6f848
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 25 15:55:01 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 25 15:55:01 2015 -0700
----------------------------------------------------------------------
.../js/src/org/apache/flex/core/ViewBase.js | 87 +-------------------
.../org/apache/flex/html/beads/ContainerView.js | 52 ++++++------
.../src/org/apache/flex/html/beads/ListView.js | 20 ++---
.../src/org/apache/flex/html/beads/PanelView.js | 30 +++----
.../TextItemRendererFactoryForArrayData.js | 1 +
5 files changed, 49 insertions(+), 141 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6cce51a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js
index e423a09..4bded41 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js
@@ -32,32 +32,7 @@ goog.require('org.apache.flex.utils.MXMLDataInterpreter');
org.apache.flex.core.ViewBase = function() {
org.apache.flex.core.ViewBase.base(this, 'constructor');
- /**
- * @private
- * @type {Array}
- */
- this.states_ = null;
-
- /**
- * @private
- * @type {Array}
- */
- this.transitions_ = null;
-
- /**
- * @private
- * @type {string}
- */
- this.currentState_ = '';
-
- /**
- * @private
- * @type {boolean}
- */
- this.initialized_ = false;
-
this.document = this;
-
};
goog.inherits(org.apache.flex.core.ViewBase, org.apache.flex.core.ContainerBase);
@@ -69,7 +44,7 @@ goog.inherits(org.apache.flex.core.ViewBase, org.apache.flex.core.ContainerBase)
*/
org.apache.flex.core.ViewBase.prototype.FLEXJS_CLASS_INFO =
{ names: [{ name: 'ViewBase',
- qName: 'org.apache.flex.core.ContainerBase' }],
+ qName: 'org.apache.flex.core.ViewBase' }],
interfaces: [org.apache.flex.core.IPopUpHost] };
@@ -121,14 +96,6 @@ org.apache.flex.core.ViewBase.prototype.addedToParent = function() {
org.apache.flex.core.ViewBase.base(this, 'addedToParent');
- if (!this.initialized_) {
- org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this.document,
- this, this.MXMLDescriptor);
-
- this.dispatchEvent(new org.apache.flex.events.Event('initBindings'));
- this.dispatchEvent(new org.apache.flex.events.Event('initComplete'));
- this.initialized_ = true;
- }
this.dispatchEvent(new org.apache.flex.events.Event('childrenAdded'));
};
@@ -139,9 +106,10 @@ org.apache.flex.core.ViewBase.prototype.addedToParent = function() {
* @return {boolean} True if state in states array.
*/
org.apache.flex.core.ViewBase.prototype.hasState = function(state) {
- for (var p in this.states_)
+ var states = this.states;
+ for (var p in states)
{
- var s = this.states_[p];
+ var s = states[p];
if (s.name == state)
return true;
}
@@ -171,52 +139,5 @@ Object.defineProperties(org.apache.flex.core.ViewBase.prototype, {
set: function(value) {
this.applicationModel_ = value;
}
- },
- /** @export */
- states: {
- /** @this {org.apache.flex.core.ViewBase} */
- get: function() {
- return this.states_;
- },
- /** @this {org.apache.flex.core.ViewBase} */
- set: function(value) {
- this.states_ = value;
- this.currentState_ = value[0].name;
-
- if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) {
- /**
- * @type {Function}
- */
- var impl = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl.
- getValue(this, 'iStatesImpl'));
- // TODO: (aharui) check if bead already exists
- this.addBead(new impl());
- }
- }
- },
- /** @export */
- currentState: {
- /** @this {org.apache.flex.core.ViewBase} */
- get: function() {
- return this.currentState_;
- },
- /** @this {org.apache.flex.core.ViewBase} */
- set: function(value) {
- var event = new org.apache.flex.events.ValueChangeEvent(
- 'currentStateChange', false, false, this.currentState_, value);
- this.currentState_ = value;
- this.dispatchEvent(event);
- }
- },
- /** @export */
- transitions: {
- /** @this {org.apache.flex.core.ViewBase} */
- get: function() {
- return this.transitions_;
- },
- /** @this {org.apache.flex.core.ViewBase} */
- set: function(value) {
- this.transitions_ = value;
- }
}
});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6cce51a/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 be08b4c..70c2752 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
@@ -55,13 +55,6 @@ org.apache.flex.html.beads.ContainerView.prototype.FLEXJS_CLASS_INFO =
* @private
* @type {Object}
*/
-org.apache.flex.html.beads.ContainerView.prototype.strand_ = null;
-
-
-/**
- * @private
- * @type {Object}
- */
org.apache.flex.html.beads.ContainerView.prototype.viewport_ = null;
@@ -103,7 +96,7 @@ org.apache.flex.html.beads.ContainerView.
}
}
else {
- this.strand_.addEventListener('sizeChanged',
+ this._strand.addEventListener('sizeChanged',
goog.bind(this.deferredSizeHandler, this));
}
};
@@ -114,7 +107,7 @@ org.apache.flex.html.beads.ContainerView.
*/
org.apache.flex.html.beads.ContainerView.
prototype.deferredSizeHandler = function(event) {
- this.strand_.removeEventListener('sizeChanged',
+ this._strand.removeEventListener('sizeChanged',
goog.bind(this.deferredSizeHandler, this));
this.completeSetup();
@@ -187,20 +180,20 @@ org.apache.flex.html.beads.ContainerView.
prototype.completeSetup = function() {
this.createViewport();
- this.strand_.addEventListener('childrenAdded',
+ this._strand.addEventListener('childrenAdded',
goog.bind(this.childrenChangedHandler, this));
this.childrenChangedHandler(null);
- this.strand_.addEventListener('childrenAdded',
+ this._strand.addEventListener('childrenAdded',
goog.bind(this.changeHandler, this));
- this.strand_.addEventListener('childrenRemoved',
+ this._strand.addEventListener('childrenRemoved',
goog.bind(this.changeHandler, this));
- this.strand_.addEventListener('layoutNeeded',
+ this._strand.addEventListener('layoutNeeded',
goog.bind(this.performLayout, this));
- this.strand_.addEventListener('widthChanged',
+ this._strand.addEventListener('widthChanged',
goog.bind(this.resizeHandler, this));
- this.strand_.addEventListener('heightChanged',
+ this._strand.addEventListener('heightChanged',
goog.bind(this.resizeHandler, this));
- this.strand_.addEventListener('sizeChanged',
+ this._strand.addEventListener('sizeChanged',
goog.bind(this.resizeHandler, this));
};
@@ -218,7 +211,7 @@ org.apache.flex.html.beads.ContainerView.
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_);
}
};
@@ -228,8 +221,8 @@ org.apache.flex.html.beads.ContainerView.
*/
org.apache.flex.html.beads.ContainerView.
prototype.adjustSizeBeforeLayout = function() {
- 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;
};
@@ -242,11 +235,11 @@ org.apache.flex.html.beads.ContainerView.
prototype.performLayout = function(event) {
this.adjustSizeBeforeLayout();
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();
@@ -298,8 +291,8 @@ org.apache.flex.html.beads.ContainerView.
*/
org.apache.flex.html.beads.ContainerView.
prototype.layoutContainer = function(widthSizedToContent, heightSizedToContent) {
- 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;
};
@@ -320,8 +313,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;*/
};
@@ -334,6 +327,7 @@ Object.defineProperties(org.apache.flex.html.beads.ContainerView.prototype, {
get: function() {
return this.contentArea_;
},
+ /** @this {org.apache.flex.html.beads.ContainerView} */
set: function(value) {
this.contentArea_ = value;
}
@@ -342,8 +336,9 @@ 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;
},
+ /** @this {org.apache.flex.html.beads.ContainerView} */
set: function(value) {
}
},
@@ -351,14 +346,13 @@ Object.defineProperties(org.apache.flex.html.beads.ContainerView.prototype, {
strand: {
/** @this {org.apache.flex.html.beads.ContainerView} */
set: function(value) {
- this.strand_ = value;
org.apache.flex.utils.Language.superSetter(org.apache.flex.html.beads.ContainerView, this, 'strand', value);
this.contentView = this.createContentView();
this.contentView.percentWidth = 100;
this.contentView.percentHeight = 100;
this.host.addElement(this.contentView);
this.host.setActualParent(this.contentView);
- this.strand_.addEventListener('initComplete',
+ this._strand.addEventListener('initComplete',
goog.bind(this.initCompleteHandler, this));
}
},
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6cce51a/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 7079201..e1b951d 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
@@ -63,7 +63,7 @@ org.apache.flex.html.beads.ListView.prototype.
org.apache.flex.html.beads.ListView.
prototype.createContentView = function() {
var m2 = org.apache.flex.core.ValuesManager.valuesImpl.
- getValue(this.strand_, 'iDataGroup');
+ getValue(this._strand, 'iDataGroup');
var contentView = new m2();
return contentView;
};
@@ -75,7 +75,7 @@ org.apache.flex.html.beads.ListView.
org.apache.flex.html.beads.ListView.
prototype.completeSetup = function() {
org.apache.flex.html.beads.ListView.base(this, 'completeSetup');
- this.strand_.addEventListener('itemsCreated',
+ this._strand.addEventListener('itemsCreated',
goog.bind(this.changeHandler, this));
};
@@ -85,11 +85,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',
@@ -97,14 +96,15 @@ Object.defineProperties(org.apache.flex.html.beads.ListView.prototype, {
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');
+ /*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_);
}*/
},
+ /** @this {org.apache.flex.html.beads.ListView} */
get: function() {
- return this.strand_;
+ return this._strand;
}
},
/** @export */
@@ -192,6 +192,6 @@ org.apache.flex.html.beads.ListView.prototype.
* @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;
+ this.dataGroup_.width = this._strand.width;
+ this.dataGroup_.height = this._strand.height;
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6cce51a/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 6056ccb..281558d 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
@@ -58,13 +58,6 @@ org.apache.flex.html.beads.PanelView
/**
- * @private
- * @type {Object}
- */
-org.apache.flex.html.beads.PanelView.prototype.strand_ = null;
-
-
-/**
* @override
*/
org.apache.flex.html.beads.PanelView.
@@ -79,22 +72,21 @@ Object.defineProperties(org.apache.flex.html.beads.PanelView.prototype, {
strand: {
/** @this {org.apache.flex.html.beads.PanelView} */
set: function(value) {
- this.strand_ = value;
if (!this.titleBar_)
this.titleBar_ = new org.apache.flex.html.TitleBar();
- this.strand_.titleBar = this.titleBar_;
+ value.titleBar = this.titleBar_;
this.titleBar_.id = 'panelTitleBar';
- this.titleBar_.model = this.strand_.model;
+ this.titleBar_.model = value.model;
this.titleBarAdded_ = true;
- this.strand_.addElement(this.titleBar_);
+ value.addElement(this.titleBar_);
-// 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',
+ value.model.addEventListener('titleChange',
goog.bind(this.changeHandler, this));
org.apache.flex.utils.Language.superSetter(org.apache.flex.html.beads.PanelView, this, 'strand', value);
@@ -124,15 +116,15 @@ org.apache.flex.html.beads.PanelView.prototype.layoutContainer =
this.titleBar_.x = 0;
this.titleBar_.y = 0;
- this.titleBar_.width = this.strand_.width;
+ this.titleBar_.width = this._strand.width;
this.titleBar_.dispatchEvent('layoutNeeded');
if (heightSizedToContent) {
- this.strand_.height = this.strand_.height + this.titleBar_.height;
+ this._strand.height = this._strand.height + this.titleBar_.height;
}
- this.viewportModel.viewportHeight = this.strand_.height - this.titleBar_.height;
- this.viewportModel.viewportWidth = this.strand_.width;
+ this.viewportModel.viewportHeight = this._strand.height - this.titleBar_.height;
+ this.viewportModel.viewportWidth = this._strand.width;
this.viewportModel.viewportX = 0;
this.viewportModel.viewportY = this.titleBar_.height;
};
@@ -144,7 +136,7 @@ org.apache.flex.html.beads.PanelView.prototype.layoutContainer =
*/
/**org.apache.flex.html.beads.PanelView.prototype.changeHandler =
function(event) {
- var strand = this.strand_;
+ var strand = this._strand;
if (!this.titleBarAdded_)
{
this.titleBarAdded_ = true;
@@ -157,7 +149,7 @@ org.apache.flex.html.beads.PanelView.prototype.layoutContainer =
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;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b6cce51a/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
index 2932704..de7dde4 100644
--- 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
@@ -77,6 +77,7 @@ Object.defineProperties(org.apache.flex.html.beads.TextItemRendererFactoryForArr
this.dataProviderChangedHandler(null);
},
+ /** @this {org.apache.flex.html.beads.TextItemRendererFactoryForArrayData} */
get: function() {
return this.strand_;
}