Path: blob/trunk/third_party/closure/goog/graphics/imageelement.js
2868 views
// Copyright 2007 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.131415/**16* @fileoverview A thin wrapper around the DOM element for images.17*/181920goog.provide('goog.graphics.ImageElement');2122goog.require('goog.graphics.Element');23242526/**27* Interface for a graphics image element.28* You should not construct objects from this constructor. Instead,29* you should use {@code goog.graphics.Graphics.drawImage} and it30* will return an implementation of this interface for you.31*32* @param {Element} element The DOM element to wrap.33* @param {goog.graphics.AbstractGraphics} graphics The graphics creating34* this element.35* @constructor36* @extends {goog.graphics.Element}37* @deprecated goog.graphics is deprecated. It existed to abstract over browser38* differences before the canvas tag was widely supported. See39* http://en.wikipedia.org/wiki/Canvas_element for details.40*/41goog.graphics.ImageElement = function(element, graphics) {42goog.graphics.Element.call(this, element, graphics);43};44goog.inherits(goog.graphics.ImageElement, goog.graphics.Element);454647/**48* Update the position of the image.49*50* @param {number} x X coordinate (left).51* @param {number} y Y coordinate (top).52*/53goog.graphics.ImageElement.prototype.setPosition = goog.abstractMethod;545556/**57* Update the size of the image.58*59* @param {number} width Width of image.60* @param {number} height Height of image.61*/62goog.graphics.ImageElement.prototype.setSize = goog.abstractMethod;636465/**66* Update the source of the image.67* @param {string} src Source of the image.68*/69goog.graphics.ImageElement.prototype.setSource = goog.abstractMethod;707172