| 1 |
// Copyright 2007 The Closure Library Authors. All Rights Reserved. |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS-IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
|
| 16 |
/** |
| 17 |
* @fileoverview A thin wrapper around the DOM element for images. |
| 18 |
*/ |
| 19 |
|
| 20 |
|
| 21 |
goog.provide('goog.graphics.ImageElement'); |
| 22 |
|
| 23 |
goog.require('goog.graphics.Element'); |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
/** |
| 28 |
* Interface for a graphics image element. |
| 29 |
* You should not construct objects from this constructor. Instead, |
| 30 |
* you should use {@code goog.graphics.Graphics.drawImage} and it |
| 31 |
* will return an implementation of this interface for you. |
| 32 |
* |
| 33 |
* @param {Element} element The DOM element to wrap. |
| 34 |
* @param {goog.graphics.AbstractGraphics} graphics The graphics creating |
| 35 |
* this element. |
| 36 |
* @constructor |
| 37 |
* @extends {goog.graphics.Element} |
| 38 |
* @deprecated goog.graphics is deprecated. It existed to abstract over browser |
| 39 |
* differences before the canvas tag was widely supported. See |
| 40 |
* http://en.wikipedia.org/wiki/Canvas_element for details. |
| 41 |
*/ |
| 42 |
goog.graphics.ImageElement = function(element, graphics) { |
| 43 |
goog.graphics.Element.call(this, element, graphics); |
| 44 |
}; |
| 45 |
goog.inherits(goog.graphics.ImageElement, goog.graphics.Element); |
| 46 |
|
| 47 |
|
| 48 |
/** |
| 49 |
* Update the position of the image. |
| 50 |
* |
| 51 |
* @param {number} x X coordinate (left). |
| 52 |
* @param {number} y Y coordinate (top). |
| 53 |
*/ |
| 54 |
goog.graphics.ImageElement.prototype.setPosition = goog.abstractMethod; |
| 55 |
|
| 56 |
|
| 57 |
/** |
| 58 |
* Update the size of the image. |
| 59 |
* |
| 60 |
* @param {number} width Width of image. |
| 61 |
* @param {number} height Height of image. |
| 62 |
*/ |
| 63 |
goog.graphics.ImageElement.prototype.setSize = goog.abstractMethod; |
| 64 |
|
| 65 |
|
| 66 |
/** |
| 67 |
* Update the source of the image. |
| 68 |
* @param {string} src Source of the image. |
| 69 |
*/ |
| 70 |
goog.graphics.ImageElement.prototype.setSource = goog.abstractMethod; |