KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > analyser > lib > gui > GuiPanelAutomaticAnalyser


1 /*
2 * CLIF is a Load Injection Framework
3 * Copyright (C) 2003 France Telecom R&D
4 * Copyright (C) 2003 INRIA
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * CLIF $Name: $
21 *
22 * Contact: clif@objectweb.org
23 */

24
25
26 /** Implementation of a graphic user interface for Automatic Analyser
27  *
28  * @author Damien Croizer
29  */

30
31 package org.objectweb.clif.analyser.lib.gui;
32
33 import java.awt.GridBagConstraints JavaDoc;
34 import java.awt.GridBagLayout JavaDoc;
35 import java.awt.GridLayout JavaDoc;
36 import java.awt.event.ActionEvent JavaDoc;
37 import java.awt.event.ActionListener JavaDoc;
38 import java.awt.Dimension JavaDoc;
39
40 import javax.swing.JButton JavaDoc;
41 import javax.swing.JComboBox JavaDoc;
42 import javax.swing.JLabel JavaDoc;
43 import javax.swing.JPanel JavaDoc;
44 import javax.swing.JScrollPane JavaDoc;
45 import javax.swing.JSplitPane JavaDoc;
46 import javax.swing.JTable JavaDoc;
47 import javax.swing.JTree JavaDoc;
48 import javax.swing.tree.DefaultMutableTreeNode JavaDoc;
49 import javax.swing.event.*;
50
51 import javax.swing.tree.*;
52 import javax.swing.JTextField JavaDoc;
53 import javax.swing.Timer JavaDoc;
54 import javax.swing.event.TableModelEvent JavaDoc;
55 import javax.swing.event.TableModelListener JavaDoc;
56 import org.objectweb.clif.analyser.Analyser;
57 import org.objectweb.clif.analyser.Hypothesis;
58 import org.objectweb.clif.analyser.AutomaticAnalyser;
59 import org.objectweb.clif.analyser.lib.gui.GuiPanelOutput;
60
61
62
63 public class GuiPanelAutomaticAnalyser extends JPanel JavaDoc implements ActionListener JavaDoc, TreeSelectionListener{
64     
65     private AutomaticAnalyser aa;
66        
67     private JTextField JavaDoc ruleField = new JTextField JavaDoc("premiere regle");
68     private JTextField JavaDoc hypField = new JTextField JavaDoc("premiere hypothese");
69     private JTextField JavaDoc testIdField = new JTextField JavaDoc("test#0");
70     private JTextField JavaDoc machineField = new JTextField JavaDoc("g-ladale");
71     private JTextField JavaDoc threadField = new JTextField JavaDoc("-1");
72     private JComboBox JavaDoc paramXCombo = null;
73     private JComboBox JavaDoc paramYCombo = null;
74     private JTextField JavaDoc intervalField = new JTextField JavaDoc("0-50000");
75     private JComboBox JavaDoc fonctionCombo = null;;
76     private JTextField JavaDoc fresultField = new JTextField JavaDoc("98");
77     
78     private JButton JavaDoc eraseButton = new JButton JavaDoc("Erase");
79     private JButton JavaDoc validButton = new JButton JavaDoc("Valid");
80
81     private JLabel JavaDoc ruleLabel = new JLabel JavaDoc("Rule name: ");
82     private JLabel JavaDoc hypLabel = new JLabel JavaDoc("Hypothesis name: ");
83     private JLabel JavaDoc caracLabel = new JLabel JavaDoc("Caracteristics...");
84     private JLabel JavaDoc testIdLabel = new JLabel JavaDoc("Test param : ");
85     private JLabel JavaDoc machineLabel = new JLabel JavaDoc("Injector param : ");
86     private JLabel JavaDoc threadLabel = new JLabel JavaDoc("Thread param : ");
87     private JLabel JavaDoc paramXLabel = new JLabel JavaDoc("X axis param : ");
88     private JLabel JavaDoc paramYLabel = new JLabel JavaDoc("Y axis param : ");
89     private JLabel JavaDoc intervalLabel = new JLabel JavaDoc("Interval param: ");
90     private JLabel JavaDoc fonctionLabel = new JLabel JavaDoc("Fonction param: ");
91     private JLabel JavaDoc fresultLabel = new JLabel JavaDoc("Fonction result param: ");
92  
93     private JPanel JavaDoc panelDroite = new JPanel JavaDoc();
94     private JPanel JavaDoc panelGauche = new JPanel JavaDoc();
95     private JPanel JavaDoc panelHaut = new JPanel JavaDoc();
96     private JPanel JavaDoc panelBas = new JPanel JavaDoc();
97     //private JPanel panelState = new JPanel();
98
private JPanel JavaDoc panelResult = new JPanel JavaDoc();
99
100
101     private JTree JavaDoc tree ;
102     private DefaultMutableTreeNode JavaDoc top;
103     private String JavaDoc[][] rules = new String JavaDoc[100][100];
104     private GridBagConstraints JavaDoc cTree = new GridBagConstraints JavaDoc();
105     private GridBagConstraints JavaDoc c = new GridBagConstraints JavaDoc();
106
107     private JScrollPane JavaDoc treePane;
108         private JScrollPane JavaDoc graphPane;
109
110     private JSplitPane JavaDoc splitPane = null;
111     private JSplitPane JavaDoc splitPaneGauche = null;
112     //private JSplitPane splitPaneState = null;
113
private JSplitPane JavaDoc splitPaneResult = null;
114
115
116     private GuiPanelOutput message = new GuiPanelOutput();
117     private static GuiPanelOutput resultat = new GuiPanelOutput();
118
119     //private GuiPanelRuleState rulestate;
120

121
122     /**
123      * The constructor which builds the Automatic Analyser graphical interface.
124      *
125      */

126     public GuiPanelAutomaticAnalyser() {
127
128         GridBagLayout JavaDoc gbg = new GridBagLayout JavaDoc();
129         GridBagConstraints JavaDoc cg = new GridBagConstraints JavaDoc();
130
131         this.setLayout(new GridLayout JavaDoc(1, 1));
132         panelBas.setLayout(gbg);
133         cg.gridx = 0;
134         cg.gridy = 0;
135         cg.gridheight = 1;
136         cg.gridwidth = 1;
137         cg.weightx = 300;
138         cg.weighty = 300;
139         cg.fill = GridBagConstraints.BOTH;
140         cg.anchor = GridBagConstraints.SOUTH;
141         message.setSize(200, 200);
142         message.setOutputText("commentaire sur l'hypothese selectionnée\n--------------------------\n");
143         panelBas.add(message, cg);
144
145         GridBagLayout JavaDoc gb = new GridBagLayout JavaDoc();
146         
147         String JavaDoc[] comboElementsdeX = new String JavaDoc[10];
148         String JavaDoc[] comboElementsdeY = new String JavaDoc[10];
149         String JavaDoc[] comboElementsdeFonction = new String JavaDoc[6];
150
151         comboElementsdeY[0] = comboElementsdeX[0] = "testing time";
152         comboElementsdeY[1] = comboElementsdeX[1] = "response time";
153         comboElementsdeY[2] = comboElementsdeX[2] = "number of users";
154         comboElementsdeY[3] = comboElementsdeX[3] = "hits per second";
155         comboElementsdeY[4] = comboElementsdeX[4] = "processor";
156         comboElementsdeY[5] = comboElementsdeX[5] = "memory";
157         comboElementsdeY[6] = comboElementsdeX[6] = "Java virtuel machine";
158         comboElementsdeY[7] = comboElementsdeX[7] = "network";
159         comboElementsdeY[8] = comboElementsdeX[8] = "disk";
160         comboElementsdeY[9] = comboElementsdeX[9] = "activity control";
161         paramXCombo = new JComboBox JavaDoc(comboElementsdeX);
162         paramYCombo = new JComboBox JavaDoc(comboElementsdeY);
163         comboElementsdeFonction[0] = "Maximum";
164         comboElementsdeFonction[1] = "Minimum";
165         comboElementsdeFonction[2] = "Mean";
166         comboElementsdeFonction[3] = "Standard deviation";
167         comboElementsdeFonction[4] = "Linar regression";
168         comboElementsdeFonction[5] = "Regular increase";
169         fonctionCombo = new JComboBox JavaDoc(comboElementsdeFonction);
170
171
172
173
174         treePane = initTree();
175
176         this.setLayout(new GridLayout JavaDoc(1, 1));
177         panelHaut.setLayout(gb);
178
179         panelDroite.setLayout(gb);
180         cTree.gridx = 0;
181         cTree.gridy = 0;
182         cTree.gridheight = 1;
183         cTree.gridwidth = 1;
184         cTree.weightx = 100;
185         cTree.weighty = 100;
186         cTree.fill = GridBagConstraints.BOTH;
187         cTree.anchor = GridBagConstraints.NORTH;
188         treePane.setSize(100, 50);
189         panelDroite.add(treePane, cTree); //treepane
190

191         c.gridx = 0;
192         c.gridy = 11;
193         c.gridheight = 1;
194         c.gridwidth = 1;
195         c.weightx = 0;
196         c.weighty = 0;
197         c.fill = GridBagConstraints.NONE;
198         c.anchor = GridBagConstraints.WEST;
199         validButton.setActionCommand("VALID");
200         validButton.addActionListener(this);
201         panelHaut.add(validButton, c);
202         c.gridx = 1;
203         c.gridy = 11;
204         c.gridheight = 1;
205         c.gridwidth = 1;
206         c.weightx = 0;
207         c.weighty = 0;
208         c.fill = GridBagConstraints.NONE;
209         c.anchor = GridBagConstraints.EAST;
210         eraseButton.setActionCommand("ERASE");
211         eraseButton.addActionListener(this);
212         panelHaut.add(eraseButton, c);
213         
214         c.gridx = 0;
215         c.gridy = 1;
216         c.gridheight = 1;
217         c.gridwidth = 1;
218         c.weightx = 0;
219         c.weighty = 0;
220         c.fill = GridBagConstraints.NONE;
221         c.anchor = GridBagConstraints.WEST;
222         panelHaut.add(ruleLabel, c);
223         c.gridx = 1;
224         c.gridy = 1;
225         c.gridheight = 1;
226         c.gridwidth = 1;
227         c.weightx = 0;
228         c.weighty = 0;
229         c.fill = GridBagConstraints.NONE;
230         c.anchor = GridBagConstraints.WEST;
231         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
232
ruleField.setSize(ruleField.getPreferredSize());
233         ruleField.setMinimumSize(ruleField.getPreferredSize());
234         ruleField.setMaximumSize(ruleField.getPreferredSize());
235         panelHaut.add(ruleField, c);
236
237         c.gridx = 0;
238         c.gridy = 2;
239         c.gridheight = 1;
240         c.gridwidth = 1;
241         c.weightx = 0;
242         c.weighty = 0;
243         c.fill = GridBagConstraints.NONE;
244         c.anchor = GridBagConstraints.WEST;
245         panelHaut.add(hypLabel, c);
246         c.gridx = 1;
247         c.gridy = 2;
248         c.gridheight = 1;
249         c.gridwidth = 1;
250         c.weightx = 0;
251         c.weighty = 0;
252         c.fill = GridBagConstraints.NONE;
253         c.anchor = GridBagConstraints.WEST;
254         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
255
hypField.setSize(hypField.getPreferredSize());
256         hypField.setMinimumSize(hypField.getPreferredSize());
257         hypField.setMaximumSize(hypField.getPreferredSize());
258         panelHaut.add(hypField, c);
259
260     
261         c.gridx = 0;
262         c.gridy = 3;
263         c.gridheight = 1;
264         c.gridwidth = 1;
265         c.weightx = 0;
266         c.weighty = 0;
267         c.fill = GridBagConstraints.NONE;
268         c.anchor = GridBagConstraints.WEST;
269         panelHaut.add(testIdLabel, c);
270         c.gridx = 1;
271         c.gridy = 3;
272         c.gridheight = 1;
273         c.gridwidth = 1;
274         c.weightx = 0;
275         c.weighty = 0;
276         c.fill = GridBagConstraints.NONE;
277         c.anchor = GridBagConstraints.WEST;
278         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
279
testIdField.setSize(testIdField.getPreferredSize());
280         testIdField.setMinimumSize(testIdField.getPreferredSize());
281         testIdField.setMaximumSize(testIdField.getPreferredSize());
282         panelHaut.add(testIdField, c);
283
284         c.gridx = 0;
285         c.gridy = 6;
286         c.gridheight = 1;
287         c.gridwidth = 1;
288         c.weightx = 0;
289         c.weighty = 0;
290         c.fill = GridBagConstraints.NONE;
291         c.anchor = GridBagConstraints.WEST;
292         panelHaut.add(paramXLabel, c);
293         c.gridx = 1;
294         c.gridy = 6;
295         c.gridheight = 1;
296         c.gridwidth = 1;
297         c.weightx = 0;
298         c.weighty = 0;
299         c.fill = GridBagConstraints.NONE;
300         c.anchor = GridBagConstraints.WEST;
301         panelHaut.add(paramXCombo, c);
302         
303         c.gridx = 0;
304         c.gridy = 7;
305         c.gridheight = 1;
306         c.gridwidth = 1;
307         c.weightx = 0;
308         c.weighty = 0;
309         c.fill = GridBagConstraints.NONE;
310         c.anchor = GridBagConstraints.WEST;
311         panelHaut.add(paramYLabel, c);
312         c.gridx = 1;
313         c.gridy = 7;
314         c.gridheight = 1;
315         c.gridwidth = 1;
316         c.weightx = 0;
317         c.weighty = 0;
318         c.fill = GridBagConstraints.NONE;
319         c.anchor = GridBagConstraints.WEST;
320         panelHaut.add(paramYCombo, c);
321         
322         c.gridx = 0;
323         c.gridy = 4;
324         c.gridheight = 1;
325         c.gridwidth = 1;
326         c.weightx = 0;
327         c.weighty = 0;
328         c.fill = GridBagConstraints.NONE;
329         c.anchor = GridBagConstraints.WEST;
330         panelHaut.add(machineLabel, c);
331         c.gridx = 1;
332         c.gridy = 4;
333         c.gridheight = 1;
334         c.gridwidth = 1;
335         c.weightx = 0;
336         c.weighty = 0;
337         c.fill = GridBagConstraints.NONE;
338         c.anchor = GridBagConstraints.WEST;
339         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
340
machineField.setSize(machineField.getPreferredSize());
341         machineField.setMinimumSize(machineField.getPreferredSize());
342         machineField.setMaximumSize(machineField.getPreferredSize());
343         panelHaut.add(machineField, c);
344
345         c.gridx = 0;
346         c.gridy = 5;
347         c.gridheight = 1;
348         c.gridwidth = 1;
349         c.weightx = 0;
350         c.weighty = 0;
351         c.fill = GridBagConstraints.NONE;
352         c.anchor = GridBagConstraints.WEST;
353         panelHaut.add(threadLabel, c);
354         c.gridx = 1;
355         c.gridy = 5;
356         c.gridheight = 1;
357         c.gridwidth = 1;
358         c.weightx = 0;
359         c.weighty = 0;
360         c.fill = GridBagConstraints.NONE;
361         c.anchor = GridBagConstraints.WEST;
362         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
363
threadField.setSize(threadField.getPreferredSize());
364         threadField.setMinimumSize(threadField.getPreferredSize());
365         threadField.setMaximumSize(threadField.getPreferredSize());
366         panelHaut.add(threadField, c);
367
368         c.gridx = 0;
369         c.gridy = 8;
370         c.gridheight = 1;
371         c.gridwidth = 1;
372         c.weightx = 0;
373         c.weighty = 0;
374         c.fill = GridBagConstraints.NONE;
375         c.anchor = GridBagConstraints.WEST;
376         panelHaut.add(intervalLabel, c);
377         c.gridx = 1;
378         c.gridy = 8;
379         c.gridheight = 1;
380         c.gridwidth = 1;
381         c.weightx = 0;
382         c.weighty = 0;
383         c.fill = GridBagConstraints.NONE;
384         c.anchor = GridBagConstraints.WEST;
385         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
386
intervalField.setSize(intervalField.getPreferredSize());
387         intervalField.setMinimumSize(intervalField.getPreferredSize());
388         intervalField.setMaximumSize(intervalField.getPreferredSize());
389         panelHaut.add(intervalField, c);
390     
391         c.gridx = 0;
392         c.gridy = 9;
393         c.gridheight = 1;
394         c.gridwidth = 1;
395         c.weightx = 0;
396         c.weighty = 0;
397         c.fill = GridBagConstraints.NONE;
398         c.anchor = GridBagConstraints.WEST;
399         panelHaut.add(fonctionLabel, c);
400         c.gridx = 1;
401         c.gridy = 9;
402         c.gridheight = 1;
403         c.gridwidth = 1;
404         c.weightx = 0;
405         c.weighty = 0;
406         c.fill = GridBagConstraints.NONE;
407         c.anchor = GridBagConstraints.WEST;
408         panelHaut.add(fonctionCombo, c);
409
410         c.gridx = 0;
411         c.gridy = 10;
412         c.gridheight = 1;
413         c.gridwidth = 1;
414         c.weightx = 0;
415         c.weighty = 0;
416         c.fill = GridBagConstraints.NONE;
417         c.anchor = GridBagConstraints.WEST;
418         panelHaut.add(fresultLabel, c);
419         c.gridx = 1;
420         c.gridy = 10;
421         c.gridheight = 1;
422         c.gridwidth = 1;
423         c.weightx = 0;
424         c.weighty = 0;
425         c.fill = GridBagConstraints.NONE;
426         c.anchor = GridBagConstraints.WEST;
427         // The following 3 lines are necessary due to a bug of JTextField size in a GridBagLayout
428
fresultField.setSize(fresultField.getPreferredSize());
429         fresultField.setMinimumSize(fresultField.getPreferredSize());
430         fresultField.setMaximumSize(fresultField.getPreferredSize());
431         panelHaut.add(fresultField, c);
432
433
434
435
436         splitPaneGauche = new JSplitPane JavaDoc(JSplitPane.VERTICAL_SPLIT, panelHaut,panelBas);
437         splitPaneGauche.setOneTouchExpandable(true);
438         panelGauche.add(splitPaneGauche);
439         
440         panelResult.setLayout(gbg);
441         resultat.setSize(200, 200);
442         resultat.setOutputText("résultats des recherches en cours\n--------------------------\n");
443         panelResult.add(resultat,cg);
444
445         splitPaneResult = new JSplitPane JavaDoc(JSplitPane.HORIZONTAL_SPLIT, panelResult,panelGauche);
446         splitPaneResult.setDividerLocation(280);
447         splitPaneResult.setOneTouchExpandable(true);
448
449
450         splitPane = new JSplitPane JavaDoc(JSplitPane.HORIZONTAL_SPLIT, splitPaneResult,panelDroite);
451         splitPane.setDividerLocation(600);
452         splitPane.setOneTouchExpandable(true);
453         //splitPane.setMaximumSize(new Dimension(600,500));
454

455
456         //rulestate = initRuleState();
457
//panelState.setLayout(gbg);
458
//panelState.add(rulestate,cg);
459

460
461         //splitPaneState = new JSplitPane(JSplitPane.VERTICAL_SPLIT, splitPane,panelState);
462
//splitPaneState.setDividerLocation(470);
463
//splitPaneState.setOneTouchExpandable(true);
464

465         add(splitPane);
466
467         
468
469     }
470
471
472    // public GuiPanelRuleState initRuleState()
473
// {
474
// GuiPanelRuleState rs = new GuiPanelRuleState();
475
// rs.addHost("rulename","state","time","numhyp","numsoluc");
476

477 // return rs;
478
// }
479

480
481
482     /**
483      * This method is called each time the user interacts with a button.<br>
484      * Depending on the button clicked, we dispatch the event.
485      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
486      */

487     public void actionPerformed(ActionEvent JavaDoc e) {
488     
489     String JavaDoc command = e.getActionCommand();
490     
491     if (command.equals("VALID")) {
492         rules = aa.newrule(ruleField.getText(),hypField.getText(),testIdField.getText(),machineField.getText(),threadField.getText(),paramXCombo.getSelectedIndex(),paramYCombo.getSelectedIndex(),intervalField.getText(),fonctionCombo.getSelectedIndex(),fresultField.getText());
493         // puis on update le trreee avec le nouveau tableau "rules"
494
updateViewTree();
495         makeComment(ruleField.getText(),hypField.getText(),testIdField.getText(),machineField.getText(),threadField.getText(),paramXCombo.getSelectedIndex(),paramYCombo.getSelectedIndex(),intervalField.getText(),fonctionCombo.getSelectedIndex(),fresultField.getText());
496
497     }else if (command.equals("ERASE")) {
498         rules = aa.erase(ruleField.getText(),hypField.getText());
499          // puis on update le trreee avec le nouveau tableau "rules"
500
updateViewTree();
501     }
502     
503     }
504     
505
506     public void valueChanged(TreeSelectionEvent e) {
507     DefaultMutableTreeNode JavaDoc node = (DefaultMutableTreeNode JavaDoc) tree.getLastSelectedPathComponent();
508     if (node == null) return;
509     if (node.isLeaf()) {
510         Hypothesis hyp = aa.wichHypNamed(node.getParent().toString(),node.toString());
511         if(hyp != null)
512         {
513             ruleField.setText(node.getParent().toString());
514             setHypothesis(hyp);
515         }
516
517     } else {
518         System.out.println("ceci est une regle");
519     }
520 }
521  
522   public void setHypothesis(Hypothesis hyp)
523     {
524     hypField.setText(hyp.getName());
525     testIdField.setText(hyp.getTest());
526     machineField.setText(hyp.getMachine());
527     threadField.setText(hyp.getThread());
528     intervalField.setText(hyp.getInterval()) ;
529     paramYCombo.setSelectedIndex(hyp.getY());
530     paramXCombo.setSelectedIndex(hyp.getX());
531     fonctionCombo.setSelectedIndex(hyp.getFonction());
532     fresultField.setText(hyp.getFresult());
533
534
535     }
536    
537      public JScrollPane JavaDoc initTree()
538     {
539     top = new DefaultMutableTreeNode JavaDoc("Existing rules");
540     createNodes(top);
541     tree = new JTree JavaDoc(top);
542     tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
543     tree.addTreeSelectionListener(this);
544     return (new JScrollPane JavaDoc(tree));
545     
546     }
547
548  
549        private void createNodes(DefaultMutableTreeNode JavaDoc top) {
550         
551     DefaultMutableTreeNode JavaDoc rep = null;
552     DefaultMutableTreeNode JavaDoc file = null;
553     
554     
555     for(int i = 0 ; rules[i][0] != null ; i++)
556         {
557         rep = new DefaultMutableTreeNode JavaDoc((String JavaDoc) (rules[i][0]));
558         top.add(rep);
559         for(int j = 1 ; rules[i][j] != null ; j++)
560             {
561             file = new DefaultMutableTreeNode JavaDoc((String JavaDoc) (rules[i][j]));
562             rep.add(file);
563             }
564         }
565     }
566
567     
568  public static void updateResult(String JavaDoc comment)
569     {
570     resultat.clearText();
571     resultat.setOutputText(comment);
572     }
573
574
575    public void updateViewTree()
576     {
577     panelDroite.remove(treePane);
578     treePane = initTree();
579     panelDroite.add(treePane,cTree);
580     panelDroite.validate();
581     }
582     
583     public void makeComment(String JavaDoc rule,String JavaDoc hyp,String JavaDoc test,String JavaDoc machine,String JavaDoc thread,int X,int Y,String JavaDoc interval,int fonction,String JavaDoc fresult)
584     {
585     String JavaDoc comment = null;
586     String JavaDoc result = null;
587     String JavaDoc[] VAR = new String JavaDoc[5];
588     String JavaDoc[] NONVAR = new String JavaDoc[5];
589
590     int i=0;
591     int j=0;
592     String JavaDoc stringX = null;
593     String JavaDoc stringY = null;
594     String JavaDoc stringFonction =null;
595
596     if(Y==0) stringY = "du temps de test";
597     if(Y==1) stringY = "du temps de reponse ";
598     if(Y==2) stringY = "du nombre d'utilisateurs connectés ";
599     if(Y==3) stringY = "du nombre de hits par seconde ";
600     if(Y==4) stringY = "du CPU ";
601     if(Y==5) stringY = "de la mémoire ";
602     if(Y==6) stringY = "de la jvm ";
603     if(Y==7) stringY = "du reseau ";
604     if(Y==8) stringY = "des acces disques ";
605
606     if(X==0) stringX = "en fonction du temps de test ";
607     if(X==1) stringX = "en fonction du temps de reponse ";
608     if(X==2) stringX = "en fonction du nombre d'utilisateurs connectés ";
609     if(X==3) stringX = "en fonction du nombre de hits par seconde ";
610     if(X==4) stringX = "en fonction du CPU ";
611     if(X==5) stringX = "en fonction de la mémoire ";
612     if(X==6) stringX = "en fonction de la jvm ";
613     if(X==7) stringX = "en fonction du reseau ";
614     if(X==7) stringX = "en fonction des acces disques ";
615
616     if(fonction==0) stringFonction = "maximum ";
617     if(fonction==1) stringFonction = "minimum ";
618     if(fonction==2) stringFonction = "moyenne ";
619     if(fonction==3) stringFonction = "ecart type ";
620     if(fonction==4) stringFonction = " regression lineaire ";
621     if(fonction==5) stringFonction = "augmentation reg ";
622
623
624
625     result = " Le moteur de recherche va \nrechercher";
626     if(test.startsWith("VAR")) VAR[i++] = "tous les tests ";
627     else NONVAR[j++] = "pour le test "+test+" ";
628     if(machine.startsWith("VAR")) VAR[i++] = "toutes les machines ";
629     else NONVAR[j++] = "pour la machine "+machine+" ";
630     if(thread.startsWith("VAR")) VAR[i++] = "tous les threads ";
631     else NONVAR[j++] = "pour le thread "+thread+" ";
632     if(interval.startsWith("VAR")) VAR[i++] = "tous les intervales ";
633     else NONVAR[j++] = "pour l'interval "+interval+" ";
634     
635     comment = "Nous cherchons des "+i+"-uplets : \n";
636
637     for(i=0; VAR[i] != null;i++) result = result + ", " + VAR[i] ;
638     result = result + "\npour lesquels la courbe "+stringY +"\n"+ stringX+"\n" ;
639     for(i=0; NONVAR[i] != null;i++) result = result + ", " + NONVAR[i] ;
640
641     result = result + ", \nobtient le résultat : " + fresult+ " lorsqu'on lui \napplique la fonction "+stringFonction+".";
642     comment = comment +result;
643
644     message.clearText();
645     message.setOutputText(comment);
646     }
647     
648 }
649
Popular Tags