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

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

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.IUIBase');
goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.events.IEventDispatcher');
goog.require('org.apache.royale.events.MouseEvent');
goog.require('org.apache.royale.html.beads.models.DividedContainerModel');
goog.require('org.apache.royale.html.supportClasses.DividedContainerDivider');
goog.require('org.apache.royale.core.IBead');
goog.require('org.apache.royale.core.IBeadController');
goog.require('org.apache.royale.utils.Language');



/**
 * Constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.9
 * @constructor
 * @implements {org.apache.royale.core.IBead}
 * @implements {org.apache.royale.core.IBeadController}
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController = function() {
};


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


/**
 * @private
 * @type {org.apache.royale.core.IStrand}
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove = 0;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_lastPosition = 0;


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.MouseEvent} event
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseDown = function(event) {
  event.preventDefault();
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_lastPosition = event.screenY;
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove = 0;
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.IUIBase, true).topMostEventDispatcher.addEventListener(org.apache.royale.events.MouseEvent.MOUSE_MOVE, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseMove, this, 'handleMouseMove'));
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.IUIBase, true).topMostEventDispatcher.addEventListener(org.apache.royale.events.MouseEvent.MOUSE_UP, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseUp, this, 'handleMouseUp'));
};


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.MouseEvent} event
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseMove = function(event) {
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove = event.screenY - this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_lastPosition;
  var /** @type {org.apache.royale.html.beads.models.DividedContainerModel} */ model = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.UIBase).model, org.apache.royale.html.beads.models.DividedContainerModel);
  var /** @type {number} */ pairIndex = org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.html.supportClasses.DividedContainerDivider).pairIndex;
  model.addPairAdjustment(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove, pairIndex);
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_lastPosition = event.screenY;
};


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.MouseEvent} event
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseUp = function(event) {
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove = event.screenY - this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_lastPosition;
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.IUIBase, true).topMostEventDispatcher.removeEventListener(org.apache.royale.events.MouseEvent.MOUSE_MOVE, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseMove, this, 'handleMouseMove'));
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.IUIBase, true).topMostEventDispatcher.removeEventListener(org.apache.royale.events.MouseEvent.MOUSE_UP, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseUp, this, 'handleMouseUp'));
  var /** @type {org.apache.royale.html.beads.models.DividedContainerModel} */ model = org.apache.royale.utils.Language.as(org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.core.UIBase).model, org.apache.royale.html.beads.models.DividedContainerModel);
  var /** @type {number} */ pairIndex = org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.html.supportClasses.DividedContainerDivider).pairIndex;
  model.addPairAdjustment(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_deltaMove, pairIndex);
};


org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.set__strand = function(value) {
  this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand = value;
  org.apache.royale.utils.Language.as(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController__strand, org.apache.royale.events.IEventDispatcher).addEventListener(org.apache.royale.events.MouseEvent.MOUSE_DOWN, org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_controllers_VDividedContainerMouseController_handleMouseDown, this, 'handleMouseDown'));
};


Object.defineProperties(org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype, /** @lends {org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.controllers.VDividedContainerMouseController.prototype.set__strand}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.controllers.VDividedContainerMouseController.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.controllers.VDividedContainerMouseController'}
      };
    },
    methods: function () {
      return {
        'VDividedContainerMouseController': { type: '', declaredBy: 'org.apache.royale.html.beads.controllers.VDividedContainerMouseController'}
      };
    }
  };
};