EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.views]

COVERAGE SUMMARY FOR SOURCE FILE [HTMLVisitor.java]

nameclass, %method, %block, %line, %
HTMLVisitor.java0%   (0/1)0%   (0/5)0%   (0/124)0%   (0/19)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HTMLVisitor0%   (0/1)0%   (0/5)0%   (0/124)0%   (0/19)
HTMLVisitor (): void 0%   (0/1)0%   (0/6)0%   (0/2)
getHTML (): String 0%   (0/1)0%   (0/11)0%   (0/1)
visitGeneratedTextReportItem (RCommandRReportItem): void 0%   (0/1)0%   (0/33)0%   (0/3)
visitGraphicReportItem (AbstractPlotReportItem): void 0%   (0/1)0%   (0/30)0%   (0/7)
visitStaticTextReportItem (StaticTextReportItem): void 0%   (0/1)0%   (0/44)0%   (0/6)

1package de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.views;
2 
3import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.AbstractPlotReportItem;
4import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.IReportRenderingVisitor;
5import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.RCommandRReportItem;
6import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.StaticTextReportItem;
7 
8/**Visitor that generates HTML code for the report items of a report.
9 * @author groenda
10 */
11public class HTMLVisitor implements IReportRenderingVisitor {
12 
13        /** The content of the HTML body. */
14        private String content = "";
15        
16        /**Returns the generated HTML code for a report.
17         * @return a valid HTML page.
18         */
19        public String getHTML() {
20                return "<html><body>" + content + "</body></html>";
21        }
22        
23        /** {@inheritDoc}
24         */
25        public void visitStaticTextReportItem(
26                        final StaticTextReportItem staticReportItem) {
27                if (staticReportItem.isHeading()) {
28                        content += "<h2>";
29                }
30                content += staticReportItem.getText();
31                if (staticReportItem.isHeading()) {
32                        content += "</h2>";
33                }
34        }
35 
36        /** {@inheritDoc}
37         */
38        public void visitGeneratedTextReportItem(
39                        final RCommandRReportItem rCommandReportItem) {
40                content += "<b>" + rCommandReportItem.getDescription() + ":</b> ";
41                content += rCommandReportItem.getText() + "<br/>";
42        }
43 
44        /** {@inheritDoc}
45         */
46        public void visitGraphicReportItem(
47                        final AbstractPlotReportItem plotReportItem) {
48                // include generated graphics
49                if (plotReportItem.getTemporaryRasterGraphicFilename() != null) {
50                        content += "<a href=\"file:///" 
51                                + plotReportItem.getTemporaryVectorGraphicFilename() + "\">"
52                                + "<img src=\"file:///" 
53                                + plotReportItem.getTemporaryRasterGraphicFilename() + "\"/>"
54                                + "</a><br/>";
55                }
56        }
57 
58}

[all classes][de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.views]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov