-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithm.java
More file actions
633 lines (549 loc) · 27.9 KB
/
Algorithm.java
File metadata and controls
633 lines (549 loc) · 27.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package algo;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.WindowConstants;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.RefineryUtilities;
/**
*
* @author Google
*/
class PlotBar extends JFrame
{
public PlotBar( String applicationTitle , String chartTitle ) throws FileNotFoundException, IOException
{
super( applicationTitle );
JFreeChart barChart = ChartFactory.createBarChart(
chartTitle,
"Algorithms",
"Execution Time(ms)",
createDataset(),
PlotOrientation.VERTICAL,
true, true, false);
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
ChartPanel chartPanel = new ChartPanel( barChart );
chartPanel.setPreferredSize(new java.awt.Dimension( 500 , 420 ) );
setContentPane( chartPanel );
}
double fileReadTime(String fileName) throws FileNotFoundException, IOException{
File file = new File(fileName);
FileInputStream fis = new FileInputStream(file);
byte[] data = new byte[(int) file.length()];
fis.read(data);
fis.close();
String str = new String(data, "UTF-8");
return Double.parseDouble((str.isEmpty()) ? "0.0" : str);
}
private CategoryDataset createDataset( ) throws FileNotFoundException, IOException
{
final String BinarySearchMergeSort = "Binary";
final String InterpolationSearchMerge = "Interpolation";
final String NormalMergeSort = "Normal";
final String TanSort = "TAN";
final DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(fileReadTime("time_binary_search_merge_sort.txt")*1000, BinarySearchMergeSort, BinarySearchMergeSort);
dataset.addValue(fileReadTime("time_interpolation_search_merge_sort.txt")*1000, InterpolationSearchMerge, InterpolationSearchMerge);
dataset.addValue(fileReadTime("time_normal_merge_sort.txt")*1000, NormalMergeSort, NormalMergeSort);
dataset.addValue(fileReadTime("time_tan_sor2.txt")*1000, TanSort, TanSort);
return dataset;
}
}
public class Algorithm extends javax.swing.JFrame implements ActionListener {
JComboBox cb;
/**
* Creates new form Algorithm
*
* @throws java.io.IOException
*/
public Algorithm() throws IOException {
setTitle("Algorithm Simulation");
initComponents();
BufferedImage wPic = ImageIO.read(ClassLoader.getSystemResource("algo/res/bubbles.jpg"));
imageLabel.setIcon(new ImageIcon(wPic));
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
comboAlgo = new javax.swing.JComboBox();
buttonOk = new javax.swing.JButton();
imageLabel = new javax.swing.JLabel();
labelExecutionTime = new javax.swing.JLabel();
labelExecutionOutput = new javax.swing.JLabel();
labelExecution = new javax.swing.JLabel();
labelExecutionTimeElapsed = new javax.swing.JLabel();
btnPlot = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setPreferredSize(new java.awt.Dimension(450, 450));
comboAlgo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Algorithm", "Binary Search Merge Sort", "Interpolation Search Merge Sort", "Normal Merge Sort", "Tan Sort" }));
comboAlgo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comboAlgoActionPerformed(evt);
}
});
buttonOk.setText("Run");
buttonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonOkActionPerformed(evt);
}
});
labelExecutionTime.setText("Time Elapsed :");
labelExecutionTime.setToolTipText("");
labelExecution.setText("Execution :");
btnPlot.setText("Plot");
btnPlot.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPlotActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(labelExecution, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(41, 41, 41)
.addComponent(labelExecutionOutput, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(labelExecutionTime, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(labelExecutionTimeElapsed, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addComponent(comboAlgo, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonOk)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnPlot)
.addGap(0, 0, Short.MAX_VALUE))))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(comboAlgo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(buttonOk)
.addComponent(btnPlot))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(imageLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(labelExecution, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
.addComponent(labelExecutionOutput, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(labelExecutionTime, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
.addComponent(labelExecutionTimeElapsed, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void comboAlgoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboAlgoActionPerformed
// TODO add your handling code here:
// cb = (JComboBox) evt.getSource();
// String comboSelected = (String) cb.getSelectedItem();
// System.out.println(comboSelected);
/// For bubbles.jpg image
switch (comboAlgo.getSelectedIndex()) {
/// For Heap.jpg image
case 0:
try {
BufferedImage wPic = ImageIO.read(ClassLoader.getSystemResource("algo/res/bubbles.jpg"));
//JLabel wIcon = new JLabel(new ImageIcon(original));
labelExecutionOutput.setText("");
imageLabel.setIcon(new ImageIcon(wPic));
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
/// For merge.jpg
case 1:
try {
BufferedImage original = ImageIO.read(ClassLoader.getSystemResource("algo/res/heap.jpg"));
//JLabel wIcon = new JLabel(new ImageIcon(original));
labelExecutionOutput.setText("");
//double widthFactor = .4;
//double heightFactor = .4;
// imageLabel.setIcon(new ImageIcon(bufferResize(original, widthFactor, heightFactor)));
imageLabel.setIcon(new ImageIcon(original));
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
/// For quick.jpg
case 2:
try {
BufferedImage original = ImageIO.read(ClassLoader.getSystemResource("algo/res/merge.jpg"));
//double widthFactor = .3;
//double heightFactor = .38;
labelExecutionOutput.setText("");
// imageLabel.setIcon(new ImageIcon(bufferResize(original, widthFactor, heightFactor)));
imageLabel.setIcon(new ImageIcon(original));
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
case 3:
try {
BufferedImage original = ImageIO.read(ClassLoader.getSystemResource("algo/res/quick.png"));
double widthFactor = .8;
double heightFactor = .9;
labelExecutionOutput.setText("");
imageLabel.setIcon(new ImageIcon(bufferResize(original, widthFactor, heightFactor)));
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
case 4:
try {
BufferedImage original = ImageIO.read(ClassLoader.getSystemResource("algo/res/chess.png"));
//double widthFactor = .5;
//double heightFactor = .5;
labelExecutionOutput.setText("");
//imageLabel.setIcon(new ImageIcon(bufferResize(original, widthFactor, heightFactor)));
imageLabel.setIcon(new ImageIcon(original));
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
default:
break;
}
}//GEN-LAST:event_comboAlgoActionPerformed
private BufferedImage bufferResize(BufferedImage original, double widthFactor, double heightFactor) {
// original image width & height
int w, h;
w = original.getHeight();
h = original.getWidth();
// System.out.println(original.getHeight());
// System.out.println(original.getWidth());
// new width & height calculated by multiplying factor
int newWidth = new Double(original.getWidth() * widthFactor).intValue();
int newHeight = new Double(original.getWidth() * heightFactor).intValue();
// new resized image
BufferedImage buffResized = new BufferedImage(newWidth, newHeight, original.getType());
Graphics2D g = buffResized.createGraphics();
g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g.drawImage(original, 0, 0, newWidth, newHeight, 0, 0, w, h, null);
g.dispose();
return buffResized;
}
private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
BufferedReader br;
/// For bubbles.jpg image
switch (comboAlgo.getSelectedIndex()) {
/// For Bubble.jpg image
case 0:
JOptionPane.showMessageDialog(null, "Select Algorithm", "Algorithm Selection", JOptionPane.INFORMATION_MESSAGE);
// labelExecutionOutput.setText("Bubble Sort");
// try {
// System.out.println(comboAlgo.getSelectedItem().toString());
// Runtime rt = Runtime.getRuntime();
// Process pr = rt.exec(new String[]{"cmd.exe",
// "/c",
// "start",
// "BubbleSort.exe"
// });
//
// } catch (IOException ex) {
// Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
// }
break;
/// For merge.jpg
case 1:
labelExecutionOutput.setText("Binary Search Merge Sort");
try {
System.out.println(comboAlgo.getSelectedItem().toString());
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(new String[]{"cmd.exe",
"/c",
"start",
"Binary_search_merge_sort.exe"
});
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
try {
String fileName = "time_binary_search_merge_sort.txt";
br = new BufferedReader(new FileReader(fileName));
File file = new File(fileName);
Thread thread;
thread = new Thread() {
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
if (file.exists()) {
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
// System.out.println(line);
labelExecutionTimeElapsed.setText(line.concat(" s"));
br.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
};
thread.start();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
/// For quick.jpg
case 2:
labelExecutionOutput.setText("Interpolation Merge Sort");
try {
System.out.println(comboAlgo.getSelectedItem().toString());
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(new String[]{"cmd.exe",
"/c",
"start",
"interpolation_search_merge_sort.exe"
});
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
try {
String fileName = "time_interpolation_search_merge_sort.txt";
br = new BufferedReader(new FileReader(fileName));
File file = new File(fileName);
Thread thread;
thread = new Thread() {
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
if (file.exists()) {
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
// System.out.println(line);
labelExecutionTimeElapsed.setText(line.concat(" s"));
br.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
};
thread.start();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
case 3:
labelExecutionOutput.setText("Normal Merge Sort");
try {
System.out.println(comboAlgo.getSelectedItem().toString());
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(new String[]{"cmd.exe",
"/c",
"start",
"normal_merge_sort.exe"
});
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
try {
String fileName = "time_normal_merge_sort.txt";
br = new BufferedReader(new FileReader(fileName));
File file = new File(fileName);
Thread thread;
thread = new Thread() {
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
if (file.exists()) {
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
// System.out.println(line);
labelExecutionTimeElapsed.setText(line.concat(" s"));
br.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
};
thread.start();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
case 4:
labelExecutionOutput.setText("TAN Sort");
try {
System.out.println(comboAlgo.getSelectedItem().toString());
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(new String[]{"cmd.exe",
"/c",
"start",
"TAN_SOR2.exe"
});
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
// time_tan_sor2.txt
try {
String fileName = "time_tan_sor2.txt";
br = new BufferedReader(new FileReader(fileName));
File file = new File(fileName);
Thread thread;
thread = new Thread() {
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
if (file.exists()) {
try {
StringBuilder sb = new StringBuilder();
String line = br.readLine();
// System.out.println(line);
labelExecutionTimeElapsed.setText(line.concat(" s"));
br.close();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
};
thread.start();
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
break;
default:
break;
}
}//GEN-LAST:event_buttonOkActionPerformed
private void btnPlotActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPlotActionPerformed
try {
// TODO add your handling code here:
// final JFXPanel fxPanel = new JFXPanel();
// panelPlot.add(fxPanel);
//
// Platform.runLater(new Runnable() {
// @Override
// public void run() {
// initFX(fxPanel);
// }
// });
PlotBar chart = new PlotBar("Algorithm Execution Plot", "Comparison of Sorting Algorithms");
chart.pack( );
RefineryUtilities.centerFrameOnScreen( chart );
chart.setVisible( true );
} catch (FileNotFoundException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}//GEN-LAST:event_btnPlotActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Algorithm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Algorithm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Algorithm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Algorithm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new Algorithm().setVisible(true);
} catch (IOException ex) {
Logger.getLogger(Algorithm.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnPlot;
private javax.swing.JButton buttonOk;
private javax.swing.JComboBox comboAlgo;
private javax.swing.JLabel imageLabel;
private javax.swing.JLabel labelExecution;
private javax.swing.JLabel labelExecutionOutput;
private javax.swing.JLabel labelExecutionTime;
private javax.swing.JLabel labelExecutionTimeElapsed;
// End of variables declaration//GEN-END:variables
@Override
public void actionPerformed(ActionEvent e) {
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}