Author: kono
Date: 2012-03-13 13:57:09 -0700 (Tue, 13 Mar 2012)
New Revision: 28521
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/editor/EdgeBendValueEditor.java
Log:
fixes #771 Multiple handle editing problem fixed.
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
2012-03-13 20:22:51 UTC (rev 28520)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/HandleImpl.java
2012-03-13 20:57:09 UTC (rev 28521)
@@ -134,6 +134,21 @@
// Theta is the angle between v1 and v2
final double theta = Math.acos(cosTheta);
sinTheta = Math.sin(theta);
+
+ // Check direction of rotation
+ final double slopeE = (tY-sY)/(tX-sX);
+ final double slopeH = (hY-sY)/(hX-sX);
+ if((sX<=tX && sY <= tY) || (sX>tX && sY > tY)) {
+ if(slopeE>=slopeH) {
+ cosTheta = Math.cos(-theta);
+ sinTheta = Math.sin(-theta);
+ }
+ } else {
+ if(slopeE<=slopeH) {
+ cosTheta = Math.cos(-theta);
+ sinTheta = Math.sin(-theta);
+ }
+ }
// System.out.println("** (Sx, Sy) = (" + sX + ", " + sY + ")");
// System.out.println("** (Tx, Ty) = (" + tX + ", " + tY + ")");
Modified:
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/editor/EdgeBendValueEditor.java
===================================================================
---
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/editor/EdgeBendValueEditor.java
2012-03-13 20:22:51 UTC (rev 28520)
+++
core3/impl/trunk/ding-impl/ding-presentation-impl/src/main/java/org/cytoscape/ding/impl/editor/EdgeBendValueEditor.java
2012-03-13 20:57:09 UTC (rev 28521)
@@ -126,9 +126,9 @@
dummyview.getNodeView(source).setVisualProperty(NODE_X_LOCATION, 0d);
-
dummyview.getNodeView(source).setVisualProperty(NODE_Y_LOCATION, 200d);
-
dummyview.getNodeView(target).setVisualProperty(NODE_X_LOCATION, 200d);
-
dummyview.getNodeView(target).setVisualProperty(NODE_Y_LOCATION, 0d);
+
dummyview.getNodeView(source).setVisualProperty(NODE_Y_LOCATION, 100d);
+
dummyview.getNodeView(target).setVisualProperty(NODE_X_LOCATION, 400d);
+
dummyview.getNodeView(target).setVisualProperty(NODE_Y_LOCATION, 120d);
innerPanel.setBackground(BACKGROUND_COLOR);
// Render it in this panel
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.