01: package org.enhydra.tool.swing.layout;
02:
03: import java.io.Serializable;
04:
05: public class XYConstraints implements Cloneable, Serializable {
06:
07: int x;
08: int y;
09: int width;
10: int height;
11:
12: public XYConstraints() {
13: this (0, 0, 0, 0);
14: }
15:
16: public XYConstraints(int x, int y, int width, int height) {
17: this .x = x;
18: this .y = y;
19: this .width = width;
20: this .height = height;
21: }
22:
23: public int getX() {
24: return x;
25: }
26:
27: public void setX(int x) {
28: this .x = x;
29: }
30:
31: public int getY() {
32: return y;
33: }
34:
35: public void setY(int y) {
36: this .y = y;
37: }
38:
39: public int getWidth() {
40: return width;
41: }
42:
43: public void setWidth(int width) {
44: this .width = width;
45: }
46:
47: public int getHeight() {
48: return height;
49: }
50:
51: public void setHeight(int height) {
52: this .height = height;
53: }
54:
55: public int hashCode() {
56: return x ^ y * 37 ^ width * 43 ^ height * 47;
57: }
58:
59: public boolean equals(Object that) {
60: if (that instanceof XYConstraints) {
61: XYConstraints other = (XYConstraints) that;
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(
75: "XYConstraints[")).append(x).append(",").append(y)
76: .append(",").append(width).append(",").append(height)
77: .append("]")));
78: }
79: }
|