gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] loom/org/fenfire/loom WheelView.java


From: Asko Soukka
Subject: [Gzz-commits] loom/org/fenfire/loom WheelView.java
Date: Thu, 03 Apr 2003 04:16:35 -0500

CVSROOT:        /cvsroot/loom
Module name:    loom
Changes by:     Asko Soukka <address@hidden>    03/04/03 04:16:34

Modified files:
        org/fenfire/loom: WheelView.java 

Log message:
        uh, way too complicated and buggy, need to find better approach..

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/loom/loom/org/fenfire/loom/WheelView.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: loom/org/fenfire/loom/WheelView.java
diff -u loom/org/fenfire/loom/WheelView.java:1.2 
loom/org/fenfire/loom/WheelView.java:1.3
--- loom/org/fenfire/loom/WheelView.java:1.2    Thu Apr  3 03:20:18 2003
+++ loom/org/fenfire/loom/WheelView.java        Thu Apr  3 04:16:34 2003
@@ -176,9 +176,9 @@
        int posConnCount = c.getConnections(1).size();
        int negRotIndex = c.getRotationIndex(-1);
        int posRotIndex = c.getRotationIndex(1);
-       double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI/2, -1,
+       double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI, -1,
                                               recursionDepth);
-       double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI/2, 1,
+       double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI, 1,
                                               recursionDepth);
 
        /** Negwards connections */
@@ -263,6 +263,7 @@
 
        double[] angles = new double[conns];
 
+       
        if (recursion == 0) {
            double rota = angle / conns;
            if (dbg) p("getRotationAngle, no recursion, rota: "+rota);
@@ -288,18 +289,27 @@
            RDFNode current = (dir<0) ? stmt.getSubject() : stmt.getObject();
            if(current != null && current instanceof Resource) {
                subconns[connCount] = getConnectionCount(c, (Resource)current,
-                                                        dir, recursion - 1);
+                                                        0, recursion - 1);
                totalsubconns += subconns[connCount];
-               if (subconns[connCount] == 0) subconns[connCount] = 1;
-           } else subconns[connCount] = 1;
+               if (subconns[connCount] == 0) {
+                   subconns[connCount] = 1;
+                   totalsubconns ++;
+               }
+           } else {
+               subconns[connCount] = 1;
+               totalsubconns++;
+           }
            connCount++;
        }
+       if (dbg) p("getRotationAngles, totalsubconns: "+totalsubconns);
 
        if ((angle / totalsubconns) >= maxrota) 
            angle = totalsubconns * maxrota;
        for (int i = 0; i < conns; i++)
-           angles[i] = angle * ((double)subconns[i] / (double)totalsubconns);
-
+           angles[i] = angle / conns;
+       /** Variable angles just didnt work */
+       //angles[i] = angle * ((double)subconns[i] / (double)totalsubconns);
+       
        if (dbg) p("getRotationAngle, angles: "+dArrayToString(angles));
 
        return angles;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]