Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3880/src/org/mediavirus/graphl/layout
Modified Files:
RepulsionNodeLayouter.java GraphlLayoutStrategy.java
Log Message:
some adjustments to layout algorithm
Index: GraphlLayoutStrategy.java
===================================================================
RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/GraphlLayoutStrategy.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** GraphlLayoutStrategy.java 17 Aug 2005 15:52:49 -0000 1.11
--- GraphlLayoutStrategy.java 24 Aug 2005 16:05:54 -0000 1.12
***************
*** 101,108 ****
* Returns <code>true</code> if more steps in the layout should be executed.
*
! * @return <code>true</code> if more steps should be executed
*/
public boolean shouldExecuteStep() {
! return !(damper<0.2 && damping && graphManager.maxMotion<0.5);
}
/**
--- 101,109 ----
* Returns <code>true</code> if more steps in the layout should be executed.
*
! * @return <code>true</code> if more steps should be executed
*/
public boolean shouldExecuteStep() {
! //System.out.println(damping + ":" + damper + ":" + graphManager.maxMotion);
! return !(damper<0.2 && damping && graphManager.maxMotion<1.0);
}
/**
***************
*** 173,183 ****
//We never want the damper to be negative though
if ((graphManager.maxMotion<0.2 || (graphManager.maxMotion>1 && damper<0.9)) && damper > 0.01)
! damper-=0.01;
//If we've slowed down significanly, damp more aggresively (then the line two below)
! else if (graphManager.maxMotion<0.4 && damper > 0.003)
! damper-=0.003;
//If max motion is pretty high, and we just started damping, then only damp slightly
else if(damper>0.0001)
! damper -=0.0001;
}
}
--- 174,184 ----
//We never want the damper to be negative though
if ((graphManager.maxMotion<0.2 || (graphManager.maxMotion>1 && damper<0.9)) && damper > 0.01)
! damper-=0.1;
//If we've slowed down significanly, damp more aggresively (then the line two below)
! else if (graphManager.maxMotion<0.8 && damper > 0.003)
! damper-=0.03;
//If max motion is pretty high, and we just started damping, then only damp slightly
else if(damper>0.0001)
! damper -=0.001;
}
}
Index: RepulsionNodeLayouter.java
===================================================================
RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/layout/RepulsionNodeLayouter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** RepulsionNodeLayouter.java 17 Aug 2005 15:52:49 -0000 1.8
--- RepulsionNodeLayouter.java 24 Aug 2005 16:05:54 -0000 1.9
***************
*** 48,52 ****
dy=Math.random();
}
! else if (currentLengthSquared<600*600) { // 600, because we don't want deleted nodes to fly too far away
dx=deltaX/currentLengthSquared; // If it was sqrt(len) then a single node surrounded by many others will
dy=deltaY/currentLengthSquared; // always look like a circle. This might look good at first, but I think
--- 48,52 ----
dy=Math.random();
}
! else if (currentLengthSquared<300*300) { // 600, because we don't want deleted nodes to fly too far away
dx=deltaX/currentLengthSquared; // If it was sqrt(len) then a single node surrounded by many others will
dy=deltaY/currentLengthSquared; // always look like a circle. This might look good at first, but I think
|