Browse Source

Added icons to dialogs.

Updated code style.
master
Chris Cromer 5 years ago
parent
commit
f4a103b3cc
  1. 3
      src/cl/cromer/estructuras/ArrayController.java
  2. 1
      src/cl/cromer/estructuras/BurbujaController.java
  3. 3
      src/cl/cromer/estructuras/ColaController.java
  4. 1
      src/cl/cromer/estructuras/InsercionController.java
  5. 3
      src/cl/cromer/estructuras/ListaEnlazdaController.java
  6. 6
      src/cl/cromer/estructuras/Main.java
  7. 4
      src/cl/cromer/estructuras/MenuController.java
  8. 1
      src/cl/cromer/estructuras/MergeController.java
  9. 3
      src/cl/cromer/estructuras/PilaController.java
  10. 1
      src/cl/cromer/estructuras/QuickController.java
  11. 1
      src/cl/cromer/estructuras/SeleccionController.java
  12. 1
      src/cl/cromer/estructuras/ShellController.java

3
src/cl/cromer/estructuras/ArrayController.java

@ -148,6 +148,7 @@ public class ArrayController implements Initializable {
dialog.setContentText(resourceBundle.getString("arrayValorExiste"));
}
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
}
@ -245,6 +246,7 @@ public class ArrayController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("arrayNoValor"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
@ -257,6 +259,7 @@ public class ArrayController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("arrayNoEsta"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/BurbujaController.java

@ -152,6 +152,7 @@ public class BurbujaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("burbujaYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

3
src/cl/cromer/estructuras/ColaController.java

@ -138,6 +138,7 @@ public class ColaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("colaLlena"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
}
@ -209,6 +210,7 @@ public class ColaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("colaNoValor"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
@ -221,6 +223,7 @@ public class ColaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("colaVacia"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/InsercionController.java

@ -152,6 +152,7 @@ public class InsercionController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("insercionYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

3
src/cl/cromer/estructuras/ListaEnlazdaController.java

@ -189,6 +189,7 @@ public class ListaEnlazdaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("listaLlaveExiste"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
}
@ -326,6 +327,7 @@ public class ListaEnlazdaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("listaNoValor"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
@ -338,6 +340,7 @@ public class ListaEnlazdaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("listaNoEsta"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

6
src/cl/cromer/estructuras/Main.java

@ -4,6 +4,7 @@ import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Dialog;
import javafx.scene.image.Image;
import javafx.stage.Stage;
@ -66,4 +67,9 @@ public class Main extends Application {
stage.getIcons().add(new Image(getClass().getResourceAsStream("/cl/cromer/estructuras/images/icon.png")));
stage.show();
}
static public void setIcon(Dialog dialog, Class classe) {
Stage stage = (Stage) dialog.getDialogPane().getScene().getWindow();
stage.getIcons().add(new Image(classe.getResourceAsStream("/cl/cromer/estructuras/images/icon.png")));
}
}

4
src/cl/cromer/estructuras/MenuController.java

@ -6,6 +6,7 @@ import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
@ -221,6 +222,7 @@ public class MenuController extends VBox implements Initializable {
dialog.getDialogPane().getButtonTypes().add(botonCancelar);
dialog.getDialogPane().getButtonTypes().add(botonCambiar);
dialog.getDialogPane().setPrefSize(400, 120);
Main.setIcon(dialog, getClass());
Optional<ButtonType> result = dialog.showAndWait();
if (result.isPresent() && result.get() == botonCambiar) {
@ -249,6 +251,7 @@ public class MenuController extends VBox implements Initializable {
dialog.getDialogPane().getButtonTypes().add(botonCancelar);
dialog.getDialogPane().getButtonTypes().add(botonCambiar);
dialog.getDialogPane().setPrefSize(400, 120);
Main.setIcon(dialog, getClass());
Optional<ButtonType> result = dialog.showAndWait();
if (result.isPresent() && result.get() == botonCambiar) {
@ -274,6 +277,7 @@ public class MenuController extends VBox implements Initializable {
dialog.setTitle(resourceBundle.getString("acerca"));
dialog.setContentText(resourceBundle.getString("credito"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/MergeController.java

@ -152,6 +152,7 @@ public class MergeController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("mergeYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

3
src/cl/cromer/estructuras/PilaController.java

@ -138,6 +138,7 @@ public class PilaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("pilaLlena"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
}
@ -209,6 +210,7 @@ public class PilaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("pilaNoValor"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}
@ -221,6 +223,7 @@ public class PilaController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("pilaVacia"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/QuickController.java

@ -152,6 +152,7 @@ public class QuickController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("quickYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/SeleccionController.java

@ -152,6 +152,7 @@ public class SeleccionController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("seleccionYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

1
src/cl/cromer/estructuras/ShellController.java

@ -152,6 +152,7 @@ public class ShellController implements Initializable {
dialog.setTitle(resourceBundle.getString("error"));
dialog.setContentText(resourceBundle.getString("shellYaOrdenado"));
dialog.getDialogPane().getButtonTypes().add(botonCerrar);
Main.setIcon(dialog, getClass());
dialog.show();
}

Loading…
Cancel
Save