Updated Branches: refs/heads/develop 9619b7072 -> 072c0d196
Added RangeModel for Slider and NumericStepper. Fixed lint issues. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/072c0d19 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/072c0d19 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/072c0d19 Branch: refs/heads/develop Commit: 072c0d19606c80ea865dc1e1dc333c7cfc453359 Parents: 9619b70 Author: Peter Ent <[email protected]> Authored: Mon Aug 5 13:55:00 2013 -0400 Committer: Peter Ent <[email protected]> Committed: Mon Aug 5 13:55:00 2013 -0400 ---------------------------------------------------------------------- .../flex/html/staticControls/NumericStepper.js | 127 +++++++++++++- .../apache/flex/html/staticControls/Panel.js | 22 ++- .../apache/flex/html/staticControls/Slider.js | 83 +++++---- .../apache/flex/html/staticControls/TitleBar.js | 23 +-- .../flex/html/staticControls/beads/PanelView.js | 16 +- .../staticControls/beads/models/PanelModel.js | 40 ++--- .../staticControls/beads/models/RangeModel.js | 171 +++++++++++++++++++ .../beads/models/TitleBarModel.js | 40 ++--- 8 files changed, 413 insertions(+), 109 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js index 39d302d..d1852c8 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/NumericStepper.js @@ -17,6 +17,7 @@ goog.provide('org.apache.flex.html.staticControls.NumericStepper'); goog.require('org.apache.flex.core.UIBase'); goog.require('org.apache.flex.html.staticControls.Spinner'); goog.require('org.apache.flex.html.staticControls.TextInput'); +goog.require('org.apache.flex.html.staticControls.beads.models.RangeModel'); @@ -25,13 +26,9 @@ goog.require('org.apache.flex.html.staticControls.TextInput'); * @extends {org.apache.flex.core.UIBase} */ org.apache.flex.html.staticControls.NumericStepper = function() { + this.model = + new org.apache.flex.html.staticControls.beads.models.RangeModel(); goog.base(this); - - this.minimum_ = 0; - this.maximum_ = 100; - this.value_ = 1; - this.stepSize_ = 1; - this.snapInterval_ = 1; }; goog.inherits(org.apache.flex.html.staticControls.NumericStepper, org.apache.flex.core.UIBase); @@ -54,20 +51,132 @@ org.apache.flex.html.staticControls.NumericStepper.prototype.createElement = this.addElement(this.spinner); this.spinner.positioner.style.display = 'inline-block'; goog.events.listen(this.spinner, 'valueChanged', - goog.bind(this.handleSpinnerChange, this)); + goog.bind(this.spinnerChange, this)); this.element.flexjs_wrapper = this; + this.set_className('NumericStepper'); this.input.set_text(String(this.spinner.get_value())); }; /** - * @this {org.apache.flex.html.staticControls.Spinner} + * @this {org.apache.flex.html.staticControls.NumericStepper} * @param {Object} event The input event. */ -org.apache.flex.html.staticControls.NumericStepper.prototype.handleSpinnerChange = +org.apache.flex.html.staticControls.NumericStepper.prototype.spinnerChange = function(event) { this.input.set_text(String(this.spinner.get_value())); this.dispatchEvent(new org.apache.flex.events.Event('valueChanged')); }; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @return {Number} The current minimum value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.get_minimum = + function() { + return this.model.get_minimum(); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @param {Number} value The new minimum value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.set_minimum = + function(value) { + this.model.set_minimum(value); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @return {Number} The current maximum value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.get_maximum = + function() { + return this.model.get_maximum(); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @param {Number} value The new maximum value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.set_maximum = + function(value) { + this.model.set_maximum(value); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @return {Number} The current value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.get_value = + function() { + return this.model.get_value(); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @param {Number} newValue The new value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.set_value = + function(newValue) { + this.model.set_value(newValue); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @return {Number} The current snapInterval value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.get_snapInterval = + function() { + return this.model.get_snapInterval(); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @param {Number} value The new snapInterval value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.set_snapInterval = + function(value) { + this.model.set_snapInterval(value); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @return {Number} The current stepSize value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.get_stepSize = + function() { + return this.model.get_stepSize(); +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.NumericStepper} + * @param {Number} value The new stepSize value. + */ +org.apache.flex.html.staticControls.NumericStepper.prototype.set_stepSize = + function(value) { + this.model.set_stepSize(value); +}; + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js index 8a14d6e..ade0f1a 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js @@ -27,7 +27,8 @@ goog.require('org.apache.flex.html.staticControls.beads.models.PanelModel'); * @extends {org.apache.flex.html.staticControls.Container} */ org.apache.flex.html.staticControls.Panel = function() { - this.model_ = new org.apache.flex.html.staticControls.beads.models.PanelModel(); + this.model = + new org.apache.flex.html.staticControls.beads.models.PanelModel(); goog.base(this); }; goog.inherits(org.apache.flex.html.staticControls.Panel, @@ -40,13 +41,13 @@ goog.inherits(org.apache.flex.html.staticControls.Panel, */ org.apache.flex.html.staticControls.Panel.prototype.addElement = function(c) { if (c == this.titleBar) { - this.element.insertBefore(this.titleBar.element,this.contentArea); + this.element.insertBefore(this.titleBar.element, this.contentArea); } else if (c == this.controlBar) { this.element.appendChild(c.element); } else { - this.contentArea.appendChild(c.element); + this.contentArea.appendChild(c.element); } c.addedToParent(); }; @@ -57,7 +58,8 @@ org.apache.flex.html.staticControls.Panel.prototype.addElement = function(c) { * @param {Object} c The child element. * @param {number} index The index. */ -org.apache.flex.html.staticControls.Panel.prototype.addElementAt = function(c, index) { +org.apache.flex.html.staticControls.Panel.prototype.addElementAt = + function(c, index) { var children = this.internalChildren(); if (index >= children.length) this.addElement(c); @@ -75,7 +77,8 @@ org.apache.flex.html.staticControls.Panel.prototype.addElementAt = function(c, i * @param {Object} c The child element. * @return {number} The index in parent. */ -org.apache.flex.html.staticControls.Panel.prototype.getElementIndex = function(c) { +org.apache.flex.html.staticControls.Panel.prototype.getElementIndex = + function(c) { var children = this.internalChildren(); var n = children.length; for (i = 0; i < n; i++) @@ -91,7 +94,8 @@ org.apache.flex.html.staticControls.Panel.prototype.getElementIndex = function(c * @this {org.apache.flex.html.staticControls.Panel} * @param {Object} c The child element. */ -org.apache.flex.html.staticControls.Panel.prototype.removeElement = function(c) { +org.apache.flex.html.staticControls.Panel.prototype.removeElement = + function(c) { this.contentArea.removeChild(c.element); }; @@ -122,7 +126,7 @@ org.apache.flex.html.staticControls.Panel.prototype.createElement = */ org.apache.flex.html.staticControls.Panel.prototype.addedToParent = function() { - + }; @@ -132,7 +136,7 @@ org.apache.flex.html.staticControls.Panel.prototype.addedToParent = * @return {string} The title getter. */ org.apache.flex.html.staticControls.Panel.prototype.get_title = function() { - return this.model_.get_title(); + return this.model.get_title(); }; @@ -143,7 +147,7 @@ org.apache.flex.html.staticControls.Panel.prototype.get_title = function() { */ org.apache.flex.html.staticControls.Panel.prototype.set_title = function(value) { - this.model_.set_title(value); + this.model.set_title(value); }; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js index d946c6d..c333f35 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Slider.js @@ -15,6 +15,7 @@ goog.provide('org.apache.flex.html.staticControls.Slider'); goog.require('org.apache.flex.core.UIBase'); +goog.require('org.apache.flex.html.staticControls.beads.models.RangeModel'); @@ -23,12 +24,9 @@ goog.require('org.apache.flex.core.UIBase'); * @extends {org.apache.flex.core.UIBase} */ org.apache.flex.html.staticControls.Slider = function() { + this.model = + new org.apache.flex.html.staticControls.beads.models.RangeModel(); goog.base(this); - - this.minimum_ = 0; - this.maximum_ = 100; - this.value_ = 1; - this.snapInterval_ = 1; }; goog.inherits(org.apache.flex.html.staticControls.Slider, org.apache.flex.core.UIBase); @@ -90,7 +88,7 @@ function() { */ org.apache.flex.html.staticControls.Slider.prototype.get_value = function() { - return this.value_; + return this.model.get_value(); }; /** @@ -101,10 +99,7 @@ function() { */ org.apache.flex.html.staticControls.Slider.prototype.set_value = function(newValue) { - if (newValue != this.value_) { - this.value_ = newValue; - this.dispatchEvent('valueChanged'); - } + this.model.set_value(newValue); }; /** @@ -114,7 +109,7 @@ function(newValue) { */ org.apache.flex.html.staticControls.Slider.prototype.get_minimum = function() { - return this.minimum_; + return this.model.get_minimum(); }; /** @@ -125,10 +120,7 @@ function() { */ org.apache.flex.html.staticControls.Slider.prototype.set_minimum = function(value) { - if (value != this.minimum_) { - this.minimum_ = value; - this.dispatchEvent('minimumChanged'); - } + this.model.set_minimum(value); }; /** @@ -138,7 +130,7 @@ function(value) { */ org.apache.flex.html.staticControls.Slider.prototype.get_maximum = function() { - return this.maximum_; + return this.model.get_maximum(); }; /** @@ -149,10 +141,7 @@ function() { */ org.apache.flex.html.staticControls.Slider.prototype.set_maximum = function(value) { - if (value != this.maximum_) { - this.maximum_ = value; - this.dispatchEvent('maximumChanged'); - } + this.model.set_maximum(value); }; /** @@ -162,7 +151,7 @@ function(value) { */ org.apache.flex.html.staticControls.Slider.prototype.get_snapInterval = function() { - return this.snapInterval_; + return this.model.get_snapInterval(); }; /** @@ -173,10 +162,28 @@ function() { */ org.apache.flex.html.staticControls.Slider.prototype.set_snapInterval = function(value) { - if (value != this.snapInterval_) { - this.snapInterval_ = value; - this.dispatchEvent('snapIntervalChanged'); - } + this.model.set_snapInterval(value); +}; + +/** + * @expose + * @this {org.apache.flex.html.staticControls.Slider} + * @return {Number} The stepSize getter. + */ +org.apache.flex.html.staticControls.Slider.prototype.get_stepSize = +function() { + return this.model.get_stepSize(); +}; + +/** + * @expose + * @this {org.apache.flex.html.staticControls.Slider} + * @param {Object} value The new stepSize value. + * @return {void} The stepSize setter. + */ +org.apache.flex.html.staticControls.Slider.prototype.set_stepSize = +function(value) { + this.model.set_stepSize(value); }; /** @@ -186,8 +193,9 @@ function(value) { */ org.apache.flex.html.staticControls.Slider.prototype.snap = function(value) { - var si = this.snapInterval_; - var n = Math.round((value - this.minimum_) / si) * si + this.minimum_; + var si = this.get_snapInterval(); + var n = Math.round((value - this.get_minimum()) / si) * + si + this.get_minimum(); if (value > 0) { if (value - n < n + si - value) @@ -207,14 +215,18 @@ org.apache.flex.html.staticControls.Slider.prototype.snap = function(value) org.apache.flex.html.staticControls.Slider.prototype.handleTrackClick = function(event) { - this.value_ = this.snap(Math.min(this.maximum_, this.value_ + - this.stepSize_)); - this.dispatchEvent(new org.apache.flex.events.Event('valueChanged')); + var xloc = event.clientX; + var p = Math.min(1, xloc / parseInt(this.track.style.width, 10)); + var n = p * (this.get_maximum() - this.get_minimum()) + this.get_minimum(); + + this.set_value(n); this.origin = parseInt(this.thumb.style.left, 10); this.position = parseInt(this.thumb.style.left, 10); this.calcValFromMousePosition(event, true); + + this.dispatchEvent(new org.apache.flex.events.Event('valueChanged')); }; /** @@ -276,17 +288,18 @@ function(event, useOffset) var newX = this.position + deltaX; var p = newX / parseInt(this.track.style.width, 10); - var n = p * (this.maximum_ - this.minimum_) + this.minimum_; + var n = p * (this.get_maximum() - this.get_minimum()) + this.get_minimum(); n = this.snap(n); - if (n < this.minimum_) n = this.minimum_; - else if (n > this.maximum_) n = this.maximum_; + if (n < this.get_minimum()) n = this.get_minimum(); + else if (n > this.get_maximum()) n = this.get_maximum(); - p = (n - this.minimum_) / (this.maximum_ - this.minimum_); + p = (n - this.get_minimum()) / (this.get_maximum() - this.get_minimum()); newX = p * parseInt(this.track.style.width, 10); this.thumb.style.left = String(newX - parseInt(this.thumb.style.width, 10) / 2) + 'px'; - this.value_ = n; + this.set_value(n); }; + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js index 5023551..26608ce 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js @@ -27,7 +27,8 @@ goog.require('org.apache.flex.html.staticControls.beads.models.TitleBarModel'); */ org.apache.flex.html.staticControls.TitleBar = function() { - this.model_ = new org.apache.flex.html.staticControls.beads.models.TitleBarModel(); + this.model = + new org.apache.flex.html.staticControls.beads.models.TitleBarModel(); goog.base(this); }; @@ -63,7 +64,8 @@ org.apache.flex.html.staticControls.TitleBar.prototype.createElement = this.set_className('TitleBar'); // listen for changes to the model so items can be changed in the view - this.model_.addEventListener('titleChange',goog.bind(this.changeHandler, this)); + this.model.addEventListener('titleChange', + goog.bind(this.changeHandler, this)); }; @@ -73,10 +75,10 @@ org.apache.flex.html.staticControls.TitleBar.prototype.createElement = */ org.apache.flex.html.staticControls.TitleBar.prototype.addedToParent = function() { - - this.titleLabel.set_text(this.model_.get_title()); - if (this.model_.showCloseButton) { + this.titleLabel.set_text(this.model.get_title()); + + if (this.model.showCloseButton) { this.titleButton.positioner.style.display = 'inline-block'; } else { this.titleButton.positioner.style.display = 'none'; @@ -84,14 +86,13 @@ org.apache.flex.html.staticControls.TitleBar.prototype.addedToParent = }; /** - * @private * @this {org.apache.flex.html.staticControls.TitleBar} * @param {Object} event The event that triggered this handler. */ org.apache.flex.html.staticControls.TitleBar.prototype.changeHandler = function(event) { if (event.type == 'titleChange') { - this.titleLabel.set_text(this.model_.get_title()); + this.titleLabel.set_text(this.model.get_title()); } else if (event.type == 'htmlTitleChange') { this.titleLabel.set_text(this.model.get_htmlTitle()); @@ -106,7 +107,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.changeHandler = */ org.apache.flex.html.staticControls.TitleBar.prototype.get_title = function() { - return this.model_.get_title(); + return this.model.get_title(); }; @@ -117,7 +118,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.get_title = */ org.apache.flex.html.staticControls.TitleBar.prototype.set_title = function(value) { - this.model_.set_title(value); + this.model.set_title(value); }; @@ -128,7 +129,7 @@ org.apache.flex.html.staticControls.TitleBar.prototype.set_title = */ org.apache.flex.html.staticControls.TitleBar.prototype.get_showCloseButton = function() { - return this.model_.get_showCloseButton(); + return this.model.get_showCloseButton(); }; @@ -139,5 +140,5 @@ org.apache.flex.html.staticControls.TitleBar.prototype.get_showCloseButton = */ org.apache.flex.html.staticControls.TitleBar.prototype.set_showCloseButton = function(value) { - this.model_.set_showCloseButton(value); + this.model.set_showCloseButton(value); }; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js index 05534e1..16b81f1 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/PanelView.js @@ -20,7 +20,7 @@ goog.provide('org.apache.flex.html.staticControls.beads.PanelView'); * @constructor */ org.apache.flex.html.staticControls.beads.PanelView = function() { - + }; /** @@ -38,22 +38,24 @@ org.apache.flex.html.staticControls.beads.PanelView.prototype.set_strand = this.strand_.titleBar.element.id = 'titleBar'; this.strand_.addElement(this.strand_.titleBar); - this.strand_.controlBar = new org.apache.flex.html.staticControls.ControlBar(); + this.strand_.controlBar = + new org.apache.flex.html.staticControls.ControlBar(); this.strand_.addElement(this.strand_.controlBar); - // listen for changes to the strand's model so items can be changed in the view - this.strand_.model_.addEventListener('titleChange',goog.bind(this.changeHandler, this)); + // listen for changes to the strand's model so items can be changed + // in the view + this.strand_.model.addEventListener('titleChange', + goog.bind(this.changeHandler, this)); }; /** - * @private * @this {org.apache.flex.html.staticControls.beads.PanelView} * @param {Object} event The event that triggered this handler. */ org.apache.flex.html.staticControls.beads.PanelView.prototype.changeHandler = function(event) { if (event.type == 'titleChange') { - this.strand_.titleBar.set_title(this.strand_.model_.get_title()); + this.strand_.titleBar.set_title(this.strand_.model.get_title()); } -}; \ No newline at end of file +}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js index cd3f4d0..febc95f 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/PanelModel.js @@ -22,7 +22,7 @@ goog.require('org.apache.flex.events.EventDispatcher'); */ org.apache.flex.html.staticControls.beads.models.PanelModel = function() { goog.base(this); - + this.title_ = ''; this.htmlTitle = ''; this.showCloseButton_ = false; @@ -37,8 +37,8 @@ goog.inherits(org.apache.flex.html.staticControls.beads.models.PanelModel, * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} * @param {Object} value The strand. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_strand = - function(value) { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +set_strand = function(value) { this.strand_ = value; }; @@ -46,10 +46,10 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_strand /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} - * @returns {String} The title. + * @return {String} The title. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_title = - function() { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +get_title = function() { return this.title_; }; @@ -59,8 +59,8 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_title * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} * @param {String} value The title to set. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_title = - function(value) { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +set_title = function(value) { if (this.title_ != value) { this.title_ = value; this.dispatchEvent('titleChange'); @@ -71,10 +71,10 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_title /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} - * @returns {String} The HTML title. + * @return {String} The HTML title. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_htmlTitle = - function() { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +get_htmlTitle = function() { return this.htmlTitle_; }; @@ -84,8 +84,8 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_htmlTi * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} * @param {String} value The new HTML title. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_htmlTitle = - function(value) { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +set_htmlTitle = function(value) { if (this.htmlTitle_ != value) { this.htmlTitle_ = value; this.dispatchEvent('htmlTitleChange'); @@ -96,10 +96,11 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_htmlTi /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} - * @returns {Boolean} Returns true if the close button should appear in the TitleBar. + * @return {Boolean} Returns true if the close button should appear in + * the TitleBar. */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_showCloseButton = - function() { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +get_showCloseButton = function() { return this.showCloseButton_; }; @@ -107,10 +108,11 @@ org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.get_showCl /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.PanelModel} - * @param {Boolean} value Determines if the close button shows (true) or not (false). + * @param {Boolean} value Determines if the close button shows (true) or + * not (false). */ -org.apache.flex.html.staticControls.beads.models.PanelModel.prototype.set_showCloseButton = - function(value) { +org.apache.flex.html.staticControls.beads.models.PanelModel.prototype. +set_showCloseButton = function(value) { if (this.showCloseButton_ != value) { this.showCloseButton_ = value; this.dispatchEvent('showCloseButtonChange'); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/RangeModel.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/RangeModel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/RangeModel.js new file mode 100644 index 0000000..7a7c23b --- /dev/null +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/RangeModel.js @@ -0,0 +1,171 @@ +/** + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +goog.provide('org.apache.flex.html.staticControls.beads.models.RangeModel'); + +goog.require('org.apache.flex.events.EventDispatcher'); + +/** + * @constructor + * @extends {org.apache.flex.events.EventDispatcher} + */ +org.apache.flex.html.staticControls.beads.models.RangeModel = function() { + goog.base(this); + + this.minimum_ = 0; + this.maximum_ = 100; + this.value_ = 0; + this.snapInterval_ = 1; + this.stepSize_ = 1; +}; +goog.inherits(org.apache.flex.html.staticControls.beads.models.RangeModel, + org.apache.flex.events.EventDispatcher); + + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Object} value The strand. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_strand = function(value) { + this.strand_ = value; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @return {Number} The current minimum value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +get_minimum = function() { + return this.minimum_; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Number} value The new minimum value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_minimum = function(value) { + if (this.minimum_ != value) { + this.minimum_ = value; + this.dispatchEvent('minimumChange'); + } +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @return {Number} The current maximu value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +get_maximum = function() { + return this.maximum_; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Number} value The new maximum value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_maximum = function(value) { + if (this.maximum_ != value) { + this.maximum_ = value; + this.dispatchEvent('maximumChange'); + } +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @return {Number} The current value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +get_value = function() { + return this.value_; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Number} newValue The new value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_value = function(newValue) { + if (this.value_ != newValue) { + this.value_ = newValue; + this.dispatchEvent('valueChange'); + } +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @return {Number} The current snapInterval value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +get_snapInterval = function() { + return this.snapInterval_; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Number} value The new snapInterval value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_snapInterval = function(value) { + if (this.snapInterval_ != value) { + this.snapInterval_ = value; + this.dispatchEvent('snapIntervalChange'); + } +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @return {Number} The current stepSize value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +get_stepSize = function() { + return this.stepSize_; +}; + + +/** + * @expose + * @this {org.apache.flex.html.staticControls.beads.models.RangeModel} + * @param {Number} value The new stepSize value. + */ +org.apache.flex.html.staticControls.beads.models.RangeModel.prototype. +set_stepSize = function(value) { + if (this.stepSize_ != value) { + this.stepSize_ = value; + this.dispatchEvent('stepSizeChange'); + } +}; + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/072c0d19/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js ---------------------------------------------------------------------- diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js index 6987074..f0cf755 100644 --- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js +++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/beads/models/TitleBarModel.js @@ -22,7 +22,7 @@ goog.require('org.apache.flex.events.EventDispatcher'); */ org.apache.flex.html.staticControls.beads.models.TitleBarModel = function() { goog.base(this); - + this.title_ = ''; this.htmlTitle = ''; this.showCloseButton_ = false; @@ -37,8 +37,8 @@ goog.inherits(org.apache.flex.html.staticControls.beads.models.TitleBarModel, * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} * @param {Object} value The strand. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_strand = - function(value) { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +set_strand = function(value) { this.strand_ = value; }; @@ -46,10 +46,10 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_str /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} - * @returns {String} The title. + * @return {String} The title. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_title = - function() { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +get_title = function() { return this.title_; }; @@ -59,8 +59,8 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_tit * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} * @param {String} value The title to set. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_title = - function(value) { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +set_title = function(value) { if (this.title_ != value) { this.title_ = value; this.dispatchEvent('titleChange'); @@ -71,10 +71,10 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_tit /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} - * @returns {String} The HTML title. + * @return {String} The HTML title. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_htmlTitle = - function() { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +get_htmlTitle = function() { return this.htmlTitle_; }; @@ -84,8 +84,8 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_htm * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} * @param {String} value The new HTML title. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_htmlTitle = - function(value) { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +set_htmlTitle = function(value) { if (this.htmlTitle_ != value) { this.htmlTitle_ = value; this.dispatchEvent('htmlTitleChange'); @@ -96,10 +96,11 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_htm /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} - * @returns {Boolean} Returns true if the close button should appear in the TitleBar. + * @return {Boolean} Returns true if the close button should appear in + * the TitleBar. */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_showCloseButton = - function() { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +get_showCloseButton = function() { return this.showCloseButton_; }; @@ -107,10 +108,11 @@ org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.get_sho /** * @expose * @this {org.apache.flex.html.staticControls.beads.models.TitleBarModel} - * @param {Boolean} value Determines if the close button shows (true) or not (false). + * @param {Boolean} value Determines if the close button shows (true) or + * not (false). */ -org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype.set_showCloseButton = - function(value) { +org.apache.flex.html.staticControls.beads.models.TitleBarModel.prototype. +set_showCloseButton = function(value) { if (this.showCloseButton_ != value) { this.showCloseButton_ = value; this.dispatchEvent('showCloseButtonChange');
