File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -70,14 +70,16 @@ public class Sorting extends Main {
7070
7171 class ListenerClass implements ActionListener {
7272 public void actionPerformed (ActionEvent e ) {
73- if (e .getSource () == jbtRandomize )
74- System .out .println ("jbtRandomize button clicked" );
73+ if (e .getSource () == jbtRandomize ) {
74+ sortAlgo .initShuffler ();
75+ }
7576 else if (e .getSource () == jbtMerge )
7677 System .out .println ("jbtMerge button clicked" );
7778 else if (e .getSource () == jbtBubble )
7879 System .out .println ("jbtBubble button clicked" );
7980 else if (e .getSource () == jbtInsertion ) {
80- sortAlgo .startSorting (); // Sorting algotithm
81+ sortAlgo .initSorter (); // Sorting algotithm
82+ sortAlgo .initShuffler ();
8183 }
8284 else if (e .getSource () == jbtSelection )
8385 System .out .println ("jbtSelection button clicked" );
Original file line number Diff line number Diff line change @@ -20,12 +20,6 @@ public class SortingAlgorithm extends JPanel {
2020 setBackground (Color .BLACK );
2121 setPreferredSize (new Dimension (WIDTH , HEIGHT ));
2222 initBarHeight (); // initialize the height of each bar
23- //initSorter();
24- initShuffler ();
25- }
26-
27- public void startSorting () {
28- initSorter ();
2923 initShuffler ();
3024 }
3125
You can’t perform that action at this time.
0 commit comments