merge app_test avec main

This commit is contained in:
Thomas Rubini 2022-06-07 16:13:20 +02:00
commit 4198d23e32
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
4 changed files with 215 additions and 1 deletions

View File

@ -0,0 +1,108 @@
package fr.univ_amu.iut.admin2;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import javafx.scene.layout.AnchorPane;
import java.net.URL;
import java.util.ResourceBundle;
public class Controller implements Initializable {
@FXML
private Button addActeurs;
@FXML
private AnchorPane acteurs;
@FXML
private Button addRessources;
@FXML
private AnchorPane ressources;
@FXML
private MenuButton menuButton;
@FXML
private TextArea textMenuButton;
@FXML
MenuItem id1;
@FXML
MenuItem id2;
@FXML
MenuItem id3;
private int cptActeur = 1;
private int cptRessource = 1;
private void addActeur(){
TextField nom = new TextField();
TextField type = new TextField();
nom.setId(String.format("nomActeur%s",cptActeur));
nom.setLayoutX(13);
nom.setLayoutY(16+cptActeur*10+cptActeur*36);
nom.setPrefHeight(36);
nom.setPrefWidth(240);
nom.resize(36 ,240);
nom.setPromptText("Nom");
type.setId(String.format("typeActeur%s",cptActeur));
type.setLayoutX(310);
type.setLayoutY(16+cptActeur*10+cptActeur*36);
type.setPrefHeight(36);
type.setPrefWidth(240);
type.resize(36 ,240);
type.setPromptText("Type");
acteurs.getChildren().addAll(nom,type);
acteurs.resize(acteurs.getHeight()+46,acteurs.getWidth());
acteurs.setPrefHeight(acteurs.getHeight()+62);
++cptActeur;
}
private void addRessource(){
TextField nom = new TextField();
TextField lien = new TextField();
TextField type = new TextField();
nom.setId(String.format("nomRessource%s",cptRessource));
nom.setLayoutX(13);
nom.setLayoutY(18+cptRessource*10+cptRessource*36);
nom.setPrefHeight(36);
nom.setPrefWidth(170);
nom.resize(36 ,170);
nom.setPromptText("Nom");
lien.setId(String.format("lineRessource%s",cptRessource));
lien.setLayoutX(199);
lien.setLayoutY(18+cptRessource*10+cptRessource*36);
lien.setPrefHeight(36);
lien.setPrefWidth(170);
lien.resize(36 ,170);
lien.setPromptText("Lien");
type.setId(String.format("typeRessource%s",cptRessource));
type.setLayoutX(379);
type.setLayoutY(18+cptRessource*10+cptRessource*36);
type.setPrefHeight(36);
type.setPrefWidth(170);
type.resize(36 ,170);
type.setPromptText("Type");
ressources.getChildren().addAll(nom,type,lien);
ressources.resize(ressources.getHeight()+46,ressources.getWidth());
ressources.setPrefHeight(ressources.getHeight()+62);
++cptRessource;
}
@Override
public void initialize(URL url, ResourceBundle resourceBundle) {
addActeurs.setOnAction(actionEvent -> addActeur());
addRessources.setOnAction(actionEvent -> addRessource());
id1.setOnAction(actionEvent -> textMenuButton.setPromptText("Degrès 1"));
id2.setOnAction(actionEvent -> textMenuButton.setPromptText("Degrès 2"));
id3.setOnAction(actionEvent -> textMenuButton.setPromptText("Degrès +"));
}
}

View File

@ -0,0 +1,26 @@
package fr.univ_amu.iut.admin2;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {launch(args);}
@Override
public void start(Stage stage) throws Exception {
try {
AnchorPane root = FXMLLoader.load(getClass().getResource("/fr/univ_amu/iut/admin2/admin2.fxml"));
stage.setScene(new Scene(root));
stage.show();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="837.0" prefWidth="1350.0" style="-fx-background-color: #f5f0e1#f5f0e1;" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.admin2.Controller">
<children>
<ScrollPane id="acteurs" layoutX="14.0" layoutY="136.0" prefHeight="234.0" prefWidth="589.0" style="-fx-background-radius: 10;">
<content>
<AnchorPane fx:id="acteurs" minHeight="0.0" minWidth="0.0" prefHeight="234.0" prefWidth="590.0" style="-fx-background-color: #e5e0d1;">
<children>
<TextField id="nomActeur0" fx:id="nomActeur0" layoutX="13.0" layoutY="16.0" prefHeight="36.0" prefWidth="240.0" promptText="Nom" />
<TextField id="typeActeur0" fx:id="typeActeur0" layoutX="310.0" layoutY="17.0" prefHeight="35.0" prefWidth="238.0" promptText="Type" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<ScrollPane layoutX="684.0" layoutY="133.0" prefHeight="234.0" prefWidth="586.0" style="-fx-background-radius: 10;" AnchorPane.rightAnchor="80.0">
<content>
<AnchorPane fx:id="ressources" minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="583.0" style="-fx-background-color: #e5e0d1 #e5e0d1;">
<children>
<TextField fx:id="nomRessources0" layoutX="13.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Nom" />
<TextField fx:id="lienRessources0" layoutX="199.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Lien" />
<TextField fx:id="typeRessources0" layoutX="379.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Type" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Text layoutX="16.0" layoutY="118.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Acteurs" textAlignment="CENTER" wrappingWidth="580.0">
<font>
<Font size="31.0" />
</font>
</Text>
<Button fx:id="addActeurs" layoutX="615.0" layoutY="146.0" mnemonicParsing="false" prefHeight="34.0" prefWidth="42.0" style="-fx-background-radius: 200; -fx-background-color: #e5e0d1 #e5e0d1;" text="+">
<font>
<Font size="26.0" />
</font>
</Button>
<Text layoutX="682.0" layoutY="119.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Ressources" textAlignment="CENTER" wrappingWidth="580.0" AnchorPane.rightAnchor="88.0">
<font>
<Font size="31.0" />
</font>
</Text>
<Button fx:id="addRessources" layoutX="1278.0" layoutY="136.0" mnemonicParsing="false" prefHeight="34.0" prefWidth="42.0" style="-fx-background-radius: 200; -fx-background-color: #e5e0d1;" text="+" AnchorPane.rightAnchor="16.0">
<font>
<Font size="26.0" />
</font>
</Button>
<Text layoutX="675.0" layoutY="429.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Description" wrappingWidth="194.92605590820312" AnchorPane.rightAnchor="480.0739440917969">
<font>
<Font size="31.0" />
</font>
</Text>
<TextArea fx:id="description" layoutX="673.0" layoutY="450.0" prefHeight="174.0" prefWidth="496.0" AnchorPane.rightAnchor="181.0" />
<Button layoutX="1150.0" layoutY="739.0" mnemonicParsing="false" prefHeight="82.0" prefWidth="178.0" style="-fx-background-radius: 40;" text="VALIDER" AnchorPane.bottomAnchor="16.0" AnchorPane.rightAnchor="22.0">
<font>
<Font size="18.0" />
</font>
</Button>
<Button layoutX="16.0" layoutY="751.0" mnemonicParsing="false" prefHeight="60.0" prefWidth="93.0" style="-fx-background-radius: 30;" text="&lt;-" AnchorPane.bottomAnchor="16.0" AnchorPane.leftAnchor="10.0">
<font>
<Font size="24.0" />
</font>
</Button>
<MenuButton fx:id="menuButton" layoutX="183.0" layoutY="432.0" mnemonicParsing="false" prefHeight="60.0" prefWidth="145.0" style="-fx-background-radius: 10;" text="Degrès">
<items>
<MenuItem fx:id="id1" mnemonicParsing="false" text="1" />
<MenuItem fx:id="id2" mnemonicParsing="false" text="2" />
<MenuItem fx:id="id3" mnemonicParsing="false" text="+" />
</items>
</MenuButton>
<TextArea fx:id="textMenuButton" layoutX="352.0" layoutY="442.0" prefHeight="40.0" prefWidth="80.0"/>
</children>
</AnchorPane>

View File

@ -164,7 +164,6 @@ public class Controller implements Initializable {
stackPaneFrance.getChildren().add(france);
// init
daoFactory = DAOFactoryProducer.getFactory(AppMain.testMode ? DAOType.TEST : DAOType.JPA);
daoDiscipline = daoFactory.createDAODiscipline();
daoThematique = daoFactory.createDAOThematique();