/[loom]/loom/org/fenfire/loom/WheelView.java
ViewVC logotype

Diff of /loom/org/fenfire/loom/WheelView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by humppake, Thu Apr 3 08:20:18 2003 UTC revision 1.3 by humppake, Thu Apr 3 09:16:34 2003 UTC
# Line 176  public class WheelView implements View { Line 176  public class WheelView implements View {
176          int posConnCount = c.getConnections(1).size();          int posConnCount = c.getConnections(1).size();
177          int negRotIndex = c.getRotationIndex(-1);          int negRotIndex = c.getRotationIndex(-1);
178          int posRotIndex = c.getRotationIndex(1);          int posRotIndex = c.getRotationIndex(1);
179          double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI/2, -1,          double[] negRotAngles = getRotationAngles(c, c.focus, Math.PI, -1,
180                                                 recursionDepth);                                                 recursionDepth);
181          double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI/2, 1,          double[] posRotAngles = getRotationAngles(c, c.focus, Math.PI, 1,
182                                                 recursionDepth);                                                 recursionDepth);
183    
184          /** Negwards connections */          /** Negwards connections */
# Line 263  public class WheelView implements View { Line 263  public class WheelView implements View {
263    
264          double[] angles = new double[conns];          double[] angles = new double[conns];
265    
266            
267          if (recursion == 0) {          if (recursion == 0) {
268              double rota = angle / conns;              double rota = angle / conns;
269              if (dbg) p("getRotationAngle, no recursion, rota: "+rota);              if (dbg) p("getRotationAngle, no recursion, rota: "+rota);
# Line 288  public class WheelView implements View { Line 289  public class WheelView implements View {
289              RDFNode current = (dir<0) ? stmt.getSubject() : stmt.getObject();              RDFNode current = (dir<0) ? stmt.getSubject() : stmt.getObject();
290              if(current != null && current instanceof Resource) {              if(current != null && current instanceof Resource) {
291                  subconns[connCount] = getConnectionCount(c, (Resource)current,                  subconns[connCount] = getConnectionCount(c, (Resource)current,
292                                                           dir, recursion - 1);                                                           0, recursion - 1);
293                  totalsubconns += subconns[connCount];                  totalsubconns += subconns[connCount];
294                  if (subconns[connCount] == 0) subconns[connCount] = 1;                  if (subconns[connCount] == 0) {
295              } else subconns[connCount] = 1;                      subconns[connCount] = 1;
296                        totalsubconns ++;
297                    }
298                } else {
299                    subconns[connCount] = 1;
300                    totalsubconns++;
301                }
302              connCount++;              connCount++;
303          }          }
304            if (dbg) p("getRotationAngles, totalsubconns: "+totalsubconns);
305    
306          if ((angle / totalsubconns) >= maxrota)          if ((angle / totalsubconns) >= maxrota)
307              angle = totalsubconns * maxrota;              angle = totalsubconns * maxrota;
308          for (int i = 0; i < conns; i++)          for (int i = 0; i < conns; i++)
309              angles[i] = angle * ((double)subconns[i] / (double)totalsubconns);              angles[i] = angle / conns;
310            /** Variable angles just didnt work */
311            //angles[i] = angle * ((double)subconns[i] / (double)totalsubconns);
312            
313          if (dbg) p("getRotationAngle, angles: "+dArrayToString(angles));          if (dbg) p("getRotationAngle, angles: "+dArrayToString(angles));
314    
315          return angles;          return angles;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26