il y a un bug le hover reste sur les button deja selectionne
This commit is contained in:
parent
4a0793217a
commit
c31fa88d68
@ -2,7 +2,6 @@ package fr.univ_amu.iut.fp;
|
||||
|
||||
import fr.univ_amu.iut.Donnees;
|
||||
import fr.univ_amu.iut.dao.DAODiscipline;
|
||||
import fr.univ_amu.iut.dao.DAORessource;
|
||||
import fr.univ_amu.iut.dao.DAOThematique;
|
||||
import fr.univ_amu.iut.dao.DAOUsage;
|
||||
import fr.univ_amu.iut.dao.factory.DAOFactory;
|
||||
@ -10,7 +9,6 @@ import fr.univ_amu.iut.dao.factory.DAOFactoryProducer;
|
||||
import fr.univ_amu.iut.dao.factory.DAOType;
|
||||
import fr.univ_amu.iut.model.Discipline;
|
||||
import fr.univ_amu.iut.model.Thematique;
|
||||
import fr.univ_amu.iut.screenController.ScreenController;
|
||||
import fr.univ_amu.iut.view.map.AcademiePath;
|
||||
import fr.univ_amu.iut.view.map.France;
|
||||
import fr.univ_amu.iut.view.map.FranceBuilder;
|
||||
@ -29,6 +27,7 @@ import javafx.event.ActionEvent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@ -53,6 +52,8 @@ public class Controller implements Initializable {
|
||||
@FXML
|
||||
private Button recherche;
|
||||
|
||||
List<String> listNomThematique = new ArrayList<>();
|
||||
|
||||
// Style des boutons
|
||||
Background btNormalBackground = new Background(new BackgroundFill(Color.rgb(255, 110, 64), new CornerRadii(30), Insets.EMPTY));
|
||||
Background btNormalHover = new Background(new BackgroundFill(Color.rgb(255, 152, 120), new CornerRadii(30), Insets.EMPTY));
|
||||
@ -86,30 +87,48 @@ public class Controller implements Initializable {
|
||||
bt.setBackground(btNormalBackground);
|
||||
};
|
||||
|
||||
|
||||
if (obj instanceof Discipline) {
|
||||
Discipline disciplineActuelle = (Discipline) obj;
|
||||
nom = disciplineActuelle.getNom();
|
||||
actionHandler = event -> {
|
||||
Donnees.setDisciplineSelectionee(disciplineActuelle);
|
||||
};
|
||||
} else {
|
||||
Thematique thematiqueActuelle = (Thematique) obj;
|
||||
nom = thematiqueActuelle.getNom();
|
||||
actionHandler = event -> {
|
||||
Donnees.setThematiqueSelectionee(thematiqueActuelle);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
onPressHandler = event -> {
|
||||
Button bt = (Button) event.getSource();
|
||||
if (bt.getBackground().equals(btNormalSelected)) {
|
||||
bt.setBackground(btNormalHover);
|
||||
bt.setOnMouseEntered(onEnterHandler);
|
||||
bt.setOnMouseExited(onExitHandler);
|
||||
} else {
|
||||
if (obj instanceof Discipline) {
|
||||
for (int i = 0; i < discipline.getChildren().size(); ++i) {
|
||||
Button btChild = (Button) discipline.getChildren().get(i);
|
||||
btChild.setBackground(btNormalBackground);
|
||||
|
||||
btChild.setOnMouseEntered(onEnterHandler);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < thematique.getChildren().size(); ++i) {
|
||||
Button btChild = (Button) thematique.getChildren().get(i);
|
||||
btChild.setBackground(btNormalBackground);
|
||||
btChild.setOnMouseEntered(null);
|
||||
}
|
||||
}
|
||||
else{
|
||||
bt.setBackground(btNormalSelected);
|
||||
bt.setOnMouseEntered(null);
|
||||
bt.setOnMouseExited(null);
|
||||
}
|
||||
};
|
||||
|
||||
if ( obj instanceof Discipline ){
|
||||
Discipline disciplineActuelle = (Discipline) obj;
|
||||
nom = disciplineActuelle.getNom();
|
||||
actionHandler = event -> {Donnees.setDisciplineSelectionee(disciplineActuelle);};
|
||||
}
|
||||
else{
|
||||
Thematique thematiqueActuelle = (Thematique) obj;
|
||||
nom = thematiqueActuelle.getNom();
|
||||
actionHandler = event -> {Donnees.setThematiqueSelectionee(thematiqueActuelle);};
|
||||
}
|
||||
|
||||
Button bt = new Button(nom);
|
||||
bt.setMnemonicParsing(false);
|
||||
@ -134,8 +153,7 @@ public class Controller implements Initializable {
|
||||
for (int i = 0; i < disciplines.size(); ++i) {
|
||||
if (i % 2 == 0) {
|
||||
discipline.getChildren().add(initButton(disciplines.get(i), 38, i / 2 * 130));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
discipline.getChildren().add(initButton(disciplines.get(i), 332, i / 2 * 130));
|
||||
}
|
||||
}
|
||||
@ -149,8 +167,7 @@ public class Controller implements Initializable {
|
||||
for (int i = 0; i < thematiques.size(); ++i) {
|
||||
if (i % 2 == 0) {
|
||||
thematique.getChildren().add(initButton(thematiques.get(i), 38, i / 2 * 130));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
thematique.getChildren().add(initButton(thematiques.get(i), 332, i / 2 * 130));
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
<properties>
|
||||
<!-- database connection properties -->
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://localhost/devapp"/>
|
||||
<property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://lagrottedeneotaku.hopto.org:6776/devapp"/>
|
||||
<property name="jakarta.persistence.jdbc.user" value="devapp"/>
|
||||
<property name="jakarta.persistence.jdbc.password" value="7kPoWBgoV5ahygxyXYGzaL"/>
|
||||
<!-- Nous ne devrions pas commit le mot de passe dans le dépot, mais... je ne pense pas que le projet ne respecte la moindre règle de sécurité de toute facon (pas d'architecture trois tiers)-->
|
||||
|
Loading…
Reference in New Issue
Block a user