You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/11/07 14:58:26 UTC
[07/17] git commit: [flex-asjs] [refs/heads/develop] - Run of
'gjslint' with --strict argument. Lot's of indentation and too long line
fixes.
Run of 'gjslint' with --strict argument. Lot's of indentation and too long line fixes.
'gjslint --strict -r ./'
Signed-off-by: Erik de Bruin <er...@ixsoftware.nl>
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3510e0a6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3510e0a6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3510e0a6
Branch: refs/heads/develop
Commit: 3510e0a68ec2e0ca31041370ac24f5e1b6f9d688
Parents: dca3287
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Thu Nov 7 13:43:08 2013 +0100
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Thu Nov 7 13:43:08 2013 +0100
----------------------------------------------------------------------
.../src/org/apache/flex/binding/BindingBase.js | 5 +-
.../org/apache/flex/binding/ConstantBinding.js | 2 +-
.../org/apache/flex/binding/GenericBinding.js | 107 +++--
.../org/apache/flex/binding/PropertyWatcher.js | 148 +++---
.../org/apache/flex/binding/SimpleBinding.js | 2 +-
.../src/org/apache/flex/binding/WatcherBase.js | 199 ++++----
.../src/org/apache/flex/core/Application.js | 5 +-
.../org/apache/flex/core/HTMLElementWrapper.js | 2 +
.../src/org/apache/flex/core/IBeadController.js | 2 +
.../src/org/apache/flex/core/IBeadModel.js | 6 +-
.../src/org/apache/flex/core/IBeadView.js | 7 +-
.../org/apache/flex/core/IItemRendererParent.js | 4 +-
.../flex/core/ItemRendererClassFactory.js | 14 +-
.../FlexJS/src/org/apache/flex/core/ListBase.js | 8 +-
.../org/apache/flex/core/SimpleCSSValuesImpl.js | 179 ++++----
.../org/apache/flex/core/SimpleStatesImpl.js | 33 +-
.../FlexJS/src/org/apache/flex/core/UIBase.js | 83 ++--
.../FlexJS/src/org/apache/flex/core/ViewBase.js | 51 ++-
.../org/apache/flex/core/ViewBaseDataBinding.js | 451 ++++++++++---------
.../src/org/apache/flex/createjs/Application.js | 47 +-
.../src/org/apache/flex/createjs/core/UIBase.js | 68 +--
.../org/apache/flex/createjs/core/ViewBase.js | 27 +-
.../flex/createjs/staticControls/CheckBox.js | 97 ++--
.../flex/createjs/staticControls/Label.js | 35 +-
.../flex/createjs/staticControls/TextButton.js | 57 ++-
.../FlexJS/src/org/apache/flex/events/Event.js | 2 +
.../org/apache/flex/events/ValueChangeEvent.js | 22 +-
.../apache/flex/html/staticControls/Alert.js | 69 +--
.../apache/flex/html/staticControls/Button.js | 2 +-
.../flex/html/staticControls/ButtonBar.js | 32 +-
.../flex/html/staticControls/Container.js | 5 +-
.../apache/flex/html/staticControls/DataGrid.js | 22 +-
.../flex/html/staticControls/DropDownList.js | 28 +-
.../apache/flex/html/staticControls/Image.js | 8 +-
.../apache/flex/html/staticControls/Label.js | 1 +
.../org/apache/flex/html/staticControls/List.js | 35 +-
.../flex/html/staticControls/NumericStepper.js | 33 +-
.../apache/flex/html/staticControls/Panel.js | 23 +-
.../flex/html/staticControls/RadioButton.js | 60 +--
.../flex/html/staticControls/SimpleAlert.js | 3 +-
.../flex/html/staticControls/SimpleList.js | 27 +-
.../apache/flex/html/staticControls/Slider.js | 44 +-
.../apache/flex/html/staticControls/Spinner.js | 68 +--
.../apache/flex/html/staticControls/TitleBar.js | 19 +-
.../accessories/NumericOnlyTextInputBead.js | 8 +-
.../accessories/PasswordInputBead.js | 5 +-
.../accessories/TextPromptBead.js | 13 +-
.../html/staticControls/beads/ButtonBarView.js | 7 +-
.../staticControls/beads/DataGridColumnView.js | 12 +-
.../html/staticControls/beads/DataGridView.js | 30 +-
.../DataItemRendererFactoryForArrayData.js | 23 +-
.../DataItemRendererFactoryForColumnData.js | 2 +-
.../flex/html/staticControls/beads/ImageView.js | 7 +-
.../flex/html/staticControls/beads/ListView.js | 18 +-
.../flex/html/staticControls/beads/PanelView.js | 10 +-
.../staticControls/beads/SliderThumbView.js | 5 +-
.../staticControls/beads/SliderTrackView.js | 5 +-
.../TextItemRendererFactoryForArrayData.js | 22 +-
.../controllers/ItemRendererMouseController.js | 45 +-
.../ListSingleSelectionMouseController.js | 14 +-
.../beads/controllers/SliderMouseController.js | 47 +-
.../beads/controllers/SpinnerMouseController.js | 28 +-
.../beads/layouts/ButtonBarLayout.js | 9 +-
.../beads/layouts/NonVirtualHorizontalLayout.js | 7 +-
.../beads/layouts/NonVirtualVerticalLayout.js | 2 +
.../NonVirtualVerticalScrollingLayout.js | 5 +-
.../beads/models/ArraySelectionModel.js | 34 +-
.../beads/models/DataGridModel.js | 15 +-
.../beads/models/DataGridPresentationModel.js | 11 +-
.../staticControls/beads/models/ImageModel.js | 16 +-
.../staticControls/beads/models/PanelModel.js | 21 +-
.../staticControls/beads/models/RangeModel.js | 44 +-
.../beads/models/TitleBarModel.js | 21 +-
.../ButtonBarButtonItemRenderer.js | 17 +-
.../supportClasses/DataItemRenderer.js | 54 +--
.../supportClasses/NonVirtualDataGroup.js | 18 +-
.../supportClasses/StringItemRenderer.js | 54 +--
.../src/org/apache/flex/jquery/Application.js | 4 +-
.../flex/jquery/staticControls/RadioButton.js | 72 +--
.../src/org/apache/flex/net/BinaryUploader.js | 2 +-
.../flex/svg/staticControls/TextButton.js | 19 +-
.../src/org/apache/flex/utils/BinaryData.js | 26 +-
.../src/org/apache/flex/utils/Language.js | 2 +-
.../apache/flex/utils/MXMLDataInterpreter.js | 2 +-
.../flex/utils/ViewSourceContextMenuOption.js | 7 +-
85 files changed, 1608 insertions(+), 1297 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/BindingBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/BindingBase.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/BindingBase.js
index 058ed41..2797736 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/BindingBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/BindingBase.js
@@ -22,6 +22,7 @@ goog.provide('org.apache.flex.binding.BindingBase');
org.apache.flex.binding.BindingBase = function() {
};
+
/**
* @protected
* @type {Object}
@@ -74,9 +75,9 @@ org.apache.flex.binding.BindingBase.prototype.set_strand = function(value) {
if (this.sourceID != null)
{
try {
- this.source = this.document['get_' + this.sourceID]();
+ this.source = this.document['get_' + this.sourceID]();
} catch (e) {
- this.source = this.document[this.sourceID];
+ this.source = this.document[this.sourceID];
}
}
else
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/ConstantBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/ConstantBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/ConstantBinding.js
index fa83a4a..2a83b36 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/ConstantBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/ConstantBinding.js
@@ -37,6 +37,6 @@ org.apache.flex.binding.ConstantBinding.prototype.set_strand = function(value) {
goog.base(this, 'set_strand', value);
this.destination['set_' + this.destinationPropertyName](
- this.source['get_' + this.sourcePropertyName]()
+ this.source['get_' + this.sourcePropertyName]()
);
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
index 28d38fa..aab88f6 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
@@ -15,6 +15,8 @@
goog.provide('org.apache.flex.binding.GenericBinding');
goog.require('org.apache.flex.binding.BindingBase');
+
+
/**
* @constructor
*/
@@ -30,100 +32,105 @@ goog.inherits(org.apache.flex.binding.GenericBinding,
*/
org.apache.flex.binding.GenericBinding.prototype.destinationData = null;
+
/**
* @expose
* @type {function}
*/
org.apache.flex.binding.GenericBinding.prototype.destinationFunction = null;
+
/**
* @expose
* @this {org.apache.flex.binding.GenericBinding}
* @param {Object} value The strand (owner) of the bead.
*/
org.apache.flex.binding.GenericBinding.prototype.set_strand =
- function(value) {
+ function(value) {
this.destination = value;
var val = this.getValueFromSource();
this.applyValue(val);
};
+
/**
* @expose
* @this {org.apache.flex.binding.GenericBinding}
* @return {Object} The value from the source as specified.
*/
org.apache.flex.binding.GenericBinding.prototype.getValueFromSource =
- function() {
- if (typeof(this.source) == 'object' &&
- typeof(this.source.slice) == 'function')
- {
- var arr = this.source;
- var n = arr.length;
- var obj = this.document['get_' + arr[0]]();
- if (obj == null)
- return null;
- for (var i = 1; i < n; i++)
- {
- obj = obj['get_' + arr[i]]();
- if (obj == null)
- return null;
- }
- return obj;
- }
- else if (typeof(this.source) == 'function')
+ function() {
+ if (typeof(this.source) == 'object' &&
+ typeof(this.source.slice) == 'function')
+ {
+ var arr = this.source;
+ var n = arr.length;
+ var obj = this.document['get_' + arr[0]]();
+ if (obj == null)
+ return null;
+ for (var i = 1; i < n; i++)
{
- var fn = this.source;
- obj = fn.apply(this.document);
- return obj;
+ obj = obj['get_' + arr[i]]();
+ if (obj == null)
+ return null;
}
- else if (typeof(this.source) == 'string')
- {
- obj = this.document['get_' + this.source]();
- return obj;
- }
- return null;
+ return obj;
+ }
+ else if (typeof(this.source) == 'function')
+ {
+ var fn = this.source;
+ obj = fn.apply(this.document);
+ return obj;
+ }
+ else if (typeof(this.source) == 'string')
+ {
+ obj = this.document['get_' + this.source]();
+ return obj;
+ }
+ return null;
};
+
/**
* @expose
* @this {org.apache.flex.binding.GenericBinding}
* @param {Object} value The value from the source as specified.
*/
org.apache.flex.binding.GenericBinding.prototype.applyValue =
- function(value)
-{
- if (this.destinationFunction != null)
+ function(value)
{
- this.destinationFunction.apply(this.document, [value]);
- }
- else if (typeof(this.destinationData) == 'object')
+ if (this.destinationFunction != null)
+ {
+ this.destinationFunction.apply(this.document, [value]);
+ }
+ else if (typeof(this.destinationData) == 'object')
+ {
+ var arr = this.destinationData;
+ var n = arr.length;
+ var obj = this.document['get_' + arr[0]]();
+ if (obj == null)
+ return;
+ for (var i = 1; i < n - 1; i++)
{
- var arr = this.destinationData;
- var n = arr.length;
- var obj = this.document['get_' + arr[0]]();
- if (obj == null)
- return;
- for (var i = 1; i < n - 1; i++)
- {
- obj = obj['get_' + arr[i]]();
- if (obj == null)
- return;
- }
- obj['set_' + arr[n - 1]](value);
+ obj = obj['get_' + arr[i]]();
+ if (obj == null)
+ return;
}
+ obj['set_' + arr[n - 1]](value);
+ }
};
+
/**
* @expose
* @this {org.apache.flex.binding.GenericBinding}
* @param {Object} value The value from the source as specified.
*/
org.apache.flex.binding.GenericBinding.prototype.valueChanged =
- function(value)
-{
- var val = this.getValueFromSource();
- this.applyValue(val);
+ function(value)
+ {
+ var val = this.getValueFromSource();
+ this.applyValue(val);
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/PropertyWatcher.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/PropertyWatcher.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/PropertyWatcher.js
index 0c3dd72..dd671e4 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/PropertyWatcher.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/PropertyWatcher.js
@@ -15,6 +15,8 @@
goog.provide('org.apache.flex.binding.PropertyWatcher');
goog.require('org.apache.flex.binding.WatcherBase');
+
+
/**
* @constructor
* @param {Object} source The source object.
@@ -23,11 +25,11 @@ goog.require('org.apache.flex.binding.WatcherBase');
* @param {function} getterFunction A function to get the source property.
*/
org.apache.flex.binding.PropertyWatcher =
- function(source, propertyName, eventNames, getterFunction) {
- this.source = source;
- this.propertyName = propertyName;
- this.getterFunction = getterFunction;
- this.eventNames = eventNames;
+ function(source, propertyName, eventNames, getterFunction) {
+ this.source = source;
+ this.propertyName = propertyName;
+ this.getterFunction = getterFunction;
+ this.eventNames = eventNames;
};
goog.inherits(org.apache.flex.binding.PropertyWatcher,
org.apache.flex.binding.WatcherBase);
@@ -38,107 +40,115 @@ goog.inherits(org.apache.flex.binding.PropertyWatcher,
*/
org.apache.flex.binding.PropertyWatcher.prototype.source;
+
/**
* @type {string}
*/
org.apache.flex.binding.PropertyWatcher.prototype.propertyName;
+
/**
* @type {Object}
*/
org.apache.flex.binding.PropertyWatcher.prototype.eventNames;
+
/**
* @type {function}
*/
org.apache.flex.binding.PropertyWatcher.prototype.getterFunction = null;
+
/**
* @protected
* @this {org.apache.flex.binding.PropertyWatcher}
* @param {Object} event The event.
*/
org.apache.flex.binding.PropertyWatcher.prototype.changeHandler =
- function(event) {
- if (typeof(event.propertyName) == 'string')
- {
- var propName = event.propertyName;
+ function(event) {
+ if (typeof(event.propertyName) == 'string')
+ {
+ var propName = event.propertyName;
- if (propName != this.propertyName)
- return;
- }
+ if (propName != this.propertyName)
+ return;
+ }
- this.wrapUpdate(this.updateProperty);
+ this.wrapUpdate(this.updateProperty);
- this.notifyListeners();
+ this.notifyListeners();
};
+
/**
* @protected
* @this {org.apache.flex.binding.PropertyWatcher}
* @param {Object} parent The new parent watcher.
*/
org.apache.flex.binding.PropertyWatcher.prototype.parentChanged =
- function(parent) {
+ function(parent) {
- if (this.source &&
- typeof(this.source.removeEventListener) == 'function')
- this.removeEventListeners();
+ if (this.source &&
+ typeof(this.source.removeEventListener) == 'function')
+ this.removeEventListeners();
- this.source = parent;
+ this.source = parent;
- if (this.source)
- this.addEventListeners();
+ if (this.source)
+ this.addEventListeners();
- // Now get our property.
- this.wrapUpdate(this.updateProperty);
+ // Now get our property.
+ this.wrapUpdate(this.updateProperty);
};
+
/**
* @protected
* @this {org.apache.flex.binding.PropertyWatcher}
*/
org.apache.flex.binding.PropertyWatcher.prototype.addEventListeners =
- function() {
- if (typeof(this.eventNames) == 'string')
- this.source.addEventListener(this.eventNames,
- goog.bind(this.changeHandler, this));
- else if (typeof(this.eventNames) == 'Object')
+ function() {
+ if (typeof(this.eventNames) == 'string')
+ this.source.addEventListener(this.eventNames,
+ goog.bind(this.changeHandler, this));
+ else if (typeof(this.eventNames) == 'Object')
+ {
+ var arr = this.eventNames;
+ var n = arr.length;
+ for (var i = 0; i < n; i++)
{
- var arr = this.eventNames;
- var n = arr.length;
- for (var i = 0; i < n; i++)
- {
- var eventName = this.eventNames[i];
- this.source.addEventListener(eventName,
- goog.bind(this.changeHandler, this));
- }
+ var eventName = this.eventNames[i];
+ this.source.addEventListener(eventName,
+ goog.bind(this.changeHandler, this));
}
+ }
};
+
/**
* @protected
* @this {org.apache.flex.binding.PropertyWatcher}
*/
org.apache.flex.binding.PropertyWatcher.prototype.removeEventListeners =
- function() {
- if (typeof(this.eventNames) == 'string')
- this.source.removeEventListener(this.eventNames,
- goog.bind(this.changeHandler, this));
- else if (typeof(this.eventNames) == 'Object')
+ function() {
+ if (typeof(this.eventNames) == 'string')
+ this.source.removeEventListener(this.eventNames,
+ goog.bind(this.changeHandler, this));
+ else if (typeof(this.eventNames) == 'Object')
+ {
+ var arr = this.eventNames;
+ var n = arr.length;
+ for (var i = 0; i < n; i++)
{
- var arr = this.eventNames;
- var n = arr.length;
- for (var i = 0; i < n; i++)
- {
- var eventName = this.eventNames[i];
- this.source.removeEventListener(eventName,
- goog.bind(this.changeHandler, this));
- }
+ var eventName = this.eventNames[i];
+ this.source.removeEventListener(eventName,
+ goog.bind(this.changeHandler, this));
}
+ }
};
+
/**
* @protected
* Gets the actual property then updates
@@ -146,31 +156,31 @@ org.apache.flex.binding.PropertyWatcher.prototype.removeEventListeners =
* @this {org.apache.flex.binding.PropertyWatcher}
*/
org.apache.flex.binding.PropertyWatcher.prototype.updateProperty =
- function() {
+ function() {
- if (this.source)
+ if (this.source)
+ {
+ if (this.propertyName == 'this')
{
- if (this.propertyName == 'this')
- {
- this.value = this.source;
- }
- else
- {
- if (this.getterFunction != null)
- {
- this.value = this.getterFunction.apply(
- this.source, [this.propertyName]);
- }
- else
- {
- this.value = this.source[this.propertyName];
- }
- }
+ this.value = this.source;
}
else
{
- this.value = null;
+ if (this.getterFunction != null)
+ {
+ this.value = this.getterFunction.apply(
+ this.source, [this.propertyName]);
+ }
+ else
+ {
+ this.value = this.source[this.propertyName];
+ }
}
+ }
+ else
+ {
+ this.value = null;
+ }
- this.updateChildren();
+ this.updateChildren();
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/SimpleBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/SimpleBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/SimpleBinding.js
index c46433c..d87e225 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/SimpleBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/SimpleBinding.js
@@ -40,7 +40,7 @@ org.apache.flex.binding.SimpleBinding.prototype.eventName = '';
*/
org.apache.flex.binding.SimpleBinding.prototype.changeHandler = function() {
this.destination['set_' + this.destinationPropertyName](
- this.source['get_' + this.sourcePropertyName]()
+ this.source['get_' + this.sourcePropertyName]()
);
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/binding/WatcherBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/WatcherBase.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/WatcherBase.js
index 2ccbe40..bb44103 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/WatcherBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/WatcherBase.js
@@ -14,31 +14,35 @@
goog.provide('org.apache.flex.binding.WatcherBase');
+
+
/**
* @constructor
*/
org.apache.flex.binding.WatcherBase = function() {
- /**
+ /**
* @protected
* @type {Object}
*/
- this.listeners;
+ this.listeners;
- /**
+ /**
* @protected
* @type {Object}
* Children of this watcher are watching sub values.
*/
- this.children;
+ this.children;
};
+
/**
* @expose
* The value itself.
*/
org.apache.flex.binding.WatcherBase.prototype.value;
+
/**
* @expose
* This is an abstract method that subclasses implement.
@@ -46,9 +50,10 @@ org.apache.flex.binding.WatcherBase.prototype.value;
* @param {Object} parent The new parent.
*/
org.apache.flex.binding.WatcherBase.prototype.parentChanged =
- function(parent) {
+ function(parent) {
};
+
/**
* @expose
* Add a child to this watcher, meaning that the child
@@ -57,15 +62,16 @@ org.apache.flex.binding.WatcherBase.prototype.parentChanged =
* @param {Object} child The new child.
*/
org.apache.flex.binding.WatcherBase.prototype.addChild =
- function(child) {
- if (!this.children)
- this.children = [child];
- else
- this.children.push(child);
+ function(child) {
+ if (!this.children)
+ this.children = [child];
+ else
+ this.children.push(child);
- child.parentChanged(this);
+ child.parentChanged(this);
};
+
/**
* @expose
* Add a binding to this watcher, meaning that the binding
@@ -74,15 +80,16 @@ org.apache.flex.binding.WatcherBase.prototype.addChild =
* @param {Object} binding The new binding.
*/
org.apache.flex.binding.WatcherBase.prototype.addBinding =
- function(binding) {
- if (!this.listeners)
- this.listeners = [binding];
- else
- this.listeners.push(binding);
+ function(binding) {
+ if (!this.listeners)
+ this.listeners = [binding];
+ else
+ this.listeners.push(binding);
- binding.valueChanged(this.value);
+ binding.valueChanged(this.value);
};
+
/**
* @expose
* @this {org.apache.flex.binding.WatcherBase}
@@ -90,16 +97,17 @@ org.apache.flex.binding.WatcherBase.prototype.addBinding =
* and make sure our children are updated.
*/
org.apache.flex.binding.WatcherBase.prototype.updateChildren = function() {
- if (this.children)
+ if (this.children)
+ {
+ var n = this.children.length;
+ for (var i = 0; i < n; ++i)
{
- var n = this.children.length;
- for (var i = 0; i < n; ++i)
- {
- this.children[i].parentChanged(this);
- }
+ this.children[i].parentChanged(this);
}
+ }
};
+
/**
* @protected
* @this {org.apache.flex.binding.WatcherBase}
@@ -107,75 +115,76 @@ org.apache.flex.binding.WatcherBase.prototype.updateChildren = function() {
* @return {boolean} True if value changed.
*/
org.apache.flex.binding.WatcherBase.prototype.valueChanged =
- function(oldValue) {
+ function(oldValue) {
- if (oldValue == null && this.value == null)
- return false;
+ if (oldValue == null && this.value == null)
+ return false;
- var valType = typeof(this.value);
+ var valType = typeof(this.value);
- // The first check is meant to catch the delayed instantiation case
- // where a control comes into existence but its value is still
- // the equivalent of not having been filled in.
- // Otherwise we simply return whether the value has changed.
+ // The first check is meant to catch the delayed instantiation case
+ // where a control comes into existence but its value is still
+ // the equivalent of not having been filled in.
+ // Otherwise we simply return whether the value has changed.
- if (valType == 'string')
- {
- if (oldValue == null && this.value == '')
- return false;
- else
- return oldValue != this.value;
- }
+ if (valType == 'string')
+ {
+ if (oldValue == null && this.value == '')
+ return false;
+ else
+ return oldValue != this.value;
+ }
- if (valType == 'number')
- {
- if (oldValue == null && this.value == 0)
- return false;
- else
- return oldValue != this.value;
- }
+ if (valType == 'number')
+ {
+ if (oldValue == null && this.value == 0)
+ return false;
+ else
+ return oldValue != this.value;
+ }
- if (valType == 'boolean')
- {
- if (oldValue == null && this.value == false)
- return false;
- else
- return oldValue != this.value;
- }
+ if (valType == 'boolean')
+ {
+ if (oldValue == null && this.value == false)
+ return false;
+ else
+ return oldValue != this.value;
+ }
- return true;
+ return true;
};
+
/**
* @protected
* @this {org.apache.flex.binding.WatcherBase}
* @param {function} wrappedFunction The function to call.
*/
org.apache.flex.binding.WatcherBase.prototype.wrapUpdate =
- function(wrappedFunction) {
- try
+ function(wrappedFunction) {
+ try
+ {
+ wrappedFunction.apply(this);
+ }
+ catch (error)
+ {
+ var staticClass = org.apache.flex.binding.WatcherBase;
+ var n = this.allowedErrorTypes.length;
+ for (var i = 0; i < n; i++)
{
- wrappedFunction.apply(this);
- }
- catch (error)
- {
- var staticClass = org.apache.flex.binding.WatcherBase;
- var n = this.allowedErrorTypes.length;
- for (var i = 0; i < n; i++)
- {
- if (error.constructor == allowedErrorTypes[i].type)
- {
- var handler = staticClass.allowedErrorTypes[i].handler;
- if (handler != null)
- this.value = handler(this, wrappedFunction);
- else
- this.value = null;
- }
- }
-
- if (staticClass.allowedErrors.indexOf(error.errorID) == -1)
- throw error;
+ if (error.constructor == allowedErrorTypes[i].type)
+ {
+ var handler = staticClass.allowedErrorTypes[i].handler;
+ if (handler != null)
+ this.value = handler(this, wrappedFunction);
+ else
+ this.value = null;
+ }
}
+
+ if (staticClass.allowedErrors.indexOf(error.errorID) == -1)
+ throw error;
+ }
};
@@ -183,40 +192,42 @@ org.apache.flex.binding.WatcherBase.prototype.wrapUpdate =
* Certain errors are normal when executing an update, so we swallow them:
*/
org.apache.flex.binding.WatcherBase.allowedErrors = [
- 1006, // Error #1006: Call attempted on an object
- // that is not a function.
- 1009, // Error #1009: null has no properties.
- 1010, // Error #1010: undefined has no properties.
- 1055, // Error #1055: - has no properties.
- 1069, // Error #1069: Property - not found on - and
- // there is no default value
- 1507 // Error #1507: - invalid null argument.
- ];
+ 1006, // Error #1006: Call attempted on an object
+ // that is not a function.
+ 1009, // Error #1009: null has no properties.
+ 1010, // Error #1010: undefined has no properties.
+ 1055, // Error #1055: - has no properties.
+ 1069, // Error #1069: Property - not found on - and
+ // there is no default value
+ 1507 // Error #1507: - invalid null argument.
+];
+
/**
* Certain types of errors are normal when executing an update,
* so we custom handle them or swallow them:
*/
org.apache.flex.binding.WatcherBase.allowedErrorTypes = [
- { type: RangeError /*,
+ { type: RangeError /*,
handler: function(w:WatcherBase,
wrappedFunction:Function):Object { return null }*/
- }
- ];
+ }
+];
+
/**
* @protected
* @this {org.apache.flex.binding.WatcherBase}
*/
org.apache.flex.binding.WatcherBase.prototype.notifyListeners = function()
-{
- if (this.listeners)
{
- var n = this.listeners.length;
+ if (this.listeners)
+ {
+ var n = this.listeners.length;
- for (var i = 0; i < n; i++)
- {
- this.listeners[i].valueChanged(this.value);
- }
+ for (var i = 0; i < n; i++)
+ {
+ this.listeners[i].valueChanged(this.value);
}
+ }
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js b/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
index fe5a029..8506ef0 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/Application.js
@@ -80,13 +80,14 @@ org.apache.flex.core.Application.prototype.start = function() {
this.dispatchEvent('viewChanged');
};
+
/**
* @this {org.apache.flex.core.Application}
* @param {Object} c The child element.
*/
org.apache.flex.core.Application.prototype.addElement =
function(c) {
- this.element.appendChild(c.element);
- c.addedToParent();
+ this.element.appendChild(c.element);
+ c.addedToParent();
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
index a6d57c1..1b36fee 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/HTMLElementWrapper.js
@@ -149,6 +149,7 @@ org.apache.flex.core.HTMLElementWrapper.prototype.set_strand =
}
};
+
/**
Hack to allow event.target expressions to work
* @expose
@@ -160,6 +161,7 @@ Event.prototype.get_target = function() {
return obj;
};
+
/**
Hack to allow event.target expressions to work
* @expose
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadController.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadController.js b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadController.js
index 0bbffbb..81ebd12 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadController.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadController.js
@@ -16,6 +16,8 @@ goog.provide('org.apache.flex.core.IBeadController');
goog.require('org.apache.flex.events.EventDispatcher');
+
+
/**
* @constructor
* @extends {org.apache.flex.events.EventDispatcher}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadModel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadModel.js b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadModel.js
index ff67c5f..ec8fedc 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadModel.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadModel.js
@@ -16,6 +16,8 @@ goog.provide('org.apache.flex.core.IBeadModel');
goog.require('org.apache.flex.events.EventDispatcher');
+
+
/**
* @constructor
* @extends {org.apache.flex.events.EventDispatcher}
@@ -24,5 +26,5 @@ org.apache.flex.core.IBeadModel = function() {
goog.base(this);
};
goog.inherits(
- org.apache.flex.core.IBeadModel,
- org.apache.flex.events.EventDispatcher);
+ org.apache.flex.core.IBeadModel,
+ org.apache.flex.events.EventDispatcher);
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadView.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadView.js b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadView.js
index 774cf3b..2e15acc 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadView.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/IBeadView.js
@@ -16,6 +16,8 @@ goog.provide('org.apache.flex.core.IBeadView');
goog.require('org.apache.flex.events.EventDispatcher');
+
+
/**
* @constructor
* @extends {org.apache.flex.events.EventDispatcher}
@@ -24,8 +26,9 @@ org.apache.flex.core.IBeadView = function() {
goog.base(this);
};
goog.inherits(
- org.apache.flex.core.IBeadView,
- org.apache.flex.events.EventDispatcher);
+ org.apache.flex.core.IBeadView,
+ org.apache.flex.events.EventDispatcher);
+
/**
* @expose
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/IItemRendererParent.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/IItemRendererParent.js b/frameworks/js/FlexJS/src/org/apache/flex/core/IItemRendererParent.js
index 345ff5b..09f77de 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/IItemRendererParent.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/IItemRendererParent.js
@@ -14,6 +14,8 @@
goog.provide('org.apache.flex.core.IItemRendererParent');
+
+
/**
* @constructor
*/
@@ -27,5 +29,5 @@ org.apache.flex.core.IItemRendererParent = function() {
* @param {number} index The selected index.
*/
org.apache.flex.core.IItemRendererParent.prototype.
-getItemRendererForIndex = function(index) {
+ getItemRendererForIndex = function(index) {
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/ItemRendererClassFactory.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ItemRendererClassFactory.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ItemRendererClassFactory.js
index 1e3bca2..bc9a3c1 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ItemRendererClassFactory.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ItemRendererClassFactory.js
@@ -16,6 +16,8 @@ goog.provide('org.apache.flex.core.ItemRendererClassFactory');
goog.require('org.apache.flex.core.ValuesManager');
+
+
/**
* @constructor
*/
@@ -24,21 +26,20 @@ org.apache.flex.core.ItemRendererClassFactory = function() {
};
-
/**
* @expose
* @this {org.apache.flex.core.ItemRendererClassFactory}
* @param {object} value The component strand.
*/
org.apache.flex.core.ItemRendererClassFactory.
-prototype.set_strand = function(value) {
+ prototype.set_strand = function(value) {
this.strand_ = value;
this.itemRendererClass = org.apache.flex.core.ValuesManager.valuesImpl.
getValue(this.strand_, 'iItemRenderer');
if (this.itemRendererClass) {
- this.createFunction = this.createFromClass;
- }
+ this.createFunction = this.createFromClass;
+ }
};
@@ -49,10 +50,11 @@ prototype.set_strand = function(value) {
* @return {object} The new item renderer.
*/
org.apache.flex.core.ItemRendererClassFactory.
-prototype.createItemRenderer = function(parent) {
+ prototype.createItemRenderer = function(parent) {
return this.createFunction(parent);
};
+
/**
* @expose
* @this {org.apache.flex.core.ItemRendererClassFactory}
@@ -60,7 +62,7 @@ prototype.createItemRenderer = function(parent) {
* @return {object} The new item renderer.
*/
org.apache.flex.core.ItemRendererClassFactory.
-prototype.createFromClass = function(parent) {
+ prototype.createFromClass = function(parent) {
var renderer = new this.itemRendererClass();
parent.addElement(renderer);
return renderer;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
index b20f5f3..6659176 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ListBase.js
@@ -47,9 +47,9 @@ goog.inherits(org.apache.flex.core.ListBase,
* @this {org.apache.flex.core.ListBase}
*/
org.apache.flex.core.ListBase.prototype.createElement = function() {
-// this.element = document.createElement('select');
-// goog.events.listen(this.element, 'change',
-// goog.bind(this.changeHandler, this));
+ // this.element = document.createElement('select');
+ // goog.events.listen(this.element, 'change',
+ // goog.bind(this.changeHandler, this));
this.element = document.createElement('div');
this.element.style.overflow = 'auto';
this.element.style.border = 'solid';
@@ -66,7 +66,7 @@ org.apache.flex.core.ListBase.prototype.createElement = function() {
*/
org.apache.flex.core.ListBase.prototype.get_dataProvider =
function() {
- return this.get_model().get_dataProvider();
+ return this.get_model().get_dataProvider();
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
index aa806be..f152805 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
@@ -22,6 +22,7 @@ goog.provide('org.apache.flex.core.SimpleCSSValuesImpl');
org.apache.flex.core.SimpleCSSValuesImpl = function() {
};
+
/**
* @this {org.apache.flex.core.SimpleCSSValuesImpl}
* @param {Object} thisObject The object to fetch a value for.
@@ -37,8 +38,8 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.getValue =
while (c != -1)
{
valueName = valueName.substr(0, c) +
- valueName.charAt(c + 1).toUpperCase() +
- valueName.substr(c + 2);
+ valueName.charAt(c + 1).toUpperCase() +
+ valueName.substr(c + 2);
c = valueName.indexOf('-');
}
@@ -53,22 +54,22 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.getValue =
className = thisObject.className;
if (state)
{
- selectorName = className + ':' + state;
- o = values['.' + selectorName];
- if (o)
- {
- value = o[valueName];
- if (value !== undefined)
- return value;
- }
+ selectorName = className + ':' + state;
+ o = values['.' + selectorName];
+ if (o)
+ {
+ value = o[valueName];
+ if (value !== undefined)
+ return value;
+ }
}
o = values['.' + className];
if (o)
{
- value = o[valueName];
- if (value !== undefined)
- return value;
+ value = o[valueName];
+ if (value !== undefined)
+ return value;
}
}
@@ -77,26 +78,26 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.getValue =
{
if (state)
{
- selectorName = className + ':' + state;
- o = values[selectorName];
- if (o)
- {
- value = o[valueName];
- if (value !== undefined)
- return value;
- }
+ selectorName = className + ':' + state;
+ o = values[selectorName];
+ if (o)
+ {
+ value = o[valueName];
+ if (value !== undefined)
+ return value;
+ }
}
o = values[className];
if (o)
{
- value = o[valueName];
- if (value !== undefined)
- return value;
+ value = o[valueName];
+ if (value !== undefined)
+ return value;
}
thisObject = thisObject.__proto__;
if (thisObject.__proto__ == null)
- break;
+ break;
className = this.getQualifiedClassName(thisObject);
}
o = values['global'];
@@ -104,12 +105,13 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.getValue =
{
value = o[valueName];
if (value !== undefined)
- return value;
+ return value;
}
o = values['*'];
return o[valueName];
};
+
/**
* @this {org.apache.flex.core.SimpleCSSValuesImpl}
* @param {Object} thisObject The object to get a name for.
@@ -117,80 +119,81 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.getValue =
*/
org.apache.flex.core.SimpleCSSValuesImpl.prototype.getQualifiedClassName =
function(thisObject) {
- // relies on the values parser to populate the package tree
- var proto = thisObject.__proto__;
- if (proto.hasOwnProperty('__css__package_parent'))
+ // relies on the values parser to populate the package tree
+ var proto = thisObject.__proto__;
+ if (proto.hasOwnProperty('__css__package_parent'))
+ {
+ var s = proto.__css__name;
+ while (true)
{
- var s = proto.__css__name;
- while (true)
- {
- proto = proto.__css__package_parent;
- if (proto == window || proto == undefined)
- return s;
- s = proto.__css__name + '.' + s;
- }
+ proto = proto.__css__package_parent;
+ if (proto == window || proto == undefined)
+ return s;
+ s = proto.__css__name + '.' + s;
}
- return null;
+ }
+ return null;
};
+
/**
* @this {org.apache.flex.core.SimpleCSSValuesImpl}
* @param {Object} mainclass The main class for the application.
*/
org.apache.flex.core.SimpleCSSValuesImpl.prototype.init = function(mainclass) {
- var cssData = mainclass.cssData;
- var values = this.values;
- if (values == null)
- values = {};
-
- var n = cssData.length;
- var i = 0;
- while (i < n)
+ var cssData = mainclass.cssData;
+ var values = this.values;
+ if (values == null)
+ values = {};
+
+ var n = cssData.length;
+ var i = 0;
+ while (i < n)
+ {
+ var numMQ = cssData[i++];
+ if (numMQ > 0)
{
- var numMQ = cssData[i++];
- if (numMQ > 0)
- {
- // skip MediaQuery tests for now
- i += numMQ;
- }
- var numSel = cssData[i++];
- var props = {};
- for (var j = 0; j < numSel; j++)
- {
- var selName = cssData[i++];
- if (selName.indexOf('.') != 0 &&
- selName != '*' && selName != 'global')
- {
- // should be a type selector
- var parts = selName.split('.');
- var numParts = parts.length;
- var part = window;
- for (var k = 0; k < numParts; k++)
- {
- var partName = parts[k];
- var subpart = part[partName];
- if (subpart == undefined)
- break;
- // assume last part is ctor func
- if (k == numParts - 1)
- subpart = subpart.prototype;
- subpart.__css__package_parent = part;
- subpart.__css__name = partName;
- part = subpart;
- }
- }
- if (values[selName])
- props = values[selName];
- values[selName] = props;
- }
- var numProps = cssData[i++];
- for (j = 0; j < numProps; j++)
+ // skip MediaQuery tests for now
+ i += numMQ;
+ }
+ var numSel = cssData[i++];
+ var props = {};
+ for (var j = 0; j < numSel; j++)
+ {
+ var selName = cssData[i++];
+ if (selName.indexOf('.') != 0 &&
+ selName != '*' && selName != 'global')
+ {
+ // should be a type selector
+ var parts = selName.split('.');
+ var numParts = parts.length;
+ var part = window;
+ for (var k = 0; k < numParts; k++)
{
- var propName = cssData[i++];
- var propValue = cssData[i++];
- props[propName] = propValue;
+ var partName = parts[k];
+ var subpart = part[partName];
+ if (subpart == undefined)
+ break;
+ // assume last part is ctor func
+ if (k == numParts - 1)
+ subpart = subpart.prototype;
+ subpart.__css__package_parent = part;
+ subpart.__css__name = partName;
+ part = subpart;
}
+ }
+ if (values[selName])
+ props = values[selName];
+ values[selName] = props;
}
- this.values = values;
+ var numProps = cssData[i++];
+ for (j = 0; j < numProps; j++)
+ {
+ var propName = cssData[i++];
+ var propValue = cssData[i++];
+ props[propName] = propValue;
+ }
+ }
+ this.values = values;
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
index c7564af..6b3cea5 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
@@ -17,6 +17,7 @@ goog.provide('org.apache.flex.core.SimpleStatesImpl');
goog.require('org.apache.flex.events.EventDispatcher');
+
/**
* @constructor
*/
@@ -32,6 +33,7 @@ org.apache.flex.core.SimpleStatesImpl = function() {
goog.inherits(org.apache.flex.core.SimpleStatesImpl,
org.apache.flex.events.EventDispatcher);
+
/**
* @expose
* @this {org.apache.flex.core.SimpleStatesImpl}
@@ -46,6 +48,7 @@ org.apache.flex.core.SimpleStatesImpl.prototype.set_strand =
}
};
+
/**
* @protected
* @this {org.apache.flex.core.SimpleStatesImpl}
@@ -76,6 +79,7 @@ org.apache.flex.core.SimpleStatesImpl.prototype.stateChangeHandler =
}
};
+
/**
* @protected
* @this {org.apache.flex.core.SimpleStatesImpl}
@@ -94,9 +98,9 @@ org.apache.flex.core.SimpleStatesImpl.prototype.revert = function(s) {
var item = o.items[q];
var parent;
if (typeof(o.document['get_' + o.destination]) == 'function')
- parent = o.document['get_' + o.destination]();
+ parent = o.document['get_' + o.destination]();
else
- parent = o.document[o.destination];
+ parent = o.document[o.destination];
parent.removeElement(item);
parent.dispatchEvent(
new org.apache.flex.events.Event('childrenAdded'));
@@ -117,6 +121,7 @@ org.apache.flex.core.SimpleStatesImpl.prototype.revert = function(s) {
}
};
+
/**
* @protected
* @this {org.apache.flex.core.SimpleStatesImpl}
@@ -143,24 +148,24 @@ org.apache.flex.core.SimpleStatesImpl.prototype.applyState = function(s) {
var item = o.items[q];
var parent;
if (typeof(o.document['get_' + o.destination]) == 'function')
- parent = o.document['get_' + o.destination]();
+ parent = o.document['get_' + o.destination]();
else
- parent = o.document[o.destination];
+ parent = o.document[o.destination];
if (o.relativeTo != null)
{
- var child;
- if (typeof(o.document['get_' + o.relativeTo]) == 'function')
- child = o.document['get_' + o.relativeTo]();
- else
- child = o.document[o.relativeTo];
- var index = parent.getElementIndex(child);
- if (o.position == 'after')
- index++;
- parent.addElementAt(item, index);
+ var child;
+ if (typeof(o.document['get_' + o.relativeTo]) == 'function')
+ child = o.document['get_' + o.relativeTo]();
+ else
+ child = o.document[o.relativeTo];
+ var index = parent.getElementIndex(child);
+ if (o.position == 'after')
+ index++;
+ parent.addElementAt(item, index);
}
else
{
- parent.addElement(item);
+ parent.addElement(item);
}
parent.dispatchEvent(
new org.apache.flex.events.Event('childrenAdded'));
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
index 85b1580..016a0b2 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/UIBase.js
@@ -47,6 +47,7 @@ org.apache.flex.core.UIBase = function() {
goog.inherits(org.apache.flex.core.UIBase,
org.apache.flex.core.HTMLElementWrapper);
+
/**
* @this {org.apache.flex.core.UIBase}
* @return {Object} The array of children.
@@ -56,6 +57,7 @@ org.apache.flex.core.UIBase.prototype.internalChildren =
return this.element.childNodes;
};
+
/**
* @protected
* @this {org.apache.flex.core.UIBase}
@@ -68,6 +70,7 @@ org.apache.flex.core.UIBase.prototype.createElement = function() {
return this.element;
};
+
/**
* @this {org.apache.flex.core.UIBase}
* @param {Object} c The child element.
@@ -77,6 +80,7 @@ org.apache.flex.core.UIBase.prototype.addElement = function(c) {
c.addedToParent();
};
+
/**
* @this {org.apache.flex.core.UIBase}
* @param {Object} c The child element.
@@ -89,11 +93,12 @@ org.apache.flex.core.UIBase.prototype.addElementAt = function(c, index) {
else
{
this.element.insertBefore(c.element,
- children[index]);
+ children[index]);
c.addedToParent();
}
};
+
/**
* @this {org.apache.flex.core.UIBase}
* @param {Object} c The child element.
@@ -104,12 +109,13 @@ org.apache.flex.core.UIBase.prototype.getElementIndex = function(c) {
var n = children.length;
for (i = 0; i < n; i++)
{
- if (children[i] == c.element)
- return i;
+ if (children[i] == c.element)
+ return i;
}
return -1;
};
+
/**
* @this {org.apache.flex.core.UIBase}
* @param {Object} c The child element.
@@ -118,6 +124,7 @@ org.apache.flex.core.UIBase.prototype.removeElement = function(c) {
this.element.removeChild(c.element);
};
+
/**
* @this {org.apache.flex.core.UIBase}
*/
@@ -130,9 +137,9 @@ org.apache.flex.core.UIBase.prototype.addedToParent = function() {
getValue(this, 'iBeadModel');
if (c)
{
- var model = new c();
- if (model)
- this.addBead(model);
+ var model = new c();
+ if (model)
+ this.addBead(model);
}
}
if (this.getBeadByType(org.apache.flex.core.IBeadView) == null)
@@ -143,7 +150,7 @@ org.apache.flex.core.UIBase.prototype.addedToParent = function() {
{
var view = new c();
if (view)
- this.addBead(view);
+ this.addBead(view);
}
}
if (this.getBeadByType(org.apache.flex.core.IBeadLayout) == null)
@@ -198,15 +205,15 @@ org.apache.flex.core.UIBase.prototype.addBead = function(bead) {
* @return {Object} The bead of the given type or null.
*/
org.apache.flex.core.UIBase.prototype.getBeadByType =
-function(classOrInterface) {
+ function(classOrInterface) {
if (!this.beads_) {
this.beads_ = new Array();
}
for (var i = 0; i < this.beads_.length; i++) {
- var bead = this.beads_[i];
- if (bead instanceof classOrInterface) {
- return bead;
- }
+ var bead = this.beads_[i];
+ if (bead instanceof classOrInterface) {
+ return bead;
+ }
}
return null;
};
@@ -218,7 +225,7 @@ function(classOrInterface) {
* @return {Object} The bead that was removed.
*/
org.apache.flex.core.UIBase.prototype.removeBead =
-function(value) {
+ function(value) {
if (!this.beads_) return null;
var n = beads_.length;
for (var i = 0; i < n; i++) {
@@ -230,6 +237,7 @@ function(value) {
}
};
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
@@ -261,6 +269,7 @@ org.apache.flex.core.UIBase.prototype.set_width = function(pixels) {
this.positioner.style.width = pixels.toString() + 'px';
};
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
@@ -282,6 +291,7 @@ org.apache.flex.core.UIBase.prototype.set_height = function(pixels) {
this.positioner.style.height = pixels.toString() + 'px';
};
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
@@ -331,13 +341,14 @@ org.apache.flex.core.UIBase.prototype.set_id = function(value) {
*/
org.apache.flex.core.UIBase.prototype.className = null;
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
* @return {string} The className.
*/
org.apache.flex.core.UIBase.prototype.get_className = function() {
- return this.className;
+ return this.className;
};
@@ -347,12 +358,12 @@ org.apache.flex.core.UIBase.prototype.get_className = function() {
* @param {object} value The new className.
*/
org.apache.flex.core.UIBase.prototype.set_className = function(value) {
- if (this.className !== value)
- {
- this.element.className = value;
- this.className = value;
- this.dispatchEvent('classNameChanged');
- }
+ if (this.className !== value)
+ {
+ this.element.className = value;
+ this.className = value;
+ this.dispatchEvent('classNameChanged');
+ }
};
@@ -393,34 +404,36 @@ org.apache.flex.core.UIBase.prototype.set_model = function(value) {
}
};
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
* @return {object} True if visible.
*/
org.apache.flex.core.UIBase.prototype.get_visible = function() {
- return this.element.style.display !== 'none';
+ return this.element.style.display !== 'none';
};
+
/**
* @expose
* @this {org.apache.flex.core.UIBase}
* @param {object} value The new model.
*/
org.apache.flex.core.UIBase.prototype.set_visible = function(value) {
- var oldValue = this.element.style.display !== 'none';
- if (value !== oldValue) {
- if (!value) {
- this.lastDisplay_ = this.element.style.display;
- this.element.style.display = 'none';
- this.dispatchEvent(new org.apache.flex.events.Event('hide'));
- } else {
- if (this.lastDisplay_) {
- this.element.style.display = this.lastDisplay_;
- } else {
- this.element.style.display = 'block';
- }
- this.dispatchEvent(new org.apache.flex.events.Event('show'));
- }
+ var oldValue = this.element.style.display !== 'none';
+ if (value !== oldValue) {
+ if (!value) {
+ this.lastDisplay_ = this.element.style.display;
+ this.element.style.display = 'none';
+ this.dispatchEvent(new org.apache.flex.events.Event('hide'));
+ } else {
+ if (this.lastDisplay_) {
+ this.element.style.display = this.lastDisplay_;
+ } else {
+ this.element.style.display = 'block';
+ }
+ this.dispatchEvent(new org.apache.flex.events.Event('show'));
}
+ }
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
index 40867cb..dbbe14b 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBase.js
@@ -22,7 +22,6 @@ goog.require('org.apache.flex.utils.MXMLDataInterpreter');
-
/**
* @constructor
* @extends {org.apache.flex.core.UIBase}
@@ -89,38 +88,42 @@ org.apache.flex.core.ViewBase.prototype.addedToParent = function() {
this.dispatchEvent(new org.apache.flex.events.Event('initComplete'));
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @return {Object} The application model.
*/
org.apache.flex.core.ViewBase.prototype.get_applicationModel = function() {
- return this.applicationModel;
+ return this.applicationModel;
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @return {Array} The array of State objects.
*/
org.apache.flex.core.ViewBase.prototype.get_states = function() {
- return this.states_;
+ return this.states_;
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @param {Array} value The array of State objects.
*/
org.apache.flex.core.ViewBase.prototype.set_states = function(value) {
- this.states_ = value;
+ this.states_ = value;
- var impl = org.apache.flex.core.ValuesManager.valuesImpl.
- getValue(this, 'iStatesImpl');
- // TODO: (aharui) check if bead already exists
- this.addBead(new impl());
+ var impl = org.apache.flex.core.ValuesManager.valuesImpl.
+ getValue(this, 'iStatesImpl');
+ // TODO: (aharui) check if bead already exists
+ this.addBead(new impl());
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
@@ -128,51 +131,55 @@ org.apache.flex.core.ViewBase.prototype.set_states = function(value) {
* @return {boolean} True if state in states array.
*/
org.apache.flex.core.ViewBase.prototype.hasState = function(state) {
- for (var p in this.states_)
- {
- var s = states_[p];
- if (s.name == state)
- return true;
- }
- return false;
+ for (var p in this.states_)
+ {
+ var s = states_[p];
+ if (s.name == state)
+ return true;
+ }
+ return false;
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @return {string} The name of the current state.
*/
org.apache.flex.core.ViewBase.prototype.get_currentState = function() {
- return this.currentState_;
+ return this.currentState_;
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @param {string} value The name of the current state.
*/
org.apache.flex.core.ViewBase.prototype.set_currentState = function(value) {
- var event = new org.apache.flex.events.ValueChangeEvent(
- 'currentStateChanged', this.currentState_, value);
- this.currentState_ = value;
- this.dispatchEvent(event);
+ var event = new org.apache.flex.events.ValueChangeEvent(
+ 'currentStateChanged', this.currentState_, value);
+ this.currentState_ = value;
+ this.dispatchEvent(event);
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @return {Array} The array of transitions.
*/
org.apache.flex.core.ViewBase.prototype.get_transitions = function() {
- return this.transitions_;
+ return this.transitions_;
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBase}
* @param {Array} value The array of transitions.
*/
org.apache.flex.core.ViewBase.prototype.set_transitions = function(value) {
- this.transitions_ = value;
+ this.transitions_ = value;
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
index e3b1dd1..a2a95c7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
@@ -21,6 +21,7 @@ goog.require('org.apache.flex.binding.SimpleBinding');
goog.require('org.apache.flex.events.Event');
+
/**
* @constructor
*/
@@ -40,6 +41,7 @@ org.apache.flex.core.ViewBaseDataBinding = function() {
};
+
/**
* @expose
* @this {org.apache.flex.core.ViewBaseDataBinding}
@@ -63,133 +65,133 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.set_strand =
org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
function(event) {
- var prop;
- var fieldWatcher;
- var sb;
- var bindingData = this.strand_['_bindings'];
- var n = bindingData[0];
- var bindings = [];
- var i;
- var index = 1;
- for (i = 0; i < n; i++)
- {
- var binding = {};
- binding.source = bindingData[index++];
- binding.destFunc = bindingData[index++];
- binding.destination = bindingData[index++];
- bindings.push(binding);
- }
- var watchers = this.decodeWatcher(bindingData.slice(index));
- for (i = 0; i < n; i++)
- {
- binding = bindings[i];
- // try to determine if it is an array
- if (typeof(binding.source) == 'object' &&
+ var prop;
+ var fieldWatcher;
+ var sb;
+ var bindingData = this.strand_['_bindings'];
+ var n = bindingData[0];
+ var bindings = [];
+ var i;
+ var index = 1;
+ for (i = 0; i < n; i++)
+ {
+ var binding = {};
+ binding.source = bindingData[index++];
+ binding.destFunc = bindingData[index++];
+ binding.destination = bindingData[index++];
+ bindings.push(binding);
+ }
+ var watchers = this.decodeWatcher(bindingData.slice(index));
+ for (i = 0; i < n; i++)
+ {
+ binding = bindings[i];
+ // try to determine if it is an array
+ if (typeof(binding.source) == 'object' &&
typeof(binding.source.slice) == 'function')
+ {
+ if (binding.source[0] == 'applicationModel')
+ {
+ if (binding.source.length == 2 &&
+ binding.destination.length == 2)
{
- if (binding.source[0] == 'applicationModel')
- {
- if (binding.source.length == 2 &&
- binding.destination.length == 2)
- {
- var destination;
- // can be simplebinding or constantbinding
- var modelWatcher =
- watchers.watcherMap['applicationModel'];
- var childMap = modelWatcher.children.watcherMap;
- fieldWatcher = childMap[binding.source[1]];
- if (typeof(fieldWatcher.eventNames) == 'string')
- {
- sb = new org.apache.flex.binding.SimpleBinding();
- sb.destinationPropertyName =
- binding.destination[1];
- sb.eventName = fieldWatcher.eventNames;
- sb.sourceID = binding.source[0];
- sb.sourcePropertyName = binding.source[1];
- sb.setDocument(this.strand_);
- prop = binding.destination[0];
+ var destination;
+ // can be simplebinding or constantbinding
+ var modelWatcher =
+ watchers.watcherMap['applicationModel'];
+ var childMap = modelWatcher.children.watcherMap;
+ fieldWatcher = childMap[binding.source[1]];
+ if (typeof(fieldWatcher.eventNames) == 'string')
+ {
+ sb = new org.apache.flex.binding.SimpleBinding();
+ sb.destinationPropertyName =
+ binding.destination[1];
+ sb.eventName = fieldWatcher.eventNames;
+ sb.sourceID = binding.source[0];
+ sb.sourcePropertyName = binding.source[1];
+ sb.setDocument(this.strand_);
+ prop = binding.destination[0];
- if (typeof(this.strand_['get_' +
+ if (typeof(this.strand_['get_' +
prop]) == 'function')
- destination = this.strand_[
- 'get_' + prop]();
- else
- destination = this.strand_[prop];
+ destination = this.strand_[
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
- if (destination)
- destination.addBead(sb);
- else
- {
- this.deferredBindings[prop] =
- sb;
- this.strand_.addEventListener('valueChange',
- this.deferredBindingsHandler);
- }
- }
- else if (fieldWatcher.eventNames == null)
- {
- var cb;
- cb = org.apache.flex.binding.ConstantBinding;
- cb = new cb();
- cb.destinationPropertyName =
- binding.destination[1];
- cb.sourceID = binding.source[0];
- cb.sourcePropertyName = binding.source[1];
- cb.setDocument(this.strand_);
- prop = binding.destination[0];
- if (typeof(this.strand_['get_' +
+ if (destination)
+ destination.addBead(sb);
+ else
+ {
+ this.deferredBindings[prop] =
+ sb;
+ this.strand_.addEventListener('valueChange',
+ this.deferredBindingsHandler);
+ }
+ }
+ else if (fieldWatcher.eventNames == null)
+ {
+ var cb;
+ cb = org.apache.flex.binding.ConstantBinding;
+ cb = new cb();
+ cb.destinationPropertyName =
+ binding.destination[1];
+ cb.sourceID = binding.source[0];
+ cb.sourcePropertyName = binding.source[1];
+ cb.setDocument(this.strand_);
+ prop = binding.destination[0];
+ if (typeof(this.strand_['get_' +
prop]) == 'function')
- destination = this.strand_[
- 'get_' + prop]();
- else
- destination = this.strand_[prop];
+ destination = this.strand_[
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
- if (destination)
- destination.addBead(cb);
- else
- {
- this.deferredBindings[prop] =
- cb;
- this.strand_.addEventListener('valueChange',
- this.deferredBindingsHandler);
- }
- }
- }
+ if (destination)
+ destination.addBead(cb);
+ else
+ {
+ this.deferredBindings[prop] =
+ cb;
+ this.strand_.addEventListener('valueChange',
+ this.deferredBindingsHandler);
}
+ }
}
- else if (typeof(binding.source) == 'string')
- {
- fieldWatcher = watchers.watcherMap[binding.source];
- if (typeof(fieldWatcher.eventNames) == 'string')
- {
- sb = new org.apache.flex.binding.SimpleBinding();
- sb.destinationPropertyName = binding.destination[1];
- sb.eventName = fieldWatcher.eventNames;
- sb.sourcePropertyName = binding.source;
- sb.setDocument(this.strand_);
- prop = binding.destination[0];
- if (typeof(this.strand_['get_' +
+ }
+ }
+ else if (typeof(binding.source) == 'string')
+ {
+ fieldWatcher = watchers.watcherMap[binding.source];
+ if (typeof(fieldWatcher.eventNames) == 'string')
+ {
+ sb = new org.apache.flex.binding.SimpleBinding();
+ sb.destinationPropertyName = binding.destination[1];
+ sb.eventName = fieldWatcher.eventNames;
+ sb.sourcePropertyName = binding.source;
+ sb.setDocument(this.strand_);
+ prop = binding.destination[0];
+ if (typeof(this.strand_['get_' +
prop]) == 'function')
- destination = this.strand_[
- 'get_' + prop]();
- else
- destination = this.strand_[prop];
+ destination = this.strand_[
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
- if (destination)
- destination.addBead(sb);
- else
- {
- this.deferredBindings[prop] = sb;
- this.strand_.addEventListener('valueChange',
- this.deferredBindingsHandler);
- }
- }
- }
+ if (destination)
+ destination.addBead(sb);
else
{
- this.makeGenericBinding(binding, i, watchers);
+ this.deferredBindings[prop] = sb;
+ this.strand_.addEventListener('valueChange',
+ this.deferredBindingsHandler);
}
+ }
}
+ else
+ {
+ this.makeGenericBinding(binding, i, watchers);
+ }
+ }
};
@@ -201,15 +203,16 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
* @param {Object} watchers The database of Watchers.
*/
org.apache.flex.core.ViewBaseDataBinding.prototype.makeGenericBinding =
- function(binding, index, watchers) {
- var gb = new org.apache.flex.binding.GenericBinding();
- gb.setDocument(this.strand_);
- gb.destinationData = binding.destination;
- gb.destinationFunction = binding.destFunc;
- gb.source = binding.source;
- this.setupWatchers(gb, index, watchers.watchers, null);
+ function(binding, index, watchers) {
+ var gb = new org.apache.flex.binding.GenericBinding();
+ gb.setDocument(this.strand_);
+ gb.destinationData = binding.destination;
+ gb.destinationFunction = binding.destFunc;
+ gb.source = binding.source;
+ this.setupWatchers(gb, index, watchers.watchers, null);
};
+
/**
* @protected
* @this {org.apache.flex.core.ViewBaseDataBinding}
@@ -219,45 +222,46 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.makeGenericBinding =
* @param {Object} parentWatcher The parent Watcher or null if top.
*/
org.apache.flex.core.ViewBaseDataBinding.prototype.setupWatchers =
- function(gb, index, watchers, parentWatcher) {
- var i, n;
- n = watchers.length;
- for (i = 0; i < n; i++)
+ function(gb, index, watchers, parentWatcher) {
+ var i, n;
+ n = watchers.length;
+ for (i = 0; i < n; i++)
+ {
+ var watcher = watchers[i];
+ if (watcher.bindings.indexOf(index) != -1)
{
- var watcher = watchers[i];
- if (watcher.bindings.indexOf(index) != -1)
- {
- var type = watcher.type;
- switch (type)
- {
- case 'property':
- {
- var pw = new org.apache.flex.binding.PropertyWatcher(
- this,
- watcher.propertyName,
- watcher.eventNames,
- watcher.getterFunction);
- watcher.watcher = pw;
- if (parentWatcher)
- pw.parentChanged(parentWatcher.value);
- else
- pw.parentChanged(this.strand_);
- if (parentWatcher)
- parentWatcher.addChild(pw);
- if (watcher.children == null)
- pw.addBinding(gb);
- break;
- }
- }
- if (watcher.children)
- {
- this.setupWatchers(gb, index, watcher.children,
- watcher.watcher);
- }
- }
+ var type = watcher.type;
+ switch (type)
+ {
+ case 'property':
+ {
+ var pw = new org.apache.flex.binding.PropertyWatcher(
+ this,
+ watcher.propertyName,
+ watcher.eventNames,
+ watcher.getterFunction);
+ watcher.watcher = pw;
+ if (parentWatcher)
+ pw.parentChanged(parentWatcher.value);
+ else
+ pw.parentChanged(this.strand_);
+ if (parentWatcher)
+ parentWatcher.addChild(pw);
+ if (watcher.children == null)
+ pw.addBinding(gb);
+ break;
+ }
+ }
+ if (watcher.children)
+ {
+ this.setupWatchers(gb, index, watcher.children,
+ watcher.watcher);
+ }
}
+ }
};
+
/**
* @protected
* @this {org.apache.flex.core.ViewBaseDataBinding}
@@ -266,90 +270,91 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.setupWatchers =
*/
org.apache.flex.core.ViewBaseDataBinding.prototype.decodeWatcher =
function(bindingData) {
- var watcherMap = {};
- var watchers = [];
- var n = bindingData.length - 1; // there is an extra null because
- // it is easier for the compiler
- var index = 0;
- var watcherData;
- while (index < n)
+ var watcherMap = {};
+ var watchers = [];
+ var n = bindingData.length - 1; // there is an extra null because
+ // it is easier for the compiler
+ var index = 0;
+ var watcherData;
+ while (index < n)
+ {
+ var watcherIndex = bindingData[index++];
+ var type = bindingData[index++];
+ switch (type)
{
- var watcherIndex = bindingData[index++];
- var type = bindingData[index++];
- switch (type)
+ case 0:
{
- case 0:
- {
- watcherData = { type: 'function' };
- watcherData.functionName = bindingData[index++];
- watcherData.paramFunction = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- break;
- }
- case 1:
- {
- watcherData = { type: 'static' };
- watcherData.propertyName = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherData.getterFunction = bindingData[index++];
- watcherData.parentObj = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
- case 2:
- {
- watcherData = { type: 'property' };
- watcherData.propertyName = bindingData[index++];
- watcherData.eventNames = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherData.getterFunction = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
- case 3:
- {
- watcherData = { type: 'xml' };
- watcherData.propertyName = bindingData[index++];
- watcherData.bindings = bindingData[index++];
- watcherMap[watcherData.propertyName] = watcherData;
- break;
- }
+ watcherData = { type: 'function' };
+ watcherData.functionName = bindingData[index++];
+ watcherData.paramFunction = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ break;
}
- watcherData.children = bindingData[index++];
- if (watcherData.children != null)
+ case 1:
{
- watcherData.children = this.decodeWatcher(watcherData.children);
+ watcherData = { type: 'static' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherData.parentObj = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
}
- watcherData.index = watcherIndex;
- watchers.push(watcherData);
+ case 2:
+ {
+ watcherData = { type: 'property' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
+ case 3:
+ {
+ watcherData = { type: 'xml' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
+ }
+ watcherData.children = bindingData[index++];
+ if (watcherData.children != null)
+ {
+ watcherData.children = this.decodeWatcher(watcherData.children);
}
- return { watchers: watchers, watcherMap: watcherMap };
+ watcherData.index = watcherIndex;
+ watchers.push(watcherData);
+ }
+ return { watchers: watchers, watcherMap: watcherMap };
};
+
/**
* @protected
* @this {org.apache.flex.core.ViewBaseDataBinding}
* @param {Object} event The event.
*/
org.apache.flex.core.ViewBaseDataBinding.prototype.deferredBindingsHandler =
-function(event) {
- var p;
- for (p in this.deferredBindings)
+ function(event) {
+ var p;
+ for (p in this.deferredBindings)
+ {
+ if (typeof(this.strand_['get_' + p]) == 'function')
{
- if (typeof(this.strand_['get_' + p]) == 'function')
- {
- var destination = this.strand_['get_' + p]();
- destination.addBead(this.deferredBindings[p]);
- delete deferredBindings[p];
- }
- else if (this.strand_[p] != null)
- {
- var destination = this.strand_[p];
- destination.addBead(this.deferredBindings[p]);
- delete deferredBindings[p];
- }
+ var destination = this.strand_['get_' + p]();
+ destination.addBead(this.deferredBindings[p]);
+ delete deferredBindings[p];
}
+ else if (this.strand_[p] != null)
+ {
+ var destination = this.strand_[p];
+ destination.addBead(this.deferredBindings[p]);
+ delete deferredBindings[p];
+ }
+ }
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
index 62aa09f..698c6a9 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
@@ -31,84 +31,93 @@ goog.provide('org.apache.flex.createjs.Application');
goog.require('org.apache.flex.core.HTMLElementWrapper');
goog.require('org.apache.flex.utils.MXMLDataInterpreter');
+
+
/**
* @constructor
* @extends {org.apache.flex.core.HTMLElementWrapper}
*/
org.apache.flex.createjs.Application = function() {
- goog.base(this);
+ goog.base(this);
};
goog.inherits(org.apache.flex.createjs.Application,
org.apache.flex.core.HTMLElementWrapper);
+
/**
* @expose
* @type {Object}
*/
org.apache.flex.createjs.Application.prototype.controller = null;
+
/**
* @expose
* @type {org.apache.flex.createjs.core.ViewBase}
*/
org.apache.flex.createjs.Application.prototype.initialView = null;
+
/**
* @expose
* @type {createjs.Stage}
*/
org.apache.flex.createjs.Application.prototype.stage = null;
+
/**
* @expose
* @type {org.apache.flex.events.EventDispatcher}
*/
org.apache.flex.createjs.Application.prototype.model = null;
+
/**
* @expose
* @type {org.apache.flex.core.SimpleValuesImpl}
*/
org.apache.flex.createjs.Application.prototype.valuesImpl = null;
+
/**
* @expose
* @this {org.apache.flex.createjs.Application}
*/
org.apache.flex.createjs.Application.prototype.start = function() {
- var body;
+ var body;
- // For createjs, the application is the same as the canvas
- // and it provides convenient access to the stage.
+ // For createjs, the application is the same as the canvas
+ // and it provides convenient access to the stage.
- this.element = document.createElement('canvas');
- this.element.id = 'flexjsCanvas';
- this.element.width = 700;
- this.element.height = 500;
+ this.element = document.createElement('canvas');
+ this.element.id = 'flexjsCanvas';
+ this.element.width = 700;
+ this.element.height = 500;
- body = document.getElementsByTagName('body')[0];
- body.appendChild(this.element);
+ body = document.getElementsByTagName('body')[0];
+ body.appendChild(this.element);
- this.stage = new createjs.Stage('flexjsCanvas');
+ this.stage = new createjs.Stage('flexjsCanvas');
- org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this,
- this.get_MXMLProperties());
+ org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this,
+ this.get_MXMLProperties());
- this.dispatchEvent('initialize');
+ this.dispatchEvent('initialize');
- this.initialView.applicationModel = this.model;
- this.addElement(this.initialView);
+ this.initialView.applicationModel = this.model;
+ this.addElement(this.initialView);
- this.dispatchEvent('viewChanged');
+ this.dispatchEvent('viewChanged');
};
+
/**
* @this {org.apache.flex.createjs.core.Application}
* @param {Object} c The child element.
*/
org.apache.flex.createjs.core.Application.prototype.addElement =
function(c) {
- this.stage.addChild(c.element);
- c.addedToParent();
+ this.stage.addChild(c.element);
+ c.addedToParent();
};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3510e0a6/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
index f11f433..413f071 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
@@ -23,132 +23,144 @@ goog.require('org.apache.flex.core.HTMLElementWrapper');
* @extends {org.apache.flex.core.HTMLElementWrapper}
*/
org.apache.flex.createjs.core.UIBase = function() {
- goog.base(this);
+ goog.base(this);
- /**
+ /**
* @protected
* @type {Object}
*/
- this.positioner = null;
+ this.positioner = null;
- this.createElement();
+ this.createElement();
};
goog.inherits(org.apache.flex.createjs.core.UIBase,
org.apache.flex.core.HTMLElementWrapper);
+
/**
* @this {org.apache.flex.createjs.core.UIBase}
* @param {Object} c The child element.
*/
org.apache.flex.createjs.core.UIBase.prototype.addElement =
function(c) {
- this.addChild(c.element);
+ this.addChild(c.element);
};
+
/**
* @this {org.apache.flex.createjs.core.UIBase}
*/
org.apache.flex.createjs.core.UIBase.prototype.createElement =
function() {
- this.element = new createjs.Container();
+ this.element = new createjs.Container();
- this.positioner = this.element;
+ this.positioner = this.element;
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {number} pixels The pixel count from the left edge.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_x = function(pixels) {
- this.positioner.x = pixels;
- this.element.getStage().update();
+ this.positioner.x = pixels;
+ this.element.getStage().update();
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {number} pixels The pixel count from the top edge.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_y = function(pixels) {
- this.positioner.y = pixels;
- this.element.getStage().update();
+ this.positioner.y = pixels;
+ this.element.getStage().update();
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {number} pixels The pixel count from the left edge.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_width = function(pixels) {
- this.positioner.width = pixels;
- this.element.getStage().update();
+ this.positioner.width = pixels;
+ this.element.getStage().update();
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {number} pixels The pixel count from the top edge.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_height = function(pixels) {
- this.positioner.height = pixels;
- this.element.getStage().update();
+ this.positioner.height = pixels;
+ this.element.getStage().update();
};
+
/**
* @expose
* @type {string}
*/
org.apache.flex.createjs.core.UIBase.prototype.id = null;
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @return {string} The id.
*/
org.apache.flex.createjs.core.UIBase.prototype.get_id = function() {
- return this.name;
+ return this.name;
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {object} value The new id.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_id = function(value) {
- if (this.name !== value)
- {
- this.element.name = value;
- this.name = value;
- this.dispatchEvent('idChanged');
- }
+ if (this.name !== value)
+ {
+ this.element.name = value;
+ this.name = value;
+ this.dispatchEvent('idChanged');
+ }
};
+
/**
* @expose
* @type {object}
*/
org.apache.flex.createjs.core.UIBase.prototype.model = null;
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @return {object} The model.
*/
org.apache.flex.createjs.core.UIBase.prototype.get_model = function() {
- return this.model;
+ return this.model;
};
+
/**
* @expose
* @this {org.apache.flex.createjs.core.UIBase}
* @param {object} value The new model.
*/
org.apache.flex.createjs.core.UIBase.prototype.set_model = function(value) {
- if (this.model !== value)
- {
- this.addBead(value);
- this.dispatchEvent('modelChanged');
- }
+ if (this.model !== value)
+ {
+ this.addBead(value);
+ this.dispatchEvent('modelChanged');
+ }
};