-
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.
Implementation of MonthMenuV, UpdateViewC, UpdateViewIB. Removal of u…
…nused import in UpdateViewUCI.
- Loading branch information
1 parent
a357798
commit 5dd17a5
Showing
4 changed files
with
45 additions
and
4 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package use_cases.monthly_menu; | ||
|
||
public interface UpdateViewIB { | ||
|
||
MonthMenuOD createOutput(UpdateViewID input); | ||
} |
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,4 +1,32 @@ | ||
package views.monthly_menu; | ||
|
||
import entities.SessionStorage; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class MonthMenuV implements MonthMenuVB{ | ||
UpdateViewC controller; | ||
|
||
public MonthMenuV(UpdateViewC controller, SessionStorage session, int monthID){ | ||
this.controller = controller; | ||
|
||
JLabel title = new JLabel("Monthly Menu"); | ||
title.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
JButton addExpense = new JButton("Add an expense"); | ||
JButton editExpense = new JButton("Edit an expense"); | ||
JButton addCategory = new JButton("Add an category"); | ||
JButton editCategory = new JButton("Edit an category"); | ||
JButton generateSummary = new JButton("Generate summary"); | ||
|
||
String[] expenseTableTitle = new String[]{"Expense", "Value"}; | ||
String[] categoryTableTitle = new String[]{"Category", "Budget"}; | ||
Object[][] expenseList = controller.getOutput(session, monthID).getExpenseList(); | ||
JTable expenseTable = new JTable(expenseList, expenseTableTitle); | ||
Object[][] categoryList = controller.getOutput(session, monthID).getCategoryList(); | ||
JTable categoryTable = new JTable(categoryList, categoryTableTitle); | ||
//TODO: put together the components | ||
//TODO: add reactions to the buttons | ||
} | ||
} |
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,4 +1,19 @@ | ||
package views.monthly_menu; | ||
|
||
import entities.SessionStorage; | ||
import use_cases.monthly_menu.MonthMenuOD; | ||
import use_cases.monthly_menu.UpdateViewIB; | ||
import use_cases.monthly_menu.UpdateViewID; | ||
|
||
public class UpdateViewC { | ||
final UpdateViewIB inputBoundary; | ||
|
||
public UpdateViewC(UpdateViewIB inputBoundary){ | ||
this.inputBoundary = inputBoundary; | ||
} | ||
|
||
MonthMenuOD getOutput(SessionStorage session, int monthID){ | ||
UpdateViewID inputData = new UpdateViewID(session, monthID); | ||
return inputBoundary.createOutput(inputData); | ||
} | ||
} |