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 [AbstractHtmlRReportView.java]

nameclass, %method, %block, %line, %
AbstractHtmlRReportView.java0%   (0/1)0%   (0/2)0%   (0/65)0%   (0/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractHtmlRReportView0%   (0/1)0%   (0/2)0%   (0/65)0%   (0/17)
AbstractHtmlRReportView (): void 0%   (0/1)0%   (0/3)0%   (0/2)
setInput (Collection): void 0%   (0/1)0%   (0/62)0%   (0/15)

1package de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.views;
2 
3import java.util.ArrayList;
4import java.util.Collection;
5 
6 
7import de.uka.ipd.sdq.sensorframework.entities.SensorAndMeasurements;
8import de.uka.ipd.sdq.sensorframework.visualisation.IVisualisation;
9import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reportitems.IReportItem;
10import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.reports.RReport;
11import de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.RConnection;
12 
13/**Abstract class with basic capabilities to show reports containing 
14 * data of the SensorFramework in R.
15 * @author groenda
16 */
17public abstract class AbstractHtmlRReportView extends AbstractHtmlReportView 
18                implements IVisualisation < SensorAndMeasurements > {
19 
20        /**Delegates the creation to the ancestor and does nothing else.
21         */
22        public AbstractHtmlRReportView() {
23                super();
24        }
25        
26        /**Used to ask for the report that should be displayed.
27         * @return The report that should be displayed by this view.
28         */
29        abstract public RReport getReport();
30        
31        /** {@inheritDoc}
32         */
33        public void setInput(final Collection < SensorAndMeasurements > c) {
34                if (RConnection.isEngineAvailable()) {
35                        if (c.isEmpty()) {
36                                browser.setText("<html><body><h1>Error! </h1>At least "
37                                                + "the measurements for one sensor must be "
38                                                + "available!</body></html>");
39                        } else {
40                                if (getReport() == null) {
41                                        browser.setText("<html><body><h1>Error!</h1> There "
42                                                        + "is no report associated with this view. "
43                                                        + "Ask the developer to correct this error. "
44                                                        + "</body></html>");
45                                } else {
46                                        RConnection rConnection = RConnection.getRConnection();
47                                        ArrayList<IReportItem> items = 
48                                                getReport().prepareReportItems(c, rConnection);
49                
50                                        HTMLVisitor visitor = new HTMLVisitor();
51                                        for (IReportItem item : items) {
52                                                item.generateData(rConnection);
53                                                item.visit(visitor);
54                                        }
55                                        browser.setText(visitor.getHTML());
56                                }
57                        }
58                } else {
59                        browser.setText("<html><body><h1>Error! </h1>Connection to R "
60                                        + "engine is not available!</body></html>");
61                }
62        }
63}

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