Renderer.js revision 106cc795c2891f2d2d142772cadefbcb5975bcfa
{
this._createId();
}
width: {
getter: function()
{
return this._width;
},
{
return value;
}
},
height: {
getter: function()
{
return this._height;
},
{
return value;
}
},
rendering: {
getter: function()
{
return this._rendering;
},
{
this._rendering = value;
return value;
}
},
getter: function()
{
return this._previousWidth;
},
{
},
{
this._previousWidth = value;
return value;
}
},
getter: function()
{
return this._previousHeight;
},
{
},
{
this._previousHeight = value;
return value;
}
},
/**
* Hash of style properties for class
*/
{
value: {},
lazyAdd: false,
getter: function()
{
return this._styles;
},
{
return this._styles;
},
{
}
}
};
/**
* Creates unique id for class instance.
*
* @private
*/
_createId: function()
{
},
_width: 0,
_height: 0,
_styles: null,
/**
* @private
* Indicates whether or not the class is in the process or rendering.
*/
_rendering: false,
/**
* @private
* Previous width of the object.
*/
_previousWidth: 0,
/**
* @private
* Previous height of the object.
*/
_previousHeight: 0,
/**
* Indicates whether or not any changes have occurred that would
* require a rendering.
*/
_hasFlag: false,
/**
* @private
* Indicates whether a flag has been created for a later rendering.
*/
_hasLaterFlag: false,
/**
* @private
* Hash of values that indicates which properties need to be updated.
*/
_renderFlags: {},
/**
* @private
* Hash of values that indicates which properties need to be updated
* on the following render cycle.
*/
_laterFlags: {},
/**
* @private
*
* Hash of child references with style objects.
*/
_styleObjHash: null,
/**
* Sets multiple style properties on the instance.
*
* @method _setStyles
* @param {Object} styles Hash of styles to be applied.
*/
_setStyles: function(newstyles)
{
},
/**
* Merges to object literals only overriding properties explicitly.
*
* @private
* @param {Object} newHash hash of properties to set
* @param {Object} default hash of properties to be overwritten
* @return {Object}
*/
_mergeStyles: function(a, b)
{
{
{
}
else
{
}
}, this);
return b;
},
/**
* @private
* Event handler for rendering.
*/
callRender: function()
{
if(!this.get("rendering"))
{
this.set("rendering", true);
this.render();
this.clearFlags();
this._updateRenderStatus();
}
},
/**
* @private
*/
_updateRenderStatus: function()
{
this.set("rendering", false);
this._dispatchRenderEvents();
},
/**
* @private (protected)
* All the events that need to be dispatched after <code>render</code> has completed.
*/
_dispatchRenderEvents: function()
{
if(this._hasFlag)
{
this.callRender();
}
},
/**
* @private
*/
{
if(!this._hasFlag)
{
this._hasFlag = true;
}
this._renderFlags[value] = true;
},
/**
* @private
* Sets a flag to mark for rendering on a later enterFrame.
*/
setLaterFlag: function(value)
{
if(!this._hasLaterFlag)
{
this._hasLaterFlag = true;
}
this._laterFlags[value] = true;
},
/**
* @private
*/
{
{
}
},
/**
* @private
*/
clearFlags: function()
{
this._renderFlags = {};
this._hasFlag = false;
for(var i in this._laterFlags)
{
if(this._laterFlags.hasOwnProperty(i))
{
this._renderFlags[i] = this._laterFlags[i];
this._hasFlag = true;
}
}
this._hasLaterFlag = false;
this._laterFlags = {};
},
/**
* @private
*/
{
return this._renderFlags[value];
},
/**
* @private (protected)
*/
checkFlags: function(flags)
{
var hasFlag = false;
for(var i in flags)
{
if(this._renderFlags[i])
{
hasFlag = true;
break;
}
}
return hasFlag;
}
});