avancé sur la page admin 2

This commit is contained in:
imuny 2022-06-07 11:01:05 +02:00
parent b7645957c6
commit 73f8300005
2 changed files with 118 additions and 26 deletions

View File

@ -1,4 +1,100 @@
package fr.univ_amu.iut.admin2;
public class Controller {
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
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;
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;
}
/*
* <TextField fx:id="nomRessources" layoutX="13.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Nom" />
<TextField fx:id="lienRessources" layoutX="199.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Lien" />
<TextField fx:id="typeRessources" layoutX="379.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Type" />
* */
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());
}
}

View File

@ -1,32 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?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?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.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">
<AnchorPane prefHeight="837.0" prefWidth="1350.0" style="-fx-background-color: #f5f0e1#f5f0e1;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="fr.univ_amu.iut.admin2.Controller">
<children>
<ScrollPane layoutX="14.0" layoutY="136.0" prefHeight="234.0" prefWidth="589.0" style="-fx-background-radius: 10;">
<ScrollPane id="acteurs" layoutX="14.0" layoutY="136.0" prefHeight="234.0" prefWidth="589.0" style="-fx-background-radius: 10;">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="234.0" prefWidth="590.0" style="-fx-background-color: #e5e0d1;">
<AnchorPane fx:id="acteurs" minHeight="0.0" minWidth="0.0" prefHeight="234.0" prefWidth="590.0" style="-fx-background-color: #e5e0d1;">
<children>
<TextField layoutX="13.0" layoutY="16.0" prefHeight="36.0" prefWidth="240.0" promptText="Nom" />
<TextField layoutX="310.0" layoutY="17.0" prefHeight="35.0" prefWidth="238.0" promptText="Type" />
<TextField id="nomActeur0" layoutX="13.0" layoutY="16.0" prefHeight="36.0" prefWidth="240.0" promptText="Nom" />
<TextField 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;">
<ScrollPane layoutX="684.0" layoutY="133.0" prefHeight="234.0" prefWidth="586.0" style="-fx-background-radius: 10;" AnchorPane.rightAnchor="80.0">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="583.0" style="-fx-background-color: #e5e0d1 #e5e0d1;">
<AnchorPane fx:id="ressources" minHeight="0.0" minWidth="0.0" prefHeight="235.0" prefWidth="583.0" style="-fx-background-color: #e5e0d1 #e5e0d1;">
<children>
<TextField layoutX="13.0" layoutY="19.0" prefHeight="36.0" prefWidth="170.0" promptText="Nom" />
<TextField layoutX="199.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Lien" />
<TextField layoutX="379.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Type" />
<TextField fx:id="nomRessources" layoutX="13.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Nom" />
<TextField fx:id="lienRessources" layoutX="199.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Lien" />
<TextField fx:id="typeRessources" layoutX="379.0" layoutY="18.0" prefHeight="36.0" prefWidth="170.0" promptText="Type" />
</children>
</AnchorPane>
</content>
@ -36,17 +32,17 @@
<Font size="31.0" />
</font>
</Text>
<Button 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="+">
<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">
<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 layoutX="1278.0" layoutY="136.0" mnemonicParsing="false" prefHeight="34.0" prefWidth="42.0" style="-fx-background-radius: 200; -fx-background-color: #e5e0d1 #e5e0d1;" 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>
@ -58,25 +54,25 @@
</Text>
<ScrollPane layoutX="45.0" layoutY="450.0" prefHeight="84.0" prefWidth="273.0" style="-fx-background-radius: 10;">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="83.0" prefWidth="273.0" style="-fx-background-color: #e5e0d1;">
<AnchorPane fx:id="lienRessources" minHeight="0.0" minWidth="0.0" prefHeight="83.0" prefWidth="273.0" style="-fx-background-color: #e5e0d1;">
<children>
<Button layoutX="18.0" layoutY="14.0" mnemonicParsing="false" prefHeight="39.0" prefWidth="223.0" style="-fx-background-radius: 30;" />
</children>
</AnchorPane>
</content>
</ScrollPane>
<Text layoutX="673.0" layoutY="430.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Description" wrappingWidth="173.92605590820312">
<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 layoutX="673.0" layoutY="450.0" prefHeight="174.0" prefWidth="496.0" />
<Button layoutX="1150.0" layoutY="739.0" mnemonicParsing="false" prefHeight="82.0" prefWidth="178.0" style="-fx-background-radius: 40;" text="VALIDER">
<TextArea 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;-">
<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>