diff --git a/.gitignore b/.gitignore index ebb0fc1bf072b07db4200854b10ef184a8812304..dc767db813c658b8c5fb20718309f68714f7174f 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ dkms.conf # Personal remove .vscode/ .idea/ +.DS_Store/ # Maven @@ -81,5 +82,4 @@ buildNumber.properties # intellij *.iml - -# End of https://www.toptal.com/developers/gitignore/api/maven \ No newline at end of file +# End of https://www.toptal.com/developers/gitignore/api/maven diff --git a/README.md b/README.md index 4068b515915ebe9ed08dc62ac76443827367e8a6..76b1aced350c95e8fd4de6667849272034a6aee0 100644 --- a/README.md +++ b/README.md @@ -139,4 +139,35 @@ mvn -version Run program with maven : ```console mvn clean javafx:run -``` \ No newline at end of file +``` + +## Create a branch and push it +```console + git checkout -b [branchName] [baseBranch=dev] +``` + +```console + git commit -m "[commitMessage]" +``` + +```console + git commit --allow-empty -m "[commitMessage]" +``` + +```console + git push origin [branchName] +``` + +--- +--- + +# Présentation Sprint 1 + +- Introduire le sujet (Maxence) -> gestion des branches avec git +- Montrer les objectifs du sprint 1 (Maxence) BACKLOG +- Présenter ce qui est fonctionnel : + - Map (Dylan) + - Markers (Scott) + - Scene (John) + - Profile (Niko) +- Conclution (Damian) \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5b2cb015f16ad62a921003b4fb77b0c3e6716c64..69bbae3d397271b98ea10ae9cb5ab776104fd0fd 100644 --- a/pom.xml +++ b/pom.xml @@ -68,6 +68,11 @@ <version>${junit.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.openjfx</groupId> + <artifactId>javafx-web</artifactId> + <version>17.0.1</version> + </dependency> </dependencies> <build> diff --git a/src/main/java/ch/dreamteam/geoconnect/MainApplication.java b/src/main/java/ch/dreamteam/geoconnect/MainApplication.java index 831aee582ca1a78b6ec991cad033b32745b1a35a..1ebeb30e534d05625b20ba7440e73b3afa569574 100644 --- a/src/main/java/ch/dreamteam/geoconnect/MainApplication.java +++ b/src/main/java/ch/dreamteam/geoconnect/MainApplication.java @@ -1,96 +1,31 @@ package ch.dreamteam.geoconnect; +import ch.dreamteam.geoconnect.controllers.SceneController; import ch.dreamteam.geoconnect.helpers.Params; -import com.dlsc.gmapsfx.GoogleMapView; -import com.dlsc.gmapsfx.MapComponentInitializedListener; -import com.dlsc.gmapsfx.javascript.object.*; -import com.dlsc.gmapsfx.service.directions.DirectionStatus; -import com.dlsc.gmapsfx.service.directions.DirectionsResult; -import com.dlsc.gmapsfx.service.directions.DirectionsServiceCallback; -import com.dlsc.gmapsfx.service.elevation.ElevationResult; -import com.dlsc.gmapsfx.service.elevation.ElevationServiceCallback; -import com.dlsc.gmapsfx.service.elevation.ElevationStatus; -import com.dlsc.gmapsfx.service.geocoding.GeocoderStatus; -import com.dlsc.gmapsfx.service.geocoding.GeocodingResult; -import com.dlsc.gmapsfx.service.geocoding.GeocodingServiceCallback; import javafx.application.Application; -import javafx.fxml.FXMLLoader; -import javafx.scene.Scene; -import javafx.scene.web.WebEvent; import javafx.stage.Stage; +import javafx.util.Pair; +import netscape.javascript.JSObject; import java.io.IOException; +import java.lang.reflect.Array; +import java.net.URL; +import java.util.ArrayList; -public class MainApplication extends Application implements MapComponentInitializedListener, ElevationServiceCallback, GeocodingServiceCallback, DirectionsServiceCallback { - - protected static GoogleMapView mapComponent; - protected GoogleMap map; - protected DirectionsPane directions; +public class MainApplication extends Application { public static void main(String[] args) { launch(args); } - public static GoogleMapView getMapComponent() { - return mapComponent; - } - @Override public void start(Stage primaryStage) throws IOException { - initializeMapComponent(); - + String defaultScene = "map"; + SceneController.initStageAndScenes(primaryStage, defaultScene); /*Load FXML file*/ - FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("views/home-view.fxml")); - Scene scene = new Scene(fxmlLoader.load(), 1400, 900); primaryStage.setTitle(Params.APP_NAME); - primaryStage.setScene(scene); + SceneController.loadScene(defaultScene); primaryStage.show(); } - - private void initializeMapComponent() { - mapComponent = new GoogleMapView(null, "AIzaSyBME8EFus9n7fjurdqU3Bsm1Y-BfgroA2o"); - mapComponent.addMapInitializedListener(this); - mapComponent.setDisableDoubleClick(true); - mapComponent.getWebview().getEngine().setOnAlert((WebEvent<String> event) -> System.out.println("Event event: " + event)); - } - - @Override - public void mapInitialized() { - LatLong center = new LatLong(46.2050242, 6.1090692); - mapComponent.addMapReadyListener(() -> { - // This call will fail unless the map is completely ready. - //checkCenter(center); - }); - - MapOptions options = new MapOptions(); - options.center(center) - .zoom(13) - .overviewMapControl(true) - .panControl(true) - .rotateControl(true) - .scaleControl(true) - .streetViewControl(true) - .zoomControl(true) - .mapType(MapTypeIdEnum.ROADMAP); - - map = mapComponent.createMap(options); - - map.setHeading(123.2); - } - - @Override - public void directionsReceived(DirectionsResult results, DirectionStatus status) { - - } - - @Override - public void elevationsReceived(ElevationResult[] results, ElevationStatus status) { - - } - - @Override - public void geocodedResultsReceived(GeocodingResult[] results, GeocoderStatus status) { - - } } diff --git a/src/main/java/ch/dreamteam/geoconnect/controllers/MainController.java b/src/main/java/ch/dreamteam/geoconnect/controllers/MainController.java index f7dd4b563bd8991e87b4bae2d33af5d82c4d0daf..0f3509621cc5a0cc3086e7072bbdbce18ef66c83 100644 --- a/src/main/java/ch/dreamteam/geoconnect/controllers/MainController.java +++ b/src/main/java/ch/dreamteam/geoconnect/controllers/MainController.java @@ -1,17 +1,28 @@ package ch.dreamteam.geoconnect.controllers; -import ch.dreamteam.geoconnect.MainApplication; import com.dlsc.gmapsfx.GoogleMapView; +import com.dlsc.gmapsfx.MapComponentInitializedListener; +import com.dlsc.gmapsfx.javascript.event.UIEventType; +import com.dlsc.gmapsfx.javascript.object.*; +import com.dlsc.gmapsfx.util.MarkerImageFactory; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; +import javafx.scene.web.WebEvent; +import netscape.javascript.JSObject; +import org.kordamp.ikonli.javafx.FontIcon; +import java.io.IOException; import java.net.URL; +import java.util.ArrayList; import java.util.ResourceBundle; -public class MainController implements Initializable { +public class MainController implements Initializable, MapComponentInitializedListener { + protected GoogleMapView mapComponent; + protected GoogleMap map; @FXML private HBox iconsContainer; @FXML @@ -23,13 +34,93 @@ public class MainController implements Initializable { @FXML private VBox menuContainer; + @FXML + public VBox userProfilContainer; + @Override public void initialize(URL url, ResourceBundle resourceBundle) { - System.out.println("initialize"); - GoogleMapView mapComponent = MainApplication.getMapComponent(); + initializeMapComponent(); + //mapComponent.setPrefSize(mapContainer.getWidth(), mapContainer.getHeight()); mapComponent.setPrefHeight(mapContainer.getPrefHeight()); mapComponent.setPrefWidth(mapContainer.getPrefWidth()); mapContainer.getChildren().add(mapComponent); } + + private void initializeMapComponent() { + mapComponent = new GoogleMapView(null, "AIzaSyBME8EFus9n7fjurdqU3Bsm1Y-BfgroA2o"); + mapComponent.addMapInitializedListener(this); + mapComponent.setDisableDoubleClick(true); + mapComponent.getWebview().getEngine().setOnAlert((WebEvent<String> event) -> System.out.println("Event event: " + event)); + } + + @Override + public void mapInitialized() { + LatLong center = new LatLong(46.2050242, 6.1090692); + ArrayList<LatLong> coordonates = new ArrayList<>(); + coordonates.add(new LatLong(46.2050242, 6.1090692)); + coordonates.add(new LatLong(46.2066136,6.1499329)); + + mapComponent.addMapReadyListener(() -> { + Integer index = 1; + for(LatLong coordonate : coordonates) { + Marker m = addMarker(coordonate, index); + map.addUIEventHandler(m, UIEventType.click, (JSObject o)->{ + System.out.println("CLICK USER" + m.getTitle()); + displayProfile(); + }); + index++; + } + }); + + MapOptions options = new MapOptions(); + options.center(center) + .zoom(13) + .overviewMapControl(true) + .panControl(true) + .rotateControl(true) + .scaleControl(true) + .streetViewControl(true) + .zoomControl(true) + .mapType(MapTypeIdEnum.ROADMAP); + + map = mapComponent.createMap(options); + + map.setHeading(123.2); + } + + public void handleOnMouseClicked(javafx.scene.input.MouseEvent mouseEvent) { + String id = ((FontIcon) mouseEvent.getSource()).getId(); + System.out.println(id); + System.out.println(SceneController.getCurrentScene()); + try { + if (id.equals("profileIcon") && !SceneController.getCurrentScene().equals("profile")) { + SceneController.loadScene("profile"); + } else if (id.equals("mapIcon") && !SceneController.getCurrentScene().equals("map")) { + SceneController.loadScene("map"); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + public Marker addMarker(LatLong coordinates, Integer idUser) { + MarkerOptions options = new MarkerOptions(); + String iconPath = MarkerImageFactory.createMarkerImage("./user-marker.png", "png"); + options.icon(iconPath) + .title("Id:"+idUser) + .position(coordinates); + + Marker marker = new Marker(options); + this.map.addMarker(marker); + return marker; + } + + public void displayProfile() { + userProfilContainer.setVisible(true); + } + + public void hiddeProfile() { + userProfilContainer.setVisible(false); + } } \ No newline at end of file diff --git a/src/main/java/ch/dreamteam/geoconnect/controllers/ProfileController.java b/src/main/java/ch/dreamteam/geoconnect/controllers/ProfileController.java new file mode 100644 index 0000000000000000000000000000000000000000..c28ec1c1dcc76419e2248a168ef8592787005eb6 --- /dev/null +++ b/src/main/java/ch/dreamteam/geoconnect/controllers/ProfileController.java @@ -0,0 +1,153 @@ +package ch.dreamteam.geoconnect.controllers; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Button; +import javafx.scene.control.DatePicker; +import javafx.scene.control.ListView; +import javafx.scene.control.TextField; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.HBox; +import org.kordamp.ikonli.javafx.FontIcon; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.time.LocalDate; +import java.util.List; +import java.util.ResourceBundle; + + + + +public class ProfileController implements Initializable { + // ATTRIBUTES + private String name; + private String surname; + private LocalDate birthday; + private Image profilePic; + private ObservableList<String> interests; + + // COMPONENTS + // FXML ids must be the exact same as written below + @FXML private TextField tfName; + @FXML private TextField tfSurname; + @FXML private ImageView ivProfileImg; + @FXML private ListView<String> lvInterests; + @FXML private DatePicker dpBirthday; + @FXML private Button btnSubmitModifications; + @FXML private Button btnCancelModifications; + @FXML private Button btnActivateModification; + + + private void initComponents() { + // TODO: setup data source + name = "Jean"; + surname = "Charles"; + birthday = LocalDate.of(1997, 1, 9); + File file = new File("/home/eldado/HEPIA/PJO/geoconnect/src/main/resources/ch/dreamteam/geoconnect/images/profile-pic-example.jpg"); // only used for the example + profilePic = new Image(file.toURI().toString()); + interests = FXCollections.observableArrayList("Pêche", "Fôtbale", "MEPORG", "HTML5", "Pétanque"); + + tfName.setText(name); + tfName.setEditable(false); + tfName.setDisable(false); + + tfSurname.setText(surname); + tfSurname.setEditable(false); + tfSurname.setDisable(false); + + ivProfileImg.setImage(profilePic); + dpBirthday.setValue(birthday); + dpBirthday.setEditable(false); + //TODO: implement interests + + lvInterests.getItems().setAll(interests); + } + + + private void setEditMode() { + tfName.setEditable(true); + tfName.setDisable(false); + + tfSurname.setEditable(true); + tfSurname.setDisable(false); + //tfSurname.setEditable(true); + //ImageView to implement + //HBox to implement + dpBirthday.setDisable(false); + + btnActivateModification.setDisable(true); + btnActivateModification.setVisible(false); + + btnSubmitModifications.setDisable(false); + btnSubmitModifications.setVisible(true); + + btnCancelModifications.setDisable(false); + btnCancelModifications.setVisible(true); + } + public void handleOnMouseClicked(javafx.scene.input.MouseEvent mouseEvent) { + String id = ((FontIcon) mouseEvent.getSource()).getId(); + System.out.println(id); + System.out.println(SceneController.getCurrentScene()); + try { + if (id.equals("profileIcon") && !SceneController.getCurrentScene().equals("profile")) { + SceneController.loadScene("profile"); + } else if (id.equals("mapIcon") && !SceneController.getCurrentScene().equals("map")) { + SceneController.loadScene("map"); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + private void setReadMode() { + tfName.setEditable(false); + tfSurname.setEditable(false); + //TODO: implement ImageView picker + //TODO: implement HBox edition + dpBirthday.setDisable(true); + dpBirthday.getEditor().setStyle("-fx-opacity: 1"); + + btnActivateModification.setDisable(false); + btnActivateModification.setVisible(true); + + btnSubmitModifications.setDisable(true); + btnSubmitModifications.setVisible(false); + + btnCancelModifications.setDisable(true); + btnCancelModifications.setVisible(false); + } + + private void saveModifications() { + name = tfName.getText(); + birthday = dpBirthday.getValue(); + //TODO: implement interests update + //TODO: implement image update + } + + @Override + public void initialize(URL url, ResourceBundle resourceBundle) { + System.out.println("initialize profile"); + initComponents(); + setReadMode(); + + btnActivateModification.setOnAction(actionEvent -> setEditMode()); + + //TODO: implement buttons behaviour + btnSubmitModifications.setOnAction(actionEvent -> { + saveModifications(); + //System.out.println(name + " " + surname + " " + birthday + " added as new infos"); + setReadMode(); + }); + + + btnCancelModifications.setOnAction(actionEvent -> { + initComponents(); + setReadMode(); + }); + } +} diff --git a/src/main/java/ch/dreamteam/geoconnect/controllers/SceneController.java b/src/main/java/ch/dreamteam/geoconnect/controllers/SceneController.java new file mode 100644 index 0000000000000000000000000000000000000000..a8e0ed7e646d8574c7661fb69477d34994734bf4 --- /dev/null +++ b/src/main/java/ch/dreamteam/geoconnect/controllers/SceneController.java @@ -0,0 +1,42 @@ +package ch.dreamteam.geoconnect.controllers; + +import ch.dreamteam.geoconnect.MainApplication; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.stage.Stage; + +import java.io.IOException; +import java.net.URL; +import java.util.HashMap; + +public class SceneController { + private static Stage currentStage; + + private static HashMap<String, URL> scenes; + private static String currentScene; + + public static String getCurrentScene() { + return currentScene; + } + + public static void initStageAndScenes(Stage stage, String defaultScene) { + currentStage = stage; + scenes = new HashMap<>(); + scenes.put("map", MainApplication.class.getResource("views/home-view.fxml")); + scenes.put("profile", MainApplication.class.getResource("views/profile-view.fxml")); + currentScene = defaultScene; + } + + + public static void loadScene(String sceneName) throws IOException { + URL sceneUrl = scenes.get(sceneName); + if (sceneUrl == null) { + return; + } + currentScene = sceneName; + + FXMLLoader fxmlLoader = new FXMLLoader(sceneUrl); + Scene scene = new Scene(fxmlLoader.load(), 1400, 900); + currentStage.setScene(scene); + } +} diff --git a/src/main/java/ch/dreamteam/geoconnect/controllers/user-marker.png b/src/main/java/ch/dreamteam/geoconnect/controllers/user-marker.png new file mode 100644 index 0000000000000000000000000000000000000000..6676489d6cbe56166738fc94a0b7a8cd6b4c1306 Binary files /dev/null and b/src/main/java/ch/dreamteam/geoconnect/controllers/user-marker.png differ diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 6311ce4d56ed76153c8665bbfa00071689eb6ba1..7176e2c210b409e256885d6ea29792feb4515565 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -8,6 +8,7 @@ module ch.dreamteam.geoconnect { requires com.dlsc.gmapsfx; requires javafx.web; requires org.kordamp.ikonli.fontawesome5; + requires jdk.jsobject; opens ch.dreamteam.geoconnect to javafx.fxml; exports ch.dreamteam.geoconnect; diff --git a/src/main/resources/ch/dreamteam/geoconnect/css/style.css b/src/main/resources/ch/dreamteam/geoconnect/css/style.css index 4a98f492d950d2a3a4d8dd3f577afaec95b8da3d..1b5df7ccaf3fcf847d8233d3cb51792d40b65f35 100644 --- a/src/main/resources/ch/dreamteam/geoconnect/css/style.css +++ b/src/main/resources/ch/dreamteam/geoconnect/css/style.css @@ -5,4 +5,10 @@ .active { -fx-icon-color: black; +} + +.main-vbox { + -fx-pref-width: 960px; + -fx-pref-height: 540px; + -fx-background-color: blue; } \ No newline at end of file diff --git a/src/main/resources/ch/dreamteam/geoconnect/images/profile-pic-example.jpg b/src/main/resources/ch/dreamteam/geoconnect/images/profile-pic-example.jpg new file mode 100644 index 0000000000000000000000000000000000000000..27705e18cdde6581c59da7415c9af87cbcd5e531 Binary files /dev/null and b/src/main/resources/ch/dreamteam/geoconnect/images/profile-pic-example.jpg differ diff --git a/src/main/resources/ch/dreamteam/geoconnect/img/user-marker.png b/src/main/resources/ch/dreamteam/geoconnect/img/user-marker.png new file mode 100644 index 0000000000000000000000000000000000000000..6676489d6cbe56166738fc94a0b7a8cd6b4c1306 Binary files /dev/null and b/src/main/resources/ch/dreamteam/geoconnect/img/user-marker.png differ diff --git a/src/main/resources/ch/dreamteam/geoconnect/views/home-view.fxml b/src/main/resources/ch/dreamteam/geoconnect/views/home-view.fxml index 891f2883804b1265b2cdd08fb462f16b9cddff58..123fd40311dcd169215952730fb22f82bd54f963 100644 --- a/src/main/resources/ch/dreamteam/geoconnect/views/home-view.fxml +++ b/src/main/resources/ch/dreamteam/geoconnect/views/home-view.fxml @@ -1,19 +1,27 @@ <?xml version="1.0" encoding="UTF-8"?> +<?import javafx.scene.control.*?> +<?import javafx.scene.image.*?> <?import javafx.scene.layout.*?> -<?import org.kordamp.ikonli.javafx.FontIcon?> -<AnchorPane prefHeight="900.0" prefWidth="1400.0" xmlns="http://javafx.com/javafx/11.0.14-internal" - xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.dreamteam.geoconnect.controllers.MainController" - stylesheets="@../css/style.css"> - <VBox fx:id="container" layoutX="14.0" layoutY="47.0" prefHeight="900.0" prefWidth="1400.0" - AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" - AnchorPane.topAnchor="0.0"> - <VBox fx:id="mapContainer" prefHeight="850.0" prefWidth="1400.0"/> +<?import org.kordamp.ikonli.javafx.*?> + +<AnchorPane prefHeight="900.0" prefWidth="1400.0" stylesheets="@../css/style.css" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.dreamteam.geoconnect.controllers.MainController"> + <VBox fx:id="container" layoutX="14.0" layoutY="47.0" prefHeight="900.0" prefWidth="1400.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <VBox fx:id="mapContainer" prefHeight="850.0" prefWidth="1400.0" /> <VBox fx:id="menuContainer" prefHeight="50.0" prefWidth="1400.0"> <HBox fx:id="iconsContainer" alignment="CENTER" spacing="15" style="-fx-padding: 5 15 5 15"> - <FontIcon styleClass="icon" iconLiteral="fas-map-marker-alt" iconSize="32" iconColor="#99b0ff"/> - <FontIcon styleClass="icon,active" iconLiteral="far-user-circle" iconSize="32" iconColor="#99b0ff"/> + <FontIcon fx:id="mapIcon" iconColor="#99b0ff" iconLiteral="fas-map-marker-alt" iconSize="32" styleClass="icon" onMouseClicked="#handleOnMouseClicked"/> + <FontIcon fx:id="profileIcon" iconColor="#99b0ff" iconLiteral="far-user-circle" iconSize="32" styleClass="icon,active" onMouseClicked="#handleOnMouseClicked"/> </HBox> </VBox> </VBox> + <VBox fx:id="userProfilContainer" prefHeight="850.0" prefWidth="400.0" style="-fx-background-color: white;" visible="false" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <children> + <Button text="Close" onMouseClicked="#hiddeProfile"/> + <ImageView fx:id="imageProfil" fitHeight="200.0" fitWidth="200.0" pickOnBounds="true" preserveRatio="true"/> + <Label text="Birner Scott" textAlignment="CENTER"/> + <Label text="HEPIA" /> + <Label text="Informatique" /> + </children></VBox> + </AnchorPane> diff --git a/src/main/resources/ch/dreamteam/geoconnect/views/profile-view.fxml b/src/main/resources/ch/dreamteam/geoconnect/views/profile-view.fxml new file mode 100644 index 0000000000000000000000000000000000000000..db3aadfd1b8334468330be4b8b7384a5fd380fb7 --- /dev/null +++ b/src/main/resources/ch/dreamteam/geoconnect/views/profile-view.fxml @@ -0,0 +1,109 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Copyright (c) 2015, 2019, Gluon and/or its affiliates. + All rights reserved. Use is subject to license terms. + + This file is available and licensed under the following license: + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + - Neither the name of Oracle Corporation nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<?import javafx.geometry.*?> +<?import javafx.scene.control.*?> +<?import javafx.scene.image.*?> +<?import javafx.scene.layout.*?> +<?import javafx.scene.paint.*?> +<?import javafx.scene.text.*?> +<?import org.kordamp.ikonli.javafx.*?> + +<VBox stylesheets="@../css/style.css" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="800.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ch.dreamteam.geoconnect.controllers.ProfileController"> + <children> + <SplitPane focusTraversable="true" prefHeight="-1.0" prefWidth="-1.0" VBox.vgrow="ALWAYS"> + <items> + <AnchorPane prefHeight="682.0" prefWidth="1278.0"> + <children> + <ImageView id="ivProfileImg" fx:id="ivProfileImg" cache="true" fitHeight="244.0" fitWidth="200.0" layoutX="90.0" layoutY="23.0" pickOnBounds="true" preserveRatio="true" /> + + + <Label layoutX="25.0" layoutY="304.0" text="Nom" HBox.hgrow="ALWAYS"> + <font> + <Font size="15.0" /> + </font> + </Label> + <TextField id="tfName" fx:id="tfName" alignment="CENTER" layoutX="161.0" layoutY="300.0"> + <font> + <Font size="15.0" /> + </font> + </TextField> + + + + <Label layoutX="25.0" layoutY="354.0" text="Prénom" HBox.hgrow="ALWAYS"> + <font> + <Font size="15.0" /> + </font> + </Label> + <TextField id="tfSurname" fx:id="tfSurname" alignment="CENTER" layoutX="161.0" layoutY="350.0"> + <font> + <Font size="15.0" /> + </font> + </TextField> + + + <Label layoutX="25.0" layoutY="399.0" text="Date de naissance" HBox.hgrow="ALWAYS"> + <font> + <Font size="15.0" /> + </font> + </Label> + <DatePicker id="dpBirthday" fx:id="dpBirthday" editable="false" layoutX="163.0" layoutY="396.0" prefHeight="32.0" prefWidth="183.0" promptText="30.04.1998" /> + + + + <Label layoutX="25.0" layoutY="449.0" text="Intérêts" HBox.hgrow="ALWAYS"> + <font> + <Font size="15.0" /> + </font> + </Label> + + + + <Button id="btnSubmitModifications" fx:id="btnSubmitModifications" layoutX="275.0" layoutY="621.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="71.0" text="Valider" /> + <Button id="btnCancelModifications" fx:id="btnCancelModifications" layoutX="163.0" layoutY="621.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="71.0" text="Annuler" /> + <Button id="btnActivateModification" fx:id="btnActivateModification" layoutX="190.0" layoutY="663.0" mnemonicParsing="false" prefHeight="25.0" prefWidth="125.0" text="Editer le profil" /> + <ListView id="lvInterests" fx:id="lvInterests" layoutX="161.0" layoutY="449.0" prefHeight="143.0" prefWidth="186.0" /> + </children> + </AnchorPane> + </items> + </SplitPane> + <VBox fx:id="menuContainer" prefHeight="50.0" prefWidth="1400.0"> + <HBox fx:id="iconsContainer" alignment="CENTER" spacing="15" style="-fx-padding: 5 15 5 15"> + <FontIcon fx:id="mapIcon" iconColor="#99b0ff" iconLiteral="fas-map-marker-alt" iconSize="32" onMouseClicked="#handleOnMouseClicked" styleClass="icon" /> + <FontIcon fx:id="profileIcon" iconColor="#99b0ff" iconLiteral="far-user-circle" iconSize="32" onMouseClicked="#handleOnMouseClicked" styleClass="icon,active" /> + </HBox> + </VBox> + </children> +</VBox> diff --git a/src/main/resources/ch/dreamteam/geoconnect/views/test.fxml b/src/main/resources/ch/dreamteam/geoconnect/views/test.fxml new file mode 100644 index 0000000000000000000000000000000000000000..a480ca6b327cc8292e324d141ba9b9cdb72c4343 --- /dev/null +++ b/src/main/resources/ch/dreamteam/geoconnect/views/test.fxml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Label?> +<?import javafx.scene.layout.AnchorPane?> +<AnchorPane xmlns:fx="http://javafx.com/fxml" + xmlns="http://javafx.com/javafx" + prefHeight="400.0" prefWidth="600.0"> + <Label text="Salut a tous"/> +</AnchorPane>