Skip to content

Commit

Permalink
Update GUI and add Ui.png
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjieee committed Feb 29, 2024
1 parent 9ef7366 commit 8855b03
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 8 deletions.
Binary file added docs/Ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/main/java/xavier/Xavier.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public String getResponse(String input) {
try {
Command cmd = new Parser(input, tasks).parse();
isExit = cmd.isExit();
if (isExit) {
storage.saveDataAndExit(tasks);
return cmd.execute();
}
return cmd.execute();

} catch (IndexOutOfBoundsException e) {
Expand Down
23 changes: 20 additions & 3 deletions src/main/resources/view/DialogBox.fxml
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.geometry.Point3D?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.text.Font?>

<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefWidth="400.0" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
<fx:root alignment="TOP_RIGHT" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" type="javafx.scene.layout.HBox" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Label fx:id="dialog" text="Label" wrapText="true" />
<ImageView fx:id="displayPicture" fitHeight="99.0" fitWidth="99.0" pickOnBounds="true" preserveRatio="true" />
<Label fx:id="dialog" accessibleRole="TOOLTIP" alignment="TOP_LEFT" text="Label" wrapText="true" HBox.hgrow="ALWAYS">
<font>
<Font name="Verdana" size="13.0" />
</font>
<HBox.margin>
<Insets />
</HBox.margin>
<padding>
<Insets left="10.0" right="10.0" />
</padding>
<rotationAxis>
<Point3D />
</rotationAxis></Label>
<ImageView fx:id="displayPicture" fitHeight="50.0" fitWidth="50.0" pickOnBounds="true" preserveRatio="true" HBox.hgrow="ALWAYS">
<rotationAxis>
<Point3D />
</rotationAxis></ImageView>
</children>
<padding>
<Insets bottom="15.0" left="5.0" right="5.0" top="15.0" />
Expand Down
14 changes: 9 additions & 5 deletions src/main/resources/view/MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xavier.MainWindow">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="xavier.MainWindow">
<children>
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="324.0" AnchorPane.bottomAnchor="1.0" />
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput" prefHeight="41.0" prefWidth="76.0" text="Send" />
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0" vvalue="1.0">
<TextField fx:id="userInput" layoutY="558.0" onAction="#handleUserInput" prefHeight="41.0" prefWidth="324.0" AnchorPane.bottomAnchor="1.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="76.0">
<font>
<Font name="Verdana" size="13.0" />
</font></TextField>
<Button fx:id="sendButton" layoutX="324.0" layoutY="558.0" mnemonicParsing="false" onAction="#handleUserInput" prefHeight="41.0" prefWidth="75.0" text="Send" AnchorPane.bottomAnchor="1.0" AnchorPane.rightAnchor="1.0" />
<ScrollPane fx:id="scrollPane" hbarPolicy="NEVER" hvalue="1.0" prefHeight="557.0" prefWidth="400.0" vvalue="1.0" AnchorPane.bottomAnchor="43.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<content>
<VBox fx:id="dialogContainer" prefHeight="552.0" prefWidth="388.0" />
<VBox fx:id="dialogContainer" alignment="TOP_CENTER" prefHeight="552.0" prefWidth="398.0" />
</content>
</ScrollPane>
</children>
Expand Down

0 comments on commit 8855b03

Please sign in to comment.