Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e0a4570

Browse files
author
javiluli
committed
Creo nuevos estilos graficos y realizo cambios menores
1 parent 10f9d91 commit e0a4570

File tree

12 files changed

+268
-116
lines changed

12 files changed

+268
-116
lines changed

‎ordenaciones.jar‎

7.96 KB
Binary file not shown.

‎src/EstilosGraficos/Circulo.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
public class Circulo extends Transfomaciones {
6+
private static final long serialVersionUID = 1L;
7+
8+
public Circulo() {
9+
}
10+
11+
public Circulo(Graphics2D graphics) {
12+
graphics.rotate(Math.PI / (NUM_BARS / 2));
13+
graphics.fillRect(0, 0, 5, 400);
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
public class Circunferencia extends Transfomaciones {
6+
private static final long serialVersionUID = 1L;
7+
8+
public Circunferencia() {
9+
}
10+
11+
public Circunferencia(int i, Graphics2D graphics) {
12+
graphics.rotate(Math.PI / (NUM_BARS / 2));
13+
graphics.fillOval(300, 300, BAR_WIDTH * 3, BAR_WIDTH * 3);
14+
}
15+
}

‎src/EstilosGraficos/Columnas.java‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
import Sorts.Sorts;
6+
7+
public class Columnas extends EstiloGrafico {
8+
private static final long serialVersionUID = 1L;
9+
10+
public Columnas() {
11+
}
12+
13+
public Columnas(int i, Graphics2D graphics) {
14+
height = (Sorts.n[i] * BAR_HEIGHT) + BAR_HEIGHT;
15+
xBegin = i + (BAR_WIDTH - 1) * i;
16+
yBegin = WIN_HEIGHT - height;
17+
graphics.fillRect(xBegin, yBegin, BAR_HEIGHT, height);
18+
}
19+
}

‎src/EstilosGraficos/Espital.java‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
import Sorts.Sorts;
6+
7+
public class Espital extends Transfomaciones {
8+
private static final long serialVersionUID = 1L;
9+
10+
public Espital() {
11+
}
12+
13+
public Espital(int i, Graphics2D graphics) {
14+
height = (Sorts.n[i] * BAR_HEIGHT) + BAR_HEIGHT;
15+
graphics.rotate(Math.PI / (NUM_BARS / 2));
16+
graphics.drawLine(10, 10, 20, height / 3);
17+
}
18+
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package EstilosGraficos;
2+
3+
import javax.swing.JPanel;
4+
5+
public abstract class EstiloGrafico extends JPanel {
6+
private static final long serialVersionUID = 1L;
7+
8+
public final static int WIN_WIDTH = 1024;
9+
public final static int WIN_HEIGHT = WIN_WIDTH;
10+
public static int NUM_BARS = 32;
11+
public static int BAR_WIDTH = WIN_WIDTH / NUM_BARS;
12+
public static int BAR_HEIGHT = WIN_HEIGHT / NUM_BARS;
13+
public boolean activarMulticolor = false;
14+
15+
public static int mismo;
16+
public static int anterioresMismo;
17+
public static boolean finSort = false;
18+
19+
// Medidas y posicion de los graficos
20+
public int height, xBegin, yBegin;
21+
}

‎src/EstilosGraficos/Piramide.java‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
import Sorts.Sorts;
6+
7+
public class Piramide extends EstiloGrafico {
8+
private static final long serialVersionUID = 1L;
9+
public Piramide() {
10+
}
11+
public Piramide(int i, Graphics2D graphics) {
12+
height = (Sorts.n[i] * BAR_HEIGHT) + BAR_HEIGHT;
13+
xBegin = i + (BAR_WIDTH - 1) * i;
14+
yBegin = (WIN_HEIGHT - height) / 2;
15+
graphics.fillRect(xBegin, yBegin, BAR_HEIGHT, height);
16+
}
17+
}

‎src/EstilosGraficos/Pixel.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package EstilosGraficos;
2+
3+
import java.awt.Graphics2D;
4+
5+
import Sorts.Sorts;
6+
7+
public class Pixel extends EstiloGrafico {
8+
9+
private static final long serialVersionUID = 1L;
10+
11+
public Pixel() {
12+
13+
}
14+
15+
public Pixel(int i, Graphics2D graphics) {
16+
height = (Sorts.n[i] * BAR_HEIGHT) + BAR_HEIGHT;
17+
xBegin = i + (BAR_WIDTH - 1) * i;
18+
yBegin = WIN_HEIGHT - height;
19+
graphics.fillRect(xBegin, yBegin, BAR_HEIGHT, BAR_HEIGHT);
20+
}
21+
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package EstilosGraficos;
2+
3+
public abstract class Transfomaciones extends EstiloGrafico {
4+
private static final long serialVersionUID = 1L;
5+
// Traslada todos los graficos al centro.
6+
public int translateX = WIN_WIDTH / 2, translateY = WIN_WIDTH / 2;
7+
}

‎src/Sorts/Algoritmos/Bubble.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public void sort() {
2323
n[j + 1] = temp;
2424
cambiosArray++;
2525
}
26-
// Barras.mismo = j + 1;
2726
accesoArray += 2;
2827
m.updateAnimaciones();
2928
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /