Skip to content

Commit 6670a84

Browse files
committed
Merge branch 'branch-A-Release'
2 parents ed62ff1 + 06c0c2e commit 6670a84

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

src/main/java/DialogBox.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import javafx.scene.image.Image;
1212
import javafx.scene.image.ImageView;
1313
import javafx.scene.layout.HBox;
14+
import javafx.scene.shape.Circle;
1415

1516
/**
1617
* An example of a custom control using FXML.
@@ -32,9 +33,11 @@ private DialogBox(String text, Image img) {
3233
} catch (IOException e) {
3334
e.printStackTrace();
3435
}
36+
Circle clip = new Circle(30, 30, 30);
3537

3638
dialog.setText(text);
3739
displayPicture.setImage(img);
40+
displayPicture.setClip(clip);
3841
}
3942

4043
/**

src/main/java/MainWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class MainWindow extends AnchorPane {
2929
private Duke duke;
3030

3131
private Image userImage = new Image(this.getClass().getResourceAsStream("/images/DaUser.png"));
32-
private Image dukeImage = new Image(this.getClass().getResourceAsStream("/images/Duke_waving.svg.png"));
32+
private Image dukeImage = new Image(this.getClass().getResourceAsStream("/images/Duke_waving.svg.png"), 80, 80, false, false);
3333

3434
@FXML
3535
public void initialize() {
-4.71 KB
Loading
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.Group?>
45
<?import javafx.scene.control.Label?>
56
<?import javafx.scene.image.ImageView?>
67
<?import javafx.scene.layout.HBox?>
78

8-
<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="400.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
9+
<fx:root alignment="TOP_RIGHT" maxWidth="-Infinity" opacity="0.81" prefWidth="430.0" style="-fx-border-radius: 30 30 0 0; -fx-background-color: #5598AA; -fx-background-radius: 30 30 30 30; -fx-background-position: center;" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1">
910
<children>
10-
<Label fx:id="dialog" text="Label" wrapText="true" />
11-
<ImageView fx:id="displayPicture" fitHeight="99.0" fitWidth="99.0" pickOnBounds="true" preserveRatio="true" />
11+
<Group>
12+
<children>
13+
<Label fx:id="dialog" text="Label" textFill="#f2f0f0" wrapText="true" />
14+
</children>
15+
<HBox.margin>
16+
<Insets bottom="15.0" right="10.0" top="15.0" />
17+
</HBox.margin>
18+
</Group>
19+
<ImageView fx:id="displayPicture" fitHeight="60.0" fitWidth="60.0" pickOnBounds="true" preserveRatio="true">
20+
<HBox.margin>
21+
<Insets />
22+
</HBox.margin>
23+
</ImageView>
1224
</children>
1325
<padding>
14-
<Insets bottom="15.0" left="5.0" right="5.0" top="15.0" />
26+
<Insets bottom="10.0" left="5.0" right="5.0" top="10.0" />
1527
</padding>
16-
</fx:root>
28+
</fx:root>
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import javafx.geometry.Insets?>
34
<?import javafx.scene.control.Button?>
45
<?import javafx.scene.control.ScrollPane?>
56
<?import javafx.scene.control.TextField?>
67
<?import javafx.scene.layout.AnchorPane?>
78
<?import javafx.scene.layout.VBox?>
89

9-
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="MainWindow">
10+
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="450.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="MainWindow">
1011
<children>
1112
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="316.0" promptText="Type your input here..." AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="80.0" />
1213
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput" prefHeight="41.0" prefWidth="72.0" text="Send" AnchorPane.rightAnchor="4.0" />
13-
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0" vvalue="1.0">
14+
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="450.0" vvalue="1.0">
1415
<content>
15-
<VBox fx:id="dialogContainer" prefHeight="552.0" prefWidth="388.0" />
16+
<VBox fx:id="dialogContainer" prefHeight="552.0" prefWidth="440.0" spacing="25.0">
17+
<padding>
18+
<Insets left="10.0" right="10.0" />
19+
</padding></VBox>
1620
</content>
21+
<padding>
22+
<Insets left="5.0" right="5.0" />
23+
</padding>
1724
</ScrollPane>
1825
</children>
1926
</AnchorPane>

0 commit comments

Comments
 (0)