The goog.graphics.ext.Element Class

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

goog.graphics.ext.Element(group, wrapper)

Base class for a wrapper around the goog.graphics wrapper that enables more advanced functionality.

group {goog.graphics.ext.Group?}
Parent for this element.
wrapper {goog.graphics.Element}
The thin wrapper to wrap.

.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.

.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.

.getBottom()

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

.getCenter()

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

.getGraphics()

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

.getHeight()

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

.getLeft()

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()

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

.getMaxY()

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

.getMiddle()

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

.getMinHeight()

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

.getMinWidth()

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

.getParent()

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()

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

.getPixelScaleY()

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

.getRight()

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

.getRotation()

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

.getTop()

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()

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()

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()

returns {boolean}
Whether this element has pending transforms.

.parentTransform()

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.

.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. This is called when the element changes size, or when the coordinate system changes in a way that would affect pixel based rendering

.setBottom(bottom, opt_chain)

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)

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)

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)

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)

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)

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)

Sets the minimum height of the element.

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

.setMinWidth(minWidth)

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)

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)

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)

Set the rotation of this element.

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

.setSize(width, height, opt_chain)

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)

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)

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.