From b822436f92c51a668d864359144eecee6b396132 Mon Sep 17 00:00:00 2001 From: Daryl Goh Date: Thu, 19 Mar 2020 00:28:54 +0800 Subject: [PATCH 1/2] - Redesigned GUI --- src/main/java/igrad/ui/CapPanel.java | 7 +- src/main/java/igrad/ui/MainWindow.java | 18 +++- src/main/resources/view/CommandBox.fxml | 7 +- src/main/resources/view/DarkTheme.css | 88 ++++++++++++--- src/main/resources/view/MainWindow.fxml | 100 +++++++++++------- src/main/resources/view/ModuleListCard.fxml | 4 +- src/main/resources/view/ModuleListPanel.fxml | 13 ++- .../resources/view/ProgressSidePanel.fxml | 71 +++++++++++++ src/main/resources/view/ResultDisplay.fxml | 32 +++--- src/main/resources/view/StatusBar.fxml | 12 +-- 10 files changed, 253 insertions(+), 99 deletions(-) create mode 100644 src/main/resources/view/ProgressSidePanel.fxml diff --git a/src/main/java/igrad/ui/CapPanel.java b/src/main/java/igrad/ui/CapPanel.java index 1d4d16e0c98..221422c9a78 100644 --- a/src/main/java/igrad/ui/CapPanel.java +++ b/src/main/java/igrad/ui/CapPanel.java @@ -3,16 +3,15 @@ import javafx.fxml.FXML; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.Region; +import javafx.scene.layout.VBox; /** * Panel containing the current, target CAP for the user. */ public class CapPanel extends UiPart { - public static final String FXML = "CapPanel.fxml"; + public static final String FXML = "ProgressSidePanel.fxml"; - @FXML - private AnchorPane capPanel; /* * @FXML @@ -27,8 +26,6 @@ public class CapPanel extends UiPart { public CapPanel() { super(FXML); - - this.capPanel = new AnchorPane(); } /* public void showPanels() { diff --git a/src/main/java/igrad/ui/MainWindow.java b/src/main/java/igrad/ui/MainWindow.java index 1615f666ded..3b63c34e5ee 100644 --- a/src/main/java/igrad/ui/MainWindow.java +++ b/src/main/java/igrad/ui/MainWindow.java @@ -40,7 +40,7 @@ public class MainWindow extends UiPart { private ResultDisplay resultDisplay; private HelpWindow helpWindow; private StatusBar statusBar; - private McSidePanel mcSidePanel; +/* private McSidePanel mcSidePanel;*/ private CapPanel capPanel; @FXML @@ -49,8 +49,8 @@ public class MainWindow extends UiPart { @FXML private VBox moduleList; - @FXML - private HBox sidePanelPlaceholder; +/* @FXML + private HBox sidePanelPlaceholder;*/ @FXML private VBox capPanelPlaceholder; @@ -67,6 +67,9 @@ public class MainWindow extends UiPart { @FXML private Label mcCount; + @FXML + private Label commandReceived; + public MainWindow(Stage primaryStage, Logic logic) { super(FXML, primaryStage); @@ -164,8 +167,8 @@ void displayModulePanel(Model model) { * Fills up and displays/refreshes the the placeholders of the side panels (Modular credits info, CAP info). */ void displaySidePanels(Model model) { - mcSidePanel = new McSidePanel(); - sidePanelPlaceholder.getChildren().add(mcSidePanel.getRoot()); +/* mcSidePanel = new McSidePanel(); + sidePanelPlaceholder.getChildren().add(mcSidePanel.getRoot());*/ capPanel = new CapPanel(); capPanelPlaceholder.getChildren().add(capPanel.getRoot()); @@ -224,6 +227,10 @@ private void setWindowDefaultSize(GuiSettings guiSettings) { } } + private void setCommandReceived(String command) { + commandReceived.setText(command); + } + /** * Opens the help window or focuses on it if it's already opened. */ @@ -294,6 +301,7 @@ private CommandResult executeCommand(String commandText, Model model) throws Com } } + setCommandReceived(commandText); return commandResult; } catch (CommandException | ParseException | IOException | ServiceException e) { logger.info("Invalid command: " + commandText); diff --git a/src/main/resources/view/CommandBox.fxml b/src/main/resources/view/CommandBox.fxml index 6a884f6d7b9..7bff0dee3da 100644 --- a/src/main/resources/view/CommandBox.fxml +++ b/src/main/resources/view/CommandBox.fxml @@ -3,10 +3,11 @@ - - + + + - + diff --git a/src/main/resources/view/DarkTheme.css b/src/main/resources/view/DarkTheme.css index 8e95795316a..837a7b4db5c 100644 --- a/src/main/resources/view/DarkTheme.css +++ b/src/main/resources/view/DarkTheme.css @@ -91,25 +91,25 @@ .list-view { -fx-background-insets: 0; -fx-padding: 0; - -fx-background-color: #2d2d2d; + -fx-background-color: #3a3a3a; } .list-cell { -fx-label-padding: 0 0 0 0; -fx-graphic-text-gap : 0; - -fx-padding: 0 0 0 0; + -fx-padding: 10 20 10 20; } .list-cell:filled:even { - -fx-background-color: #3c3e3f; + -fx-background-color: #3a3a3a; } .list-cell:filled:odd { - -fx-background-color: #515658; + -fx-background-color: #3a3a3a; } .list-cell:filled:selected { - -fx-background-color: #424d5f; + -fx-background-color: #3a3a3a; } .list-cell:filled:selected #cardPane { @@ -141,6 +141,20 @@ -fx-text-fill: #010504; } +.progress_panel { + -fx-background-color: #3a3a3a; + -fx-border-style: solid; + -fx-border-color: transparent; + -fx-background-radius: 20; + -fx-effect: dropshadow(gaussian, #1d1d1d, 20, 0.2, 0, 10); +} + +.progress_panel .label { + -fx-font-family: Calibri; + -fx-text-fill: #d1d1d1; + -fx-font-size: 16; +} + .stack-pane { -fx-background-color: #2d2d2d; } @@ -167,14 +181,22 @@ } .status-bar { - -fx-background-color: #3d3d3d; + -fx-background-color: #2d2d2d; } .result-display { + -fx-background-color: #3a3a3a; + -fx-background-radius: 20; + -fx-border-color: transparent; + -fx-effect: dropshadow(gaussian, #1d1d1d, 20, 0.2, 0, 10); +} + +.result-display-text-area { -fx-background-color: transparent; - -fx-font-family: "Calibri Light"; - -fx-font-size: 16pt; + -fx-border-color: transparent; + -fx-font-size: 20; -fx-text-fill: white; + -fx-font-family: Calibri; } .result-display .label { @@ -182,7 +204,7 @@ } .status-bar .label { - -fx-font-family: "Calibri Light"; + -fx-font-family: Calibri; -fx-font-size: 18pt; -fx-text-fill: white; -fx-padding: 4px; @@ -347,11 +369,34 @@ -fx-padding: 8 1 8 1; } -#cardPane { +.command-box { + -fx-background-color: #d1d1d1; + -fx-background-radius: 20; + -fx-font-family: Calibri; + -fx-font-size: 20; + -fx-text-fill: #2a2a2a; + -fx-border-color: transparent; +} + +.command-received { + -fx-font-size: 16; + -fx-text-fill: white; -fx-background-color: #2d2d2d; + -fx-background-radius: 5; + -fx-border-radius: 5; + -fx-border-style: solid solid solid solid; + -fx-border-color: #4d4d4d; + -fx-text-fill: white; + -fx-effect: innershadow(gaussian, #1d1d1d, 0.2, 1, 1); +} + +#cardPane { + -fx-background-color: #303030; + -fx-background-radius: 20; -fx-border-width: 1; -fx-border-style: solid solid solid solid; - -fx-border-color: #3d3d3d; + -fx-border-radius: 20; + -fx-border-color: #4d4d4d; } #commandTypeLabel { @@ -359,20 +404,29 @@ -fx-text-fill: #F70D1A; } -#commandTextField { +/*#commandTextField { -fx-background-color: #2f2f2f; + -fx-background-radius: 20; -fx-border-style: solid; - -fx-border-color: #2d2d2d; - -fx-text-fill: white; -} + -fx-border-color: transparent; + -fx-text-fill: black; +}*/ #filterField, #personListPanel, #personWebpage { -fx-effect: innershadow(gaussian, black, 10, 0, 0, 0); } #resultDisplay .content { - -fx-background-color: #2f2f2f; - -fx-background-radius: 0; + -fx-background-color: #3a3a3a; + -fx-background-radius:0; + -fx-border-color: transparent; + -fx-text-fill: white; +} + +#commandReceived .content { + -fx-background-color: #2a2a2a; + -fx-border-radius: 20; + -fx-border-style: solid; -fx-border-color: transparent; -fx-text-fill: white; } diff --git a/src/main/resources/view/MainWindow.fxml b/src/main/resources/view/MainWindow.fxml index 5880edd751e..bb8f0be32c9 100644 --- a/src/main/resources/view/MainWindow.fxml +++ b/src/main/resources/view/MainWindow.fxml @@ -3,9 +3,12 @@ + + + - + @@ -22,60 +25,77 @@ - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + diff --git a/src/main/resources/view/ModuleListCard.fxml b/src/main/resources/view/ModuleListCard.fxml index de03e836a48..ba4dd5fff9e 100644 --- a/src/main/resources/view/ModuleListCard.fxml +++ b/src/main/resources/view/ModuleListCard.fxml @@ -41,11 +41,11 @@ - + - + diff --git a/src/main/resources/view/ModuleListPanel.fxml b/src/main/resources/view/ModuleListPanel.fxml index dbcdb2b2416..cfe9f6e762d 100644 --- a/src/main/resources/view/ModuleListPanel.fxml +++ b/src/main/resources/view/ModuleListPanel.fxml @@ -1,7 +1,16 @@ + - - + + + + + + + + + + diff --git a/src/main/resources/view/ProgressSidePanel.fxml b/src/main/resources/view/ProgressSidePanel.fxml new file mode 100644 index 00000000000..05658a87ee1 --- /dev/null +++ b/src/main/resources/view/ProgressSidePanel.fxml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/view/ResultDisplay.fxml b/src/main/resources/view/ResultDisplay.fxml index dd451613436..003d99f23a2 100644 --- a/src/main/resources/view/ResultDisplay.fxml +++ b/src/main/resources/view/ResultDisplay.fxml @@ -4,21 +4,21 @@ - - - - - - - - - - - - - + + + + + + + diff --git a/src/main/resources/view/StatusBar.fxml b/src/main/resources/view/StatusBar.fxml index 664d978ed2c..c00fb7dee45 100644 --- a/src/main/resources/view/StatusBar.fxml +++ b/src/main/resources/view/StatusBar.fxml @@ -3,18 +3,12 @@ - + + - From dc83c72e3a34bd4dbd501b1b8706fe354ff0bc1b Mon Sep 17 00:00:00 2001 From: Daryl Goh Date: Thu, 19 Mar 2020 12:17:11 +0800 Subject: [PATCH 2/2] Fixed commandreceived box bug --- src/main/java/igrad/ui/MainWindow.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/igrad/ui/MainWindow.java b/src/main/java/igrad/ui/MainWindow.java index 3b63c34e5ee..ad50e8f9230 100644 --- a/src/main/java/igrad/ui/MainWindow.java +++ b/src/main/java/igrad/ui/MainWindow.java @@ -273,6 +273,8 @@ private CommandResult executeCommand(String commandText, Model model) throws Com IOException, ServiceException { + setCommandReceived(commandText); + try { CommandResult commandResult; @@ -301,7 +303,6 @@ private CommandResult executeCommand(String commandText, Model model) throws Com } } - setCommandReceived(commandText); return commandResult; } catch (CommandException | ParseException | IOException | ServiceException e) { logger.info("Invalid command: " + commandText);