MT |
Esta clase es la clase princial de la Maquina Turing
diff --git a/doc/mt/package-tree.html b/doc/mt/package-tree.html
index acb6479..7e4104b 100644
--- a/doc/mt/package-tree.html
+++ b/doc/mt/package-tree.html
@@ -2,9 +2,9 @@
-
+
mt Class Hierarchy
-
+
@@ -89,6 +89,8 @@
mt.LeerXML
mt.LeerXML.SimpleErrorHandler (implements jdk.internal.org.xml.sax.ErrorHandler, org.xml.sax.ErrorHandler)
+
+ mt.ListaCargada
mt.Maquina
javafx.scene.Node (implements javafx.event.EventTarget, javafx.css.Styleable)
diff --git a/doc/mt/package-use.html b/doc/mt/package-use.html
index 09bd0ee..331adf9 100644
--- a/doc/mt/package-use.html
+++ b/doc/mt/package-use.html
@@ -2,9 +2,9 @@
-
+
Uses of Package mt
-
+
diff --git a/doc/overview-tree.html b/doc/overview-tree.html
index f3bb34b..c12924b 100644
--- a/doc/overview-tree.html
+++ b/doc/overview-tree.html
@@ -2,9 +2,9 @@
-
+
Class Hierarchy
-
+
@@ -91,6 +91,8 @@
mt.Estado
mt.LeerXML
mt.LeerXML.SimpleErrorHandler (implements jdk.internal.org.xml.sax.ErrorHandler, org.xml.sax.ErrorHandler)
+
+ mt.ListaCargada
mt.Maquina
javafx.scene.Node (implements javafx.event.EventTarget, javafx.css.Styleable)
diff --git a/src/mt/ListaCargada.java b/src/mt/ListaCargada.java
new file mode 100644
index 0000000..f3e8377
--- /dev/null
+++ b/src/mt/ListaCargada.java
@@ -0,0 +1,43 @@
+package mt;
+
+import javafx.beans.property.SimpleStringProperty;
+
+public class ListaCargada {
+ private final SimpleStringProperty primer;
+
+ private final SimpleStringProperty segundo;
+
+ public ListaCargada(SimpleStringProperty primer, SimpleStringProperty segundo) {
+ this.primer = primer;
+ this.segundo = segundo;
+ }
+
+ public ListaCargada(String primer, String segundo) {
+ this.primer = new SimpleStringProperty(primer);
+ this.segundo = new SimpleStringProperty(segundo);
+ }
+
+ public String getPrimer() {
+ return primer.get();
+ }
+
+ public void setPrimer(String primer) {
+ this.primer.set(primer);
+ }
+
+ public SimpleStringProperty primerProperty() {
+ return primer;
+ }
+
+ public String getSegundo() {
+ return segundo.get();
+ }
+
+ public void setSegundo(String segundo) {
+ this.segundo.set(segundo);
+ }
+
+ public SimpleStringProperty segundoProperty() {
+ return segundo;
+ }
+}
diff --git a/src/mt/MenuController.java b/src/mt/MenuController.java
index 4edbcb1..a49e078 100644
--- a/src/mt/MenuController.java
+++ b/src/mt/MenuController.java
@@ -8,16 +8,20 @@
package mt;
import com.sun.javafx.scene.control.skin.TableHeaderRow;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.MenuBar;
-import javafx.scene.control.TableColumn;
+import javafx.scene.control.MenuItem;
import javafx.scene.control.TableView;
-import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
+import javafx.scene.paint.Color;
+import javafx.scene.text.Font;
+import javafx.scene.text.Text;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import org.w3c.dom.Document;
@@ -25,6 +29,8 @@ import org.w3c.dom.Document;
import java.io.File;
import java.net.URL;
import java.util.ResourceBundle;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* Controlar las acciones cuando una opción es elegido en el menu.
@@ -33,6 +39,12 @@ public class MenuController extends VBox implements Initializable {
@FXML
private MenuBar menuBar;
+ @FXML
+ private MenuItem menuIndiv;
+
+ @FXML
+ private MenuItem menuLote;
+
/**
* Inicialicar el menu con el idioma.
*
@@ -61,21 +73,42 @@ public class MenuController extends VBox implements Initializable {
Document documento = xml.leerArchivo(archivo);
if (documento != null) {
maquina = new Maquina(documento);
- for (int i = 0; i < maquina.getMaquina().getEstados().size(); i++) {
- System.out.println(maquina.getMaquina().getEstados().get(i));
+ TableView temp = (TableView) scene.lookup("#tableView");
+ VBox contenido = (VBox) scene.lookup("#contenido");
+ if (temp != null) {
+ // Remover tabla anterior si existe
+ contenido.getChildren().remove(temp);
}
- TableView tableView = FXMLLoader.load(getClass().getResource("tabla.fxml"));
- HBox.setHgrow(tableView, Priority.ALWAYS);
- HBox contenido = (HBox) scene.lookup("#contenido");
- contenido.getChildren().add(tableView);
- TableColumn tableColumn1 = (TableColumn) tableView.getColumns().get(0);
- TableColumn tableColumn2 = (TableColumn) tableView.getColumns().get(1);
+ else {
+ Text text = new Text(0, 0, "TRANSICIONES CARGADAS");
+ text.setFill(Color.BLACK);
+ text.setFont(Font.font(java.awt.Font.SANS_SERIF, 25));
+ contenido.getChildren().add(text);
+
+ menuIndiv.setDisable(false);
+ menuLote.setDisable(false);
+ }
+ TableView tableView = FXMLLoader.load(getClass().getResource("tabla.fxml"));
+ VBox.setVgrow(tableView, Priority.ALWAYS);
tableView.skinProperty().addListener((source, oldWidth, newWidth) -> {
final TableHeaderRow header = (TableHeaderRow) tableView.lookup("TableHeaderRow");
header.reorderingProperty().addListener((observable, oldValue, newValue) -> header.setReordering(false));
});
- tableColumn1.prefWidthProperty().bind(tableView.widthProperty().multiply(0.5));
- tableColumn2.prefWidthProperty().bind(tableView.widthProperty().multiply(0.5));
+ tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
+
+ ObservableList listaCargadas = FXCollections.observableArrayList();
+ Pattern pattern = Pattern.compile("(\\(.*\\)) = (\\(.*\\))");
+ for (int i = 0; i < maquina.getMaquina().getEstados().size(); i++) {
+ Matcher matcher = pattern.matcher(maquina.getMaquina().getEstados().get(i).toString());
+ while (matcher.find()) {
+ listaCargadas.add(new ListaCargada(matcher.group(1), matcher.group(2)));
+ }
+ }
+
+ tableView.setEditable(true);
+ tableView.setItems(listaCargadas);
+
+ contenido.getChildren().add(tableView);
/*if (maquina.comprobarCadena(new StringBuilder("000111###"), 5)) {
MT.mostrarMensaje("Resultado", "Reconce");
@@ -85,4 +118,20 @@ public class MenuController extends VBox implements Initializable {
}*/
}
}
+
+ /**
+ * Menu opción reconocimiento indivual
+ */
+ @FXML
+ protected void reconoceIndividual() {
+
+ }
+
+ /**
+ * Menu opción reconocimiento lote
+ */
+ @FXML
+ protected void reconoceLote() {
+
+ }
}
\ No newline at end of file
diff --git a/src/mt/menu.fxml b/src/mt/menu.fxml
index 3286e18..7feee82 100644
--- a/src/mt/menu.fxml
+++ b/src/mt/menu.fxml
@@ -10,8 +10,8 @@ This file may not be copied, modified, propagated, or distributed except accordi
\ No newline at end of file
diff --git a/src/mt/mt.css b/src/mt/mt.css
index e243245..d6db6f5 100644
--- a/src/mt/mt.css
+++ b/src/mt/mt.css
@@ -12,4 +12,24 @@
.scroll-pane {
-fx-background-color: transparent;
+}
+
+.table-view {
+ -fx-background-color: transparent;
+}
+
+#tableView .table-column {
+ -fx-alignment: CENTER;
+}
+
+.table-row-cell:empty {
+ -fx-background-color: transparent;
+}
+
+.table-row-cell:empty .table-cell {
+ -fx-border-width: 0px;
+}
+
+.list-cell:empty {
+ -fx-background-color: transparent;
}
\ No newline at end of file
diff --git a/src/mt/mt.fxml b/src/mt/mt.fxml
index 10a872d..03fefa4 100644
--- a/src/mt/mt.fxml
+++ b/src/mt/mt.fxml
@@ -8,12 +8,11 @@ This file may not be copied, modified, propagated, or distributed except accordi
-->
-
-
-
+
+
\ No newline at end of file
diff --git a/src/mt/tabla.fxml b/src/mt/tabla.fxml
index 76294a7..a4ad6ff 100644
--- a/src/mt/tabla.fxml
+++ b/src/mt/tabla.fxml
@@ -7,12 +7,21 @@ This file is part of mt. It is subject to the license terms in the LICENSE file
This file may not be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.
-->
+
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
|