001: /*
002: * ErdTableDependency.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.executequery.gui.erd;
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:52 $
038: */
039: public class ErdTableDependency implements Serializable {
040:
041: private ErdTable table_1;
042: private ErdTable table_2;
043:
044: /** Start x position */
045: private int xPosn_1;
046: /** Middle x position */
047: private int xPosn_2;
048: /** Final x position */
049: private int xPosn_3;
050: /** Start y position */
051: private int yPosn_1;
052: /** Middle y position */
053: private int yPosn_2;
054: /** Final y position */
055: private int yPosn_3;
056: /** The relative position of each table */
057: private int position;
058:
059: protected static final int POSITION_1 = 0;
060: protected static final int POSITION_2 = 1;
061: protected static final int POSITION_3 = 2;
062: protected static final int POSITION_4 = 3;
063: protected static final int POSITION_5 = 4;
064: protected static final int POSITION_6 = 5;
065:
066: public ErdTableDependency(ErdTable table_1, ErdTable table_2) {
067: this .table_1 = table_1;
068: this .table_2 = table_2;
069: reset();
070: }
071:
072: public void reset() {
073: xPosn_1 = -1;
074: xPosn_2 = -1;
075: xPosn_3 = -1;
076: yPosn_1 = -1;
077: yPosn_2 = -1;
078: yPosn_3 = -1;
079: position = -1;
080: }
081:
082: public int getPosition() {
083: return position;
084: }
085:
086: public void setPosition(int position) {
087: this .position = position;
088: }
089:
090: public ErdTable getTable_2() {
091: return table_2;
092: }
093:
094: public ErdTable getTable_1() {
095: return table_1;
096: }
097:
098: public int getXPosn_1() {
099: return xPosn_1;
100: }
101:
102: public int getXPosn_2() {
103: return xPosn_2;
104: }
105:
106: public int getXPosn_3() {
107: return xPosn_3;
108: }
109:
110: public int getYPosn_1() {
111: return yPosn_1;
112: }
113:
114: public int getYPosn_2() {
115: return yPosn_2;
116: }
117:
118: public int getYPosn_3() {
119: return yPosn_3;
120: }
121:
122: public void setXPosn_1(int xPosn_1) {
123: this .xPosn_1 = xPosn_1;
124: }
125:
126: public void setXPosn_2(int xPosn_2) {
127: this .xPosn_2 = xPosn_2;
128: }
129:
130: public void setXPosn_3(int xPosn_3) {
131: this .xPosn_3 = xPosn_3;
132: }
133:
134: public void setYPosn_1(int yPosn_1) {
135: this .yPosn_1 = yPosn_1;
136: }
137:
138: public void setYPosn_2(int yPosn_2) {
139: this .yPosn_2 = yPosn_2;
140: }
141:
142: public void setYPosn_3(int yPosn_3) {
143: this .yPosn_3 = yPosn_3;
144: }
145:
146: public void clean() {
147: table_1 = null;
148: table_2 = null;
149: }
150:
151: } // class
|