1 package org.enhydra.dods.wizard; 2 3 import java.io.Serializable ; 4 5 public class XYConstraints 6 implements Cloneable , Serializable { 7 int x; 8 int y; 9 int width; 10 int height; 11 public XYConstraints() { 12 this(0, 0, 0, 0); 13 } 14 15 public XYConstraints(int x, int y, int width, int height) { 16 this.x = x; 17 this.y = y; 18 this.width = width; 19 this.height = height; 20 } 21 22 public int getX() { 23 return x; 24 } 25 26 public void setX(int x) { 27 this.x = x; 28 } 29 30 public int getY() { 31 return y; 32 } 33 34 public void setY(int y) { 35 this.y = y; 36 } 37 38 public int getWidth() { 39 return width; 40 } 41 42 public void setWidth(int width) { 43 this.width = width; 44 } 45 46 public int getHeight() { 47 return height; 48 } 49 50 public void setHeight(int height) { 51 this.height = height; 52 } 53 54 public int hashCode() { 55 return x ^ y * 37 ^ width * 43 ^ height * 47; 56 } 57 58 public boolean equals(Object that) { 59 if (that instanceof XYConstraints) { 60 XYConstraints other = (XYConstraints) that; 61 62 return other.x == x && other.y == y && other.width == width 63 && other.height == height; 64 } else { 65 return false; 66 } 67 } 68 69 public Object clone() { 70 return new XYConstraints(x, y, width, height); 71 } 72 73 public String toString() { 74 return String.valueOf(String.valueOf((new StringBuffer ("XYConstraints[")).append(x).append(",").append(y).append(",").append(width).append(",").append(height).append("]"))); 75 } 76 } 77 | Popular Tags |