rectelement.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. * @fileoverview A thin wrapper around the DOM element for rectangles.
  16. * @author arv@google.com (Erik Arvidsson)
  17. */
  18. goog.provide('goog.graphics.RectElement');
  19. goog.require('goog.graphics.StrokeAndFillElement');
  20. /**
  21. * Interface for a graphics rectangle element.
  22. * You should not construct objects from this constructor. The graphics
  23. * will return an implementation of this interface for you.
  24. * @param {Element} element The DOM element to wrap.
  25. * @param {goog.graphics.AbstractGraphics} graphics The graphics creating
  26. * this element.
  27. * @param {goog.graphics.Stroke?} stroke The stroke to use for this element.
  28. * @param {goog.graphics.Fill?} fill The fill to use for this element.
  29. * @constructor
  30. * @extends {goog.graphics.StrokeAndFillElement}
  31. * @deprecated goog.graphics is deprecated. It existed to abstract over browser
  32. * differences before the canvas tag was widely supported. See
  33. * http://en.wikipedia.org/wiki/Canvas_element for details.
  34. */
  35. goog.graphics.RectElement = function(element, graphics, stroke, fill) {
  36. goog.graphics.StrokeAndFillElement.call(
  37. this, element, graphics, stroke, fill);
  38. };
  39. goog.inherits(goog.graphics.RectElement, goog.graphics.StrokeAndFillElement);
  40. /**
  41. * Update the position of the rectangle.
  42. * @param {number} x X coordinate (left).
  43. * @param {number} y Y coordinate (top).
  44. */
  45. goog.graphics.RectElement.prototype.setPosition = goog.abstractMethod;
  46. /**
  47. * Update the size of the rectangle.
  48. * @param {number} width Width of rectangle.
  49. * @param {number} height Height of rectangle.
  50. */
  51. goog.graphics.RectElement.prototype.setSize = goog.abstractMethod;