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

COVERAGE SUMMARY FOR SOURCE FILE [CopyClipboardAsR.java]

nameclass, %method, %block, %line, %
CopyClipboardAsR.java0%   (0/1)0%   (0/3)0%   (0/84)0%   (0/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CopyClipboardAsR0%   (0/1)0%   (0/3)0%   (0/84)0%   (0/16)
CopyClipboardAsR (ISeriesExporter): void 0%   (0/1)0%   (0/9)0%   (0/4)
exportValues (XYSeries): void 0%   (0/1)0%   (0/69)0%   (0/10)
run (): void 0%   (0/1)0%   (0/6)0%   (0/2)

1package de.uka.ipd.sdq.sensorframework.visualisation.jfreechartvisualisation;
2 
3import org.eclipse.jface.action.Action;
4import org.eclipse.swt.dnd.Clipboard;
5import org.eclipse.swt.dnd.TextTransfer;
6import org.eclipse.swt.dnd.Transfer;
7import org.eclipse.ui.PlatformUI;
8import org.jfree.data.xy.XYDataItem;
9import org.jfree.data.xy.XYSeries;
10 
11public class CopyClipboardAsR extends Action {
12 
13        private ISeriesExporter viewer;
14 
15        public CopyClipboardAsR(ISeriesExporter freeChartHistogramViewer) {
16                super();
17                setText("Copy Values to Clipboard using R format...");
18                this.viewer = freeChartHistogramViewer;
19        }
20 
21        @Override
22        public void run() {
23                exportValues(viewer.getSeries());
24        }
25 
26        private void exportValues(XYSeries series) {
27                Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay());
28                StringBuffer plainText = new StringBuffer("c(");
29                for(Object item : series.getItems()){
30                        XYDataItem data = (XYDataItem) item;
31                        plainText.append(data.getY()+",");
32                }
33                TextTransfer textTransfer = TextTransfer.getInstance();
34                clipboard.setContents(new String[] { plainText.substring(0, plainText.length()-1)+")" },
35                                new Transfer[] { textTransfer });
36                clipboard.dispose();
37        }
38}

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