1 29 30 package org.objectweb.clif.analyser.lib.gui; 31 32 import ptolemy.plot.Plot; 33 import java.awt.*; 34 import java.io.File ; 35 import java.io.FileInputStream ; 36 import java.io.FileNotFoundException ; 37 import java.io.IOException ; 38 import org.objectweb.clif.analyser.View; 39 40 41 42 43 48 49 public class GraphAnalyser extends Frame { 50 51 52 public GraphAnalyser() { 53 } 54 55 public Plot init() 56 { 57 Plot rightPlot = new Plot(); 58 rightPlot.clear(true); 59 rightPlot.setSize(590,390); 60 rightPlot.setTitle(""); 61 return rightPlot; 62 } 63 64 65 public Plot update(View vue) 66 { 67 Plot rightPlot = new Plot(); 68 String input = new String ("report/"+vue.getTestId() + "/vues/" + vue.getName() + ".view"); 69 File file = new File (input); 70 try { 71 rightPlot.clear(true); 72 rightPlot.read(new FileInputStream (file)); 73 } catch (FileNotFoundException ex) { 74 System.out.println("File not found: " + file + " : " + ex); 75 } catch (IOException ex) { 76 System.out.println("Error reading input: " + file + 77 " : " + ex); 78 } 79 rightPlot.setTitle("Test name: "+ vue.getTestId() + " View name: "+ vue.getName()); 81 rightPlot.setXLabel("testing time in ms"); 82 rightPlot.setYLabel("hits per second"); 83 rightPlot.setSize(590,390); 84 return rightPlot; 85 } 86 87 88 } 89 | Popular Tags |