labelled the name of the room when in it
This commit is contained in:
@@ -44,6 +44,9 @@ public class ClientGuiController implements ClientListener {
|
|||||||
@FXML
|
@FXML
|
||||||
private ScrollPane chatPane;
|
private ScrollPane chatPane;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
private Label roomName;
|
||||||
|
|
||||||
public void setClient(Client client) {
|
public void setClient(Client client) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
}
|
}
|
||||||
@@ -183,11 +186,13 @@ public class ClientGuiController implements ClientListener {
|
|||||||
*/
|
*/
|
||||||
private void createChatEnv(String roomName) {
|
private void createChatEnv(String roomName) {
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
this.roomName.setText("Room: " + roomName);
|
||||||
chatList.getChildren().clear();
|
chatList.getChildren().clear();
|
||||||
chatInput.getChildren().clear();
|
chatInput.getChildren().clear();
|
||||||
Button leaveButton = new Button("Leave room");
|
Button leaveButton = new Button("Leave room");
|
||||||
leaveButton.setOnAction(event -> {
|
leaveButton.setOnAction(event -> {
|
||||||
client.SendLeaveRoom();
|
client.SendLeaveRoom();
|
||||||
|
this.roomName.setText("");
|
||||||
chatList.getChildren().clear();
|
chatList.getChildren().clear();
|
||||||
chatInput.getChildren().clear();
|
chatInput.getChildren().clear();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<BorderPane xmlns="http://javafx.com/javafx"
|
<BorderPane xmlns="http://javafx.com/javafx"
|
||||||
xmlns:fx="http://javafx.com/fxml"
|
xmlns:fx="http://javafx.com/fxml"
|
||||||
fx:controller="client.ClientGuiController"
|
fx:controller="client.ClientGuiController"
|
||||||
prefHeight="400.0" prefWidth="600.0" styleClass="vue-container" fx:id="vueContainer">
|
prefHeight="400.0" prefWidth="600.0" fx:id="vueContainer">
|
||||||
<top>
|
<top>
|
||||||
<HBox alignment="CENTER" styleClass="logo-box">
|
<HBox alignment="CENTER" styleClass="logo-box">
|
||||||
<padding>
|
<padding>
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
</HBox>
|
</HBox>
|
||||||
</top>
|
</top>
|
||||||
<left>
|
<left>
|
||||||
<ScrollPane prefWidth="200.0" styleClass="rooms-pane" fx:id="roomsPane" fitToWidth="true">
|
<ScrollPane prefWidth="200.0" fitToWidth="true">
|
||||||
<VBox fx:id="rooms" spacing="10.0" alignment="CENTER" VBox.vgrow="ALWAYS">
|
<VBox spacing="10.0" alignment="CENTER" VBox.vgrow="ALWAYS">
|
||||||
<Label text="Rooms" styleClass="rooms-label"/>
|
<Label text="Rooms" styleClass="rooms-label"/>
|
||||||
<VBox fx:id="roomList" styleClass="rooms-list" spacing="5.0" VBox.vgrow="ALWAYS" alignment="CENTER"/>
|
<VBox fx:id="roomList" styleClass="rooms-list" spacing="5.0" VBox.vgrow="ALWAYS" alignment="CENTER"/>
|
||||||
</VBox>
|
</VBox>
|
||||||
@@ -34,15 +34,23 @@
|
|||||||
</left>
|
</left>
|
||||||
<center>
|
<center>
|
||||||
<BorderPane>
|
<BorderPane>
|
||||||
|
<top>
|
||||||
|
<HBox alignment="CENTER">
|
||||||
|
<padding>
|
||||||
|
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
|
||||||
|
</padding>
|
||||||
|
<Label fx:id="roomName" style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
|
||||||
|
</HBox>
|
||||||
|
</top>
|
||||||
<center>
|
<center>
|
||||||
<ScrollPane styleClass="chat-pane" fx:id="chatPane" fitToWidth="true">
|
<ScrollPane fx:id="chatPane" fitToWidth="true">
|
||||||
<VBox fx:id="chat" spacing="10.0">
|
<VBox spacing="10.0">
|
||||||
<VBox fx:id="chatList" styleClass="chat-list" spacing="5.0" VBox.vgrow="ALWAYS"/>
|
<VBox fx:id="chatList" styleClass="chat-list" spacing="5.0" VBox.vgrow="ALWAYS"/>
|
||||||
</VBox>
|
</VBox>
|
||||||
</ScrollPane>
|
</ScrollPane>
|
||||||
</center>
|
</center>
|
||||||
<bottom>
|
<bottom>
|
||||||
<HBox fx:id="chatInput" styleClass="chat-input" spacing="5.0" style="-fx-padding: 10;" />
|
<HBox fx:id="chatInput" spacing="5.0" style="-fx-padding: 10;" />
|
||||||
</bottom>
|
</bottom>
|
||||||
</BorderPane>
|
</BorderPane>
|
||||||
</center>
|
</center>
|
||||||
|
|||||||
Reference in New Issue
Block a user