Debian Codegraph @

src/dr/xml/XHTMLReport.java

raw symbols SCIP
1 /*
2 * XHTMLReport.java
3 *
4 * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.xml;
27
28 import dr.util.XHTMLable;
29
30
31 /**
32 * A generates an XHTML report from the elements within it.
33 *
34 * @version $Id: XHTMLReport.java,v 1.5 2005/05/24 20:26:01 rambaut Exp $
35 *
36 * @author Andrew Rambaut
37 */
38 public class XHTMLReport extends Report {
39
40 public void createReport() {
41 System.out.println("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>");
42 System.out.print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" ");
43 System.out.println("\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">");
44 System.out.println("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
45 System.out.println("<head>");
46 System.out.println("<title>");
47 System.out.println(getTitle());
48 System.out.println("</title>");
49 System.out.println("</head>");
50 System.out.println("<body>");
51
52 for (int i = 0; i < objects.size(); i++) {
53 if (objects.get(i) instanceof XHTMLable)
54 System.out.println(((XHTMLable)objects.get(i)).toXHTML());
55 else {
56 System.out.print("<p>");
57 System.out.print(objects.get(i).toString());
58 System.out.println("</p>");
59 }
60 }
61 System.out.println("</body>");
62 System.out.println("</html>");
63 }
64 }