/**
 * Generated by Apache Royale Compiler from org\apache\royale\html\beads\SliderView.as
 * org.apache.royale.html.beads.SliderView
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.html.beads.SliderView');

goog.require('org.apache.royale.core.BeadViewBase');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.core.IBeadLayout');
goog.require('org.apache.royale.core.IBeadModel');
goog.require('org.apache.royale.core.IParent');
goog.require('org.apache.royale.core.IRangeModel');
goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.core.ValuesManager');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.html.Button');
goog.require('org.apache.royale.html.TextButton');
goog.require('org.apache.royale.core.IBeadView');
goog.require('org.apache.royale.html.beads.ISliderView');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @constructor
 * @extends {org.apache.royale.core.BeadViewBase}
 * @implements {org.apache.royale.html.beads.ISliderView}
 * @implements {org.apache.royale.core.IBeadView}
 */
org.apache.royale.html.beads.SliderView = function() {
  org.apache.royale.html.beads.SliderView.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.SliderView, org.apache.royale.core.BeadViewBase);


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.html.beads.SliderView', org.apache.royale.html.beads.SliderView);


/**
 * @private
 * @type {org.apache.royale.core.IRangeModel}
 */
org.apache.royale.html.beads.SliderView.prototype.org_apache_royale_html_beads_SliderView_rangeModel;


/**
 * @private
 * @type {org.apache.royale.html.Button}
 */
org.apache.royale.html.beads.SliderView.prototype.org_apache_royale_html_beads_SliderView__track;


/**
 * @private
 * @type {org.apache.royale.html.TextButton}
 */
org.apache.royale.html.beads.SliderView.prototype.org_apache_royale_html_beads_SliderView__thumb;


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.beads.SliderView.prototype.org_apache_royale_html_beads_SliderView_modelChangeHandler = function(event) {
  org.apache.royale.utils.Language.as(this._strand, org.apache.royale.events.IEventDispatcher).dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


org.apache.royale.html.beads.SliderView.prototype.set__strand = function(value) {
  org.apache.royale.html.beads.SliderView.superClass_.set__strand.apply(this, [ value] );
  var /** @type {org.apache.royale.core.IBeadLayout} */ layout = org.apache.royale.utils.Language.as(this._strand.getBeadByType(org.apache.royale.core.IBeadLayout), org.apache.royale.core.IBeadLayout);
  if (layout == null) {
    var /** @type {Object} */ klass = org.apache.royale.core.ValuesManager["valuesImpl"].getValue(this._strand, "iBeadLayout");
    this._strand.addBead(org.apache.royale.utils.Language.as(new klass(), org.apache.royale.core.IBead));
  }
  
  this.org_apache_royale_html_beads_SliderView__track = new org.apache.royale.html.Button();
  this.org_apache_royale_html_beads_SliderView__track.className = "SliderTrack";
  this.org_apache_royale_html_beads_SliderView__track.style = {"position":"absolute", "padding":0};
  this.host.addElement(this.org_apache_royale_html_beads_SliderView__track);
  this.org_apache_royale_html_beads_SliderView__thumb = new org.apache.royale.html.TextButton();
  this.org_apache_royale_html_beads_SliderView__thumb.className = "SliderThumb";
  this.org_apache_royale_html_beads_SliderView__thumb.style = {"position":"absolute", "padding":0};
  this.org_apache_royale_html_beads_SliderView__thumb.text = '⦿';
  this.host.addElement(this.org_apache_royale_html_beads_SliderView__thumb);
  this.org_apache_royale_html_beads_SliderView_rangeModel = org.apache.royale.utils.Language.as(this._strand.getBeadByType(org.apache.royale.core.IBeadModel), org.apache.royale.core.IRangeModel);
  var /** @type {org.apache.royale.events.IEventDispatcher} */ rm = org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_SliderView_rangeModel, org.apache.royale.events.IEventDispatcher);
  rm.addEventListener("valueChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_SliderView_modelChangeHandler, this, 'modelChangeHandler'));
  rm.addEventListener("minimumChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_SliderView_modelChangeHandler, this, 'modelChangeHandler'));
  rm.addEventListener("maximumChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_SliderView_modelChangeHandler, this, 'modelChangeHandler'));
  rm.addEventListener("stepSizeChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_SliderView_modelChangeHandler, this, 'modelChangeHandler'));
  rm.addEventListener("snapIntervalChange", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_SliderView_modelChangeHandler, this, 'modelChangeHandler'));
  org.apache.royale.utils.Language.as(this._strand, org.apache.royale.events.IEventDispatcher).dispatchEvent(new org.apache.royale.events.Event("layoutNeeded"));
};


org.apache.royale.html.beads.SliderView.prototype.get__track = function() {
  return this.org_apache_royale_html_beads_SliderView__track;
};


org.apache.royale.html.beads.SliderView.prototype.get__thumb = function() {
  return this.org_apache_royale_html_beads_SliderView__thumb;
};


Object.defineProperties(org.apache.royale.html.beads.SliderView.prototype, /** @lends {org.apache.royale.html.beads.SliderView.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.SliderView.prototype.set__strand},
/**
  * @export
  * @type {org.apache.royale.core.IUIBase} */
track: {
get: org.apache.royale.html.beads.SliderView.prototype.get__track},
/**
  * @export
  * @type {org.apache.royale.core.IUIBase} */
thumb: {
get: org.apache.royale.html.beads.SliderView.prototype.get__thumb}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.html.beads.SliderView.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'SliderView', qName: 'org.apache.royale.html.beads.SliderView', kind: 'class' }], interfaces: [org.apache.royale.html.beads.ISliderView, org.apache.royale.core.IBeadView] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.SliderView.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.SliderView'},
        'track': { type: 'org.apache.royale.core.IUIBase', access: 'readonly', declaredBy: 'org.apache.royale.html.beads.SliderView'},
        'thumb': { type: 'org.apache.royale.core.IUIBase', access: 'readonly', declaredBy: 'org.apache.royale.html.beads.SliderView'}
      };
    },
    methods: function () {
      return {
        'SliderView': { type: '', declaredBy: 'org.apache.royale.html.beads.SliderView'}
      };
    }
  };
};