Пример #1
0
        internal void Draw(Graphic g)
        {
            int fh    = 30;
            int space = node.GetSpace();

            // TODO:unfinished
            if (space >= fh)
            {
                active = true;
                HTCoordS zs    = node.GetScreenCoordinates();
                String   name  = node.GetName();
                Color    color = node.GetColor();

                height = fh + 2 * node.GetSize();
                width  = space + 10 + 2 * node.GetSize();
                x      = zs.X - (width / 2) - node.GetSize();
                y      = zs.Y - (fh / 2) - node.GetSize();

                g.DrawDot(zs.X, zs.Y, 3, color);
                g.DrawLabel(x, y, width, height, name, color);
            }
            else
            {
                active = false;
            }
        }
Пример #2
0
        internal virtual int GetSpace()
        {
            int dF = -1;
            int dB = -1;

            if (father != null)
            {
                HTCoordS zF = father.GetScreenCoordinates();
                dF = zs.GetDistance(zF);
            }
            if (brother != null)
            {
                HTCoordS zB = brother.GetScreenCoordinates();
                dB = zs.GetDistance(zB);
            }

            if ((dF == -1) && (dB == -1))
            {
                return(int.MaxValue);
            }
            else if (dF == -1)
            {
                return(dB);
            }
            else if (dB == -1)
            {
                return(dF);
            }
            else
            {
                return(Math.Min(dF, dB));
            }
        }
Пример #3
0
        override internal int GetSpace()
        {
            int space = base.GetSpace();

            if (children.Count > 0)
            {
                HTDrawNode child = (HTDrawNode)children[0];
                HTCoordS   zC    = child.GetScreenCoordinates();
                int        dC    = zs.GetDistance(zC);

                if (space == -1)
                {
                    return(dC);
                }
                else
                {
                    return(Math.Min(space, dC));
                }
            }
            else
            {
                return(space);
            }
        }