001: /*
002: * XYConstraints.java
003: *
004: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: *
020: */
021:
022: package org.underworldlabs.swing.layouts;
023:
024: import java.io.Serializable;
025:
026: /* ----------------------------------------------------------
027: * CVS NOTE: Changes to the CVS repository prior to the
028: * release of version 3.0.0beta1 has meant a
029: * resetting of CVS revision numbers.
030: * ----------------------------------------------------------
031: */
032:
033: /**
034: *
035: * @author Takis Diakoumis
036: * @version $Revision: 1.4 $
037: * @date $Date: 2006/05/14 06:56:07 $
038: */
039: public class XYConstraints implements Cloneable, Serializable {
040:
041: protected int x;
042: protected int y;
043: protected int width;
044: protected int height;
045:
046: public XYConstraints() {
047: this (0, 0, 0, 0);
048: }
049:
050: public XYConstraints(int i, int j, int k, int l) {
051: x = i;
052: y = j;
053: width = k;
054: height = l;
055: }
056:
057: public int getX() {
058: return x;
059: }
060:
061: public void setX(int i) {
062: x = i;
063: }
064:
065: public int getY() {
066: return y;
067: }
068:
069: public void setY(int i) {
070: y = i;
071: }
072:
073: public int getWidth() {
074: return width;
075: }
076:
077: public void setWidth(int i) {
078: width = i;
079: }
080:
081: public int getHeight() {
082: return height;
083: }
084:
085: public void setHeight(int i) {
086: height = i;
087: }
088:
089: public void setConstraints(int i, int j, int k, int l) {
090: x = i;
091: y = j;
092: width = k;
093: height = l;
094: }
095:
096: public int hashCode() {
097: return x ^ y * 37 ^ width * 43 ^ height * 47;
098: }
099:
100: public boolean equals(Object obj) {
101:
102: if (obj instanceof XYConstraints) {
103: XYConstraints xyconstraints = (XYConstraints) obj;
104: return xyconstraints.x == x && xyconstraints.y == y
105: && xyconstraints.width == width
106: && xyconstraints.height == height;
107: } else
108: return false;
109:
110: }
111:
112: public Object clone() {
113: return new XYConstraints(x, y, width, height);
114: }
115:
116: public String toString() {
117: return "XYConstraints [" + x + ", " + y + ", " + width + ", "
118: + height + "]";
119: }
120:
121: } // class
|