- // @private
- onMouseOut: function(e) {
- this.fireEvent('mouseout', e);
- },
-
- attachEvents: function(o) {
- var me = this;
-
- o.on({
- scope: me,
- mousedown: me.onMouseDown,
- mouseup: me.onMouseUp,
- mouseover: me.onMouseOver,
- mouseout: me.onMouseOut,
- click: me.onClick
- });
- },
-
-<span id='Ext-draw-CompositeSprite-method-add'> /** Add a Sprite to the Group */
-</span> add: function(key, o) {
- var result = this.callParent(arguments);
- this.attachEvents(result);
- return result;
- },
-
- insert: function(index, key, o) {
- return this.callParent(arguments);
- },
-
-<span id='Ext-draw-CompositeSprite-method-remove'> /** Remove a Sprite from the Group */
-</span> remove: function(o) {
- var me = this;
-
- o.un({
- scope: me,
- mousedown: me.onMouseDown,
- mouseup: me.onMouseUp,
- mouseover: me.onMouseOver,
- mouseout: me.onMouseOut,
- click: me.onClick
- });
- me.callParent(arguments);
- },
-
-<span id='Ext-draw-CompositeSprite-method-getBBox'> /**
-</span> * Returns the group bounding box.
- * Behaves like {@link Ext.draw.Sprite} getBBox method.
- */
- getBBox: function() {
- var i = 0,
- sprite,
- bb,
- items = this.items,
- len = this.length,
- infinity = Infinity,
- minX = infinity,
- maxHeight = -infinity,
- minY = infinity,
- maxWidth = -infinity,
- maxWidthBBox, maxHeightBBox;
-
- for (; i < len; i++) {
- sprite = items[i];
- if (sprite.el) {
- bb = sprite.getBBox();
- minX = Math.min(minX, bb.x);
- minY = Math.min(minY, bb.y);
- maxHeight = Math.max(maxHeight, bb.height + bb.y);
- maxWidth = Math.max(maxWidth, bb.width + bb.x);
- }
- }
-
- return {
- x: minX,
- y: minY,
- height: maxHeight - minY,
- width: maxWidth - minX
- };
- },
-
-<span id='Ext-draw-CompositeSprite-method-setAttributes'> /**
-</span> * Iterates through all sprites calling
- * `setAttributes` on each one. For more information
- * {@link Ext.draw.Sprite} provides a description of the
- * attributes that can be set with this method.
- */
- setAttributes: function(attrs, redraw) {
- var i = 0,
- items = this.items,
- len = this.length;
-
- for (; i < len; i++) {
- items[i].setAttributes(attrs, redraw);
- }
- return this;
- },
-
-<span id='Ext-draw-CompositeSprite-method-hide'> /**
-</span> * Hides all sprites. If the first parameter of the method is true
- * then a redraw will be forced for each sprite.
- */
- hide: function(redraw) {
- var i = 0,
- items = this.items,
- len = this.length;
-
- for (; i < len; i++) {
- items[i].hide(redraw);
- }
- return this;
- },