28
28
import Adicionales .Social ;
29
29
import Ordenar .AdicionalesSorts ;
30
30
import Ordenar .FinSort ;
31
- import Ordenar .Algoritmos .BidirectionalBubble ;
32
- import Ordenar .Algoritmos .BinaryInsertion ;
33
- import Ordenar .Algoritmos .Bitonic ;
34
- import Ordenar .Algoritmos .Bogo ;
35
- import Ordenar .Algoritmos .Bubble ;
36
- import Ordenar .Algoritmos .BubbleOptimized ;
37
- import Ordenar .Algoritmos .BucketSort ;
38
- import Ordenar .Algoritmos .Cocktail ;
39
- import Ordenar .Algoritmos .Cycle ;
40
- import Ordenar .Algoritmos .Gnome ;
41
- import Ordenar .Algoritmos .Gravity ;
42
- import Ordenar .Algoritmos .Heap ;
43
- import Ordenar .Algoritmos .Inserccion ;
44
- import Ordenar .Algoritmos .Introsort ;
45
- import Ordenar .Algoritmos .IterativeMerge ;
46
- import Ordenar .Algoritmos .IterativeQuick ;
47
- import Ordenar .Algoritmos .Merge ;
48
- import Ordenar .Algoritmos .OddEven ;
49
- import Ordenar .Algoritmos .Pancake ;
50
- import Ordenar .Algoritmos .Pigeonhole ;
51
- import Ordenar .Algoritmos .Quick ;
52
- import Ordenar .Algoritmos .Radix ;
53
- import Ordenar .Algoritmos .RecursiveBubble ;
54
- import Ordenar .Algoritmos .RecursiveInsertion ;
55
- import Ordenar .Algoritmos .RecursiveSelection ;
56
- import Ordenar .Algoritmos .Selection ;
57
- import Ordenar .Algoritmos .DoubleSelection ;
58
- import Ordenar .Algoritmos .Shell ;
59
- import Ordenar .Algoritmos .Stooge ;
60
- import Ordenar .Algoritmos .Tim ;
31
+ import Ordenar .Algoritmos .*;
61
32
62
33
/**
63
34
* @author Javier Delgado Rodriguez
64
35
*/
65
36
public class MainAplicacion extends AdicionalesSorts {
37
+
66
38
// NOMBRES DE LOS ALGORITMOS DE ORDENACION
67
39
final String [] nombreAlgoritmos = {
68
40
"Bidirectional Bubble" ,
@@ -95,6 +67,7 @@ public class MainAplicacion extends AdicionalesSorts {
95
67
"Shell" ,
96
68
"Stooge" ,
97
69
"Tim" };
70
+
98
71
// DISEÑO GRAFICO DE LAS ANIMACIONES
99
72
final static String [] nombreEstilosGraficos = {
100
73
"Barras clasicas" ,
@@ -110,49 +83,49 @@ public class MainAplicacion extends AdicionalesSorts {
110
83
private JFrame frame = new JFrame ();
111
84
112
85
// JPANEL
113
- JPanel panelMenu = new JPanel ();
114
- JPanel panelOpcionesMenu = new JPanel ();
115
- static JPanel panelBarras = new JPanel ();
86
+ JPanel panelMenu = new JPanel ();
87
+ JPanel panelOpcionesMenu = new JPanel ();
88
+ static JPanel panelBarras = new JPanel ();
116
89
117
90
// PANEL
118
91
Panel panelVisorMemoria = new Panel ();
119
92
120
93
// COMBOBOX
121
- JComboBox <String > comboBoxTipoSort = new JComboBox <String >(nombreAlgoritmos );
122
- static JComboBox <Object > comboBoxTiposGraficos = new JComboBox <Object >(nombreEstilosGraficos );
94
+ JComboBox <String > comboBoxTipoSort = new JComboBox <String >(nombreAlgoritmos );
95
+ static JComboBox <String > comboBoxTiposGraficos = new JComboBox <String >(nombreEstilosGraficos );
123
96
124
97
// JLABEL
125
- JLabel lblTitleAlgoritmo = new JLabel ("Seleccionar algoritmo de ordenacion" );
126
- JLabel lblTitle = new JLabel ("Panel de control" );
127
- JLabel lblNumeroBarras = new JLabel ("Numero de elementos" );
128
- JLabel lblRetardo = new JLabel ("Retardo: 1 ms" );
129
- JLabel lblTituloGraficos = new JLabel ("Dise\u00F1 o grafico" );
130
- static JLabel lblTiempo = new JLabel ("Tiempo: 0 m 0 s 0 ms" );
131
- static JLabel lblMemoriaUsada = new JLabel ("Memoria usada: 0 MB" );
132
- static JLabel lblMemoriaMax = new JLabel ("Memoria maxima: 0 MB" );
133
- static JLabel lblMemoriaLibre = new JLabel ("Memoria libre: 0 MB" );
134
- static JLabel lblMemoriaTotal = new JLabel ("Memoria total: 0 MB" );
135
- static JLabel lblCambios = new JLabel ("Cambios en el Array: 0" );
136
- static JLabel lblAccesos = new JLabel ("Accesos al Array: 0" );
98
+ JLabel lblTitleAlgoritmo = new JLabel ("Seleccionar algoritmo de ordenacion" );
99
+ JLabel lblTitle = new JLabel ("Panel de control" );
100
+ JLabel lblNumeroBarras = new JLabel ("Numero de elementos" );
101
+ JLabel lblRetardo = new JLabel ("Retardo: 1 ms" );
102
+ JLabel lblTituloGraficos = new JLabel ("Dise\u00F1 o grafico" );
103
+ static JLabel lblTiempo = new JLabel ("Tiempo: 0 m 0 s 0 ms" );
104
+ static JLabel lblMemoriaUsada = new JLabel ("Memoria usada: 0 MB" );
105
+ static JLabel lblMemoriaMax = new JLabel ("Memoria maxima: 0 MB" );
106
+ static JLabel lblMemoriaLibre = new JLabel ("Memoria libre: 0 MB" );
107
+ static JLabel lblMemoriaTotal = new JLabel ("Memoria total: 0 MB" );
108
+ static JLabel lblCambios = new JLabel ("Cambios en el Array: 0" );
109
+ static JLabel lblAccesos = new JLabel ("Accesos al Array: 0" );
137
110
138
111
// JBUTTON
139
- JButton btnOrdenar = new JButton ("Ordenar" );
140
- JButton btnDesordenar = new JButton ("Desordenar" );
141
- JButton btnSaltarSort = new JButton ("Saltar Sort" );
142
- JButton btnInformacion = new JButton ("Informacion" );
143
- JButton btnGithub = new JButton ();
144
- JButton btnCodepen = new JButton ();
112
+ JButton btnOrdenar = new JButton ("Ordenar" );
113
+ JButton btnDesordenar = new JButton ("Desordenar" );
114
+ JButton btnSaltarSort = new JButton ("Saltar Sort" );
115
+ JButton btnInformacion = new JButton ("Informacion" );
116
+ JButton btnGithub = new JButton ();
117
+ JButton btnCodepen = new JButton ();
145
118
146
119
// JTOGGLE BUTTON
147
120
static JToggleButton tglbtnMulticolor = new JToggleButton ("Ver multicolor" );
148
121
149
122
// JSLIDER
150
- JSlider sliderRetardo = new JSlider ();
151
- static JSlider sliderTamBarras = new JSlider ();
123
+ JSlider sliderRetardo = new JSlider ();
124
+ static JSlider sliderTamBarras = new JSlider ();
152
125
153
126
// Tamaño de la ventana.
154
- static final int WIN_WIDTH = 1330 ;
155
- static final int WIN_HEIGHT = 1053 ;
127
+ static final int WIN_WIDTH = 1330 ;// pixeles
128
+ static final int WIN_HEIGHT = 1053 ;// pixeles
156
129
157
130
// Variables antes y despues de la ejecucion de una ordenacion.
158
131
private int seleccionAlgoritmo = -1 ;
@@ -196,7 +169,6 @@ public void main() {
196
169
barras = new DibujarGraficos ();
197
170
barras .setBounds (0 , 0 , DibujarGraficos .WIN_WIDTH , DibujarGraficos .WIN_HEIGHT );
198
171
panelBarras .add (barras );
199
-
200
172
panelBarras .setVisible (true );
201
173
frame .setResizable (false );
202
174
frame .setTitle ("Visualizador de ordenacion de matrices" );
@@ -491,7 +463,7 @@ public void menuSorting() {
491
463
MainAplicacion mainApp = new MainAplicacion ();
492
464
if (!accederOrdenacion ) {
493
465
textos ();
494
- switch (seleccionAlgoritmo ) {//
466
+ switch (seleccionAlgoritmo ) {
495
467
case 0 :sorts = new BidirectionalBubble (mainApp , barras .arrayPrincipal );break ;
496
468
case 1 :sorts = new BinaryInsertion (mainApp , barras .arrayPrincipal );break ;
497
469
case 2 :sorts = new Bitonic (mainApp , barras .arrayPrincipal );break ;
@@ -606,7 +578,6 @@ private int calcMin(int tiempo) {
606
578
int min = tiempo ;
607
579
min = (min / 1000 ) / 60 ;
608
580
return min ;
609
-
610
581
}
611
582
612
583
private int calcSeg (int tiempo ) {
0 commit comments