From 942390220235d3140010adfb651ae78d6c67b278 Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Wed, 12 Dec 2018 16:44:02 +0100 Subject: [PATCH] Razionalizzata schermata frazioni generatrici --- build.fxbuild | 2 +- resources/Frazioni.fxml | 96 +++++++++++++++---- .../math/controller/FrazioniController.java | 8 +- src/it/nave/math/support/Tool.java | 1 - 4 files changed, 86 insertions(+), 21 deletions(-) diff --git a/build.fxbuild b/build.fxbuild index 6c95a91..65ab0f4 100644 --- a/build.fxbuild +++ b/build.fxbuild @@ -1,7 +1,7 @@ - + diff --git a/resources/Frazioni.fxml b/resources/Frazioni.fxml index 5c64e55..efd5777 100644 --- a/resources/Frazioni.fxml +++ b/resources/Frazioni.fxml @@ -1,25 +1,85 @@ + + - + + + + + + - - - + + + + + + diff --git a/src/it/nave/math/controller/FrazioniController.java b/src/it/nave/math/controller/FrazioniController.java index 0df176e..c13b003 100644 --- a/src/it/nave/math/controller/FrazioniController.java +++ b/src/it/nave/math/controller/FrazioniController.java @@ -34,7 +34,13 @@ private void backToHome() throws IOException { @FXML private void genera() { - Fraction f = new Fraction(input.getText()); + Fraction f; + try { + f = new Fraction(input.getText()); + } catch (IllegalArgumentException e) { + Tool.inputNotValid("La stringa non č un decimale valido"); + return; + } scriviFrazione(f); } diff --git a/src/it/nave/math/support/Tool.java b/src/it/nave/math/support/Tool.java index bedef5b..812967e 100644 --- a/src/it/nave/math/support/Tool.java +++ b/src/it/nave/math/support/Tool.java @@ -33,7 +33,6 @@ public static Stage setStandardStage(Stage stage, String fxmlFile, String title) Parent root = FXMLLoader.load(Tool.class.getClassLoader().getResource(fxmlFile)); stage.setTitle(title); stage.setScene(new Scene(root)); -// stage.setResizable(false); // FIXME computazionalmente pių efficiente di rendere gli elementi dinamici return stage; }