Exemple #1
0
 protected internal virtual void  checkForValidAlignment()
 {
     if (x == -1)
     {
         ViewGraphNode r = this;
         while (!r.parents.isEmpty())
         {
             r = (ViewGraphNode)parents.get(0);
         }
         r.calculateAlignment(0, 0);
     }
 }
Exemple #2
0
 protected internal virtual void  calculateAlignment(int offsetX, int offsetY)
 {
     x = SubtreeWidth / 2 - 1 + offsetX;
     if (x < offsetX)
     {
         x = offsetX;
     }
     y = offsetY;
     offsetY++;
     for (Iterator it = childs.iterator(); it.hasNext();)
     {
         ViewGraphNode sub = (ViewGraphNode)it.next();
         sub.calculateAlignment(offsetX, offsetY);
         offsetX += sub.SubtreeWidth;
         if (sub.SubtreeWidth == 0)
         {
             offsetX += 2;
         }
     }
 }