textelement.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 text elements.
  16. * @author arv@google.com (Erik Arvidsson)
  17. */
  18. goog.provide('goog.graphics.TextElement');
  19. goog.require('goog.graphics.StrokeAndFillElement');
  20. /**
  21. * Interface for a graphics text element.
  22. * You should not construct objects from this constructor. The graphics
  23. * will return an implementation of this interface for you.
  24. *
  25. * @param {Element} element The DOM element to wrap.
  26. * @param {goog.graphics.AbstractGraphics} graphics The graphics creating
  27. * this element.
  28. * @param {goog.graphics.Stroke?} stroke The stroke to use for this element.
  29. * @param {goog.graphics.Fill?} fill The fill to use for this element.
  30. * @constructor
  31. * @extends {goog.graphics.StrokeAndFillElement}
  32. * @deprecated goog.graphics is deprecated. It existed to abstract over browser
  33. * differences before the canvas tag was widely supported. See
  34. * http://en.wikipedia.org/wiki/Canvas_element for details.
  35. */
  36. goog.graphics.TextElement = function(element, graphics, stroke, fill) {
  37. goog.graphics.StrokeAndFillElement.call(
  38. this, element, graphics, stroke, fill);
  39. };
  40. goog.inherits(goog.graphics.TextElement, goog.graphics.StrokeAndFillElement);
  41. /**
  42. * Update the displayed text of the element.
  43. * @param {string} text The text to draw.
  44. */
  45. goog.graphics.TextElement.prototype.setText = goog.abstractMethod;