Пример #1
0
  public void calcDimsAndStartPts(LinkedList llist, draw d) {
    /*  Determines the following variables Lenx, Leny, Startx, Starty,
    TitleStarty   */
    // Task: Calculate the length and height of a node and its starting point.
    //   It also computes the y-coordinate of the title

    double TitleToSSGap, MinGt, MaxGt, Diam, MinTitlex, MaxTitlex;
    int NumNodes, NumLines;
    super.calcDimsAndStartPts(llist, d);
    // With circular nodes, not adding Textheight works better to finetune the circle size
    Lenx = Maxstringlength - .02;
    Leny = ((linespernode + 1) * Textheight) + ((linespernode - 1) * (0.5 * Textheight));
    TDx = (Lenx + Leny) / 5.0; // Height is a third of their average *)
    TDy = TDx / Math.sqrt(3);
    TitleToSSGap = 2 * Titleheight;
    NumLines = title.size();
    Startx = 0.0;
    Starty =
        Topy
            - IconHeight
            - IconToTitleGap
            - (NumLines * Titleheight)
            - ((NumLines - 1) * (0.5 * Titleheight))
            - TitleToSSGap
            - (Lenx / 2.0)
            - .15;
    TitleStarty = (Topy - IconHeight - IconToTitleGap - Titleheight) + .05;
  }