Author: jflesch
Date: 2007-08-25 19:25:53 +0000 (Sat, 25 Aug 2007)
New Revision: 14880

Modified:
   trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/GraphBuilder.java
   trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/Node.java
Log:
Try to make the graph optimisation more efficient

Modified: trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/GraphBuilder.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/GraphBuilder.java  
2007-08-25 18:54:59 UTC (rev 14879)
+++ trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/GraphBuilder.java  
2007-08-25 19:25:53 UTC (rev 14880)
@@ -175,6 +175,16 @@
                        }
                }

+               graphPanel.guessZoom();
+               graphPanel.recomputeMinMax();
+               graphPanel.refresh();
+
+               try {
+                       Thread.sleep(3000);
+               } catch(InterruptedException e) {
+                       /* \_o< */
+               }
+
                /* === */

                plugin.setProgress(4);

Modified: trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/Node.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/Node.java  2007-08-25 
18:54:59 UTC (rev 14879)
+++ trunk/apps/Thaw/src/thaw/plugins/indexWebGrapher/Node.java  2007-08-25 
19:25:53 UTC (rev 14880)
@@ -121,11 +121,11 @@

        public final static double TIMESTEP                = 0.001;
        public final static int NMB_STEPS                  = 50000;
-       public final static double FACTOR_ATTRACTION       = 1;
+       public final static double FACTOR_ATTRACTION       = 0.5;
        public final static double FACTOR_REPULSION        = 1;
        public final static double REPULSE_LIMIT           = 10000;
        public final static double FACTOR_DECELERATION     = 1.1;
-       public final static double FACTOR_INITIAL_DISTANCE = 2.0;
+       public final static double FACTOR_INITIAL_DISTANCE = 5.0;

        /**
         * attracted by its peers/neightbours
@@ -207,7 +207,7 @@
                     it.hasNext();) {
                        Node node = (Node)it.next();

-                       if (node == this)
+                       if (node == this || linkTo.indexOf(node) >= 0)
                                continue;

                        double[] attr = attraction(node);


Reply via email to