Dimension.js
上传用户:ahit0551
上传日期:2009-04-15
资源大小:2345k
文件大小:1k
源码类别:

xml/soap/webservice

开发平台:

Java

  1. /**
  2.  * <p>Title:  </p>
  3.  * <p>Description: </p>
  4.  * <p>Copyright: Copyright (c) xio.name 2006</p>
  5.  * @author xio
  6.  */
  7. function Dimension(width, height) {
  8.     this.width;
  9.     this.height;
  10.     if (width) {
  11.         this.width = width;
  12.     }
  13.     if (height) {
  14.         this.height = height;
  15.     }
  16. }
  17. Dimension.prototype.toString = function () {
  18.     return "[Dimension]";
  19. };
  20. Dimension.prototype.getHeight = function () {
  21.     return this.height;
  22. };
  23. Dimension.prototype.getWidth = function () {
  24.     return this.width;
  25. };
  26. Dimension.prototype.getSize = function () {
  27.     return this;
  28. };
  29. Dimension.prototype.setHeight = function (height) {
  30.     if (height) {
  31.         this.height = height;
  32.     }
  33. };
  34. Dimension.prototype.setWidth = function (width) {
  35.     if (width) {
  36.         this.width = width;
  37.     }
  38. };
  39. Dimension.prototype.setSize = function (width, height) {
  40.     if (width) {
  41.         this.width = width;
  42.     }
  43.     if (height) {
  44.         this.height = height;
  45.     }
  46. };
  47. Dimension.prototype.toString = function () {
  48.     return "[width=" + this.width + ",height=" + this.height + "]";
  49. };