Fix java doc, make an about section, add the ubb logo
This commit is contained in:
@@ -18,9 +18,15 @@ import javafx.scene.image.Image;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
/**
|
||||
* Esta clase es la clase princial de la Maquina Turing
|
||||
* Maquina de Turing
|
||||
*
|
||||
* @author Christopher Cromer
|
||||
* @author Carlos Fáundez
|
||||
* @version 1.0.0
|
||||
*/
|
||||
public class MT extends Application {
|
||||
static public final String version = "1.0.0";
|
||||
|
||||
/**
|
||||
* El metodo principal del programa
|
||||
*
|
||||
@@ -53,7 +59,7 @@ public class MT extends Application {
|
||||
*/
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
Parent root = FXMLLoader.load(getClass().getResource("fxml/mt.fxml"));
|
||||
Parent root = FXMLLoader.load(getClass().getResource("/cl/cromer/mt/fxml/mt.fxml"));
|
||||
primaryStage.setTitle("Maquina de Turing");
|
||||
|
||||
Scene scene = new Scene(root, 640, 480);
|
||||
|
||||
@@ -14,13 +14,12 @@ import javafx.event.Event;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.MenuBar;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.control.cell.TextFieldTableCell;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.Priority;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
@@ -54,6 +53,13 @@ public class MenuController {
|
||||
protected void cargarTransiciones() throws Exception {
|
||||
Scene scene = menuBar.getScene();
|
||||
Stage parentStage = (Stage) scene.getWindow();
|
||||
|
||||
ImageView imageView = (ImageView) scene.lookup("#logo");
|
||||
if (imageView != null) {
|
||||
VBox vbox = (VBox) imageView.getParent();
|
||||
vbox.getChildren().remove(imageView);
|
||||
}
|
||||
|
||||
FileChooser fileChooser = new FileChooser();
|
||||
fileChooser.setTitle("Abrir archivo XML");
|
||||
fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("Archivos XML (*.xml)", "*.xml"));
|
||||
@@ -219,6 +225,21 @@ public class MenuController {
|
||||
contenido.getChildren().add(tableView);
|
||||
}
|
||||
|
||||
/**
|
||||
* Click en acerca.
|
||||
*/
|
||||
@FXML
|
||||
protected void menuAcerca() {
|
||||
ButtonType botonCerrar = new ButtonType("Cerrar", ButtonBar.ButtonData.OK_DONE);
|
||||
Alert alert = new Alert(Alert.AlertType.NONE, "Maquina de Turning " + MT.version + "\n\nConstruido por:\n\tChristopher Cromer\n\tCarlos Fáundez\n\nIngenier\u00EDa Civil en Inform\u00E1tica\nUniversidad del B\u00EDo B\u00EDo");
|
||||
alert.getDialogPane().getChildren().stream().filter(node -> node instanceof Label).forEach(node -> ((Label)node).setMinHeight(Region.USE_PREF_SIZE));
|
||||
alert.setGraphic(null);
|
||||
alert.getDialogPane().getButtonTypes().add(botonCerrar);
|
||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||
stage.getIcons().add(new Image(getClass().getResourceAsStream("/cl/cromer/mt/images/icon.png")));
|
||||
alert.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Agregar un gato al inicio y al final de un string si no existen
|
||||
*
|
||||
|
||||
@@ -14,4 +14,7 @@ This file may not be copied, modified, propagated, or distributed except accordi
|
||||
<MenuItem fx:id="menuIndiv" text="Reconocimiento individual" disable="true" onAction="#reconoceIndividual"/>
|
||||
<MenuItem fx:id="menuLote" text="Reconocimiento por lote" disable="true" onAction="#reconoceLote"/>
|
||||
</Menu>
|
||||
<Menu text="Ayuda">
|
||||
<MenuItem text="Acerca" onAction="#menuAcerca" />
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
@@ -9,9 +9,15 @@ This file may not be copied, modified, propagated, or distributed except accordi
|
||||
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<VBox xmlns:fx="http://javafx.com/fxml/1" prefHeight="480.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8.0.92">
|
||||
<fx:include source="menu.fxml"/>
|
||||
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
|
||||
<VBox alignment="CENTER" VBox.vgrow="ALWAYS" fx:id="contenido"/>
|
||||
<VBox alignment="CENTER" VBox.vgrow="ALWAYS" fx:id="contenido">
|
||||
<ImageView fx:id="logo">
|
||||
<Image url="@/cl/cromer/mt/images/UBBLogo.png"/>
|
||||
</ImageView>
|
||||
</VBox>
|
||||
</ScrollPane>
|
||||
</VBox>
|
||||
BIN
src/cl/cromer/mt/images/UBBLogo.png
Normal file
BIN
src/cl/cromer/mt/images/UBBLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 50 KiB |
Reference in New Issue
Block a user