Ejemplo n.º 1
0
        /** Print HTML version of this node to output stream */
        public string toHTML()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<TABLE><TR>");

            if (getChildCount() <= 1)
            {
                sb.Append("<TD>");
            }
            else
            {
                sb.Append("<TD COLSPAN=\"");
                sb.Append(getChildCount());
                sb.Append("\">");
            }

            sb.Append(getID());
            sb.Append(" ");
            sb.Append(_labeling);
            if (_final_flag)
            {
                sb.Append("!");
            }
            sb.Append("</TD></TR>");
            if (getChildCount() > 0)
            {
                sb.Append("<TR>");
                //for (child_iterator it = children_begin(); it != children_end(); ++it)
                for (SafraTreeNode cit = children_begin(); cit != children_end(); cit = cit.increment())
                {
                    sb.Append("<TD>");
                    sb.Append(cit.toHTML());
                    sb.Append("</TD>");
                }
                sb.Append("</TR>");
            }
            sb.Append("</TABLE>");
            return(sb.ToString());
        }