Skip to content
Snippets Groups Projects
Commit 34f7bd7a authored by Matisse DEKEISER's avatar Matisse DEKEISER
Browse files

Merge branch 'hugodebuyser' into 'master'

FXML et controllers

See merge request sae302/2024/H4_SAE3.3!5
parents c80b3169 3d202d2c
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.stage.*?>
<Stage fx:id="stage" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.AddDataController">
<scene>
<Scene>
<AnchorPane prefHeight="200" prefWidth="200">
<children>
<VBox alignment="CENTER" prefHeight="224.0" prefWidth="384.0" spacing="20.0">
<children>
<HBox alignment="CENTER" prefHeight="18.0" prefWidth="335.0" spacing="20.0">
<children>
<Label text="Valeur 1" />
<TextField />
</children>
</HBox>
<HBox alignment="CENTER" layoutX="10.0" layoutY="47.0" prefHeight="17.0" prefWidth="335.0" spacing="20.0">
<children>
<Label text="Valeur 2" />
<ChoiceBox prefHeight="26.0" prefWidth="163.0" />
</children>
</HBox>
<HBox alignment="CENTER" layoutX="10.0" layoutY="109.0" prefHeight="17.0" prefWidth="335.0" spacing="20.0">
<children>
<Label text="Valeur 3" />
<Spinner />
</children>
</HBox>
<Button fx:id="confirmAdd" mnemonicParsing="false" text="Valider" />
</children></VBox>
</children></AnchorPane>
</Scene>
</scene>
</Stage>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.stage.*?>
<Stage fx:id="stage" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.AxesSettingsController">
<scene>
<Scene>
<AnchorPane prefHeight="200" prefWidth="200">
<children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="406.0" spacing="15.0">
<children>
<HBox alignment="CENTER" prefHeight="46.0" prefWidth="406.0" spacing="20.0">
<children>
<Label text="Valeur des ordonnées" />
<ChoiceBox fx:id="selectOrd" prefWidth="150.0" />
</children>
</HBox>
<HBox alignment="CENTER" prefHeight="44.0" prefWidth="406.0" spacing="20.0">
<children>
<Label text="Valeur des abscisses" />
<ChoiceBox fx:id="selectAbs" prefWidth="150.0" />
</children>
</HBox>
<Button fx:id="confirmAxes" mnemonicParsing="false" text="Valider" />
</children>
</VBox>
</children></AnchorPane>
</Scene>
</scene>
</Stage>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.stage.*?>
<Stage fx:id="stage" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.DisplaySettingsController">
<scene>
<Scene>
<AnchorPane prefHeight="200" prefWidth="200">
<children>
<VBox alignment="CENTER" layoutY="1.0" prefHeight="292.0" prefWidth="438.0" spacing="30.0">
<children>
<HBox alignment="CENTER" prefHeight="58.0" prefWidth="294.0" spacing="20.0">
<children>
<Label text="Nouvel ajout" />
<ColorPicker fx:id="addColor" editable="true" />
</children></HBox>
<Button fx:id="confirmSettings" mnemonicParsing="false" text="Valider" />
</children></VBox>
</children></AnchorPane>
</Scene>
</scene>
</Stage>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.Scene?> <?import javafx.scene.*?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.Label?> <?import javafx.scene.layout.*?>
<?import javafx.scene.layout.AnchorPane?> <?import javafx.stage.*?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>
<Stage fx:id="stage" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.LoadDataController"> <Stage fx:id="stage" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.LoadDataController">
<scene> <scene>
<Scene> <Scene>
<AnchorPane prefHeight="143.0" prefWidth="363.0"> <AnchorPane prefHeight="143.0" prefWidth="363.0">
...@@ -17,13 +14,13 @@ ...@@ -17,13 +14,13 @@
<children> <children>
<HBox alignment="CENTER" prefHeight="91.0" prefWidth="272.0"> <HBox alignment="CENTER" prefHeight="91.0" prefWidth="272.0">
<children> <children>
<Label fx:id="filenamelab" prefHeight="83.0" prefWidth="157.0" text="file name" /> <Button fx:id="browseFile" mnemonicParsing="false" onAction="#openFileChooser" text="Parcourir" />
<Button mnemonicParsing="false" onAction="#openFileChooser" text="Parcourir" /> <TextField fx:id="filePath" prefHeight="26.0" prefWidth="207.0" />
</children> </children>
</HBox> </HBox>
<HBox alignment="CENTER" prefHeight="76.0" prefWidth="310.0"> <HBox alignment="CENTER" prefHeight="76.0" prefWidth="310.0">
<children> <children>
<Button mnemonicParsing="false" onAction="#validate" text="Valider" /> <Button fx:id="confirmDataSelection" mnemonicParsing="false" onAction="#validate" text="Valider" />
</children> </children>
</HBox> </HBox>
</children> </children>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.Scene?> <?import javafx.scene.*?>
<?import javafx.scene.chart.CategoryAxis?> <?import javafx.scene.chart.*?>
<?import javafx.scene.chart.NumberAxis?> <?import javafx.scene.control.*?>
<?import javafx.scene.chart.ScatterChart?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.Button?> <?import javafx.stage.*?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<?import javafx.stage.Stage?>
<Stage fx:id="stage" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.MainStageController"> <Stage fx:id="stage" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univlille.sae.classification.controller.MainStageController">
<scene> <scene>
<Scene> <Scene>
<AnchorPane prefHeight="487.0" prefWidth="692.0"> <AnchorPane prefHeight="487.0" prefWidth="692.0">
<children> <children>
<VBox prefHeight="488.0" prefWidth="691.0"> <VBox prefHeight="488.0" prefWidth="691.0">
<children> <children>
<HBox prefHeight="305.0" prefWidth="691.0"> <HBox prefHeight="356.0" prefWidth="691.0">
<children> <children>
<Region prefHeight="200.0" prefWidth="200.0" /> <Region prefHeight="338.0" prefWidth="65.0" />
<ScatterChart prefHeight="213.0" prefWidth="557.0"> <ScatterChart prefHeight="342.0" prefWidth="609.0">
<xAxis> <xAxis>
<CategoryAxis side="BOTTOM" /> <CategoryAxis fx:id="absAxe" prefHeight="21.0" prefWidth="498.0" side="BOTTOM" />
</xAxis> </xAxis>
<yAxis> <yAxis>
<NumberAxis side="LEFT" /> <NumberAxis fx:id="ordAxe" side="LEFT" />
</yAxis> </yAxis>
</ScatterChart> </ScatterChart>
<Region prefHeight="200.0" prefWidth="200.0" /> <Button fx:id="settings" mnemonicParsing="false" text="Réglage" />
</children> </children>
</HBox> </HBox>
<Region prefHeight="77.0" prefWidth="691.0" /> <HBox alignment="CENTER" prefHeight="169.0" prefWidth="691.0" spacing="50.0">
<HBox prefHeight="100.0" prefWidth="200.0">
<children> <children>
<Region prefHeight="101.0" prefWidth="131.0" /> <Button fx:id="loadData" mnemonicParsing="false" onAction="#openLoadData" prefHeight="27.0" prefWidth="185.0" text="Charger un jeu de données" />
<Button mnemonicParsing="false" onAction="#openLoadData" prefHeight="27.0" prefWidth="122.0" text="Charger" /> <Button fx:id="addData" mnemonicParsing="false" prefHeight="26.0" prefWidth="141.0" text="Ajouter une donnée" />
<Region prefHeight="101.0" prefWidth="75.0" /> <Button fx:id="classifyData" disable="true" mnemonicParsing="false" prefHeight="26.0" prefWidth="157.0" text="Classifier une donnée" />
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="129.0" text="Classifier" />
<Region prefHeight="101.0" prefWidth="70.0" />
<Button mnemonicParsing="false" prefHeight="26.0" prefWidth="133.0" text="Reglages" />
<Region prefHeight="101.0" prefWidth="111.0" />
</children> </children>
</HBox> </HBox>
</children> </children>
......
package fr.univlille.sae.classification.controller;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.stage.Stage;
public class AddDataController {
@FXML
Stage stage;
@FXML
Button confirmAdd;
}
package fr.univlille.sae.classification.controller;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
public class AxesSettingsController {
@FXML
ChoiceBox selectOrd;
@FXML
ChoiceBox selectAbs;
@FXML
Button confirmAxes;
}
package fr.univlille.sae.classification.controller;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ColorPicker;
import javafx.stage.Stage;
public class DisplaySettingsController {
@FXML
Stage stage;
@FXML
Button confirmSettings;
@FXML
ColorPicker addColor;
}
package fr.univlille.sae.classification.controller; package fr.univlille.sae.classification.controller;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.stage.FileChooser; import javafx.stage.FileChooser;
import javafx.stage.Stage; import javafx.stage.Stage;
...@@ -14,7 +16,13 @@ public class LoadDataController { ...@@ -14,7 +16,13 @@ public class LoadDataController {
Stage stage; Stage stage;
@FXML @FXML
Label filenamelab; Button browseFile;
@FXML
Button confirmDataSelection;
@FXML
TextField filePath;
File file; File file;
...@@ -34,7 +42,7 @@ public class LoadDataController { ...@@ -34,7 +42,7 @@ public class LoadDataController {
this.file = fileChooser.showOpenDialog(stage); this.file = fileChooser.showOpenDialog(stage);
if(file != null) { if(file != null) {
filenamelab.setText(file.getName()); filePath.setText(file.getName());
} }
} }
......
...@@ -2,10 +2,9 @@ package fr.univlille.sae.classification.controller; ...@@ -2,10 +2,9 @@ package fr.univlille.sae.classification.controller;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Scene; import javafx.scene.chart.*;
import javafx.scene.layout.VBox; import javafx.scene.control.Button;
import javafx.stage.Modality; import javafx.stage.*;
import javafx.stage.Stage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
...@@ -17,6 +16,25 @@ public class MainStageController { ...@@ -17,6 +16,25 @@ public class MainStageController {
@FXML @FXML
Stage stage; Stage stage;
@FXML
CategoryAxis absAxe;
@FXML
NumberAxis ordAxe;
@FXML
Button settings;
@FXML
Button loadData;
@FXML
Button addData;
@FXML
Button classifyData;
Stage loadStage; Stage loadStage;
...@@ -25,9 +43,6 @@ public class MainStageController { ...@@ -25,9 +43,6 @@ public class MainStageController {
* @throws IOException * @throws IOException
*/ */
public void openLoadData() throws IOException { public void openLoadData() throws IOException {
FXMLLoader loader = new FXMLLoader(); FXMLLoader loader = new FXMLLoader();
URL fxmlFileUrl = new File(System.getProperty("user.dir") + File.separator + "res" + File.separator + "stages" + File.separator + "load-data-stage.fxml").toURI().toURL(); URL fxmlFileUrl = new File(System.getProperty("user.dir") + File.separator + "res" + File.separator + "stages" + File.separator + "load-data-stage.fxml").toURI().toURL();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment