The goog.graphics.ext.Group Class

goog.graphics.ext.Group
> goog.graphics.ext.Element
> goog.events.EventTarget
> goog.Disposable

goog.graphics.ext.Group(group, opt_wrapper)

Wrapper for a graphics group.

group {goog.graphics.ext.Group}
Parent for this element. Can be null if this is a Graphics instance.
opt_wrapper {goog.graphics.GroupElement=}
The thin wrapper to wrap. If omitted, a new group will be created. Must be included when group is null.

.addChild(element, opt_chain)

Add an element to the group. This should be treated as package local, as it is called by the draw* methods.

element {!goog.graphics.ext.Element}
The element to add.
opt_chain {boolean=}
Whether this addition is part of a longer set of element additions.

.addEventListener(type, handler, opt_capture, opt_handlerScope)

Inherited from goog.events.EventTarget .

Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched. Supported for legacy but use goog.events.listen(src, type, handler) instead.

type {string}
The type of the event to listen for.
handler {Function|Object}
The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.
opt_capture {boolean=}
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope {Object=}
Object in whose scope to call the listener.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.clear()

Remove all drawing elements from the group.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispatchEvent(e)

Inherited from goog.events.EventTarget .

Dispatches an event (or event like object) and calls all listeners listening for events of this type. The type of the event is decided by the type property on the event object. If any of the listeners returns false OR calls preventDefault then this function will return false. If one of the capture listeners calls stopPropagation, then the bubble listeners won't fire.

e {string|Object|goog.events.Event}
Event object.
returns {boolean}
If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.forEachChild(f, opt_obj)

Calls the given function on each of this component's children in order. If {@code opt_obj} is provided, it will be used as the 'this' object in the function when called. The function should take two arguments: the child component and its 0-based index. The return value is ignored.

f {Function}
The function to call for every child component; should take 2 arguments (the child and its index).
opt_obj {Object=}
Used as the 'this' object in f when called.

.getBottom()

Inherited from goog.graphics.ext.Element .

returns {number}
The bottom coordinate of the element, in units of the parent's coordinate system.

.getCenter()

Inherited from goog.graphics.ext.Element .

returns {number}
The center coordinate of the element, in units of the parent's coordinate system.

.getCoordinateHeight()

returns {number}
The height of the element's coordinate space.

.getCoordinateWidth()

returns {number}
The width of the element's coordinate space.

.getGraphics()

Inherited from goog.graphics.ext.Element .

returns {goog.graphics.ext.Element|goog.graphics.ext.Graphics}
The graphics surface the element is a part of.

.getHeight()

Inherited from goog.graphics.ext.Element .

returns {number}
The height of the element, in units of the parent's coordinate system.

.getLeft()

Inherited from goog.graphics.ext.Element .

returns {number}
The distance from the left edge of this element to the left edge of its parent, specified in units of the parent's coordinate system.

.getMaxX()

Inherited from goog.graphics.ext.Element .

returns {number}
An estimate of the maximum x extent this element would have in a parent of no width.

.getMaxY()

Inherited from goog.graphics.ext.Element .

returns {number}
An estimate of the maximum y extent this element would have in a parent of no height.

.getMiddle()

Inherited from goog.graphics.ext.Element .

returns {number}
The middle coordinate of the element, in units of the parent's coordinate system.

.getMinHeight()

Inherited from goog.graphics.ext.Element .

returns {number}
The minimum height of the element, in units of the parent's coordinate system.

.getMinWidth()

Inherited from goog.graphics.ext.Element .

returns {number}
The minimum width of the element, in units of the parent's coordinate system.

.getParent()

Inherited from goog.graphics.ext.Element .

returns {goog.graphics.ext.Group|undefined}
The parent of this element.

.getParentEventTarget()

Inherited from goog.events.EventTarget .

Returns the parent of this event target to use for bubbling.

returns {goog.events.EventTarget}
The parent EventTarget or null if there is no parent.

.getPixelScaleX()

Inherited from goog.graphics.ext.Element .

returns {number}
Returns the number of pixels per unit in the x direction.

.getPixelScaleY()

Inherited from goog.graphics.ext.Element .

returns {number}
Returns the number of pixels per unit in the y direction.

.getRight()

Inherited from goog.graphics.ext.Element .

returns {number}
The right coordinate of the element, in units of the parent's coordinate system.

.getRotation()

Inherited from goog.graphics.ext.Element .

returns {number}
The angle of rotation of this element, in degrees.

.getTop()

Inherited from goog.graphics.ext.Element .

returns {number}
The distance from the top edge of this element to the top edge of its parent, specified in units of the parent's coordinate system.

.getWidth()

Inherited from goog.graphics.ext.Element .

returns {number}
The width of the element, in units of the parent's coordinate system.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.isParentDependent()

Inherited from goog.graphics.ext.Element .

Returns whether this element's bounds depend on its parents. This function should be treated as if it has package scope.

returns {boolean}
Whether this element's bounds depend on its parents.

.isPendingTransform()

Inherited from goog.graphics.ext.Element .

returns {boolean}
Whether this element has pending transforms.

.parentTransform()

Inherited from goog.graphics.ext.Element .

Called by the parent when the parent has transformed. Should be treated as package scope.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.removeChild(element)

Remove an element from the group.

element {goog.graphics.ext.Element}
The element to remove.

.removeEventListener(type, handler, opt_capture, opt_handlerScope)

Inherited from goog.events.EventTarget .

Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.

type {string}
The type of the event to listen for.
handler {Function|Object}
The function to handle the event. The handler can also be an object that implements the handleEvent method which takes the event object as argument.
opt_capture {boolean=}
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope {Object=}
Object in whose scope to call the listener.

.reset()

Reset the element.

.setBottom(bottom, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the bottom coordinate of the element. Overwrites any previous value of top, middle, or bottom for this element.

bottom {string|number}
The bottom coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setBounds(left, top, width, height, opt_chain)

Inherited from goog.graphics.ext.Element .

Shortcut for setting the left, top, width, and height.

left {string|number}
The left coordinate.
top {string|number}
The top coordinate.
width {string|number}
The new width value.
height {string|number}
The new height value.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setCenter(center, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the center coordinate of the element. Overwrites any previous value of left, center, or right for this element.

center {string|number}
The center coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setHeight(height, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the height of the element.

height {string|number}
The new height value.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setLeft(left, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the left coordinate of the element. Overwrites any previous value of left, center, or right for this element.

left {string|number}
The left coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setMiddle(middle, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the middle coordinate of the element. Overwrites any previous value of top, middle, or bottom for this element

middle {string|number}
The middle coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setMinHeight(minHeight)

Inherited from goog.graphics.ext.Element .

Sets the minimum height of the element.

minHeight {string|number}
The minimum height of the element.

.setMinWidth(minWidth)

Inherited from goog.graphics.ext.Element .

Sets the minimum width of the element.

minWidth {string|number}
The minimum width of the element.

.setParentEventTarget(parent)

Inherited from goog.events.EventTarget .

Sets the parent of this event target to use for bubbling.

parent {goog.events.EventTarget?}
Parent EventTarget (null if none).

.setPosition(left, top, opt_chain)

Inherited from goog.graphics.ext.Element .

Shortcut for setting the left and top position.

left {string|number}
The left coordinate.
top {string|number}
The top coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setRight(right, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the right coordinate of the element. Overwrites any previous value of left, center, or right for this element.

right {string|number}
The right coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setRotation(angle)

Inherited from goog.graphics.ext.Element .

Set the rotation of this element.

angle {number}
The angle of rotation, in degrees.

.setSize(width, height, opt_chain)

Inherited from goog.graphics.ext.Element .

Shortcut for setting the width and height.

width {string|number}
The new width value.
height {string|number}
The new height value.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setTop(top, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the top coordinate of the element. Overwrites any previous value of top, middle, or bottom for this element.

top {string|number}
The top coordinate.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.setWidth(width, opt_chain)

Inherited from goog.graphics.ext.Element .

Sets the width of the element.

width {string|number}
The new width value.
opt_chain {boolean=}
Optional flag to specify this function is part of a chain of calls and therefore transformations should be set as pending but not yet performed.

.updateChildren()

As part of the reset process, update child elements.