Clase App actualizada

This commit is contained in:
NataliaCancinoV 2024-03-23 20:32:48 -06:00
parent 81805a43d9
commit 8cd2cae9d2
1 changed files with 37 additions and 6 deletions

View File

@ -14,13 +14,44 @@ public class App extends Application {
@Override
public void start(Stage stage) {
var javaVersion = SystemInfo.javaVersion();
var javafxVersion = SystemInfo.javafxVersion();
// Diapositiva d1
Titulo t1 = new Titulo("Titulo 1", "Subtitulo 1");
NC_CuadroTexto ct = new NC_CuadroTexto();
ct.agregaTexto("Sentencia 1");
ct.agregaTexto("Sentencia 2");
ct.agregaTexto("Sentencia 3");
ct.agregaTexto("Sentencia 4");
Contenido c1 = new Contenido();
c1.agregaElemento(ct);
ModeloDiapositiva md1 = new ModeloDiapositiva(t1, c1);
Diapositiva d1 = new Diapositiva(md1);
var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
var scene = new Scene(new StackPane(label), 640, 480);
stage.setScene(scene);
stage.show();
// Diapositiva d2
ConstructorGraficaBarras cgb = new ConstructorGraficaBarras("Ventas anuales de pasteles", "Año", "Ventas");
cgb.agregaSerie("2016");
cgb.agregaBarraSerie("2016", "Milky", 5200);
cgb.agregaBarraSerie("2016", "Zanahoria", 2200);
cgb.agregaBarraSerie("2016", "Mostachón", 4800);
cgb.agregaSerie("2017");
cgb.agregaBarraSerie("2017", "Milky", 5400);
cgb.agregaBarraSerie("2017", "Zanahoria", 2500);
cgb.agregaBarraSerie("2017", "Mostachón", 4700);
Contenido c2 = new Contenido();
c2.agregaElemento(cgb.generaGraficaBarras());
Titulo t2 = new Titulo("Titulo 2", "Subtitulo 2");
ModeloDiapositiva md2 = new ModeloDiapositiva(t2, c2);
Diapositiva d2 = new Diapositiva(md2);
Presentacion p = new Presentacion(stage);
p.agregarDiapositiva(d1);
p.agregarDiapositiva(d2);
p.mostrar();
}
public static void main(String[] args) {