Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1002_2023_9
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Kluge Svendsrud
idatt1002_2023_9
Commits
1889b4de
Commit
1889b4de
authored
1 year ago
by
Harry Linrui XU
Browse files
Options
Downloads
Patches
Plain Diff
Added sum field under income and expense tables
parent
d46b3591
Branches
feat/SignUp
Branches containing commit
No related tags found
3 merge requests
!43
Merging frontend-testing into master
,
!38
"Made progressbar dynamic in accordance to spending. Added balance field....
,
!37
Made the sub progress bars respond to changes in expense
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
+9
-8
9 additions, 8 deletions
...nu/idatt1002/demo/controller/IncomeExpenseController.java
src/main/resources/view/IncomeAndExpenses.fxml
+2
-2
2 additions, 2 deletions
src/main/resources/view/IncomeAndExpenses.fxml
with
11 additions
and
10 deletions
src/main/java/no/ntnu/idatt1002/demo/controller/IncomeExpenseController.java
+
9
−
8
View file @
1889b4de
...
@@ -42,6 +42,7 @@ import no.ntnu.idatt1002.demo.data.Economics.IncomeRegister;
...
@@ -42,6 +42,7 @@ import no.ntnu.idatt1002.demo.data.Economics.IncomeRegister;
public
class
IncomeExpenseController
implements
FinanceController
{
public
class
IncomeExpenseController
implements
FinanceController
{
private
final
static
String
sumText
=
"Sum: "
;
@FXML
@FXML
private
TableColumn
<
Expense
,
Double
>
expAmountCol
;
private
TableColumn
<
Expense
,
Double
>
expAmountCol
;
...
@@ -79,10 +80,10 @@ public class IncomeExpenseController implements FinanceController {
...
@@ -79,10 +80,10 @@ public class IncomeExpenseController implements FinanceController {
private
TableView
<
Income
>
incomeTableView
;
private
TableView
<
Income
>
incomeTableView
;
@FXML
@FXML
private
Text
inSum
;
private
Label
inSum
;
@FXML
@FXML
private
Text
expSum
;
private
Label
expSum
;
@FXML
@FXML
private
MenuItem
addExpense
;
private
MenuItem
addExpense
;
...
@@ -164,9 +165,10 @@ public class IncomeExpenseController implements FinanceController {
...
@@ -164,9 +165,10 @@ public class IncomeExpenseController implements FinanceController {
refreshProgress
();
refreshProgress
();
formatDatePicker
();
formatDatePicker
();
//Initialize sum field under the tableview
//Initialize sum field under the tableview
//
inSum.setText(String.valueOf(incomeRegister.getTotalSum()));
inSum
.
setText
(
sumText
+
String
.
valueOf
(
incomeRegister
.
getTotalSum
()));
//
expSum.setText(String.valueOf(expenseRegister.getTotalSum()));
expSum
.
setText
(
sumText
+
String
.
valueOf
(
expenseRegister
.
getTotalSum
()));
}
}
private
void
setColumns
()
{
private
void
setColumns
()
{
...
@@ -287,10 +289,10 @@ public class IncomeExpenseController implements FinanceController {
...
@@ -287,10 +289,10 @@ public class IncomeExpenseController implements FinanceController {
@Override
@Override
public
void
refreshTableView
()
{
public
void
refreshTableView
()
{
this
.
income
.
setAll
(
incomeRegister
.
getItems
());
this
.
income
.
setAll
(
incomeRegister
.
getItems
());
//
this.
s
um.setText(String.valueOf(incomeRegister.getTotalSum()));
this
.
inS
um
.
setText
(
"Sum: "
+
String
.
valueOf
(
incomeRegister
.
getTotalSum
()));
this
.
expenses
.
setAll
(
expenseRegister
.
getItems
());
this
.
expenses
.
setAll
(
expenseRegister
.
getItems
());
//
this.
s
um.setText(String.valueOf(incomeRegister.getTotalSum()));
this
.
expS
um
.
setText
(
"Sum: "
+
String
.
valueOf
(
incomeRegister
.
getTotalSum
()));
}
}
private
void
refreshPieCharts
()
{
private
void
refreshPieCharts
()
{
...
@@ -402,8 +404,7 @@ public class IncomeExpenseController implements FinanceController {
...
@@ -402,8 +404,7 @@ public class IncomeExpenseController implements FinanceController {
// Show the Dialog and wait for the user to close it
// Show the Dialog and wait for the user to close it
dialog
.
showAndWait
();
dialog
.
showAndWait
();
this
.
incomePieChart
.
setData
(
createIncomePieChart
());
incomePieChart
.
setData
(
createIncomePieChart
());
}
}
@FXML
@FXML
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/view/IncomeAndExpenses.fxml
+
2
−
2
View file @
1889b4de
...
@@ -155,7 +155,7 @@
...
@@ -155,7 +155,7 @@
</ContextMenu>
</ContextMenu>
</contextMenu>
</contextMenu>
</TableView>
</TableView>
<Label
text=
"Sum: "
>
<Label
fx:id=
"inSum"
text=
"Sum: "
>
<font>
<font>
<Font
name=
"Lucida Console"
size=
"14.0"
/>
<Font
name=
"Lucida Console"
size=
"14.0"
/>
</font>
</font>
...
@@ -203,7 +203,7 @@
...
@@ -203,7 +203,7 @@
</ContextMenu>
</ContextMenu>
</contextMenu>
</contextMenu>
</TableView>
</TableView>
<Label
text=
"Sum: "
>
<Label
fx:id=
"expSum"
text=
"Sum: "
>
<font>
<font>
<Font
name=
"Lucida Console"
size=
"14.0"
/>
<Font
name=
"Lucida Console"
size=
"14.0"
/>
</font>
</font>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment