Artifact builds and web version

This commit is contained in:
2017-07-03 20:46:11 -04:00
parent 6744de19d5
commit 1452f6e215
89 changed files with 7825 additions and 483 deletions

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import org.w3c.dom.Document;

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
class Enlace {
private char si;

View File

@@ -4,7 +4,7 @@
* This file is part of mt. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution.
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import java.util.ArrayList;

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import jdk.internal.org.xml.sax.ErrorHandler;
import jdk.internal.org.xml.sax.SAXException;
@@ -67,6 +67,7 @@ class LeerXML {
db.setErrorHandler(seh);
documento = db.parse(archivo);
if (seh.error) {
MT.mostrarMensaje("Error", "The file " + archivo.getName() + " does not contain valid xml!");
return null;
}
documento.getDocumentElement().normalize();
@@ -76,6 +77,7 @@ class LeerXML {
if (e.getMessage().contains(".dtd")) {
return validarXML(archivo);
}
MT.mostrarMensaje("Error", "The file " + archivo.getName() + " does not contain valid xml!");
System.out.println(e.getMessage());
e.printStackTrace();
return null;

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
@@ -37,14 +37,14 @@ public class LoteController extends VBox {
Scene scene = vboxLote.getScene();
Maquina maquina = (Maquina) scene.getUserData();
for (TablaData fila : tablaData) {
Maquina clone = maquina.clone();
boolean exito = clone.comprobarCadena(new StringBuilder(fila.getPrimer()), new int[] {5});
boolean exito = maquina.comprobarCadena(new StringBuilder(fila.getPrimer()), new int[] {5});
if (exito) {
fila.setSegundo("Aceptada");
}
else {
fila.setSegundo("Rechazada");
}
maquina.reset();
}
}
@@ -53,17 +53,13 @@ public class LoteController extends VBox {
*/
@FXML
protected void agregarCadena() {
if (!cadena.getText().trim().equals("")) {
tablaData.add(new TablaData(cadena.getText(), ""));
Scene scene = vboxLote.getScene();
@SuppressWarnings("unchecked")
TableView<TablaData> tableView = (TableView<TablaData>) scene.lookup("#tableView");
tableView.setEditable(true);
tableView.setItems(tablaData);
}
else {
MT.mostrarMensaje("Error", "Ingresa una cadena por favor!");
}
tablaData.add(new TablaData(cadena.getText(), ""));
Scene scene = vboxLote.getScene();
@SuppressWarnings("unchecked")
TableView<TablaData> tableView = (TableView<TablaData>) scene.lookup("#tableView");
tableView.setEditable(true);
tableView.setItems(tablaData);
cadena.setText("");
}
/**

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
@@ -57,11 +57,11 @@ public class MT extends Application {
primaryStage.setTitle("Maquina de Turing");
Scene scene = new Scene(root, 640, 480);
scene.getStylesheets().add("/mt/mt.css");
scene.getStylesheets().add("/cl/cromer/mt/mt.css");
primaryStage.setScene(scene);
primaryStage.setMinHeight(480);
primaryStage.setMinWidth(640);
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/mt/images/icon.png")));
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("/cl/cromer/mt/images/icon.png")));
primaryStage.show();
}
}

View File

@@ -5,11 +5,11 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import org.w3c.dom.Document;
class Maquina implements Cloneable {
class Maquina {
private Automata maquina;
private Estado estadoactual;
private Enlace enlaceactual;
@@ -21,21 +21,6 @@ class Maquina implements Cloneable {
reset();
}
@Override
public Maquina clone() {
try {
final Maquina result = (Maquina) super.clone();
result.maquina = this.maquina;
result.estadoactual = this.estadoactual;
result.enlaceactual = this.enlaceactual;
result.cintaanterior = this.cintaanterior;
return result;
}
catch (final CloneNotSupportedException e) {
throw new AssertionError();
}
}
Automata getMaquina() {return maquina;}
public Estado getEstadoactual() {return estadoactual;}
@@ -46,7 +31,7 @@ class Maquina implements Cloneable {
public int getCabezal() {return cabezal;}
public void reset(){
public void reset() {
estadoactual = maquina.getEstados().get(0);
enlaceactual = null;
cintaanterior = "";

View File

@@ -5,7 +5,7 @@
* This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
*/
package mt;
package cl.cromer.mt;
import com.sun.javafx.scene.control.skin.TableHeaderRow;
import javafx.collections.FXCollections;
@@ -127,7 +127,7 @@ public class MenuController {
fxmlLoader.setLocation(getClass().getResource("lote.fxml"));
Scene scene = new Scene(fxmlLoader.load(), 640, 480);
scene.setUserData(maquina);
scene.getStylesheets().add("/mt/mt.css");
scene.getStylesheets().add("/cl/cromer/mt/mt.css");
Stage stage = new Stage();
stage.initModality(Modality.WINDOW_MODAL);
stage.initOwner(parentStage);
@@ -135,7 +135,7 @@ public class MenuController {
stage.setMinHeight(480);
stage.setMinWidth(640);
stage.setScene(scene);
stage.getIcons().add(new Image(getClass().getResourceAsStream("/mt/images/icon.png")));
stage.getIcons().add(new Image(getClass().getResourceAsStream("/cl/cromer/mt/images/icon.png")));
stage.show();
TableView<TablaData> tableView = FXMLLoader.load(getClass().getResource("tabla.fxml"));

View File

@@ -1,4 +1,4 @@
package mt;
package cl.cromer.mt;
import javafx.beans.property.SimpleStringProperty;

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 97 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -12,7 +12,7 @@ This file may not be copied, modified, propagated, or distributed except accordi
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Text?>
<VBox xmlns:fx="http://javafx.com/fxml/1" fx:id="vboxLote" prefHeight="480.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8.0.131" fx:controller="mt.LoteController">
<VBox xmlns:fx="http://javafx.com/fxml/1" fx:id="vboxLote" prefHeight="480.0" prefWidth="640.0" xmlns="http://javafx.com/javafx/8.0.131" fx:controller="cl.cromer.mt.LoteController">
<ScrollPane fitToHeight="true" fitToWidth="true" VBox.vgrow="ALWAYS">
<VBox alignment="CENTER" VBox.vgrow="ALWAYS">
<VBox fx:id="contenidoLote" alignment="CENTER" VBox.vgrow="ALWAYS">

View File

@@ -8,7 +8,7 @@ This file may not be copied, modified, propagated, or distributed except accordi
-->
<?import javafx.scene.control.*?>
<MenuBar xmlns:fx="http://javafx.com/fxml/1" fx:id="menuBar" fx:controller="mt.MenuController" xmlns="http://javafx.com/javafx/8.0.92">
<MenuBar xmlns:fx="http://javafx.com/fxml/1" fx:id="menuBar" fx:controller="cl.cromer.mt.MenuController" xmlns="http://javafx.com/javafx/8.0.92">
<Menu text="Operaciones">
<MenuItem text="Cargar transiciones" onAction="#cargarTransiciones"/>
<MenuItem fx:id="menuIndiv" text="Reconocimiento individual" disable="true" onAction="#reconoceIndividual"/>