home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / rt.jar / java / awt / Dimension.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-23  |  1.4 KB  |  49 lines

  1. package java.awt;
  2.  
  3. import java.io.Serializable;
  4.  
  5. public class Dimension implements Serializable {
  6.    public int width;
  7.    public int height;
  8.    private static final long serialVersionUID = 4723952579491349524L;
  9.  
  10.    public Dimension() {
  11.       this(0, 0);
  12.    }
  13.  
  14.    public Dimension(Dimension var1) {
  15.       this(var1.width, var1.height);
  16.    }
  17.  
  18.    public Dimension(int var1, int var2) {
  19.       this.width = var1;
  20.       this.height = var2;
  21.    }
  22.  
  23.    public Dimension getSize() {
  24.       return new Dimension(this.width, this.height);
  25.    }
  26.  
  27.    public void setSize(Dimension var1) {
  28.       this.setSize(var1.width, var1.height);
  29.    }
  30.  
  31.    public void setSize(int var1, int var2) {
  32.       this.width = var1;
  33.       this.height = var2;
  34.    }
  35.  
  36.    public boolean equals(Object var1) {
  37.       if (var1 instanceof Dimension) {
  38.          Dimension var2 = (Dimension)var1;
  39.          return this.width == var2.width && this.height == var2.height;
  40.       } else {
  41.          return false;
  42.       }
  43.    }
  44.  
  45.    public String toString() {
  46.       return this.getClass().getName() + "[width=" + this.width + ",height=" + this.height + "]";
  47.    }
  48. }
  49.