-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updating javafx dependencies for Graphical User Interface. * Implements the following GUI Elements: - Task List Display - Balance Chart * Fixed a bug in PieChart and Parser. * Fixed a bug in displaying of tasks. * Implemented the bare-bones breakdownChart (stacked bar chart) * Added in breakdownChart functionality for GUI * Soft integration of GUI with Duke$$$. More bugs to be researched on. * GUI Partial Integration. Requires: - Command Line Output Emulator - Balance Figure - Hover Over Concept * PieChart bug fixed. CommandLineDisplay in development. * Implemented toggling between screens * Resolved Merge Conflicts * Near-complete integration of GUI with existing Features. * Quality of Life adjustments to the Toast Msgs * Resolved Checkstyle Violations * Added the Home and CLI Commands so that the user can navigate between the two. * Fixed Bugs found in CommandConvert with GUI. * Amended the GUI to be compatible with the new Architecture. WARNING: GUI Pulls Wallet AND TaskList into its layer for execution. Signed-off-by: Mudaafi <[email protected]>
- Loading branch information
Showing
65 changed files
with
1,477 additions
and
121 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,6 @@ src/main/resources/docs/ | |
bin/ | ||
|
||
# Customized | ||
savedData.txt | ||
savedData.txt | ||
savedWallet.txt | ||
savedTask.txt |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
out $5.0 /date 2019-02-01 /tags food | ||
1000.0 | ||
out $250.0 /date 2019-11-07 /tags | ||
out $100.0 /date 2019-11-07 /tags | ||
in $100.0 /date 2019-11-07 /tags |
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
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,21 @@ | ||
package executor.accessors; | ||
|
||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
|
||
public class AccessDeny extends Accessor { | ||
|
||
public AccessDeny(String argsStr) { | ||
super(); | ||
this.accessType = AccessType.DENY; | ||
this.argsStr = argsStr; | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
this.infoCapsule.setCodeError(); | ||
this.infoCapsule.setOutputStr("Access Denied"); | ||
|
||
} | ||
} |
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 executor.accessors; | ||
|
||
import duke.exception.DukeException; | ||
import javafx.collections.FXCollections; | ||
import javafx.scene.chart.PieChart; | ||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
|
||
public class AccessPieChartData extends Accessor { | ||
|
||
/** | ||
* Constructor for AccessPieChartData | ||
*/ | ||
public AccessPieChartData() { | ||
super(); | ||
this.accessType = AccessType.PIE_CHART_DATA; | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
this.infoCapsule.setUiCode(UiCode.UPDATE); | ||
Double walletBalance; | ||
Double walletExpenses; | ||
try { | ||
walletBalance = storageManager.getWalletBalance(); | ||
walletExpenses = storageManager.getWalletExpenses(); | ||
} catch (DukeException e) { | ||
e.printStackTrace(); | ||
walletBalance = 0.0; | ||
walletExpenses = 0.0; | ||
this.infoCapsule.setUiCode(UiCode.ERROR); | ||
this.infoCapsule.setOutputStr(e.getMessage()); | ||
} | ||
this.infoCapsule.setPieChartData(FXCollections.observableArrayList( | ||
new PieChart.Data("Expenses", | ||
walletExpenses), | ||
new PieChart.Data("Balance", | ||
walletBalance - walletExpenses))); | ||
} | ||
} |
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,22 @@ | ||
package executor.accessors; | ||
|
||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
|
||
public class AccessTaskList extends Accessor { | ||
|
||
/** | ||
* Constructor for AccessTaskList Class | ||
*/ | ||
public AccessTaskList() { | ||
super(); | ||
this.accessType = AccessType.TASKLIST; | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
infoCapsule.setUiCode(UiCode.UPDATE); | ||
infoCapsule.setTaskList(storageManager.getTaskList()); | ||
} | ||
} |
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,23 @@ | ||
package executor.accessors; | ||
|
||
import duke.exception.DukeException; | ||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
|
||
public class AccessWallet extends Accessor { | ||
|
||
/** | ||
* Constructor for AccessWallet Class | ||
*/ | ||
public AccessWallet() { | ||
super(); | ||
this.accessType = AccessType.WALLET; | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
this.infoCapsule.setUiCode(UiCode.UPDATE); | ||
this.infoCapsule.setWallet(storageManager.getWallet()); | ||
} | ||
} |
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,27 @@ | ||
package executor.accessors; | ||
|
||
import duke.exception.DukeException; | ||
import storage.StorageManager; | ||
import ui.UiCode; | ||
|
||
public class AccessWalletBalance extends Accessor { | ||
|
||
/** | ||
* Constructor for AccessWalletBalance Class | ||
*/ | ||
public AccessWalletBalance() { | ||
super(); | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
try { | ||
Double walletBalance = storageManager.getWalletBalance(); | ||
this.infoCapsule.setUiCode(UiCode.UPDATE); | ||
this.infoCapsule.setOutputDouble(walletBalance); | ||
} catch (DukeException e) { | ||
this.infoCapsule.setUiCode(UiCode.ERROR); | ||
this.infoCapsule.setOutputStr(e.getMessage()); | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/executor/accessors/AccessWalletExpenses.java
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,31 @@ | ||
package executor.accessors; | ||
|
||
import duke.exception.DukeException; | ||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
|
||
public class AccessWalletExpenses extends Accessor { | ||
|
||
/** | ||
* Constructor for AccessExpenses | ||
*/ | ||
public AccessWalletExpenses() { | ||
super(); | ||
this.accessType = AccessType.EXPENSES; | ||
} | ||
|
||
@Override | ||
public void execute(StorageManager storageManager) { | ||
this.infoCapsule.setUiCode(UiCode.UPDATE); | ||
Double expenses; | ||
try { | ||
expenses = storageManager.getWalletExpenses(); | ||
} catch (DukeException e) { | ||
this.infoCapsule.setUiCode(UiCode.ERROR); | ||
this.infoCapsule.setOutputStr(e.getMessage()); | ||
return; | ||
} | ||
this.infoCapsule.setOutputDouble(expenses); | ||
} | ||
} |
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,39 @@ | ||
package executor.accessors; | ||
|
||
import storage.StorageManager; | ||
import ui.UiCode; | ||
import utils.AccessType; | ||
import utils.InfoCapsule; | ||
|
||
public abstract class Accessor { | ||
protected AccessType accessType; | ||
protected String argsStr; | ||
protected InfoCapsule infoCapsule; | ||
|
||
public Accessor() { | ||
this.accessType = AccessType.DENY; | ||
this.infoCapsule = new InfoCapsule(); | ||
infoCapsule.setUiCode(UiCode.ERROR); | ||
infoCapsule.setOutputStr("Command was not executed.\n"); | ||
} | ||
|
||
/** | ||
* Executes the Accessor Method to Obtain Information for the UI | ||
* @return InfoCapsule containing the desired information | ||
*/ | ||
public abstract void execute(StorageManager storageManager); | ||
|
||
// Setters & Getters | ||
|
||
public InfoCapsule getInfoCapsule() { | ||
return this.infoCapsule; | ||
} | ||
|
||
public AccessType getAccessType() { | ||
return this.accessType; | ||
} | ||
|
||
public String getArgsStr() { | ||
return this.argsStr; | ||
} | ||
} |
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
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
Oops, something went wrong.