mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 08:43:54 +00:00
feat(graphique): ajout images, fix tailles gridpane
This commit is contained in:
parent
6d8ec5b7f5
commit
bf1099609c
5 changed files with 25 additions and 15 deletions
|
|
@ -3,10 +3,12 @@ package rtgre.chat;
|
||||||
import javafx.application.Application;
|
import javafx.application.Application;
|
||||||
import javafx.fxml.FXMLLoader;
|
import javafx.fxml.FXMLLoader;
|
||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.LogManager;
|
import java.util.logging.LogManager;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
@ -31,8 +33,10 @@ public class ChatApplication extends Application {
|
||||||
FXMLLoader fxmlLoader = new FXMLLoader(ChatApplication.class.getResource("chat-view.fxml"));
|
FXMLLoader fxmlLoader = new FXMLLoader(ChatApplication.class.getResource("chat-view.fxml"));
|
||||||
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
|
Scene scene = new Scene(fxmlLoader.load(), 320, 240);
|
||||||
stage.setTitle("Chat @BOUCLY_Emi (B2GA)");
|
stage.setTitle("Chat @BOUCLY_Emi (B2GA)");
|
||||||
stage.setMinWidth(800);
|
|
||||||
stage.setMinHeight(500);
|
stage.getIcons().add(new Image(Objects.requireNonNull(ChatApplication.class.getResourceAsStream("rt.png"))));
|
||||||
|
stage.setMinWidth(600);
|
||||||
|
stage.setMinHeight(400);
|
||||||
stage.setScene(scene);
|
stage.setScene(scene);
|
||||||
stage.show();
|
stage.show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@ package rtgre.chat;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.control.*;
|
import javafx.scene.control.*;
|
||||||
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.image.ImageView;
|
import javafx.scene.image.ImageView;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
|
@ -28,5 +30,9 @@ public class ChatController implements Initializable {
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||||
LOGGER.info("Initialisation de l'interface graphique");
|
LOGGER.info("Initialisation de l'interface graphique");
|
||||||
|
|
||||||
|
Image image = new Image(Objects.requireNonNull(ChatController.class.getResourceAsStream("anonymous.png")));
|
||||||
|
this.avatarImageView.setImage(image);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIN
chat/src/main/resources/rtgre/chat/anonymous.png
Normal file
BIN
chat/src/main/resources/rtgre/chat/anonymous.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
|
|
@ -19,7 +19,7 @@
|
||||||
<?import javafx.scene.layout.RowConstraints?>
|
<?import javafx.scene.layout.RowConstraints?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
|
|
||||||
<VBox alignment="CENTER" minHeight="500.0" minWidth="800.0" prefHeight="500.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rtgre.chat.ChatController">
|
<VBox alignment="CENTER" minHeight="400.0" minWidth="600.0" prefHeight="500.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="rtgre.chat.ChatController">
|
||||||
<children>
|
<children>
|
||||||
<MenuBar>
|
<MenuBar>
|
||||||
<menus>
|
<menus>
|
||||||
|
|
@ -36,11 +36,11 @@
|
||||||
</Menu>
|
</Menu>
|
||||||
</menus>
|
</menus>
|
||||||
</MenuBar>
|
</MenuBar>
|
||||||
<GridPane>
|
<GridPane maxWidth="1.7976931348623157E308">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="NEVER" maxWidth="94.0" minWidth="10.0" prefWidth="59.0" />
|
<ColumnConstraints hgrow="NEVER" maxWidth="107.0" minWidth="10.0" prefWidth="62.0" />
|
||||||
<ColumnConstraints hgrow="NEVER" maxWidth="286.0" minWidth="0.0" prefWidth="32.0" />
|
<ColumnConstraints hgrow="NEVER" maxWidth="286.0" minWidth="0.0" prefWidth="34.0" />
|
||||||
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="494.0" />
|
<ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="400.0" />
|
||||||
<ColumnConstraints halignment="RIGHT" hgrow="NEVER" maxWidth="131.0" minWidth="10.0" prefWidth="106.0" />
|
<ColumnConstraints halignment="RIGHT" hgrow="NEVER" maxWidth="131.0" minWidth="10.0" prefWidth="106.0" />
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
|
|
@ -48,33 +48,33 @@
|
||||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<Label text="Server :" />
|
<Label text="Server :" GridPane.hgrow="NEVER" />
|
||||||
<Label text="Login :" GridPane.rowIndex="1" />
|
<Label text="Login :" GridPane.hgrow="NEVER" GridPane.rowIndex="1" />
|
||||||
<ComboBox fx:id="hostComboBox" maxWidth="1.7976931348623157E308" promptText="Choose host..." GridPane.columnIndex="2">
|
<ComboBox fx:id="hostComboBox" maxWidth="1.7976931348623157E308" promptText="Choose host..." GridPane.columnIndex="2" GridPane.hgrow="ALWAYS">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="5.0" top="5.0" />
|
<Insets bottom="5.0" top="5.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
<TextField fx:id="loginTextField" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.rowIndex="1">
|
<TextField fx:id="loginTextField" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="5.0" top="5.0" />
|
<Insets bottom="5.0" top="5.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</TextField>
|
</TextField>
|
||||||
<ToggleButton fx:id="connectionButton" maxHeight="1.7976931348623157E308" mnemonicParsing="false" prefWidth="100.0" text="Connection" GridPane.columnIndex="3" GridPane.rowSpan="2">
|
<ToggleButton fx:id="connectionButton" maxHeight="1.7976931348623157E308" mnemonicParsing="false" prefWidth="100.0" text="Connection" GridPane.columnIndex="3" GridPane.halignment="RIGHT" GridPane.hgrow="NEVER" GridPane.rowSpan="2">
|
||||||
<GridPane.margin>
|
<GridPane.margin>
|
||||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||||
</GridPane.margin>
|
</GridPane.margin>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
<ImageView fx:id="avatarImageView" fitHeight="35.0" fitWidth="34.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
<ImageView fx:id="avatarImageView" fitHeight="24.0" fitWidth="24.0" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="1" GridPane.halignment="LEFT" GridPane.hgrow="NEVER" GridPane.rowIndex="1" />
|
||||||
</children>
|
</children>
|
||||||
<VBox.margin>
|
<VBox.margin>
|
||||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||||
</VBox.margin>
|
</VBox.margin>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<SplitPane fx:id="exchangeSplitPane" dividerPositions="0.5" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
|
<SplitPane fx:id="exchangeSplitPane" dividerPositions="0.9" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
|
||||||
<items>
|
<items>
|
||||||
<ListView fx:id="postListView" prefHeight="200.0" prefWidth="348.0" />
|
<ListView fx:id="postListView" prefHeight="200.0" prefWidth="348.0" />
|
||||||
<SplitPane dividerPositions="0.5" orientation="VERTICAL" prefHeight="200.0" prefWidth="160.0">
|
<SplitPane dividerPositions="0.1" orientation="VERTICAL" prefHeight="200.0" prefWidth="160.0">
|
||||||
<items>
|
<items>
|
||||||
<ListView fx:id="roomsListView" prefHeight="200.0" prefWidth="200.0" />
|
<ListView fx:id="roomsListView" prefHeight="200.0" prefWidth="200.0" />
|
||||||
<ListView fx:id="contactListView" prefHeight="200.0" prefWidth="200.0" />
|
<ListView fx:id="contactListView" prefHeight="200.0" prefWidth="200.0" />
|
||||||
|
|
|
||||||
BIN
chat/src/main/resources/rtgre/chat/rt.png
Normal file
BIN
chat/src/main/resources/rtgre/chat/rt.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue