forked from nus-cs2103-AY2324S2/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
111 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package shon.component; | ||
|
||
import java.io.IOException; | ||
|
||
import javafx.fxml.FXML; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.image.Image; | ||
import javafx.scene.layout.HBox; | ||
import javafx.scene.paint.ImagePattern; | ||
import javafx.scene.shape.Circle; | ||
import shon.MainWindow; | ||
|
||
/** | ||
* Represents the user's dialog box. | ||
*/ | ||
public class UserDialogBox extends HBox { | ||
@FXML | ||
private Label dialog; | ||
@FXML | ||
private Circle circle; | ||
|
||
/** | ||
* Creates a dialog box for user. | ||
* @param text The message to be displayed. | ||
* @param img The anon image of user. | ||
*/ | ||
public UserDialogBox(String text, Image img) { | ||
try { | ||
FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("/view/UserDialogBox.fxml")); | ||
fxmlLoader.setController(this); | ||
fxmlLoader.setRoot(this); | ||
fxmlLoader.load(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
dialog.setText(text); | ||
circle.setFill(new ImagePattern(img)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.shape.Circle?> | ||
|
||
<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"> | ||
<children> | ||
<Label fx:id="dialog" minHeight="-Infinity" minWidth="250.0" style="-fx-background-color: #E0E0E0; -fx-background-radius: 10;" text="Label" wrapText="true"> | ||
<padding> | ||
<Insets bottom="10.0" left="12.0" right="10.0" top="10.0" /> | ||
</padding> | ||
<HBox.margin> | ||
<Insets left="5.0" right="5.0" /> | ||
</HBox.margin></Label> | ||
<Circle fx:id="circle" fill="#1f93ff" radius="20.0" stroke="BLACK" strokeType="INSIDE" HBox.hgrow="ALWAYS"> | ||
<HBox.margin> | ||
<Insets left="5.0" right="5.0" /> | ||
</HBox.margin></Circle> | ||
</children> | ||
<padding> | ||
<Insets bottom="10.0" left="7.0" right="7.0" top="10.0" /> | ||
</padding> | ||
</fx:root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.shape.Circle?> | ||
|
||
<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"> | ||
<children> | ||
<Label fx:id="dialog" minHeight="-Infinity" minWidth="250.0" style="-fx-background-color: #B1D9FE; -fx-background-radius: 10;" text="Label" wrapText="true"> | ||
<padding> | ||
<Insets bottom="10.0" left="12.0" right="10.0" top="10.0" /> | ||
</padding> | ||
<HBox.margin> | ||
<Insets left="5.0" right="5.0" /> | ||
</HBox.margin></Label> | ||
<Circle fx:id="circle" fill="#1f93ff" radius="20.0" stroke="BLACK" strokeType="INSIDE" HBox.hgrow="ALWAYS"> | ||
<HBox.margin> | ||
<Insets left="5.0" right="5.0" /> | ||
</HBox.margin></Circle> | ||
</children> | ||
<padding> | ||
<Insets bottom="10.0" left="7.0" right="7.0" top="10.0" /> | ||
</padding> | ||
</fx:root> |