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

goog.provide('org.apache.royale.html.supportClasses.UIItemRendererBase');

goog.require('org.apache.royale.core.UIBase');
goog.require('org.apache.royale.core.ValuesManager');
goog.require('org.apache.royale.events.Event');
goog.require('org.apache.royale.utils.MXMLDataInterpreter');
goog.require('org.apache.royale.core.ISelectableItemRenderer');
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.UIBase}
 * @implements {org.apache.royale.core.ISelectableItemRenderer}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase = function() {
  org.apache.royale.html.supportClasses.UIItemRendererBase.base(this, 'constructor');

this.useColor = this.backgroundColor;
};
goog.inherits(org.apache.royale.html.supportClasses.UIItemRendererBase, org.apache.royale.core.UIBase);


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


/**
 * @asprivate
 * @export
 * @override
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.addedToParent = function() {
  org.apache.royale.utils.MXMLDataInterpreter.generateMXMLProperties(this, this.org_apache_royale_html_supportClasses_UIItemRendererBase_mxmlProperties);
  org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances(this, this, this.MXMLDescriptor);
  org.apache.royale.html.supportClasses.UIItemRendererBase.superClass_.addedToParent.apply(this);
  this.addEventListener("widthChanged", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_supportClasses_UIItemRendererBase_sizeChangeHandler, this, 'sizeChangeHandler'));
  this.addEventListener("heightChanged", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_supportClasses_UIItemRendererBase_sizeChangeHandler, this, 'sizeChangeHandler'));
  this.addEventListener("sizeChanged", org.apache.royale.utils.Language.closure(this.org_apache_royale_html_supportClasses_UIItemRendererBase_sizeChangeHandler, this, 'sizeChangeHandler'));
  org.apache.royale.core.ValuesManager["valuesImpl"].init(this);
  this.dispatchEvent(new org.apache.royale.events.Event("initBindings"));
  this.dispatchEvent(new org.apache.royale.events.Event("initComplete"));
};


/**
 * @private
 * @type {Object}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__itemRendererParent;


/**
 * @export
 * @type {Array}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.mxmlContent;


/**
 * @private
 * @type {Array}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase_mxmlProperties;


/**
 * @asprivate
 * @export
 * @param {Array} data
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.generateMXMLAttributes = function(data) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase_mxmlProperties = data;
};


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__backgroundColor = 0xFFFFFF;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__highlightColor = 0xCEDBEF;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__selectedColor = 0xA8C6EE;


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__downColor = 0x808080;


/**
 * @protected
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.useColor;


/**
 * @private
 * @type {Object}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__data;


/**
 * @private
 * @type {Object}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__listData;


/**
 * @private
 * @type {string}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__labelField = "label";


/**
 * @private
 * @type {number}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__index = 0;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__hovered;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__selectable = true;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__selected;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__hoverable = true;


/**
 * @private
 * @type {boolean}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase__down;


/**
 * @asprivate
 * @export
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.updateRenderer = function() {
  if (this.down)
    this.useColor = this.downColor;
  else if (this.hovered)
    this.useColor = this.highlightColor;
  else if (this.selected)
    this.useColor = this.selectedColor;
  else
    this.useColor = this.backgroundColor;
};


/**
 * @asprivate
 * @private
 * @param {org.apache.royale.events.Event} event
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.org_apache_royale_html_supportClasses_UIItemRendererBase_sizeChangeHandler = function(event) {
  this.adjustSize();
};


/**
 *  This function is called whenever the itemRenderer changes size. Sub-classes should override
 *  this method an handle the size change.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 0.0
 * @export
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.adjustSize = function() {
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__itemRendererParent = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__itemRendererParent;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__itemRendererParent = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__itemRendererParent = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__MXMLDescriptor = function() {
  return null;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__backgroundColor = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__backgroundColor;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__backgroundColor = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__backgroundColor = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__highlightColor = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__highlightColor;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__highlightColor = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__highlightColor = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selectedColor = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__selectedColor;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selectedColor = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__selectedColor = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__downColor = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__downColor;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__downColor = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__downColor = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__data = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__data;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__data = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__data = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__listData = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__listData;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__listData = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__listData = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__labelField = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__labelField;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__labelField = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__labelField = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__index = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__index;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__index = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__index = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__hovered = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__hovered;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__hovered = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__hovered = value;
  this.updateRenderer();
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selectable = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__selectable;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selectable = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__selectable = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selected = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__selected;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selected = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__selected = value;
  this.updateRenderer();
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__hoverable = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__hoverable;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__hoverable = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__hoverable = value;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__down = function() {
  return this.org_apache_royale_html_supportClasses_UIItemRendererBase__down;
};


org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__down = function(value) {
  this.org_apache_royale_html_supportClasses_UIItemRendererBase__down = value;
  this.updateRenderer();
};


Object.defineProperties(org.apache.royale.html.supportClasses.UIItemRendererBase.prototype, /** @lends {org.apache.royale.html.supportClasses.UIItemRendererBase.prototype} */ {
/**
  * @export
  * @type {Object} */
itemRendererParent: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__itemRendererParent,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__itemRendererParent},
/**
  * @export
  * @type {Array} */
MXMLDescriptor: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__MXMLDescriptor},
/**
  * @export
  * @type {number} */
backgroundColor: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__backgroundColor,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__backgroundColor},
/**
  * @export
  * @type {number} */
highlightColor: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__highlightColor,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__highlightColor},
/**
  * @export
  * @type {number} */
selectedColor: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selectedColor,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selectedColor},
/**
  * @export
  * @type {number} */
downColor: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__downColor,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__downColor},
/**
  * @export
  * @type {Object} */
data: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__data,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__data},
/**
  * @export
  * @type {Object} */
listData: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__listData,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__listData},
/**
  * @export
  * @type {string} */
labelField: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__labelField,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__labelField},
/**
  * @export
  * @type {number} */
index: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__index,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__index},
/**
  * @export
  * @type {boolean} */
hovered: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__hovered,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__hovered},
/**
  * @export
  * @type {boolean} */
selectable: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selectable,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selectable},
/**
  * @export
  * @type {boolean} */
selected: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__selected,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__selected},
/**
  * @export
  * @type {boolean} */
hoverable: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__hoverable,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__hoverable},
/**
  * @export
  * @type {boolean} */
down: {
get: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.get__down,
set: org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.set__down}}
);


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



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.supportClasses.UIItemRendererBase.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {
      return {
        'mxmlContent': { type: 'Array'}
      };
    },
    accessors: function () {
      return {
        'itemRendererParent': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'MXMLDescriptor': { type: 'Array', access: 'readonly', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'backgroundColor': { type: 'uint', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'highlightColor': { type: 'uint', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'selectedColor': { type: 'uint', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'downColor': { type: 'uint', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'data': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: '__NoChangeEvent__' } ] } ]; }},
        'listData': { type: 'Object', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase', metadata: function () { return [ { name: 'Bindable', args: [ { key: '', value: '__NoChangeEvent__' } ] } ]; }},
        'labelField': { type: 'String', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'index': { type: 'int', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'hovered': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'selectable': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'selected': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'hoverable': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'down': { type: 'Boolean', access: 'readwrite', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'}
      };
    },
    methods: function () {
      return {
        'UIItemRendererBase': { type: '', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'addedToParent': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'generateMXMLAttributes': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase', parameters: function () { return [  { index: 1, type: 'Array', optional: false } ]; }},
        'updateRenderer': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'},
        'adjustSize': { type: 'void', declaredBy: 'org.apache.royale.html.supportClasses.UIItemRendererBase'}
      };
    },
    metadata: function () { return [  ]; }
  };
};