[power-architect] r4056 committed - Fixed bug 3075 : changes made to solve the issue of straighten the rel...

4 views
Skip to first unread message

codesite...@google.com

unread,
Apr 16, 2013, 10:47:51 AM4/16/13
to architec...@googlegroups.com
Revision: 4056
Author: ki...@sqlpower.ca
Date: Tue Apr 16 07:47:30 2013
Log: Fixed bug 3075 : changes made to solve the issue of straighten
the relationship line when the parent faces left/right ( e.g two tables are
vertically overlap).
http://code.google.com/p/power-architect/source/detail?r=4056

Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/BasicRelationshipUI.java

=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/BasicRelationshipUI.java
Wed Nov 24 12:21:21 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/BasicRelationshipUI.java
Tue Apr 16 07:47:30 2013
@@ -1141,9 +1141,21 @@

// actual work to adjust the connection point
if (isPkConnectionPoint) {
-
relationship.setPkConnection(((double)lastValidPoint.getX() /
relationship.getPkTable().getWidth()));
- } else {
-
relationship.setFkConnection(((double)lastValidPoint.getX() /
relationship.getFkTable().getWidth()));
+ if((relationship.getOrientation() &
Relationship.PARENT_FACES_LEFT) > 0 ||
+ (relationship.getOrientation() &
Relationship.PARENT_FACES_RIGHT )> 0 ){
+
relationship.setPkConnection(((double)lastValidPoint.getY() /
relationship.getPkTable().getHeight()));
+ }
+ else{
+
relationship.setPkConnection(((double)lastValidPoint.getX() /
relationship.getPkTable().getWidth()));
+ }
+ }else{
+ if((relationship.getOrientation() &
Relationship.PARENT_FACES_LEFT) > 0 ||
+ (relationship.getOrientation() &
Relationship.PARENT_FACES_RIGHT ) > 0 ){
+
relationship.setFkConnection(((double)lastValidPoint.getY() /
relationship.getFkTable().getHeight()));
+ }
+ else {
+
relationship.setFkConnection(((double)lastValidPoint.getX() /
relationship.getFkTable().getWidth()));
+ }
}

// sets up for the next connection point, assumes
Reply all
Reply to author
Forward
0 new messages