graphics.SvgImageElement Extends goog.graphics.ImageElement
Thin wrapper for SVG image elements. This is an implementation of the goog.graphics.ImageElement interface. You should not construct objects from this constructor. The graphics will return the object for you.

Inheritance

Object
     goog.Disposable
          goog.events.EventTarget
               goog.graphics.Element
                    goog.graphics.ImageElement
                         goog.graphics.SvgImageElement

Constructor

goog.graphics.SvgImageElement(elementgraphics)

Parameters

element :
The DOM element to wrap.
graphics :
The graphics creating this element.

Instance Methods

Public Protected Private
setPosition(xy)
Update the position of the image.
Arguments:
x :
X coordinate (left).
y :
Y coordinate (top).
code »
setSize(widthheight)
Update the size of the image.
Arguments:
width :
Width of image.
height :
Height of image.
code »
setSource(src)
Update the source of the image.
Arguments:
src :
Source of the image.
code »
setPosition()
Update the position of the image.
code »
setSize()
Update the size of the image.
code »
setSource()
Update the source of the image.
code »
addEventListener(typehandleropt_captureopt_handlerScope)
Adds an event listener to the element.
Arguments:
type :
The type of the event to listen for.
handler :
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 :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
disposeInternal()
No description.
code »
getElement()
Returns the underlying object.
Returns:   The underlying element.
code »
getGraphics()
Returns the graphics.
Returns:   The graphics that created the element.
code »
getTransform()
No description.
Returns:   The transformation applied to this element.
code »
removeEventListener(typehandleropt_captureopt_handlerScope)
Removes an event listener from the element. The handler must be the same object as the one added. If the handler has not been added then nothing is done.
Arguments:
type :
The type of the event to listen for.
handler :
The function to handle the event. The handler can can also be an object that implements thehandleEvent method which takes the event obejct as argument.
opt_capture :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
setTransformation(xyrotatecenterXcenterY)
Set the transformation of the element.
Arguments:
x :
The x coordinate of the translation transform.
y :
The y coordinate of the translation transform.
rotate :
The angle of the rotation transform.
centerX :
The horizontal center of the rotation transform.
centerY :
The vertical center of the rotation transform.
code »
addEventListener(typehandleropt_captureopt_handlerScope)
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.
Arguments:
type :
The type of the event to listen for.
handler :
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 :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
dispatchEvent(e)
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.
Arguments:
e :
Event object.
Returns:   If anyone called preventDefault on the event object (or if any of the handlers returns false this will also return false.
code »
disposeInternal()
Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:
MyClass.prototype.disposeInternal = function() {
MyClass.superClass_.disposeInternal.call(this);
// Dispose logic for MyClass
};
code »
getParentEventTarget()
Returns the parent of this event target to use for bubbling.
Returns:   The parent EventTarget or null if there is no parent.
code »
removeEventListener(typehandleropt_captureopt_handlerScope)
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.
Arguments:
type :
The type of the event to listen for.
handler :
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 :
In DOM-compliant browsers, this determines whether the listener is fired during the capture or bubble phase of the event.
opt_handlerScope :
Object in whose scope to call the listener.
code »
setParentEventTarget(parent)
Sets the parent of this event target to use for bubbling.
Arguments:
parent :
Parent EventTarget (null if none).
code »
dispose()
No description.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. For example:
mypackage.MyClass = function() {
goog.Disposable.call(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
mypackage.MyClass.superClass_.disposeInternal.call(this);
// Dispose logic specific to MyClass.
...
};
code »
getDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »
isDisposed()
No description.
Returns:   Whether the object has been disposed of.
code »

Instance Properties

element_ :
The native browser element this class wraps.
Code »
The graphics object that contains this element.
Code »
The transformation applied to this element.
Code »
customEvent_ :
Used to tell if an event is a real event in goog.events.listen() so we don't get listen() calling addEventListener() and vice-versa.
Code »
parentEventTarget_ :
Parent event target, used during event bubbling.
Code »
disposed_ :
Whether the object has been disposed of.
Code »

Package graphics

Package Reference