565 Commits
v1.0 ... master

Author SHA1 Message Date
Merel Steenbergen
dfb65131e2 Merge branch 'Test/common' into 'master'
Add/package in client to make code coverage clearer.

See merge request cse1105/2018-2019/oopp-group-43/template!94
2019-04-15 12:40:21 +00:00
Merel Steenbergen
6faa5edd57 FIX::Checkstyle error.java 2019-04-15 12:38:57 +00:00
Ceren Ugurlu
2f2a9ba9fc Replace coverage report 2019-04-15 12:34:30 +00:00
Mika Wauben
533a5e9631 Merge branch 'Update/readme' into 'master'
UPDATE:: screenshots and 'getting started'

See merge request cse1105/2018-2019/oopp-group-43/template!93
2019-04-15 12:27:04 +00:00
Merel Steenbergen
f31449508e ADD::Package for features to make test coverage clearer 2019-04-15 14:24:20 +02:00
Sem van der Hoeven
b266160e93 ADD::added animations to buttons on friends pane 2019-04-15 14:17:22 +02:00
Merel Steenbergen
a44907865c ADD:: Test for ApplicationException. 2019-04-15 14:16:18 +02:00
Mika Wauben
2f1d07f008 UPDATE:: screenshots and 'getting started' 2019-04-15 12:05:02 +00:00
Sem van der Hoeven
af65142bf4 FIX::typo in extra activities 2019-04-15 14:01:23 +02:00
mlwauben
e2be018816 FIX:: explanation button 2019-04-15 11:18:19 +02:00
mlwauben
36fbcfedb8 ADD:: javadoc 2019-04-15 11:11:03 +02:00
Sem van der Hoeven
2b985344dc ADD::added button to display/hide explanation
Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
2019-04-15 10:57:34 +02:00
Sem van der Hoeven
c030bf3a8e ADD::added button to display/hide explanation 2019-04-15 10:56:50 +02:00
Mika Wauben
8150537aa5 Merge branch 'Add/docLastSprint' into 'master'
ADD:: doc sprint7

See merge request cse1105/2018-2019/oopp-group-43/template!92
2019-04-15 08:53:08 +00:00
Mika Wauben
694d58924c ADD:: doc sprint7 2019-04-15 08:53:08 +00:00
Mika Wauben
2ed6192090 Merge branch 'add_checkstyle_coverage' into 'master'
Upload weekly reports

See merge request cse1105/2018-2019/oopp-group-43/template!91
2019-04-15 08:18:56 +00:00
cugurlu
5ef716330c Upload weekly reports 2019-04-15 08:59:48 +02:00
Mika Wauben
facebc1334 Merge branch 'Fix/LastCheckstyles' into 'master'
FIX:: checkstyle error button and missing javadoc

See merge request cse1105/2018-2019/oopp-group-43/template!90
2019-04-15 05:44:50 +00:00
Mika Wauben
84793dc924 FIX:: checkstyle error button and missing javadoc 2019-04-15 05:44:49 +00:00
Ceren Ugurlu
dd184a1398 Update build.gradle 2019-04-14 16:42:57 +00:00
Ceren Ugurlu
b959484185 Merge branch 'hashPassword' into 'master'
Add password hashing & deploy heroku

See merge request cse1105/2018-2019/oopp-group-43/template!89
2019-04-14 16:37:56 +00:00
Ceren Ugurlu
69d80b1f7c Update build.gradle 2019-04-14 16:30:36 +00:00
cugurlu
f8799c06fb Add new plugins for heroku 2019-04-14 18:28:29 +02:00
cugurlu
f20f010cb8 Remove unnecessary prints 2019-04-14 18:28:04 +02:00
cugurlu
048253a9d3 Add password hashing 2019-04-14 18:27:37 +02:00
cugurlu
8d029fe21c Fix removeFriend image 2019-04-14 18:26:54 +02:00
Mika Wauben
60f8b2a9d9 Merge branch 'Update/leaderBoards' into 'master'
Update/leader boards

See merge request cse1105/2018-2019/oopp-group-43/template!88
2019-04-13 10:38:58 +00:00
Mika Wauben
66c2b44be6 Merge branch 'master' into 'Update/leaderBoards'
# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/CalculatorController.java
#   src/Client/src/main/resources/fxml/dashboard.fxml
#   src/Server/src/main/java/greenify/server/service/CalculatorService.java
2019-04-13 10:38:58 +00:00
Ceren Ugurlu
f0d6b04e30 Merge branch 'removeFriend' into 'master'
Add remove friend

See merge request cse1105/2018-2019/oopp-group-43/template!87
2019-04-11 16:43:59 +00:00
cugurlu
6084338525 Fix checkstyle errors 2019-04-11 14:24:07 +02:00
cugurlu
9006588eed Add new methods to controllers to remove a friend 2019-04-11 14:23:40 +02:00
cugurlu
367daa1eff Edit dashboard.fxml 2019-04-11 14:22:58 +02:00
cugurlu
a2af22facb Add fxml file and image for removeFriend property 2019-04-11 14:22:41 +02:00
cugurlu
abdaa14679 Fix small problem in AchievementService 2019-04-11 14:22:13 +02:00
Merel Steenbergen
8c5f177704 Merge branch 'Add/docs' into 'master'
Add final report and agenda

See merge request cse1105/2018-2019/oopp-group-43/template!86
2019-04-11 09:53:15 +00:00
Merel Steenbergen
00718a1cf2 Update 20190408_agenda 2019-04-11 09:49:29 +00:00
Merel Steenbergen
e73c419c55 ADD::Agenda for 08-04-2019 that I forgot to upload, sorry. 2019-04-11 09:49:05 +00:00
Merel Steenbergen
f4cc37a34b Upload final report 2019-04-11 09:45:49 +00:00
Merel Steenbergen
461b3bd329 Merge branch 'Feature/explanation' into 'master'
Explanation in first calculator screen

See merge request cse1105/2018-2019/oopp-group-43/template!84
2019-04-10 20:43:41 +00:00
Sem van der Hoeven
f56a959720 Merge branch 'add/more_animations' into 'master'
Add/more animations

See merge request cse1105/2018-2019/oopp-group-43/template!85
2019-04-10 19:25:41 +00:00
Merel Steenbergen
796deadb8c Merge branch 'Feature/delete_my_account' into 'master'
Feature/delete my account

See merge request cse1105/2018-2019/oopp-group-43/template!83
2019-04-10 14:20:49 +00:00
Merel Steenbergen
2b1c6cf780 FIX::Import that gave a CheckStyle error.java 2019-04-10 13:40:39 +00:00
Merel Steenbergen
eed4f7903d FIX::Small typing error in method name.java 2019-04-10 13:40:08 +00:00
Sem van der Hoeven
377db10f13 EDIT::changed color of register window button 2019-04-10 12:24:11 +02:00
Sem van der Hoeven
50fb2078b0 EDIT::fixed checkstyle import 2019-04-10 12:22:23 +02:00
Sem van der Hoeven
123a767a75 ADD::added style to button in register window 2019-04-10 12:19:31 +02:00
Sem van der Hoeven
e0e6744c95 EDIT::removed lines from background of vegetarian meals achievement picture 2019-04-10 12:07:07 +02:00
Sem van der Hoeven
cfc238af73 ADD::Added animations to switching panes in extra activities 2019-04-10 12:04:17 +02:00
Sem van der Hoeven
78e050751f ADD::added animations to buttons in login and register screen 2019-04-10 11:49:31 +02:00
Merel Steenbergen
81f48ca0b6 FIX::Checkstyle errors 2019-04-09 17:40:26 +02:00
Merel Steenbergen
d97ae9b53a FIX::Checkstyle error 2019-04-09 17:38:44 +02:00
Merel Steenbergen
2a136b6a07 ADD::Client.UserServiceTest 2019-04-09 17:37:51 +02:00
Merel Steenbergen
080053765c ADD::server.UserControllerTest 2019-04-09 17:35:39 +02:00
Merel Steenbergen
21ab3d5b79 ADD::server.userService Tests 2019-04-09 17:30:58 +02:00
Merel Steenbergen
8e747e54be ADD::Clientside method 2019-04-09 17:03:56 +02:00
Merel Steenbergen
99899dfc88 Add serverside methods 2019-04-09 17:00:51 +02:00
Merel Steenbergen
867eae66f4 ADD::Explanation in first calculator screen 2019-04-09 16:28:17 +02:00
Mika Wauben
37d43c8247 Merge branch 'Update/activitiesPane' into 'master'
UPDATE:: activities pane (added all extra activities)

See merge request cse1105/2018-2019/oopp-group-43/template!82
2019-04-09 13:37:28 +00:00
Mika Wauben
a704522a63 UPDATE:: activities pane (added all extra activities) 2019-04-09 13:37:28 +00:00
Mika Wauben
cefc4d2b4b Merge branch 'Update/readme' into 'master'
Update/readme

See merge request cse1105/2018-2019/oopp-group-43/template!79
2019-04-09 07:30:08 +00:00
Mika Wauben
222489a316 Update/readme 2019-04-09 07:30:07 +00:00
Merel Steenbergen
4b949db919 Merge branch 'Delete/forgot_password' into 'master'
DELETE 'forgot password' button

See merge request cse1105/2018-2019/oopp-group-43/template!80
2019-04-08 14:44:30 +00:00
Sem van der Hoeven
c8cbb25f5d Merge branch 'update/notes_week9' into 'master'
Update/notes week9

See merge request cse1105/2018-2019/oopp-group-43/template!81
2019-04-08 14:19:03 +00:00
Sem van der Hoeven
5653800d47 ADD::Added notes for week 9 2019-04-08 16:15:44 +02:00
Merel Steenbergen
c8d5dd99ae DELETE 'forgot password' button 2019-04-08 15:59:23 +02:00
Sem van der Hoeven
6d7e73586f Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
Sourcetree needed to merge this?
2019-04-08 15:52:20 +02:00
Sem van der Hoeven
12ca633461 EDIT::suppressed some duplicate warnings 2019-04-08 15:51:44 +02:00
Sem van der Hoeven
a715babcd9 ADD::added first part of notes week 9 2019-04-08 15:50:08 +02:00
Merel Steenbergen
7b6b8ead65 Merge branch 'Feature/more_hints' into 'master'
Feature/more hints

See merge request cse1105/2018-2019/oopp-group-43/template!78
2019-04-08 13:46:40 +00:00
Ceren Ugurlu
a206625082 Merge branch 'add_piechart' into 'master'
Add piechart

See merge request cse1105/2018-2019/oopp-group-43/template!77
2019-04-08 13:45:17 +00:00
Merel Steenbergen
425550c922 FIX::Uncomment something to make pipeline pass 2019-04-08 15:41:01 +02:00
Merel Steenbergen
e6ecda5471 FIX::Small merge conflict 2019-04-08 15:39:53 +02:00
Merel Steenbergen
f6f74cd2aa FIX::Checkstyle errors 2019-04-08 15:38:49 +02:00
cugurlu
d03deace57 Add new test methods 2019-04-08 15:36:42 +02:00
cugurlu
4dd02649b8 Add methods for getting the results of a user 2019-04-08 15:36:21 +02:00
cugurlu
9fd3b1cf5b Add new methods for piechart 2019-04-08 15:35:35 +02:00
Sem van der Hoeven
9fc42247da EDIT::added required values to saving co2 and using bike achievements 2019-04-08 15:33:18 +02:00
Merel Steenbergen
fb22937864 FIX::Illegal catch fix: RuntimeException to HttpClientErrorException 2019-04-08 15:32:09 +02:00
Merel Steenbergen
dc432df120 FIX::More CS errors 2019-04-08 15:31:34 +02:00
Merel Steenbergen
a6a52688f2 FIX::Checkstyle errors 2019-04-08 15:30:37 +02:00
Merel Steenbergen
ae7e36f757 ADD::Extra hints 2019-04-08 15:30:21 +02:00
Merel Steenbergen
917d3a64bb FIXX:: Checkstyle 2019-04-08 15:30:21 +02:00
Merel Steenbergen
92ff0073e8 EDIT::Change some hints and add tests 2019-04-08 15:30:21 +02:00
Sem van der Hoeven
3cc01e4f4a EDIT::added style to logout button 2019-04-08 15:02:15 +02:00
Ceren Ugurlu
7043f7253d Merge branch 'fix/sorting_bugs' into 'master'
Fix sorting bugs

See merge request cse1105/2018-2019/oopp-group-43/template!76
2019-04-08 12:37:57 +00:00
Sem van der Hoeven
83611c4ecc Merge branch 'add/activity_tooltips' into 'master'
Add/activity tooltips

See merge request cse1105/2018-2019/oopp-group-43/template!75
2019-04-08 12:36:45 +00:00
cugurlu
b99b66b87b Fix sorting errors 2019-04-08 14:34:38 +02:00
Sem van der Hoeven
3e7fbeae75 EDIT::Update .gitlab-ci.yml
undid code coverage part
2019-04-08 12:27:06 +00:00
Sem van der Hoeven
839292ad91 EDIT::Update .gitlab-ci.yml
added code coverage
2019-04-08 12:26:23 +00:00
Sem van der Hoeven
6ba21c331d FIX::fixed compileJava build failing
the last merge undid the change of this line, this should fix it
2019-04-08 14:21:20 +02:00
Sem van der Hoeven
0cda63cacb Merge branch 'add/activity_tooltips' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into add/activity_tooltips
sourceTree needed to merge this?
2019-04-08 14:19:06 +02:00
Sem van der Hoeven
79fd69503c FIX::fixed complieJava build failing 2019-04-08 14:17:06 +02:00
Sem van der Hoeven
cbf15d9574 Merge branch 'master' into 'add/activity_tooltips'
# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#   src/Client/src/main/java/greenify/client/controller/ExtraActivityController.java
2019-04-08 12:13:44 +00:00
Mika Wauben
8667f65e33 Merge branch 'update/doc' into 'master'
Update/doc

See merge request cse1105/2018-2019/oopp-group-43/template!74
2019-04-08 12:07:27 +00:00
Mika Wauben
544b756e70 Update/doc 2019-04-08 12:07:27 +00:00
Sem van der Hoeven
18a0973af4 EDIT::added style to tooltips and reduced delay between hovering over the achievement and the tooltip appearing
EDIT::fixed some checkstyle warnings
2019-04-08 14:00:21 +02:00
Sem van der Hoeven
9e37421d6d ADD::added tooltip texts to all achievements 2019-04-08 13:08:20 +02:00
Sem van der Hoeven
31def99398 ADD::added buttons to apply tooltips to for the activities
because you can't apply tooltips to imageviews, I added the achievement images to buttons to which you can add tooltips
2019-04-08 12:55:32 +02:00
Ceren Ugurlu
dbe6fc4e33 Delete README.md 2019-04-08 10:38:36 +00:00
Ceren Ugurlu
231c580f7a Merge branch 'connect_new_extras' into 'master'
Fix errors for new extras and upload docs

See merge request cse1105/2018-2019/oopp-group-43/template!73
2019-04-08 09:27:16 +00:00
cugurlu
7867853cdb Upload coverage report 2019-04-08 11:18:04 +02:00
cugurlu
39b108626b Upload checkstyle report 2019-04-08 11:17:49 +02:00
cugurlu
8195650226 Fix all errors for extra activities 2019-04-08 11:17:34 +02:00
cugurlu
9310674301 Fix checkstyle errors 2019-04-08 11:17:02 +02:00
Sem van der Hoeven
2025fd02cc Merge branch 'feature/localProduce_and_publicTransport' into 'master'
feature/buying local produce and using public transport

See merge request cse1105/2018-2019/oopp-group-43/template!70
2019-04-07 17:57:01 +00:00
Ceren Ugurlu
55fe2b6795 Merge branch 'develop_achievements' into 'master'
Develop achievements

See merge request cse1105/2018-2019/oopp-group-43/template!72
2019-04-07 16:00:55 +00:00
Sem van der Hoeven
b05b0ecaf7 DELETE::deleted the confirm methods for the extra activities
this should fix the build failing
2019-04-07 17:55:57 +02:00
cugurlu
e1489bda27 Update controllers for new properties of achievements 2019-04-07 15:51:27 +02:00
cugurlu
a2805c2a9f Update dashboard.fxml 2019-04-07 15:50:31 +02:00
cugurlu
16fb86c513 Update achievements in userService 2019-04-07 15:49:51 +02:00
cugurlu
1cd46940cf Add new achievement photos 2019-04-07 15:48:55 +02:00
Sem van der Hoeven
e9efdf5f24 Merge branch 'master' into 'feature/localProduce_and_publicTransport'
# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/ExtraActivityController.java
#   src/Client/src/main/resources/fxml/extraActivities.fxml
2019-04-07 12:16:42 +00:00
Ceren Ugurlu
86ec4bbd7d Merge branch 'update_calculator' into 'master'
Update calculator and new tests

See merge request cse1105/2018-2019/oopp-group-43/template!71
2019-04-06 21:57:33 +00:00
cugurlu
d210e22788 Fix ButtonSkin error 2019-04-06 22:35:13 +02:00
cugurlu
1cf3af45be Add many new tests 2019-04-06 22:30:46 +02:00
cugurlu
24be00d28a Update methods for extras 2019-04-06 21:29:49 +02:00
cugurlu
e30f312c6a Update calculator methods for new changes 2019-04-06 21:26:52 +02:00
cugurlu
95d5b2b971 Fix the number of decimal points of footprints 2019-04-06 21:26:17 +02:00
Sem van der Hoeven
c0e0063465 ADD::added animations to buttons in login and register window 2019-04-06 21:05:19 +02:00
Sem van der Hoeven
61a99d47d1 ADD::added local produce and public transport sections to the extra activities section
added the panes and designated buttons

ADD::added placeholder methods for communicating adding the activities to the server
2019-04-06 20:20:01 +02:00
Sem van der Hoeven
6cbabbdf8d Merge branch 'update/achievements' into 'master'
Update/achievements

See merge request cse1105/2018-2019/oopp-group-43/template!68
2019-04-06 17:20:49 +00:00
Mika Wauben
2a873a78c9 Merge branch 'master' into 'update/achievements'
# Conflicts:
#   src/Server/src/main/java/greenify/server/service/AchievementService.java
2019-04-06 14:18:45 +00:00
mlwauben
0e546bc25c FIX:: checkstyle 2019-04-06 16:14:17 +02:00
mlwauben
4293790ece FIX:: wrong test 2019-04-06 15:42:14 +02:00
Mika Wauben
290694c5f1 Merge branch 'Feature/logoutbutton' into 'master'
ADD:: logout button

See merge request cse1105/2018-2019/oopp-group-43/template!67
2019-04-06 13:37:35 +00:00
mlwauben
eeb0fd9d57 ADD:: extra achievements and tests 2019-04-06 15:36:44 +02:00
Ceren Ugurlu
733c0c5920 Merge branch 'Test/achievement' into 'master'
Test/achievement

See merge request cse1105/2018-2019/oopp-group-43/template!66
2019-04-06 10:40:14 +00:00
mlwauben
238c00ff46 DEBUG:: logoutbutton 2019-04-06 11:05:06 +02:00
mlwauben
4433d509bb ADD:: new achievements 2019-04-06 10:33:36 +02:00
mlwauben
0f9cd14036 ADD:: line thingy above the logout button 2019-04-06 09:18:24 +02:00
mlwauben
9af14e6015 ADD:: logout button 2019-04-06 09:00:20 +02:00
Merel Steenbergen
bce08eb6f2 DELETE::Wrong import that gave an error 2019-04-05 20:40:50 +02:00
Merel Steenbergen
dcb8404ae7 ADD::Method for achievement social butterfly 2019-04-05 20:37:54 +02:00
Merel Steenbergen
82fd016590 FIX::No longer use Mockito for AchievementService in AchievementServiceTest 2019-04-05 20:30:31 +02:00
Merel Steenbergen
ccbe5968da EDIT::Finding bugs in tests and try to fix them 2019-04-05 20:21:42 +02:00
Merel Steenbergen
adb8406d4e ADD::Some tests to achievement class 2019-04-05 19:59:57 +02:00
Merel Steenbergen
9ab4439f70 FIX::Illegal catch fix: RuntimeException to HttpClientErrorException 2019-04-05 19:34:08 +02:00
Merel Steenbergen
47c46b5458 FIX::More CS errors 2019-04-05 19:20:09 +02:00
Merel Steenbergen
02253cb645 FIX::Checkstyle errors 2019-04-05 19:16:26 +02:00
Merel Steenbergen
b92e302f8b ADD::Extra hints 2019-04-05 19:11:51 +02:00
Merel Steenbergen
67b97eb331 FIXX:: Checkstyle 2019-04-05 17:08:58 +02:00
Merel Steenbergen
daa1c838b4 EDIT::Change some hints and add tests 2019-04-05 17:00:45 +02:00
Merel Steenbergen
7228252169 Merge branch 'add/add_random_hints_to_GUI' into 'master'
add/added hints to GUI

See merge request cse1105/2018-2019/oopp-group-43/template!65
2019-04-05 14:49:28 +00:00
Merel Steenbergen
27a18659f8 Merge branch 'Feature/alerts' into 'master'
Feature/alerts

See merge request cse1105/2018-2019/oopp-group-43/template!64
2019-04-05 14:49:23 +00:00
Merel Steenbergen
f2501f3624 FIX::Resolve a merge conflict with DashBoardController 2019-04-05 13:18:21 +00:00
Sem van der Hoeven
2b7d51a5ed EDIT::edited font size of random hints 2019-04-05 13:13:27 +02:00
Sem van der Hoeven
75faf4ae8c ADD:added nodes and methods to display random hints to on the GUI
ADD::added refresh button to get a new hint

EDIT::edited hints to work with the GUI
2019-04-05 13:11:17 +02:00
Sem van der Hoeven
06daa4776f ADD::added animations to buttons on dashboard screen
EDIT::changed labels of distance in activities overview to km and km/L

EDIT::made firstCalculator.fxml have the right distance units and added the new extra activities screen
2019-04-05 09:54:34 +02:00
Sem van der Hoeven
4b07aa8072 EDIT::changed achievement picture, removed trademark and added it into the code 2019-04-05 09:24:58 +02:00
Merel Steenbergen
8927b78098 FIX:: Forgot to uncomment something. Pipeline should now work 2019-04-04 21:02:06 +02:00
Merel Steenbergen
1f12291398 FIX::Import error 2019-04-04 21:00:37 +02:00
Merel Steenbergen
1684068385 FIX::More CheckStyle errors 2019-04-04 20:59:08 +02:00
Merel Steenbergen
e929680477 Merge branch 'Feature/alerts' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into Feature/alerts 2019-04-04 20:55:10 +02:00
Merel Steenbergen
f23fc2cbea FIX::Checkstyle errors 2019-04-04 20:54:50 +02:00
Merel Steenbergen
4fa2707add FIX:: Fixed small typing error in alert 2019-04-04 18:51:04 +00:00
Merel Steenbergen
7ac5b1efda FIX:: Small bug fix, pipeline should now run 2019-04-04 20:45:10 +02:00
Merel Steenbergen
b08174b2ee ADD:: Alerts: username is now your friend and calculation saved. 2019-04-04 20:42:25 +02:00
Merel Steenbergen
04db410293 FIX::Merge conflict fix in DashBoardController 2019-04-04 20:36:37 +02:00
Merel Steenbergen
c5e7ff2884 ADD::Alert for incorrect password/username at login. 2019-04-04 20:35:02 +02:00
Merel Steenbergen
c8521feaf8 ADD:: Alert 'Footprint saved. Still has a bug.' 2019-04-04 13:26:36 +02:00
Merel Steenbergen
25a66832a5 ADD:: Alert for taken username 2019-04-04 13:26:36 +02:00
Merel Steenbergen
a55e4cecef Added class Hints, including tests 2019-04-04 13:26:35 +02:00
Merel Steenbergen
5c85c56d78 Merge branch 'Feature/alerts' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into Feature/alerts 2019-04-04 13:23:00 +02:00
Merel Steenbergen
c79a98c57d ADD:: Alert 'Footprint saved. Still has a bug.' 2019-04-04 13:20:47 +02:00
Merel Steenbergen
81701758d7 ADD:: Alert for taken username 2019-04-04 13:20:47 +02:00
Merel Steenbergen
4b04487a25 Added class Hints, including tests 2019-04-04 13:20:47 +02:00
Sem van der Hoeven
50c27cf420 FIX::fixed checkstyle errors
Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template

# Conflicts:
#	src/Client/src/main/java/greenify/client/Hints.java
#	src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#	src/Server/src/main/java/greenify/server/service/CalculatorService.java
2019-04-04 13:16:33 +02:00
Sem van der Hoeven
5526c8f467 FIX::fixed checkstyle errors 2019-04-04 13:14:03 +02:00
Mika Wauben
922a7d1fae Merge branch 'Feature/achievements' into 'master'
Feature/achievements

See merge request cse1105/2018-2019/oopp-group-43/template!63
2019-04-04 11:05:22 +00:00
Sem van der Hoeven
6ced05278b ADD::added animations to extra activities section 2019-04-04 10:43:32 +02:00
Sem van der Hoeven
9e6505dfa3 ADD::added animations to switching sections in calculator 2019-04-04 10:01:07 +02:00
Sem van der Hoeven
86f1b724c7 Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template 2019-04-04 09:27:52 +02:00
Sem van der Hoeven
90d50624f6 EDIT::added imports to dashboard.fxml 2019-04-04 09:27:09 +02:00
mlwauben
82eb5575ee FIX:: checkstyle errors (except Cyclomatic Complexity ones) 2019-04-04 08:00:47 +02:00
Mika Wauben
84154fca3a Merge branch 'master' into 'Feature/achievements'
# Conflicts:
#   src/Client/src/main/java/greenify/client/Friend.java
#   src/Client/src/main/java/greenify/client/Hints.java
#   src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#   src/Client/src/main/java/greenify/client/rest/UserService.java
#   src/Client/src/main/resources/fxml/dashboard.fxml
#   src/Client/src/test/java/UserServiceTest.java
#   src/Server/src/main/java/greenify/server/data/model/User.java
#   src/Server/src/main/java/greenify/server/rest/UserController.java
#   src/Server/src/main/java/greenify/server/service/UserService.java
#   src/Server/src/test/java/greenify/server/rest/UserControllerTest.java
#   src/Server/src/test/java/greenify/server/service/UserServiceTest.java
2019-04-04 05:45:17 +00:00
mlwauben
3aad682394 FIX:: (possible) merge conficts 2019-04-03 22:05:48 +02:00
Merel Steenbergen
b5c834fc52 ADD:: Alert 'Footprint saved. Still has a bug.' 2019-04-03 21:51:35 +02:00
Merel Steenbergen
1ff84ce3d8 ADD:: Alert for taken username 2019-04-03 21:44:50 +02:00
Sem van der Hoeven
c5f7cac9db Merge branch 'add_details_extra_activities' into 'master'
add/added extra activities GUI

See merge request cse1105/2018-2019/oopp-group-43/template!62
2019-04-03 19:15:46 +00:00
Sem van der Hoeven
19fef1d4c8 FIX::resolved merge conflict and this fixed the issue where it wouldn't set the children of the extra pane
Merge branch 'master' into 'add_details_extra_activities'

# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/CalculatorController.java
2019-04-03 19:11:51 +00:00
mlwauben
28f9f72f07 UPDATE:: achievement things, tests/checkstyle and it actually works now 2019-04-03 20:34:04 +02:00
Merel Steenbergen
f5250aa2a0 Merge branch 'Feature/hints' into 'master'
Added some 'Green hints'

See merge request cse1105/2018-2019/oopp-group-43/template!61
2019-04-03 18:08:09 +00:00
Sem van der Hoeven
d5af8816e9 ADD::added extra activities section to calculator
added section to calculator, and buttons to activities and dashboard to open it seperately
2019-04-03 19:32:40 +02:00
Merel Steenbergen
6a2eb27627 Merge branch 'Feature/delete_a_friend' into 'master'
Feature/remove a friend

See merge request cse1105/2018-2019/oopp-group-43/template!60
2019-04-03 14:29:36 +00:00
Merel Steenbergen
01e03782c2 Remove addFriend part from removeFriendTest from UserControllerTest.java 2019-04-03 13:40:53 +00:00
Merel Steenbergen
bb6d887036 Added class Hints, including tests 2019-04-03 15:33:26 +02:00
Merel Steenbergen
7b6457b286 ADD::RemoveFriend method and test in server.userController 2019-04-03 14:19:30 +02:00
Sem van der Hoeven
54d0537f95 EDIT::changed miles to kilometres in calculator 2019-04-03 11:52:03 +02:00
Ceren Ugurlu
b781727703 Delete suppression.xml 2019-04-01 17:54:41 +00:00
cugurlu
4c50eea99a Add meeting notes for week 8 2019-04-01 19:54:09 +02:00
Ceren Ugurlu
a38cd45e2a Merge branch 'add_weekly_reports' into 'master'
Add weekly reports

See merge request cse1105/2018-2019/oopp-group-43/template!59
2019-04-01 17:12:52 +00:00
Merel Steenbergen
e48264a667 EDIT:: Uncomment build.gradle mainClassName 2019-04-01 16:53:16 +02:00
Merel Steenbergen
12b05f3b73 ADD:: RemoveFriend method and test in client.userService 2019-04-01 16:46:01 +02:00
Merel Steenbergen
6d37b99c14 ADD:: RemoveFriend method and tests in Server.UserService 2019-04-01 16:43:10 +02:00
Merel Steenbergen
52291ac10f ADD:: Friend remove methods and tests in server.User 2019-04-01 16:36:12 +02:00
cugurlu
ae5d4a1496 Add coverage and checkstyle reports 2019-04-01 14:22:31 +02:00
Ceren Ugurlu
d7454345be Delete 20190401_checkstyle.png 2019-04-01 12:19:37 +00:00
Ceren Ugurlu
26693e8782 Merge branch 'add_savedCO2_property' into 'master'
Add co2 saved property tables and tests

See merge request cse1105/2018-2019/oopp-group-43/template!58
2019-04-01 12:14:42 +00:00
cugurlu
e78be7ac9f Add co2 saved property tables and tests 2019-04-01 13:59:54 +02:00
Merel Steenbergen
a25c5da5ac Merge branch 'add/final_report_draft' into 'master'
Add the draft of the final report

See merge request cse1105/2018-2019/oopp-group-43/template!57
2019-04-01 11:59:32 +00:00
Merel Steenbergen
5ab7deb210 Rename the draft final report 2019-04-01 11:57:52 +00:00
Merel Steenbergen
9ad503db0d ADD: Right version of the draft of the final report 2019-04-01 13:51:24 +02:00
Mika Wauben
5a412cd170 Merge branch 'fix/checkstyle' into 'master'
Fix/checkstyle

See merge request cse1105/2018-2019/oopp-group-43/template!55
2019-04-01 11:38:24 +00:00
Mika Wauben
644f466696 Merge branch 'fix/checkstyle' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into fix/checkstyle 2019-04-01 11:38:23 +00:00
Merel Steenbergen
118ae797f5 Upload draft of the final report 2019-04-01 11:37:02 +00:00
Mika Wauben
fcaf3ddb49 Merge branch 'update/doc' into 'master'
Update/doc

See merge request cse1105/2018-2019/oopp-group-43/template!54
2019-03-31 17:45:31 +00:00
Mika Wauben
8f026a960e UPDATE:: readme, wow 4 commits for one file 2019-03-31 17:31:28 +00:00
Mika Wauben
b8bb8dc91c UPDATE:: readme, slowly getting there 2019-03-31 17:30:09 +00:00
Sem van der Hoeven
d824a3b819 EDIT::changed activities textfields to labels 2019-03-31 19:28:29 +02:00
Mika Wauben
a5dd8667b9 UPDATE:: readme because I am an idiot and didn't save my file yet ... 2019-03-31 17:27:56 +00:00
Mika Wauben
947ae660a0 UPDATE:: readme (start of the great readme) 2019-03-31 17:26:58 +00:00
Mika Wauben
c85432fb48 ADD:: agenda week8 2019-03-31 16:57:50 +00:00
Mika Wauben
f133e80ce3 Add new directory 2019-03-31 16:57:31 +00:00
Mika Wauben
97577cfd1c ADD:: backlog sprint6 2019-03-31 16:57:01 +00:00
Mika Wauben
0cfead72af Add new directory 2019-03-31 16:56:39 +00:00
Mika Wauben
c3124f509e ADD:: scrumboard sprint5 2019-03-31 16:56:24 +00:00
Mika Wauben
d484898ba1 ADD:: retrospective sprint5 2019-03-31 16:54:52 +00:00
Mika Wauben
bd225edea1 ADD:: review sprint5 2019-03-31 16:54:10 +00:00
Ceren Ugurlu
608d3ec40f Merge branch 'addActivitySummary_newTests' into 'master'
Add activity summary and new tests

See merge request cse1105/2018-2019/oopp-group-43/template!53
2019-03-31 14:12:44 +00:00
Ceren Ugurlu
c8b9b4d78f Solve the conflict 2019-03-31 13:36:21 +00:00
Sem van der Hoeven
a9f63f6fab Merge branch 'Add_extras_to_calculator' into 'master'
edit/edited back javafx imports for checkstyle

See merge request cse1105/2018-2019/oopp-group-43/template!52
2019-03-31 13:31:08 +00:00
Ceren Ugurlu
3f4e7cb9a9 Update README.md 2019-03-31 13:28:42 +00:00
Sem van der Hoeven
9f3597124d EDIT::edited back javafx imports for checkstyle 2019-03-31 15:28:08 +02:00
cugurlu
f4f79484fa Test all new methods 2019-03-31 15:27:07 +02:00
cugurlu
3b4add03ee Add new activity page properties 2019-03-31 15:26:48 +02:00
cugurlu
32c9713835 Add acitivitySummary to GUI 2019-03-31 15:26:06 +02:00
cugurlu
8e11ecbcf4 Add new methods for getInputMap from database 2019-03-31 15:25:40 +02:00
Ceren Ugurlu
9f45b1c8ac Merge branch 'Add_extras_to_calculator' into 'master'
Extra section is added to the calculator

See merge request cse1105/2018-2019/oopp-group-43/template!51
2019-03-31 13:19:54 +00:00
Sem van der Hoeven
c03538ff34 ADD::added section indicator bars to calculator
Somehow they were deleted, so I added them again. Also added to the extra section
2019-03-31 14:41:19 +02:00
Sem van der Hoeven
7805122c06 ADD::added 'extra' section to calculator
added checkboxes to add extra activities
2019-03-31 14:26:05 +02:00
Ceren Ugurlu
61ed9fc497 Merge branch 'fixBugs_addLeaderboard' into 'master'
Fix bugs & add leaderboard

See merge request cse1105/2018-2019/oopp-group-43/template!50
2019-03-31 11:07:47 +00:00
Sem van der Hoeven
85412af2a6 ADD::added style to friends table 2019-03-31 12:41:45 +02:00
cugurlu
5449c664bd Update README.md 2019-03-31 00:54:50 +01:00
cugurlu
b4a00fade2 Add new tests 2019-03-31 00:51:55 +01:00
cugurlu
cf1704e872 Connect server and client for getAllUsers, saveFootprint and getFootprint methods 2019-03-31 00:51:34 +01:00
cugurlu
383d505f52 Fix checkstyle errors and delete unused methods for high coverage 2019-03-31 00:50:21 +01:00
cugurlu
cc236c46b6 Add tests for userService 2019-03-31 00:49:16 +01:00
cugurlu
ed695f941d Add leaderboard and fix friend bugs 2019-03-31 00:47:21 +01:00
cugurlu
a41b697510 Fix calculator bugs 2019-03-31 00:45:50 +01:00
Sem van der Hoeven
ebaeff9fad EDIT::changed colour scheme of 'add friend' button 2019-03-30 19:29:49 +01:00
mlwauben
973e8aba69 UPDATE:: checkstyle fixes 2019-03-30 17:16:24 +01:00
mlwauben
7656b60fcf UPDATE:: achievements and tests 2019-03-30 16:43:24 +01:00
Ceren Ugurlu
1437bbc1bc Merge branch 'connect_friends_GUI' into 'master'
Edit GUI for friend property

See merge request cse1105/2018-2019/oopp-group-43/template!49
2019-03-30 10:58:18 +00:00
mlwauben
ca11cd3c9a DEBUG:: achievement things (tests all work now) 2019-03-30 11:29:39 +01:00
Sem van der Hoeven
0b2677fd06 ADD:added section indicators to calculator
Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template

# Conflicts:
#	src/Client/src/main/resources/fxml/calculator.fxml
2019-03-30 11:18:50 +01:00
Sem van der Hoeven
336e56bb51 ADD:: added section indicator bars to calculator 2019-03-30 11:17:12 +01:00
Ceren Ugurlu
026cd15009 Update DashBoardController.java 2019-03-30 09:36:41 +00:00
mlwauben
f5d9bd5010 UPDATE:: added achievements to user class 2019-03-30 09:25:12 +01:00
mlwauben
3d61cd061a ADD:: class of achievements list 2019-03-30 09:02:02 +01:00
mlwauben
393bfc9445 ADD:: achievement class 2019-03-30 08:23:54 +01:00
cugurlu
a64b31001a Edit dashboard for new properties 2019-03-29 18:11:39 +01:00
cugurlu
704854e8b5 Add new controller friends 2019-03-29 18:11:16 +01:00
cugurlu
25c8951530 Add fxml file for add friend page 2019-03-29 18:10:55 +01:00
cugurlu
e41f434a28 Add new class for tableView 2019-03-29 18:10:01 +01:00
cugurlu
0530fc4ddb Add new icons 2019-03-29 18:09:31 +01:00
Ceren Ugurlu
36f36d4100 Merge branch 'connect_calculator&GUI' into 'master'
Connect calculator with GUI

See merge request cse1105/2018-2019/oopp-group-43/template!48
2019-03-29 13:17:15 +00:00
cugurlu
d0beb236ea Edit to connect calculator with GUI 2019-03-29 12:47:24 +01:00
mlwauben
c62e4719ea ADD:: test fxml+controller 2019-03-28 23:11:58 +01:00
Sem van der Hoeven
a92a5b6e47 Merge branch 'finish_calculator_GUI' into 'master'
Finished calculator GUI

See merge request cse1105/2018-2019/oopp-group-43/template!47
2019-03-28 21:37:43 +00:00
Sem van der Hoeven
56bd05324c Merge branch 'finish_calculator_GUI' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into finish_calculator_GUI
Sourcetree needed to merge this?
2019-03-28 22:35:54 +01:00
Sem van der Hoeven
fcea76f0e9 FIX::fixed checkstyle import error 2019-03-28 22:34:54 +01:00
Sem van der Hoeven
6fd04b1d0a EDiT:: resolved merge conflicts, most were just empty lines in master
Merge branch 'master' into 'finish_calculator_GUI'

# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/CalculatorController.java
#   src/Client/src/main/resources/fxml/calculator.fxml
2019-03-28 19:44:01 +00:00
Sem van der Hoeven
6ab7141f64 ADD::finished GUI for calculator
now only need to add animations
2019-03-28 14:09:36 +01:00
Sem van der Hoeven
980e64657a EDIT::finished home section of calculator 2019-03-27 20:51:14 +01:00
Ceren Ugurlu
7267a73cbe Merge branch 'develop_calculator' into 'master'
Merge working version of calculator and tests

See merge request cse1105/2018-2019/oopp-group-43/template!46
2019-03-27 13:35:10 +00:00
cugurlu
c9178362cc Update CalculatorServiceTest .java 2019-03-27 13:47:00 +01:00
cugurlu
42cf5a5ee4 Add new tests to increase coverage 2019-03-27 13:46:23 +01:00
cugurlu
56829cca6b Add new methods and tests for requesting 2019-03-27 13:45:28 +01:00
cugurlu
e51ef99bc9 Edit for saving setted new inputs and calculated footprint 2019-03-27 13:44:24 +01:00
cugurlu
4a31b52e69 Update InputValidator and its test for API 2019-03-27 13:42:34 +01:00
cugurlu
20c37c4899 Add tests for footprint 2019-03-27 13:41:32 +01:00
cugurlu
07f5eb0449 Add methods for calculator and fix checktsyle errors 2019-03-27 13:40:52 +01:00
Sem van der Hoeven
3dec44ada1 EDIT::Finished Travel GUI section of calculator 2019-03-27 13:10:21 +01:00
Sem van der Hoeven
1d10d1d54b ADD::almost completed travel pane of calculator 2019-03-27 09:44:34 +01:00
Merel Steenbergen
1f03552d84 Merge branch 'fix/checkstyleAndComments' into 'master'
Fix/checkstyle and comments

See merge request cse1105/2018-2019/oopp-group-43/template!44
2019-03-26 15:06:24 +00:00
Merel Steenbergen
2abad808ad FIX: Checkstyle fixes after merge conflicts 2019-03-26 16:01:53 +01:00
Merel Steenbergen
a540b9e8f2 Resolve merge requests 2019-03-26 15:50:11 +01:00
mlwauben
08d46ea8f0 DELETE:: not used imports 2019-03-26 15:48:51 +01:00
mlwauben
e755107fa8 FIX:: checkstyle fixes 2019-03-26 15:48:50 +01:00
mlwauben
37d3e6c4a7 FIX:: checkstyle 'client' 2019-03-26 15:40:43 +01:00
mlwauben
81f58c86f9 FIX:: checkstyle 'client' tests 2019-03-26 15:39:15 +01:00
mlwauben
0bf32dc19c FIX:: checkstyle fixes 2019-03-26 15:39:15 +01:00
mlwauben
8ec3a508eb FIX:: checkstyle server user tests 2019-03-26 15:39:15 +01:00
mlwauben
71ea1e3a4b FIX:: checkstyle 'server', things with user 2019-03-26 15:38:43 +01:00
mlwauben
61e31df157 FIX:: checkstyle 'common' 2019-03-26 15:34:50 +01:00
mlwauben
064e8e04c2 FIX:: CI 2019-03-26 15:34:50 +01:00
mlwauben
97a0e38c40 FIX:: application classes server+client 2019-03-26 15:34:50 +01:00
Mika Wauben
0751f50026 Update build.gradle 2019-03-26 15:34:50 +01:00
Merel Steenbergen
470a31889a Resolved the conflicts. We should check if the JavaDoc is still in the right place, because it looked a little weird while resolving the conflicts
Merge branch 'master' into 'fix/checkstyleAndComments'

# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#   src/Server/src/main/java/greenify/server/data/model/User.java
#   src/Server/src/main/java/greenify/server/service/UserService.java
#   src/Server/src/test/java/greenify/server/data/model/UserTest.java
#   src/Server/src/test/java/greenify/server/service/UserServiceTest.java
2019-03-26 14:33:05 +00:00
Merel Steenbergen
90bf334c19 Merge branch 'AddFriends' into 'master'
Add methods and tests for friends.

See merge request cse1105/2018-2019/oopp-group-43/template!43
2019-03-26 14:29:14 +00:00
Merel Steenbergen
12e677607d Merge branch 'Add_Calculator_to_GUI' into 'master'
merge 'add calculator to gui' to first fix master

See merge request cse1105/2018-2019/oopp-group-43/template!45
2019-03-26 14:27:23 +00:00
mlwauben
c6ff4862e6 DELETE:: not used imports 2019-03-26 15:21:23 +01:00
Sem van der Hoeven
bc6e8cd89d Merge branch 'master' into 'Add_Calculator_to_GUI'
# Conflicts:
#   src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#   src/Client/src/main/resources/fxml/dashboard.fxml

the conflicts were only empty lines on the master
2019-03-26 14:04:49 +00:00
Merel Steenbergen
4780ae7b11 Revert changes: AssertArrayEquals doesn't work on ArrayLists 2019-03-26 13:56:48 +00:00
Merel Steenbergen
b1f3725f71 Change wrong url (setInput to addFriend) on Client userService 2019-03-26 13:52:13 +00:00
Merel Steenbergen
1668731624 Use assertArrayEquals instead of AssertEquals 2019-03-26 13:49:29 +00:00
Merel Steenbergen
d6640966c5 Merge branch 'AddDocs' into 'master'
Add notes

See merge request cse1105/2018-2019/oopp-group-43/template!42
2019-03-26 10:55:53 +00:00
mlwauben
cf96ac30b8 FIX:: checkstyle fixes 2019-03-26 11:55:05 +01:00
Merel Steenbergen
4171b933dc FIX: Spelling error 2019-03-26 11:40:24 +01:00
Merel Steenbergen
c61469476b Uncommented mainClassName 2019-03-26 11:37:47 +01:00
mlwauben
8677ac94ef FIX:: checkstyle 'client' 2019-03-26 11:34:53 +01:00
Merel Steenbergen
f11cfc804b Add test for leaderboard JSON 2019-03-26 11:31:41 +01:00
Merel Steenbergen
f39aef31d0 Fix checkstyle errors 2019-03-26 11:24:10 +01:00
Merel Steenbergen
4a6d4c7043 Friend list to JSON method added 2019-03-26 11:07:04 +01:00
mlwauben
bd21e30f26 FIX:: checkstyle 'client' tests 2019-03-26 11:00:24 +01:00
Merel Steenbergen
cc9f8196bc Added tests and method to make sure you cannot add yourself as a friend 2019-03-26 10:56:45 +01:00
mlwauben
9e345ee353 FIX:: checkstyle fixes 2019-03-26 10:55:12 +01:00
Merel Steenbergen
7a4a031b1d Added some tests for friend methods 2019-03-26 10:47:12 +01:00
Merel Steenbergen
ba5e261c7f Resolve merge conflicts 2019-03-26 10:28:57 +01:00
Merel Steenbergen
471d41a600 Commit small changes before rebase 2019-03-26 10:26:29 +01:00
Merel Steenbergen
a1ba2f1d7d FIX: Create-drop databse. Add ManyToMany annotation 2019-03-26 10:26:29 +01:00
Merel Steenbergen
28cd0d0d7f FIX: Database fix 2019-03-26 10:24:57 +01:00
Merel Steenbergen
437267dcb9 Commit small changes before rebase 2019-03-26 10:24:21 +01:00
Merel Steenbergen
559885e22b Upload notes 25-03-2019 2019-03-26 09:16:26 +00:00
mlwauben
d8ced45a67 FIX:: checkstyle server user tests 2019-03-26 09:59:00 +01:00
mlwauben
72cb770861 FIX:: checkstyle 'server', things with user 2019-03-26 09:49:27 +01:00
mlwauben
0ae5e7f4ee FIX:: checkstyle 'common' 2019-03-26 08:46:54 +01:00
mlwauben
4200ae587d FIX:: CI 2019-03-26 08:26:40 +01:00
mlwauben
f28a4ea924 FIX:: application classes server+client 2019-03-26 08:25:09 +01:00
Mika Wauben
ec37bdcd79 Update build.gradle 2019-03-26 07:05:10 +00:00
Sem van der Hoeven
7a11e6260e EDIT::Update README.md
updated location of pictures
2019-03-25 15:52:52 +00:00
Sem van der Hoeven
b0cdd9bff7 EDIT::Update 20190325_agenda.md
checked presence and edited Daan leaving the study
2019-03-25 15:34:47 +00:00
Merel Steenbergen
698c6ef7fd Delete Daan from README 2019-03-25 15:28:53 +00:00
Merel Steenbergen
4be4853685 Delete corequadrant-KP.png 2019-03-25 15:27:36 +00:00
Merel Steenbergen
36c67ce217 Delete KristinPeneva.jpg 2019-03-25 15:27:20 +00:00
Merel Steenbergen
cb15a1fefe Delete Daan_Sneep_PDP_Core_Quadrant.PNG 2019-03-25 15:27:11 +00:00
Merel Steenbergen
19f4a73119 Delete Daan_Sneep.png 2019-03-25 15:27:00 +00:00
Sem van der Hoeven
71fc659c79 ADD::added javadoc comments to calculatorController class 2019-03-25 16:25:13 +01:00
Sem van der Hoeven
4cb256a30a FIX::deleted onAction of 'addVeganMeal' button, as this method was deleted 2019-03-25 15:58:34 +01:00
Sem van der Hoeven
521426ac16 ADD::added style to some buttons
EDIT::changed travel pane from anchor pane to scroll pane
2019-03-25 15:45:31 +01:00
Sem van der Hoeven
987acbad71 ADD::added calculator window to GUI
ADD::added button to open calculator to main window
2019-03-25 14:51:25 +01:00
Ceren Ugurlu
2e745e690c Merge branch 'createCalculator' into 'master'
Merge createCalculator branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!41
2019-03-25 13:40:13 +00:00
Merel Steenbergen
1cec006178 FIX: Create-drop databse. Add ManyToMany annotation 2019-03-25 14:37:45 +01:00
cugurlu
cf0952c7c2 Upload coverage report 2019-03-25 13:54:18 +01:00
cugurlu
b0d69bfc2c Upload checkstyle report 2019-03-25 13:52:25 +01:00
Ceren Ugurlu
006cf60d17 Delete ActivityDto.java 2019-03-25 12:37:49 +00:00
Ceren Ugurlu
baf516e989 Delete ActivityDtoTest.java 2019-03-25 12:36:42 +00:00
Ceren Ugurlu
5c9c1b8be5 Delete Activity.java 2019-03-25 12:36:12 +00:00
Ceren Ugurlu
d7dcd95278 Delete ActivityTest.java 2019-03-25 12:34:54 +00:00
cugurlu
fc7e718b21 Add new tests 2019-03-25 13:33:38 +01:00
cugurlu
8e58118ac7 Add new classes for calculator 2019-03-25 13:32:01 +01:00
cugurlu
99143a8f20 Fix error 2019-03-25 13:30:25 +01:00
cugurlu
34e010f62d Fix client errors 2019-03-25 13:18:48 +01:00
cugurlu
e8108498ad Update UserDto and delete addVeganMealProperty 2019-03-25 13:07:03 +01:00
cugurlu
e79d050b12 Update UserDto in Common 2019-03-25 13:03:06 +01:00
Ceren Ugurlu
b9fb7d81ce Merge branch 'updateDoc' into 'master'
Update doc

See merge request cse1105/2018-2019/oopp-group-43/template!40
2019-03-25 09:22:36 +00:00
Mika Wauben
563ae51408 ADD:: review sprint4 2019-03-25 09:17:58 +00:00
Mika Wauben
caa86f446d ADD:: notes week6 2019-03-25 09:06:52 +00:00
Mika Wauben
ce669b47d2 ADD:: backlog sprint5 2019-03-25 09:04:16 +00:00
Mika Wauben
97d2a0f6fc Add new directory 2019-03-25 09:03:54 +00:00
Mika Wauben
2dce37222d ADD:: retrospective sprint4 2019-03-25 09:03:37 +00:00
Mika Wauben
a973ab0750 ADD:: scrum board sprint4 2019-03-25 09:03:08 +00:00
mlwauben
ae3ab8f563 FIX:: folder names were wrong 2019-03-25 10:02:11 +01:00
Sem van der Hoeven
d5319fc973 Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
sourcetree needed to merge this
2019-03-24 12:11:38 +01:00
Sem van der Hoeven
566af39b0d ADD::added Agenda for next meetinf (25-03-2019) 2019-03-24 12:10:58 +01:00
Ceren Ugurlu
eb3326481a Merge branch 'Add_friends_to_GUI' into 'master'
merge Add_friends_to_gui into master

See merge request cse1105/2018-2019/oopp-group-43/template!39
2019-03-24 11:05:11 +00:00
Sem van der Hoeven
b3d4f573f8 ADD::added table to friends pane 2019-03-24 12:01:34 +01:00
Merel Steenbergen
e494b5294d Revert "Merge branch 'AddFriends' into 'master'"
This reverts merge request !37
2019-03-23 17:31:00 +00:00
Merel Steenbergen
18c3ce0c92 FIX: Database fix 2019-03-23 18:26:01 +01:00
Mika Wauben
5b3896d310 Merge branch 'AddFriends' into 'master'
Add basic friends

See merge request cse1105/2018-2019/oopp-group-43/template!37
2019-03-23 12:09:33 +00:00
Merel Steenbergen
f8315700d9 FIX: Uncomment mainClassName 2019-03-22 21:57:05 +01:00
Merel Steenbergen
6385beec06 FIX: Tests now work 2019-03-22 21:51:09 +01:00
Merel Steenbergen
12c2ebab4e Debugging in progress. FindByName returns null again. 2019-03-22 20:20:39 +01:00
Merel Steenbergen
e69e08ad15 EDIT: Try to fix server, again 2019-03-22 18:44:59 +01:00
Sem van der Hoeven
ae000baba4 EDIT:::edited .gitignore
files like .classpath and .project were commented out, they now should be ignored by git
2019-03-22 09:25:48 +01:00
Sem van der Hoeven
caf9e3e1d9 Merge branch 'cleanUp_files' into 'master'
Merge cleanUp_files into master

See merge request cse1105/2018-2019/oopp-group-43/template!36
2019-03-22 07:41:37 +00:00
cugurlu
bddf984438 Clean up all unnecessary files 2019-03-21 18:07:14 +01:00
Merel Steenbergen
6323fd06eb FIX: Bug fixed, Server now works again 2019-03-21 16:14:50 +01:00
Merel Steenbergen
fb69ec280d Added testing for the friend list and equals in User class in Server 2019-03-21 16:09:23 +01:00
Sem van der Hoeven
dfdbc8d5a9 ADD::added friends pane and button to dashboard
ADD::added load animations to register window
2019-03-21 10:45:54 +01:00
Merel Steenbergen
b3a0ddaa68 Retry adding friends. Server down again 2019-03-20 15:44:47 +01:00
Sem van der Hoeven
93aaf19f13 DEBUG/FIX::fixed bug where total amount of vegetarian meals wouldn't update
fixed the bug where totalVeganMeals wouldn't update on clicking the activities button if you were already on the activities screen

ADD::added id to 'add activity' button on dashboard

for adding a color change when clicking it, still need to implement it completely
2019-03-20 13:15:12 +01:00
Sem van der Hoeven
8345b6c06f ADD::Added slide-in transition for the menu bar
it gets played on load, right now it sometimes is a bit laggy but not sure if that is JavaFX or just everything getting loaded
2019-03-20 08:08:32 +01:00
Sem van der Hoeven
292035498c Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
SourceTree needed to merge this?
2019-03-19 14:52:19 +01:00
Sem van der Hoeven
1f78805f9b EDIT::Changed Login screen name from Go Green to Greenify 2019-03-19 14:49:47 +01:00
Sem van der Hoeven
9d38e1e541 Merge branch 'fixMaster' into 'master'
Merge fixMaster into master

See merge request cse1105/2018-2019/oopp-group-43/template!35
2019-03-19 13:48:39 +00:00
Ceren Ugurlu
121b86a73e Merge branch 'master' into 'fixMaster' 2019-03-19 13:09:13 +00:00
Sem van der Hoeven
920c7c798d ADD::added more comments 2019-03-18 20:47:34 +01:00
Ceren Ugurlu
2c54b8d68c Merge branch 'AddComments' into 'master'
merge AddComments into master

See merge request cse1105/2018-2019/oopp-group-43/template!34
2019-03-18 16:14:49 +00:00
Ceren Ugurlu
0ed8dc34ab Delete .project 2019-03-18 16:10:19 +00:00
Sem van der Hoeven
b8f4415825 ADD::added comments to most classes to make it more understandable 2019-03-18 17:07:38 +01:00
Ceren Ugurlu
2e244e600f Delete OOPP.kotlin_module 2019-03-18 15:58:27 +00:00
Ceren Ugurlu
32b0554329 Delete .classpath 2019-03-18 15:58:06 +00:00
Ceren Ugurlu
4f089d8408 Delete CSE1105.checkstyle.xml 2019-03-18 15:57:47 +00:00
cugurlu
563c72ffec Update branch 2019-03-18 16:56:44 +01:00
Sem van der Hoeven
ecdc9f3a4f ADD::Added hover effects 2019-03-18 15:48:10 +01:00
Sem van der Hoeven
2c32b7d65b Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
SourceTree needed to merge this?
2019-03-18 15:31:41 +01:00
Sem van der Hoeven
8dd8ae28d4 ADD::added animations
added animations for switching between panes in the main stage
2019-03-18 15:30:55 +01:00
cugurlu
68036b3c2f Update coverage report 2019-03-18 15:27:05 +01:00
Sem van der Hoeven
6a71823885 ADD::added stylesheet for login window
added style to the buttons, the same as in the register window
changed the font of the title
changed the font and color of the 'forgot password' link

ADD::added display of name on dashboard

added initialize method to set the 'welcome back' text to include the username of the user
2019-03-18 14:43:15 +01:00
Sem van der Hoeven
baa681833e Merge branch 'Add_report' into 'master'
Merge Add_report branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!33
2019-03-18 13:40:02 +00:00
cugurlu
166945871d Fix UserService and UserServiceTest 2019-03-18 14:35:30 +01:00
cugurlu
17d5591146 Add coverage report 2019-03-18 14:17:22 +01:00
Sem van der Hoeven
874c6fba06 ADD::added title to main program stage
now displays "Greenify - <username>"
2019-03-18 13:34:34 +01:00
Ceren Ugurlu
f89470458b Merge branch 'add_veganMealCounter' into 'master'
Merge branch add_veganMealCounter into master

See merge request cse1105/2018-2019/oopp-group-43/template!32
2019-03-18 12:16:32 +00:00
Ceren Ugurlu
318900b203 Merge branch 'master' into 'add_veganMealCounter' 2019-03-18 12:14:04 +00:00
cugurlu
584e5bf90c Update GUI 2019-03-18 13:06:04 +01:00
Mika Wauben
436343d170 Merge branch 'updateDoc' into 'master'
Update doc

See merge request cse1105/2018-2019/oopp-group-43/template!31
2019-03-18 11:46:30 +00:00
mlwauben
4863ae4d3f Merge branch 'updateDoc' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into updateDoc 2019-03-18 12:43:14 +01:00
mlwauben
97807293f9 ADD: meeting folders 2019-03-18 12:42:21 +01:00
Mika Wauben
8caf3bdac9 ADD: review sprint3 2019-03-18 11:38:29 +00:00
Mika Wauben
2e747fdc89 Delete 20190318_sprint_review.txt 2019-03-18 11:37:20 +00:00
Mika Wauben
0ca0a516bd ADD: review sprint3 2019-03-18 11:37:10 +00:00
Mika Wauben
bb89b67e87 ADD: review sprint2 2019-03-18 11:36:41 +00:00
Mika Wauben
ba4b40efab ADD: review sprint1 2019-03-18 11:36:21 +00:00
Mika Wauben
dbde18d3f2 ADD: scrum board sprint2 2019-03-18 11:35:19 +00:00
Mika Wauben
a15cfc21fc Delete 20191003_scrumboard.png 2019-03-18 11:35:02 +00:00
Mika Wauben
9c9a98c738 ADD: scrum board sprint1 2019-03-18 11:34:50 +00:00
Mika Wauben
3af4d1778f Delete 20190403_scrumboard.png 2019-03-18 11:34:31 +00:00
Mika Wauben
d3c42e70fe ADD: backlog sprint4 2019-03-18 11:34:02 +00:00
Mika Wauben
8870ed1f56 Add new directory 2019-03-18 11:33:42 +00:00
mlwauben
b2ae1d75a5 DELETE: wrong folder 2019-03-18 12:33:03 +01:00
Mika Wauben
f018484556 ADD: retrospective sprint3 2019-03-18 11:31:44 +00:00
Mika Wauben
e12d5945ff Upload scrum board sprint3 2019-03-18 11:31:05 +00:00
Sem van der Hoeven
6945eddf5d Merge branch 'Get_UserControllerTest_Working'
# Conflicts:
#	src/Server/src/test/java/UserControllerTest.java
2019-03-18 12:20:44 +01:00
cugurlu
f76a6827f7 Fix tests 2019-03-18 12:15:00 +01:00
cugurlu
a2e432d453 Add totalVeganMeal property and fix checkstyle errors 2019-03-18 12:14:30 +01:00
Sem van der Hoeven
3e5957b807 EDIT::commented out usercontrollertest, as it is still not working, but want to merge this branch to get the gui properly 2019-03-18 12:10:43 +01:00
Sem van der Hoeven
f66191f136 Merge branch 'Add_tests' into 'master'
Merge Add_tests branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!28
2019-03-17 23:39:20 +00:00
cugurlu
711b16449c Add RestExceptionHandler test 2019-03-18 00:35:29 +01:00
cugurlu
d7960103ee Add UserRepository test 2019-03-18 00:34:51 +01:00
cugurlu
2546355eba Add UserController test 2019-03-18 00:34:26 +01:00
cugurlu
8864320832 Add tests 2019-03-18 00:33:59 +01:00
Sem van der Hoeven
3c5bc0a651 FIX::fixed the fxml Label names
there were exceptions when trying to add a vegetarian meal, this was caused by the method not accessing the right label to change
2019-03-17 22:14:27 +01:00
Sem van der Hoeven
aa393da53b FIX::fixed FXML declarations under fields 2019-03-17 22:05:29 +01:00
Ceren Ugurlu
76ebd018bd Delete UserControllerTest.java 2019-03-17 20:50:20 +00:00
Ceren Ugurlu
88e7afb8fb Update the location of ActivityTest.java 2019-03-17 20:49:01 +00:00
Ceren Ugurlu
e92dd0ba2b Delete UserTest.java 2019-03-17 20:47:53 +00:00
Ceren Ugurlu
e0f0e38241 Delete MainController.java 2019-03-17 20:45:22 +00:00
Sem van der Hoeven
282d2026ba FIX::fixed UserDto names
ADD::tried to add second test to see what was the problem, but no luck so far
2019-03-17 21:42:52 +01:00
Ceren Ugurlu
874b0bcd72 Merge branch 'add_documents' into 'master'
Merge add_documents branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!27
2019-03-17 20:12:33 +00:00
cugurlu
a9e659fc9f Add checkstyle screenshot 2019-03-17 21:04:24 +01:00
cugurlu
2c3314c693 Add week 5 agenda 2019-03-17 21:01:36 +01:00
Ceren Ugurlu
8524bb2e89 Update .gitlab-ci.yml 2019-03-17 19:13:47 +00:00
Ceren Ugurlu
8a4134c52b Update .gitlab-ci.yml 2019-03-17 18:46:17 +00:00
Sem van der Hoeven
b0e2ad2903 ADD::added checkstyle file
it somehow got deleted
2019-03-17 19:25:50 +01:00
Sem van der Hoeven
8c13a8bf39 Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template 2019-03-17 19:23:32 +01:00
Sem van der Hoeven
01b4ac4287 FIX::Corrected the UserDto name change in Userservice of server
the references were still to UserDTO instead of the new UserDto
2019-03-17 19:22:59 +01:00
Ceren Ugurlu
4fa6ac7f53 Merge branch 'FixDTO' into 'master'
Merge FixDTO into master

See merge request cse1105/2018-2019/oopp-group-43/template!26
2019-03-17 18:01:55 +00:00
cugurlu
1da7f62c95 Fix the branch and add a test 2019-03-17 18:58:56 +01:00
Merel Steenbergen
0c042daa1c DTO changed to Dto. Still some errors 2019-03-17 18:31:55 +01:00
Merel Steenbergen
bfc9595d21 Changed DTO files to Dto because of checkstyle 2019-03-17 18:23:18 +01:00
Merel Steenbergen
dd74a97c47 Merge branch 'AddFeatureClass' into 'master'
Add feature class

See merge request cse1105/2018-2019/oopp-group-43/template!25
2019-03-17 17:10:37 +00:00
Sem van der Hoeven
4b77102205 Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
# Conflicts:
#	src/.idea/checkstyle-idea.xml
#	src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#	src/Client/src/main/java/greenify/client/controller/UserController.java
#	src/Client/src/main/java/greenify/client/rest/UserService.java
#	src/Server/src/main/java/greenify/server/data/repository/UserRepository.java
#	src/Server/src/main/java/greenify/server/rest/UserController.java
#	src/Server/src/main/java/greenify/server/service/UserService.java
2019-03-17 18:02:30 +01:00
Merel Steenbergen
018a164723 Fixed tests 2019-03-17 18:01:59 +01:00
Merel Steenbergen
061a6fc957 Delete useless file 2019-03-17 17:57:18 +01:00
Merel Steenbergen
ba98b30776 Fix merge conflicts 2019-03-17 17:54:24 +01:00
Merel Steenbergen
ed35c77262 Finish activity class and add tests 2019-03-17 17:53:00 +01:00
Sem van der Hoeven
09c7817eef Merge branch 'Develop_GUI_further' into master
# Conflicts:
#	src/.idea/workspace.xml
#	src/Client/src/main/java/greenify/client/controller/DashBoardController.java
#	src/Client/src/main/java/greenify/client/controller/UserController.java
#	src/Client/src/main/java/greenify/client/rest/UserService.java
#	src/Server/src/main/java/greenify/server/data/model/User.java
#	src/Server/src/main/java/greenify/server/data/repository/UserRepository.java
#	src/Server/src/main/java/greenify/server/rest/UserController.java
#	src/Server/src/main/java/greenify/server/service/UserService.java

resolved conflicts manually, used the ones from 'Develop_GUI_further'
2019-03-17 17:52:25 +01:00
Merel Steenbergen
e79280e470 Some more work done on the feature object 2019-03-17 17:50:56 +01:00
Merel Steenbergen
5f4069fcad Add outline of activity class, has bugs 2019-03-17 17:50:21 +01:00
Merel Steenbergen
dc6682d7fa Finish activity class and add tests 2019-03-17 17:46:53 +01:00
Merel Steenbergen
922f8b2657 Some more work done on the feature object 2019-03-17 17:43:45 +01:00
Sem van der Hoeven
2999359b01 Merge branch 'master' into 'AddFeatureClass'
# Conflicts:
#   src/Server/src/main/java/greenify/server/data/model/User.java
#   src/Server/src/main/java/greenify/server/service/UserService.java
2019-03-17 16:37:45 +00:00
Sem van der Hoeven
ec63a64248 Merge branch 'checkstyle' into 'master'
Merge checkstyle branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!24
2019-03-17 16:33:48 +00:00
Ceren Ugurlu
5b13f26dee Update UserDTOTest.java 2019-03-17 16:30:41 +00:00
Ceren Ugurlu
561cca7f5a Update UserDTO.java 2019-03-17 16:29:56 +00:00
cugurlu
20b6e89781 Fix checkstyle errors 2019-03-17 17:27:29 +01:00
Merel Steenbergen
249b40572e Add outline of activity class, has bugs 2019-03-17 17:26:31 +01:00
Merel Steenbergen
dc5ddfa90e Merge branch 'AddFeatureClass' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into AddFeatureClass 2019-03-17 17:17:15 +01:00
Merel Steenbergen
a80aaf3a59 Finish activity class and add tests 2019-03-17 17:15:41 +01:00
Merel Steenbergen
454a0ec1a3 Some more work done on the feature object 2019-03-17 17:15:41 +01:00
Merel Steenbergen
82d3f08e2d Fix bugs. Feature abstract class added 2019-03-17 17:15:41 +01:00
Merel Steenbergen
72c8a213a1 Add outline of activity class, has bugs 2019-03-17 17:15:41 +01:00
Ceren Ugurlu
0d0b78f6d0 Update Application.java 2019-03-17 16:13:05 +00:00
cugurlu
07c76dd385 Fix checkstyle errors 2019-03-17 17:08:46 +01:00
cugurlu
f5fa03b104 Add checkstyle plugin 2019-03-17 17:06:50 +01:00
Merel Steenbergen
34d098f188 Finish activity class and add tests 2019-03-17 16:57:09 +01:00
Sem van der Hoeven
b1ab9f4e8a Merge branch 'fix_userTest' into 'master'
FIX:: fixed the userTest

See merge request cse1105/2018-2019/oopp-group-43/template!20
2019-03-17 15:38:58 +00:00
Sem van der Hoeven
b5defaa581 FIX:: fixed the userTest
ADD:: added equals, tostring and hashcode methods

ADD:: added equals method test
2019-03-17 16:23:52 +01:00
Sem van der Hoeven
e1448055f5 ADD::Added checkstyle comments
FIX::fixed some checkstyle warnings
2019-03-17 15:58:55 +01:00
Sem van der Hoeven
4306372a61 Merge branch 'fix_master' into 'master'
Merge fix_master branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!18
2019-03-17 14:47:44 +00:00
cugurlu
a605e1a92e Update changes 2019-03-17 15:19:43 +01:00
Sem van der Hoeven
e718e3859b removed .idea folder 2019-03-17 14:32:57 +01:00
Sem van der Hoeven
50c58da035 Update .gitignore
added that it excludes the .idea directory from the src folder
2019-03-17 13:31:26 +00:00
Ceren Ugurlu
c23344e8ef Revert "Merge branch 'master' into 'vegetarian_meal'"
This reverts commit b3eeffdb32aa058f9f1aa6b9cbec3d05e2d07b8f
2019-03-17 13:24:32 +00:00
Sem van der Hoeven
a817d9118a ADD::added buttons and counters for the various activities
they don't have functionality yet, but they are already placed

ADD::added methods to get the name of  the user
2019-03-17 14:16:29 +01:00
Sem van der Hoeven
fb6dfcdd20 Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template 2019-03-17 13:11:00 +01:00
Sem van der Hoeven
7539dd20f6 EDIT::changed GUI name to greenify 2019-03-17 13:09:27 +01:00
Mika Wauben
af25d85440 Merge branch 'basic_authentication' into 'master'
Merge basic_authentication into master

See merge request cse1105/2018-2019/oopp-group-43/template!16
2019-03-17 08:57:12 +00:00
cugurlu
4b702bc63b Add configurations for basic authentication 2019-03-16 22:43:30 +01:00
Sem van der Hoeven
5a62ef18dd Merge branch 'Add_registering_GUI' into 'master'
merge registering GUI branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!15
2019-03-16 19:35:55 +00:00
Sem van der Hoeven
0fb1991240 Merge branch 'master' into 'Add_registering_GUI'
# Conflicts:
#   src/Client/src/main/java/greenify/client/Application.java
#   src/Client/src/main/java/greenify/client/controller/UserController.java
#   src/Client/src/main/resources/stylesheets/dashboardStyle.css
2019-03-16 17:40:58 +00:00
Sem van der Hoeven
592015b1cd ADD::Added GUI for the registering
added a window to the sign up button, registering still gives an exception?
2019-03-16 18:37:23 +01:00
Sem van der Hoeven
9a294930d8 Merge branch 'database_fixes' into 'master'
Merge database_fixes branch into master

See merge request cse1105/2018-2019/oopp-group-43/template!14
2019-03-16 13:50:44 +00:00
Sem van der Hoeven
33c09581ec Merge branch 'fix_ci_building' into 'master'
merge fix_ci_building into master

See merge request cse1105/2018-2019/oopp-group-43/template!13
2019-03-16 13:50:29 +00:00
Ceren Ugurlu
7fb44f6867 Delete ApplicationTest.java 2019-03-16 13:34:12 +00:00
Ceren Ugurlu
98df90b0b2 Delete UserJpaRepository.java 2019-03-16 13:27:07 +00:00
Ceren Ugurlu
80d5e42c00 Update build.gradle 2019-03-16 13:25:01 +00:00
cugurlu
4b9e6fce66 Update changes 2019-03-16 14:21:38 +01:00
Sem van der Hoeven
9ff1eb6b09 ADD:: added image to add activity button 2019-03-16 14:20:40 +01:00
cugurlu
479ed8e7f2 Add new tests 2019-03-16 14:18:40 +01:00
cugurlu
59c84f2c09 Add new classes for database 2019-03-16 14:17:35 +01:00
cugurlu
928c6f89a6 Edit common classes 2019-03-16 14:16:29 +01:00
cugurlu
20735380e5 Edit client classes 2019-03-16 14:14:17 +01:00
cugurlu
31499adc00 Add application.properties 2019-03-16 14:10:22 +01:00
cugurlu
2b04ce2306 Fix build.gradle files 2019-03-16 14:06:46 +01:00
Sem van der Hoeven
ad4e49f65c Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template
Sourcetree needed to merge this?
2019-03-14 19:26:17 +01:00
Sem van der Hoeven
e9bee87a38 FIX::edited correct names in fxml files
changed the controller names to use the greenify packages

ADD::added button to add a vegetarian meal

only the button
2019-03-14 19:23:30 +01:00
Merel Steenbergen
8bbe3f0fe9 Some more work done on the feature object 2019-03-14 15:08:49 +01:00
Merel Steenbergen
cca49bc9d6 Fix bugs. Feature abstract class added 2019-03-14 14:31:38 +01:00
Merel Steenbergen
cea68e93c9 Add outline of activity class, has bugs 2019-03-14 14:04:04 +01:00
Ceren Ugurlu
c07ea93176 Update build.gradle 2019-03-14 12:48:32 +00:00
cugurlu
a5b4a2e8f0 Update build.gradle in common 2019-03-14 13:43:03 +01:00
cugurlu
f959ffc066 Fix fxml files 2019-03-14 13:41:32 +01:00
mlwauben
ed1af0ebbc Merge branch 'changeDoc' 2019-03-14 13:27:29 +01:00
Mika Wauben
7edd9e7ed0 ADD: sprint2 review 2019-03-14 12:11:23 +00:00
Mika Wauben
b25e9a0db2 REPLACE scrumboard sprint2 2019-03-14 12:03:34 +00:00
Mika Wauben
a12f364df0 Delete 20191003_scrumboard.png 2019-03-14 12:03:16 +00:00
Mika Wauben
ceac07b27b REPLACE scrumboard sprint1 2019-03-14 12:02:30 +00:00
Mika Wauben
664a941976 Delete 20190403_scrumboard.png 2019-03-14 12:02:10 +00:00
Mika Wauben
a9c99ed678 REPLACE scrumboard sprint1 2019-03-14 12:01:52 +00:00
cugurlu
80bc87922c Update build.gradle in common 2019-03-14 12:05:41 +01:00
Mika Wauben
aa448506d7 ADD: sprint1 review 2019-03-14 10:45:27 +00:00
Sem van der Hoeven
0be9322f66 EDIT:: Update .gitignore
it should keep the build directory in Client, as that's where the ci reports are saved
2019-03-14 10:07:52 +00:00
Sem van der Hoeven
25758cfbd2 EDIT::Update .gitlab-ci.yml
changed image to thijsray/java8-javafx-gradle
2019-03-14 10:01:12 +00:00
Sem van der Hoeven
a265c286eb FIX::fixed package names and imports
changed gogreen to greenify

FIX::made user tostring test succeed

added toString method to user
2019-03-12 22:53:43 +01:00
cugurlu
d02393400e Fix names of directories 2019-03-12 10:27:30 +01:00
cugurlu
7548df160d Add tests for server 2019-03-12 10:22:07 +01:00
cugurlu
a9827b8573 Add client test 2019-03-12 10:18:34 +01:00
Sem van der Hoeven
5877e307d5 ADD:: added javadoc comments where needed for the checkstyle
EDIT:: edited some lines to fit the checkstyle

fixed some indentation warnings and line length warnings
2019-03-11 16:44:55 +01:00
Sem van der Hoeven
ece58798f1 REMOVE::removed GoGreen folder 2019-03-11 16:11:09 +01:00
Sem van der Hoeven
7e529f5608 ADD::added meeting notes for meeting 5 2019-03-11 16:06:06 +01:00
Sem van der Hoeven
29229e457c Revert "Revert "MERGE::Merge branch 'fix_gradle_build_file'""
This reverts commit 7af5470a8e.
2019-03-11 16:03:00 +01:00
Sem van der Hoeven
7af5470a8e Revert "MERGE::Merge branch 'fix_gradle_build_file'"
This reverts commit 309337f26d, reversing
changes made to d902c7401d.
2019-03-11 15:59:38 +01:00
Sem van der Hoeven
309337f26d MERGE::Merge branch 'fix_gradle_build_file'
# Conflicts:
#	src/GoGreen/Client/src/test/java/UserServiceTest.java
resolved using 'Theirs'
2019-03-11 15:48:58 +01:00
Merel Steenbergen
d902c7401d Add score for vegetarian meal.md 2019-03-11 14:40:55 +00:00
Sem van der Hoeven
cd7f5b390b ADD::added titles to the pages from the GUI
the different pages now have titles indicating on what page you are, and switching between pages works now
2019-03-11 15:40:16 +01:00
Merel Steenbergen
bbc7794e6b Add chair and secretary.md 2019-03-11 14:06:56 +00:00
Merel Steenbergen
d8b51922ac Update 20190311_agenda.md 2019-03-11 14:05:00 +00:00
Merel Steenbergen
6d0bcaeb5c Update 20190311_agenda.md 2019-03-11 14:04:26 +00:00
Merel Steenbergen
c35d5d76bc Delete 03112019_Agenda 2019-03-11 14:03:26 +00:00
Merel Steenbergen
cfa7717bea Update agenda_03112019 2019-03-11 14:02:52 +00:00
Merel Steenbergen
909f9a6dd1 Add new file 2019-03-11 14:02:17 +00:00
Sem van der Hoeven
6df15465e7 Merge branch 'changeDoc' into 'master'
Add some CO2 emmission scores and good sources to find information to score schema

See merge request cse1105/2018-2019/oopp-group-43/template!11
2019-03-11 13:52:35 +00:00
Daan Sneep
c5c34e17dc Checkstyle screenshot uploaded 2019-03-11 13:46:39 +00:00
Sem van der Hoeven
a231b7374d ADD::tried to add application plugin to build.gradle 2019-03-11 14:42:06 +01:00
Merel Steenbergen
b4c3f3644a Add some CO2 emmission scores and good sources to find information 2019-03-11 13:40:11 +00:00
Mika Wauben
c0fdb466d5 Merge branch 'changeDoc' into 'master'
Change doc

See merge request cse1105/2018-2019/oopp-group-43/template!10
2019-03-11 13:37:18 +00:00
Merel Steenbergen
dff3cffb00 Merge branch 'addBacklogSprint2' into 'master'
Add backlog sprint2

See merge request cse1105/2018-2019/oopp-group-43/template!9
2019-03-11 13:36:39 +00:00
Mika Wauben
60907b30f7 Add backlog sprint3 2019-03-11 13:21:43 +00:00
Mika Wauben
dc5534ae34 Add retrospective sprint2 2019-03-11 13:12:50 +00:00
Mika Wauben
2a0210326e Add new directory 2019-03-11 13:06:13 +00:00
Sem van der Hoeven
aabe922f8f ADD:: Added dashboard
added controller class and functionality to switch between sections
2019-03-11 14:05:26 +01:00
cugurlu
c15ba030bf Fix client test 2019-03-11 11:50:27 +01:00
cugurlu
3681daa6f4 Add coverage report 2019-03-11 11:41:11 +01:00
Merel Steenbergen
e6e3544bb7 Merge branch 'changeDoc' into 'master'
Change doc

See merge request cse1105/2018-2019/oopp-group-43/template!8
2019-03-10 20:46:54 +00:00
Mika Wauben
688d2ef847 Add scrum board sprint2 2019-03-10 07:12:46 +00:00
Mika Wauben
a6e1a70448 Replace backlog_sprint2.pdf 2019-03-10 07:07:52 +00:00
Mika Wauben
987997bfb3 Add scrum board sprint1 2019-03-10 07:06:58 +00:00
Sem van der Hoeven
2e1becbe32 REMOVE::removed settings.gradle file in src folder
this messed with the paths for the main settings.gradle file
2019-03-09 14:12:44 +01:00
Sem van der Hoeven
803b0c2064 EDIT:: edited gitignore file to include the .gradle and .idea directories, and to include the classpath and project files.
maybe this fixes the pipline build failure
2019-03-09 13:40:19 +01:00
Sem van der Hoeven
fa73f6fb4d EDIT:: Reimported project
reimported project to fix the errors in client application

FIX:: fixed the "location is not set" error in client application when loading fxml file

reimporting the project made it work, as it now has a submodule folder structure

EDIT:: edited settings.gradle file to include the modules in the new structure

EDIT: edited client build.gradle and server build.gradle files to pick the right common folder
(changed complie(:Common) to compile(:src:Common))
2019-03-09 13:33:15 +01:00
Sem van der Hoeven
cab6d9aeeb FIX:: fixed Client application class
The class was not seeing some imports from the same package, and some getters and setters for User.java were not written, so I wrote those and fixed the imports

FIX:: fixed packages

Everything now isn't in several subpackages in the Client, Common and Server package anymore, but straight in their respectable packages. Also fixed the package names

BUG FIX: fixed Client Application class not being able to see GetBean method

Don't really know how it got fixed, but resolving the import issues also fixed this bug.

EDIT::changed main class in build.gradle file to Client.Application

---------------
I now only get a bug where the fxmlloader can't see the fxml files, and thus I can't start the application. I get the error message "location not set" although I used fxmlloader.setLocation.
2019-03-07 20:46:51 +01:00
Sem van der Hoeven
aa79365784 apparently the changes that were supposed to be made weren't committed in my previous commit, so here is the right one
REMOVE:: removed the .gradle and build folders from the Client, Server and Common folders, also moved the contents that was in the src folders of these folders, to the folders themselves and deleted the src folders

EDIT:: edited the build.gradle file, build should now work

combined the build.gradle files in the Client, Server and Common folders into the build.gradle file in the root
2019-03-06 21:22:29 +01:00
Sem van der Hoeven
7a60ecb60f REMOVE:: removed the .gradle and build folders from the Client, Server and Common folders, also moved the contents that was in the src folders of these folders, to the folders themselves and deleted the src folders
EDIT:: edited the build.gradle file, build should now work

combined the build.gradle files in the Client, Server and Common folders into the build.gradle file in the root

Merge branch 'master' of gitlab.ewi.tudelft.nl:cse1105/2018-2019/oopp-group-43/template into fix_gradle_build_file
2019-03-06 21:20:09 +01:00
Sem van der Hoeven
7b1dc88653 REMOVE:: removed the .idea and .gradle files from the GoGreen subfolders
REMOVE:: removed the Client and Server folders from the src folder

they were no longer necessary since everything now is in the GoGreen folder

EDIT:: edited .gitignore file

.gitignore file should now exclude the .idea and .gradle directories

FIX:: fixed the gradle build file.

had to set the main class, for testing purposes I set the GUI.logincontroller class as main class, but this will change
2019-03-06 16:07:26 +01:00
Mika Wauben
5b802ea980 Replace backlog_sprint2.pdf 2019-03-06 11:22:08 +00:00
Mika Wauben
fc3b750348 Replace backlog_sprint2 2019-03-06 11:17:50 +00:00
Mika Wauben
584a373284 Delete backlog_sprint2.xlsx 2019-03-06 11:17:28 +00:00
Mika Wauben
0b244ebc00 Replace backlog_sprint2.xlsx 2019-03-06 11:16:08 +00:00
Merel Steenbergen
3b180893c7 Update doc_meetings_20190311_agenda.md 2019-03-06 11:08:21 +00:00
Merel Steenbergen
9e3128d4a0 Update doc_meetings_20190311_agenda.md 2019-03-06 10:55:03 +00:00
Merel Steenbergen
85ddd2b787 Update doc_meetings_20190311_agenda.md 2019-03-06 10:54:43 +00:00
Merel Steenbergen
5c63e701e8 Upload agenda 11-03-2019 2019-03-06 10:53:29 +00:00
348 changed files with 10200 additions and 8194 deletions

45
.gitignore vendored
View File

@@ -19,10 +19,12 @@
# Edit at https://www.gitignore.io/?templates=java,maven,eclipse,intellij,visualstudiocode
### our project ###
Client/.idea/
Client/.gradle/
Server/.idea/
Server/.gradle/
src/**/.idea/
# src/**/.gradle/
### Eclipse ###
@@ -85,9 +87,11 @@ local.properties
### Eclipse Patch ###
# Eclipse Core
.project
**/.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
**/.classpath
# Annotation Processing
.apt_generated
@@ -206,13 +210,36 @@ buildNumber.properties
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
# End of https://www.gitignore.io/api/java,maven,eclipse,intellij,visualstudiocode
# End of https://www.gitignore.io/api/java,maven,eclipse,intellij,visualstudiocode
### Gradle ###
.gradle
## keep the build directory, as it contains the reports for the ci
build/
!**/Client/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
## keep the build directory, as it contains the reports for the ci
**/build/
# End of https://www.gitignore.io/api/gradle

View File

@@ -2,7 +2,8 @@
# This is the Gradle build system for JVM applications
# https://gradle.org/
# https://github.com/gradle/gradle
image: gradle:alpine
# image: gradle:alpine
image: thijsray/java8-javafx-gradle
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
@@ -24,7 +25,6 @@ build:
- build
- .gradle
test:
stage: test
script: gradle check
@@ -34,4 +34,14 @@ test:
paths:
- build
- .gradle
# Code coverage badge
#deploy:
# stage: code-coverage
# script:
# - gradle clean check
# after_script:
# - awk -F"," '{ instructions += $4 + $5; covered += $5 } END { print covered, "/", instructions, " instructions covered"; print 100*covered/instructions, "% instructrions covered" }' target/site/jacoco/jacoco.csv
# - awk -F"," '{ instructions += $6 + $7; covered += $7 } END { print covered, "/", instructions, " branches covered"; print 100*covered/instructions, "% branches covered" }' target/site/jacoco/jacoco.csv
# - echo \"$(cat target/site/jacoco/jacoco.csv)% covered\"
# coverage: '/(\d+.\d+) % +branches covered/'

View File

@@ -1,188 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: TI1216
Description:
Checkstyle configurartion that checks the Google coding conventions (https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html).
-->
<module name="Checker">
<property name="severity" value="warning"/>
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml"/>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="LineLength">
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
<property name="max" value="100"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="EOL"/>
<property name="tokens" value="COMMA"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<property name="tokens" value="VARIABLE_DEF"/>
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="caseIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="allowedAbbreviationLength" value="1"/>
<property name="ignoreFinal" value="false"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
<property name="specialImportsRegExp" value="com.google"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
</module>
<module name="MethodParamPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="JavadocMethod">
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="scope" value="public"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<module name="MethodCount">
<property name="maxTotal" value="50"/>
<property name="maxPrivate" value="50"/>
<property name="maxPackage" value="50"/>
<property name="maxProtected" value="50"/>
<property name="maxPublic" value="50"/>
</module>
<module name="AvoidNestedBlocks"/>
<module name="DeclarationOrder"/>
<module name="EmptyStatement"/>
<module name="IllegalThrows"/>
<module name="IllegalCatch"/>
<module name="MissingSwitchDefault"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses"/>
<module name="CyclomaticComplexity"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="FileLength"/>
</module>

109
README.md
View File

@@ -1,35 +1,36 @@
## Getting your weekly reports
# Greenify
The easiest way to save CO2 and help the environment! Enter your activities and find out your carbon footprint.
![loginScreen](/uploads/e4812575794836a217a3a21ceb676c6a/loginScreen.png)
![you](/uploads/093956805aede6de942bcbfeecd84eb7/you.png)
**Jacoco**:
Run `maven install` ([Intellij](https://www.jetbrains.com/help/idea/2016.3/getting-started-with-maven.html#execute_maven_goal)/[Eclipse](http://imgur.com/a/6q7pV))
## Badges
[![build status](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/badges/master/build.svg)](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template)
**Checkstyle**:
Run `maven site`
## Getting started
To start Greenify:
# Daan Sneep (4849515, dsneep)
```
cd <FILE-LOCATION>/greenify/src/Client/build/libs
java -Dserver.address="https://greenify43.herokuapp.com" -jar greenify-1.0.0.jar
```
![My Picture](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/Daan_Sneep.png "The one and only")
## Running the tests
The tests cover all non-GUI code:
## Personal Development Plan
```
cd <FILE-LOCATION>/greenify
gradle check
```
My Core Quadrant is visible ![here](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/Daan_Sneep_PDP_Core_Quadrant.PNG)
## Licence
GNU General Public License v3.0
### G Goal
After completing this project, I want to be able to work on a programming project efficiently with other people. I have never attempted anything of this scale and find that it is a core requirement of becoming a good programmer, as in most companies programming is done within teams, not alone.
## Contributors
### R Reality
With this project I hope to work towards this goal. I have never programmed as a team on this scale, so this project will be the first step towards my goal.
### Merel Steenbergen (masteenbergen)
<img src="https://user-images.githubusercontent.com/47633984/55274602-13cc1200-52da-11e9-9bd7-686d84929b83.jpg" width="100"/>
### O Options
During this quarter the project will be my only option towards achieving this goal. If I am unhappy with my progress towards my goal by the end of this quarter, I must try to implement the same structure of teamwork in my next projects, and try to learn from the mistakes I made when working as a team in this project.
### W Will
I will try to make sure to adhere to the structure we establish as a group which describes how we will work together. This way, we all do the work we are supposed to do, and none of us will be overloaded with work. I will also try to make use of all the tools available to us which can improve the quality of programming together (scrum, git, GitLab etc.).
# Merel Steenbergen (masteenbergen)
![Picture:](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/Merel_Steenbergen.jpg)
## Personal Development Plan
#### Personal Development Plan
My strong points:
1. Im a natural leader. I like to know how everyone is doing, if
@@ -39,37 +40,37 @@ everyone is keeping on track and if not, why is someone slacking?
What are two of your weaker points?
1. Im a bit of a control freak. Sometimes I find it hard to let other people do things and to mind my own business.
2. Im competitive. This can be a good thing, because Im very passionate and really give it 100% if I like something, but it can also lead to hurt feelings when Im not paying attention.
![Core quadrant:](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/Core_quadrant_Merel.png)
### G - Goal
<img src="https://user-images.githubusercontent.com/47633984/55274622-2d6d5980-52da-11e9-8be0-ac1ef545f7d9.png" width="700"/>
##### G - Goal
I want to improve on letting other people handle things that I actually want to do myself. I also want to improve my programming and am aiming to not make it a competition, but to really make it a group project. This is important, because you almost never work alone in software developing, which is what I want to do after the studies.
### R - Reality (Your current situation)
##### R - Reality (Your current situation)
Ive already been working on my teamwork skills since high school. I had a subject that had only projects. Ive also worked with Scrum before, which really helps you focus on your development without letting your project out of sight. Im better at working together and listening to tips than I was before.
### O - Options (Look at possible options)
##### O - Options (Look at possible options)
Actively watching myself and letting my teammates know that they need to be clear with me if they dont like something I say or do are the best ways for me to improve. I would rather improve by myself, but for my goals it is better to let my team guide me. Its about teamwork after all.
### W - Will (Motivation, plan of action)
##### W - Will (Motivation, plan of action)
Im just going to keep working on myself and hope my teammates will work with me. It also helps to work in different teams to get a much more diverse experience. Every team is different, so Im just going to wait what this team will bring me and how I will have to adjust myself to make the team efficient.
# Sem van der Hoeven (4896726, semvanderhoeve)
![Picture location](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/sem_van_der_hoeven.jpg)
### Sem van der Hoeven (4896726, semvanderhoeve)
<img src="https://user-images.githubusercontent.com/47633984/55274658-d6b44f80-52da-11e9-9404-a4ae9a210b72.jpg" width="100"/>
## Personal development plan
![Core quadrant location](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/sem_van_der_hoeven_core_quadrant.png)
#### Personal development plan
<img src="https://user-images.githubusercontent.com/47633984/55274673-0a8f7500-52db-11e9-8d83-e1acbf22aeed.png" width="700"/>
### G - Goal
##### G - Goal
My goal with this project is most of all to be able to efficiently work with a group of people. This is important to me because I have not worked on a (development) project with a (big) group of people before. I believe I have succeeded in this goal when our project is finished and we have got a passing grade.
### R - Reality
##### R - Reality
With this project I am already setting the first step towards reaching my goal, as we have already started working as a group.
### O - Options
##### O - Options
The options I have to reach my goal are basically this project, as this is the only big project we will be doing as a team in this year. I want to obviously try to learn as much as I can during this project, especially abour working in a group. The only thing I think would be stopping this is if members of the group had different opinions on how things should be done. but so far everyone is on the same track :D.
### W - Will
##### W - Will
I am going to try my hardest to follow the rules we have set up, and to deliver everything I am supposed to. I will try to do this everytime I get the chance to do so. Right now the first step I can take is to work on this personal development plan, so that I already have my part of what we needed to do finished. My teammates can help me achieve this goal by helping if I have questions or don't understand something/am getting stuck with something.
action plan:
⋅⋅* finish my part of the readme that we have to finish
@@ -77,13 +78,11 @@ action plan:
⋅⋅* don't be hesitant on asking people for help
⋅⋅* deliver things I need to do on time
# Ceren Ugurlu (4851609, cugurlu)
### Ceren Ugurlu (4851609, cugurlu)
<img src="https://user-images.githubusercontent.com/47633984/55274734-10398a80-52dc-11e9-9fce-5059ac2b3f3b.jpeg" width="100"/>
![My Picture](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/ceren_ugurlu.jpeg)
## Personal Development Plan:
- This is my core quadrant: ![My Core Quadrant](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/Ceren_Ugurlu_Core_Quadrant.png)
#### Personal Development Plan:
<img src="https://user-images.githubusercontent.com/47633984/55274694-4296b800-52db-11e9-9cee-b8d1d5c58e6f.png" width="700"/>
My strong points:
- I am an ambitious person in order to achieve my goal I can study a lot
@@ -93,7 +92,7 @@ My strong points:
My weaker points:
- Sometimes I can be a stressed and anxious person. If we have a difficulty about time management etc. I can get stressed. But if we work efficiently as a team, I do not think this is going to be a problem
### G Goal
##### G Goal
My goals in this project:
- Developing my Java skills
- Learning how to work effectively as a team
@@ -101,13 +100,13 @@ My goals in this project:
I am aiming to successfully finish the parts that belong to me in our project. To achieve this, I should develop my Java skills. I want to contribute to my group and to learn new things from my teammates. When we finish our project, I will be achieved my goal.
### R Reality
##### R Reality
This is my first team project. I have never experienced this before. I have done some similar programs in different languages but this is the first one in Java. This is both exciting and hard. There are many things I need to do but I like to study and develop myself.
### O Options
##### O Options
There are two options to achieve and not to achieve but I do not want to count the second one as an option because we are a team. And teamwork means that many different perspectives and a lot of human power. Therefore, I can say that there is not any reason for an unsuccessful result. If it happens, it is also not a problem. It shows that I need to develop myself. I would try to learn new things from my mistakes.
### W Will
##### W Will
I will try to do my best to be successful in our project and I am going to start right now for this. The first step I can take is creating a plan with my group mates and to start our project according to this plan.
Action Plan:
@@ -117,11 +116,11 @@ Action Plan:
- Starting to code (informing each other about the steps we have took)
- While everyone is working on their part, to inform each other about the progress is very important because some parts can be connected. When two people's parts are connected they should act according to that otherwise it can lead problems or a non-compiling code)
# Mika Wauben (4834739, mlwauben)
![My picture](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/mlwaubenpic.jpg)
### Mika Wauben (4834739, mlwauben)
<img src="https://user-images.githubusercontent.com/47633984/55274742-29423b80-52dc-11e9-804d-69feec6d28e0.jpg" width="100"/>
## Personal Development Plan
![My core quadrant](https://gitlab.ewi.tudelft.nl/cse1105/2018-2019/oopp-group-43/template/blob/master/Pictures%20Group%20Members/mlwaubenCoreQuadrant.jpg)
#### Personal Development Plan
<img src="https://user-images.githubusercontent.com/47633984/55274719-c18bf080-52db-11e9-9d3f-018ba68dd1f0.jpg" width="700"/>
My strong points:
1. I am observing and think before I speak.
@@ -131,14 +130,14 @@ Action Plan:
1. I like to do things alone. I rather figure something out myself instead of asking for help, even if this takes way too long.
2. I tend to stay quiet if I'm not absolutely sure my contribution is right or useful.
### G - Goal
##### G - Goal
My goal during this course is getting more experienced in working with things like github, libraries, scrumboard, etc. and asking for help if I need it, since being stuck on something isnt going to help my groupmates.
### R - Reality
##### R - Reality
Every minute that were working on the project, Im also actively working on my goal.
### O - Options
##### O - Options
By working on the project with the chosen programs, Ill get more experienced in using them. Using those programs for other projects as well will only improve my knowledge. By being active in the groupchat and during the meetings, asking stuff will be easier.
### W - Will
##### W - Will
I will reach my goal by working actively together with my teammates using lots of the useful programs given.

View File

@@ -1,9 +1,13 @@
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE")
classpath("org.openjfx:javafx-plugin:0.0.7")
}
}
@@ -12,22 +16,22 @@ apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'application'
application {
mainClassName = 'greenify.server.Application'
}
repositories {
mavenCentral()
}
//client bootjar
bootJar {
baseName = 'gs-consuming-rest'
version = '0.1.0'
enabled = false
}
//server bootjar
bootJar {
baseName = 'gs-rest-service'
version = '0.1.0'
jar {
enabled = true
}
sourceCompatibility = 1.8
@@ -40,4 +44,21 @@ dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile("junit:junit")
}
compileOnly 'org.projectlombok:lombok:1.18.6'
compile("org.springframework.boot:spring-boot-starter-data-jpa")
annotationProcessor 'org.projectlombok:lombok:1.18.6'
testCompile(
'junit:junit:4.12',
'org.junit.jupiter:junit-jupiter-api:5.4.0'
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.4.0',
'org.junit.vintage:junit-vintage-engine:5.4.0'
)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 861 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

@@ -29,6 +29,7 @@ Score schema + register ideas
+ Password
### Add activities
+ Eating a vegetarian meal
+ -Since different types of meat have different emission rates, I've calculated an average. On peace of meat (100 gram) costs about 150 grams of CO2. That means you save about 225 grams of CO2 by eating a vegetarian meal. (Based on an average of 150 gr meat and 150 gr CO2 per 100 gr meat.)
+ Buying local produce
> What did you buy? |
> (What season is it? Calendar)
@@ -70,3 +71,49 @@ Score schema + register ideas
> Other things
+ Everything perfect?
> Happy animals
• The average passenger vehicle emits about 404 grams of CO2 per mile (+- 250 g/km)
https://www.epa.gov/greenvehicles/greenhouse-gas-emissions-typical-passenger-vehicle
The study of British peoples diets was conducted by University of Oxford scientists and found that meat-rich diets - defined as more than 100g per day - resulted in 7.2kg of carbon dioxide emissions. In contrast, both vegetarian and fish-eating diets caused about 3.8kg of CO2 per day, while vegan diets produced only 2.9kg. The research analysed the food eaten by 30,000 meat eaters, 16,000 vegetarians, 8,000 fish eaters and 2,000 vegans.
https://www.theguardian.com/environment/2014/jul/21/giving-up-beef-reduce-carbon-footprint-more-than-cars
Rank Food CO2 Kilos Equivalent
1 Lamb 39.2
2 Beef 27.0
3 Cheese 13.5
4 Pork 12.1
5 Turkey 10.9
6 Chicken 6.9
7 Tuna 6.1
8 Eggs 4.8
http://www.greeneatz.com/foods-carbon-footprint.html
Maybe some nice hints/tips:
The carbon footprint of a vegetarian diet is about half that of a meat-lovers diet. (nice tip?)
Over 3.5 million people get sick from eating dirty meat every year in the US.
Vegetarians live longer than meat-eaters. Vegetarians are slimmer than meat-eaters. Vegetarians have a lower risk of getting heart disease, high blood pressure, diabetes and cancer.
Green Fact: 70% of the deforestation of the Amazon is to provide land for cattle ranches.
Did you know that a gas oven only uses 6% of its energy to cook? And an electric oven is not much better at 12%. If you use the oven on a warm day, you will also heat up the room and need to turn on a fan or air-conditioning. In fact, the most efficient cooking method is simmering on the stove-top.
• eat more raw foods that do not need cooking
• use the stove-top whenever possible
• next best is the microwave as it uses 50% less energy than an oven
• use the oven sparingly and smartly…reduce preheating, cook multiple foods, turn off early
• use electric kettles to boil water for cooking or drinking.
http://www.greeneatz.com/foods-carbon-footprint.html
https://www.energuide.be/en/questions-answers/how-much-co2-does-my-home-emit/68/
The amount of CO2 emissions resulting from such uses varies according to the quantity of energy you consume and the type of fuel used:
• natural gas: 0.198 kg of CO2 per kWh
• electricity: 0.23 kg of CO2 per kWh (this rate varies between countries and over time because it is calculated on the basis of the composition of the production portfolio)
• heating oil: 0.264 kg of CO2 per kWh
https://ec.europa.eu/clima/sites/campaign/pdf/table_appliances_en.pdf
VERY GOOD!
https://www.ovoenergy.com/guides/energy-guides/how-much-heating-energy-do-you-use.html

View File

@@ -0,0 +1,47 @@
# Meeting 3
## Opening
> Check if everyone is present:
- ~~Nivard Jansen~~
- ~~Kristin Peneva~~
- [x] Daan Sneep
- [x] Merel SteenBergen
- [x] Ceren Uğurlu
- [x] Mika Wauben
- [x] Sem van der Hoeven
-Chair: Merel Steenbergen
-Secretary: Sem van der Hoeven
## Points of action
- First of all, discuss problems we have faced and if somebody is halted because of a problem
- if so, try to work out the problem
### pre/during meeting
- Discuss what we did last week (see scrumboard)
- Does anyone have blocking issues?
- Gitlab
- CI
-Got branches and merge right
-Also cleaned the repo
-Gradle file fixed?
-Do we finally have a name for our application?
-Next week is all about the vegetarian meal feature. We now did all the preparations and can work on the activity
-Kristin in README
### post meeting
To be done.
## Any other business
> If anybody has something that should be discussed but came up with that after the agenda was finalized, he/she should bring that up now so that it can be discussed after all.
## Question round
- Questions for the TA
- questions that were already present
- questions that rose during the meeting
## Closing
**Let's focus on the vegetarian meal option --> No more distractions!!**

Binary file not shown.

View File

@@ -0,0 +1,53 @@
# Meeting 5
## Opening
> Check if everyone is present:
- ~~Nivard Jansen~~
- ~~Kristin Peneva~~
- [x] Daan Sneep
- [x] Merel SteenBergen
- [x] Ceren Ugurlu
- [x] Mika Wauben
- [x] Sem van der Hoeven
- Chair: Ceren Ugurlu
- Secretary: Mika Wauben
## Points of action
- First of all, discuss problems we have faced and if somebody is halted because of a problem
- if so, try to work out the problem
### pre/during meeting
- Discuss what we did last week (see scrumboard)
- Does anyone have blocking issues?
- Gitlab
- CI
- Coverage reports
- Checkstyle reports
- Make sure that demo 2 is ready and all requirements is provided
- Demo 2 (full workflow "Eating a vegetarian meal")
- Make sure add vegetarian meal button is working
- Make sure when user clicked to button counter is increasing
- Make sure client sends request to the server
- Make sure database stores and persists the data
- Make sure coverage report is uploaded
- Make sure checkstyle report is uploaded
### post meeting
- Focus on demo 3
- Complete the GUI
- Add all features
- Create a calculator
## Any other business
> If anybody has something that should be discussed but came up with that after the agenda was finalized, he/she should bring that up now so that it can be discussed after all.
## Question round
- Questions for the TA
- questions that were already present
- questions that rose during the meeting
## Closing
> Demo 2 is done, good job guys!
> Let's focus on demo 3!

Binary file not shown.

View File

@@ -0,0 +1,50 @@
# Meeting 6
## Opening
> Check if everyone is present:
- ~~Nivard Jansen~~
- ~~Kristin Peneva~~
- ~~Daan Sneep~~
- [x] Merel SteenBergen
- [x] Ceren Ugurlu
- [x] Mika Wauben
- [x] Sem van der Hoeven
- Chair: Sem van der Hoeven
- Secretary: Merel Steenbergen
## Points of action
- First of all, discuss problems we have faced and if somebody is halted because of a problem
- if so, try to work out the problem
### pre/during meeting
- Discuss what we did last week (see scrumboard)
- Does anyone have blocking issues?
- Gitlab
- CI
- Coverage reports
- Checkstyle reports
- Make sure that demo 3 is ready and all requirements is provided
- Demo 3 (4 of the 6 minimal features are implemented)
- the full workflow of 'tracking the co2 you have saved and comparing it to your friends' is implemented
- user has an overview of the co2 they have saved
- user has an overview of the co2 their friends have saved
### post meeting
- Focus on demo 3
- Complete the GUI
- Add all features
- Complete friends features
- Create/finish the calculator
## Any other business
> If anybody has something that should be discussed but came up with that after the agenda was finalized, he/she should bring that up now so that it can be discussed after all.
## Question round
- Questions for the TA
- questions that were already present
- questions that rose during the meeting
## Closing
> Let's focus on demo 3!

Binary file not shown.

View File

@@ -0,0 +1,47 @@
# Meeting 7
## Opening
> Check if everyone is present:
- ~~Nivard Jansen~~
- ~~Kristin Peneva~~
- ~~Daan Sneep~~
- [x] Merel SteenBergen
- [x] Ceren Ugurlu
- [x] Mika Wauben
- [x] Sem van der Hoeven
- Chair: Mika Wauben
- Secretary: Ceren Ugurlu
## Points of action
- First of all, discuss problems we have faced and if somebody is halted because of a problem
- if so, try to work out the problem
### pre/during meeting
- Discuss what we did last week (see scrumboard)
- Does anyone have blocking issues?
- Gitlab
- CI
- Coverage reports
- Checkstyle reports
- Show demo 3 to the TA
- Discuss about the presentation
- Discuss about final things that need to be done
### post meeting
- Focus on the presentation
- Focus on the final report
- Focus on things we get points for according to the rubric
## Any other business
> If anybody has something that should be discussed but came up with that after the agenda was finalized, he/she should bring that up now so that it can be discussed after all.
## Question round
- Questions for the TA
- questions that were already present
- Ask about custom CI (do we have it already?)
- questions that rose during the meeting
## Closing
> We're almost finished!

Binary file not shown.

View File

@@ -0,0 +1,43 @@
# Meeting 8
## Opening
> Check if everyone is present:
- ~~Nivard Jansen~~
- ~~Kristin Peneva~~
- ~~Daan Sneep~~
- [x] Merel SteenBergen
- [x] Ceren Ugurlu
- [x] Mika Wauben
- [x] Sem van der Hoeven
- Chair: Merel Steenbergen
- Secretary: Sem van der Hoeven
## Points of action
- First of all, discuss problems we have faced and if somebody is halted because of a problem
- if so, try to work out the problem
### pre/during meeting
- Discuss what we did last week (see scrumboard)
- Does anyone have blocking issues?
- Coverage reports
- Checkstyle reports
- Show demo to the TA, since Mitchell isn't here, a different TA will visit us, so we'll show him the entire application.
- Discuss about the presentation
- Discuss about final things that need to be done
### post meeting
- Focus on the presentation
- Focus on the final report
- Focus on things we get points for according to the rubric
## Any other business
> If anybody has something that should be discussed but came up with that after the agenda was finalized, he/she should bring that up now so that it can be discussed after all.
## Question round
- Questions for the TA
- How to get the code coverage badge, since we use Gradle and we've got the Maven code.
## Closing
> We're almost finished!

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 793 KiB

View File

@@ -1,5 +0,0 @@
# Checkstyle folder
At the end of the week, please commit a readable screenshot that shows the Checkstyle results.
Make sure that the file follows the naming convention; `20190213_checkstyle.xyz` for February 13th.
`.xyz` can be either `.jpg` or `.png`.

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

View File

@@ -0,0 +1,12 @@
# Sprint Review
## Main problems Encountered
We have no problems so far. Everyone arrives on time and does the tasks assigned to them.
## Adjustments from previous sprints
Since this is the first review, there are no previous sprints yet
## Adjustments for next sprint
- Keep up the good work!

View File

@@ -0,0 +1,14 @@
# Sprint Review
## Main problems Encountered
### Problem 1: Kristin left the group
Kristin does not continue CSE and left our group. We'll work with five people from now on.
## Adjustments from previous sprints
We created the backlog before the sprint, which helps making clear what we're working on.
## Adjustments for next sprint
- Group made out of five
- Backlogs ready on time

View File

@@ -0,0 +1,16 @@
# Sprint Review
## Main problems Encountered
### Problem 1: Daan will quit CSE
Since Daan will quit the study, we'll work with four people from now on
## Adjustments from previous sprints
If we start working on the demo a bit earlier and do a little less research, we'll have
a little less stress in the end.
## Adjustments for next sprint
- Group made out of four
- Start implemention a bit earlier

View File

@@ -0,0 +1,13 @@
# Sprint Review
## Main problems Encountered
### Problem 1: Database won't grow
It is difficult to add new columns to the database, but together we will fix this problem.
## Adjustments from previous sprints
We're doing great with starting on time for the demo.
## Adjustments for next sprint
- Speficy tasks a bit more, that way they are easier to follow

View File

@@ -0,0 +1,14 @@
# Sprint Review
## Main problems Encountered
### Problem 1: We had some bugs
because of some bugs in the server, things did not work as intended. Ceren fixed it.
## Adjustments from previous sprints
Write all we still need to do down, even if the things are not necessarily assigned to a specific person yet.
## Adjustments for next sprint
- Write down all other necessary tasks.

View File

@@ -0,0 +1,14 @@
# Sprint Review
## Main problems Encountered
### Problem 1:
## Adjustments from previous sprints
There were no big problems this week. We made some last minute changes and added some extra features. Next week we're going to focus on our other exams, so we're
not really working on the project anymore.
## Adjustments for next sprint

View File

@@ -0,0 +1,13 @@
# Sprint Review
## Main problems Encountered
### Problem 1:
## Adjustments from previous sprints
Our project is completely finished and we're very happy with the result.
## Adjustments for next sprint
This is the last sprint for this project!

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,188 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: TI1216
Description:
Checkstyle configurartion that checks the Google coding conventions (https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html).
-->
<module name="Checker">
<property name="severity" value="warning"/>
<property name="charset" value="UTF-8"/>
<property name="fileExtensions" value="java, properties, xml"/>
<module name="TreeWalker">
<module name="OuterTypeFilename"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="LineLength">
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
<property name="max" value="100"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="NeedBraces"/>
<module name="LeftCurly"/>
<module name="RightCurly"/>
<module name="RightCurly">
<property name="option" value="alone"/>
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
<message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MultipleVariableDeclarations"/>
<module name="MissingSwitchDefault"/>
<module name="FallThrough"/>
<module name="ModifierOrder"/>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="nl"/>
<property name="tokens" value="DOT"/>
</module>
<module name="SeparatorWrap">
<property name="option" value="EOL"/>
<property name="tokens" value="COMMA"/>
</module>
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypeName">
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<property name="tokens" value="VARIABLE_DEF"/>
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Interface type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NoFinalizer"/>
<module name="GenericWhitespace">
<message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
<message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
</module>
<module name="Indentation">
<property name="basicOffset" value="4"/>
<property name="caseIndent" value="4"/>
<property name="arrayInitIndent" value="4"/>
</module>
<module name="AbbreviationAsWordInName">
<property name="allowedAbbreviationLength" value="1"/>
<property name="ignoreFinal" value="false"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="customImportOrderRules" value="STATIC###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE###STANDARD_JAVA_PACKAGE"/>
<property name="specialImportsRegExp" value="com.google"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
</module>
<module name="MethodParamPad"/>
<module name="OperatorWrap">
<property name="option" value="NL"/>
<property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph"/>
<module name="AtclauseOrder">
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
</module>
<module name="JavadocMethod">
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override, Test"/>
<property name="scope" value="public"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<property name="ignoreInlineTags" value="false"/>
</module>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="CommentsIndentation"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="MethodLength"/>
<module name="ParameterNumber"/>
<module name="MethodCount">
<property name="maxTotal" value="50"/>
<property name="maxPrivate" value="50"/>
<property name="maxPackage" value="50"/>
<property name="maxProtected" value="50"/>
<property name="maxPublic" value="50"/>
</module>
<module name="AvoidNestedBlocks"/>
<module name="DeclarationOrder"/>
<module name="EmptyStatement"/>
<module name="IllegalThrows"/>
<module name="IllegalCatch"/>
<module name="MissingSwitchDefault"/>
<module name="StringLiteralEquality"/>
<module name="UnnecessaryParentheses"/>
<module name="CyclomaticComplexity"/>
</module>
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
</module>
<module name="FileLength"/>
</module>

View File

@@ -1 +1,5 @@
rootProject.name = 'OOPP'
rootProject.name = 'OOPP'
include ':src:Client'
include ':src:Common'
include ':src:Server'

198
src/Client/.gitignore vendored
View File

@@ -1,198 +0,0 @@
# Created by https://www.gitignore.io/api/java,gradle,eclipse,intellij
# Edit at https://www.gitignore.io/?templates=java,gradle,eclipse,intellij
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Annotation Processing
.apt_generated
.sts4-cache/
### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
.idea/sonarlint
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle ###
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### Gradle Patch ###
**/build/
# End of https://www.gitignore.io/api/java,gradle,eclipse,intellij

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.16" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>

View File

@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel>
<module name="com.bettercoding.jfx.Client.main" target="1.8" />
<module name="com.bettercoding.jfx.Client.test" target="1.8" />
</bytecodeTargetLevel>
</component>
</project>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Client.main.iml" filepath="$PROJECT_DIR$/.idea/modules/Client.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/Client.test.iml" filepath="$PROJECT_DIR$/.idea/modules/Client.test.iml" />
<module fileurl="file://$PROJECT_DIR$/src/main/resources.iml" filepath="$PROJECT_DIR$/src/main/resources.iml" />
</modules>
</component>
</project>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Client" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4" />

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Client:main" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/../../out/production/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/main">
<sourceFolder url="file://$MODULE_DIR$/../../src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-web:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-json:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-tomcat:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.hibernate.validator:hibernate-validator:6.0.12.Final" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-webmvc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-web:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-autoconfigure:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-logging:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-context:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-aop:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-beans:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-expression:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-core:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
<orderEntry type="library" name="Gradle: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Gradle: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-jcl:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
</component>
</module>

View File

@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="Client:test" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$/../../src/test">
<sourceFolder url="file://$MODULE_DIR$/../../src/test/java" isTestSource="true" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="Client.main" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-web:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-test:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Gradle: org.junit.jupiter:junit-jupiter-api:5.4.0" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-json:2.0.5.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.vintage:junit-vintage-engine:5.4.0" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-tomcat:2.0.5.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.jupiter:junit-jupiter-engine:5.4.0" level="project" />
<orderEntry type="library" name="Gradle: org.hibernate.validator:hibernate-validator:6.0.12.Final" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-webmvc:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-web:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-test-autoconfigure:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-test:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: com.jayway.jsonpath:json-path:2.4.0" level="project" />
<orderEntry type="library" name="Gradle: org.assertj:assertj-core:3.9.1" level="project" />
<orderEntry type="library" name="Gradle: org.mockito:mockito-core:2.15.0" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" name="Gradle: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Gradle: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-test:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-autoconfigure:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot:2.0.5.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-context:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-expression:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-aop:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-beans:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-core:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: org.xmlunit:xmlunit-core:2.5.1" level="project" />
<orderEntry type="library" name="Gradle: org.junit.platform:junit-platform-commons:1.4.0" level="project" />
<orderEntry type="library" name="Gradle: org.apiguardian:apiguardian-api:1.0.0" level="project" />
<orderEntry type="library" name="Gradle: org.opentest4j:opentest4j:1.1.1" level="project" />
<orderEntry type="library" name="Gradle: org.springframework.boot:spring-boot-starter-logging:2.0.5.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.junit.platform:junit-platform-engine:1.4.0" level="project" />
<orderEntry type="library" name="Gradle: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-databind:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.34" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-core:8.5.34" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Gradle: org.yaml:snakeyaml:1.19" level="project" />
<orderEntry type="library" name="Gradle: org.apache.tomcat.embed:tomcat-embed-el:8.5.34" level="project" />
<orderEntry type="library" name="Gradle: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Gradle: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml:classmate:1.3.4" level="project" />
<orderEntry type="library" name="Gradle: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" />
<orderEntry type="library" name="Gradle: net.bytebuddy:byte-buddy:1.7.11" level="project" />
<orderEntry type="library" name="Gradle: net.bytebuddy:byte-buddy-agent:1.7.11" level="project" />
<orderEntry type="library" name="Gradle: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" name="Gradle: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Gradle: org.springframework:spring-jcl:5.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Gradle: com.fasterxml.jackson.core:jackson-core:2.9.6" level="project" />
<orderEntry type="library" name="Gradle: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" name="Gradle: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Gradle: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
<orderEntry type="library" name="Gradle: org.ow2.asm:asm:5.0.4" level="project" />
</component>
</module>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@@ -13,22 +13,67 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
sourceCompatibility = 1.8
targetCompatibility = 1.8
def configDir = "${project.rootDir}/quality"
checkstyle {
toolVersion '7.8.1'
configFile file("$configDir/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath
}
checkstyleMain {
source ='src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
test {
useJUnitPlatform()
}
bootJar {
baseName = 'gs-consuming-rest'
version = '0.1.0'
baseName = 'greenify'
version = '1.0.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile "org.bouncycastle:bcprov-jdk16:1.46", "org.bouncycastle:bcpg-jdk16:1.46", "org.bouncycastle:bcmail-jdk16:1.46", "org.bouncycastle:bctsp-jdk16:1.46"
compile("org.springframework.boot:spring-boot-starter")
compile("org.springframework:spring-web")
compile("com.fasterxml.jackson.core:jackson-databind")
testCompile("junit:junit")
compile project(':src:Common')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile(
'junit:junit:4.12',
'org.junit.jupiter:junit-jupiter-api:5.4.0'
)
testRuntime(
'org.junit.jupiter:junit-jupiter-engine:5.4.0',
'org.junit.vintage:junit-vintage-engine:5.4.0'
)
}
jacoco {
toolVersion = "0.8.3"
reportsDir = file("$buildDir/customJacocoReportDir")
}
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}

View File

@@ -0,0 +1,70 @@
package greenify.client;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import java.io.IOException;
@SpringBootApplication
public class Application extends javafx.application.Application {
private static ConfigurableApplicationContext springContext;
/**
* This (main) method starts launch.
* @param args the arguments
*/
public static void main(String[] args) {
launch(args);
}
/**
* This method takes an url and return a parent.
* @param url which is being loaded.
* @return parent object.
*/
public static Parent load(java.net.URL url) throws IOException {
FXMLLoader loader = new FXMLLoader();
loader.setControllerFactory(springContext::getBean);
loader.setLocation(url);
return loader.load();
}
/**
* This method initializes the application.
*/
@Override
public void init() {
springContext = SpringApplication.run(Application.class);
}
/**
* This method opens the login window.
* @param primaryStage the login window
* @throws Exception in case fxml file is not found
*/
@Override
public void start(Stage primaryStage) throws Exception {
Parent rootNode = load(this.getClass().getClassLoader()
.getResource("fxml/LoginWindow.fxml"));
primaryStage.setTitle("Greenify");
Scene scene = new Scene(rootNode);
scene.getStylesheets().add(getClass().getClassLoader().getResource(
"stylesheets/LoginWindowStyle.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}
/**
* This method stops the application.
*/
@Override
public void stop() {
springContext.stop();
}
}

View File

@@ -0,0 +1,533 @@
package greenify.client.controller;
import greenify.client.Application;
import greenify.client.rest.UserService;
import javafx.animation.FadeTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ParallelTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.io.IOException;
import java.text.DecimalFormat;
@Controller
public class CalculatorController {
@Autowired
UserService userService;
@Autowired
DashBoardController controller;
@Autowired
ExtraActivityController extraActivityController;
//navigation panes
@FXML
private AnchorPane getStartedPane;
@FXML
private AnchorPane travelPane;
@FXML
private AnchorPane homePane;
@FXML
private ScrollPane foodPane;
@FXML
private AnchorPane shoppingPane;
//'get started' pane
@FXML
private Slider peopleInHouseholdSlider;
@FXML
private Label peopleInHouseHoldLabel;
@FXML
private Slider annualIncomeSlider;
@FXML
private Label annualIncomeLabel;
@FXML
private Button saveButton;
//travel pane
@FXML
private TextField publicTransitField;
@FXML
private TextField airplaneTravelField;
@FXML
private TextField carTravelGasolineField;
@FXML
private Slider carTravelGasolineSlider;
@FXML
private Label carTravelGasolineLabel;
@FXML
private TextField carTravelDieselField;
@FXML
private Slider carTravelDieselSlider;
@FXML
private Label carTravelDieselLabel;
@FXML
private TextField carTravelElectricField;
@FXML
private Slider carTravelElectricSlider;
@FXML
private Label carTravelElectricLabel;
//home pane
@FXML
private TextField electricityField;
@FXML
private Slider cleanEnergyPurchasedSlider;
@FXML
private Label cleanEnergyPurchasedLabel;
@FXML
private TextField naturalGasField;
@FXML
private TextField heatingOilField;
@FXML
private TextField livingSpaceField;
@FXML
private Slider waterUsageSlider;
@FXML
private Label waterUsageLabel;
//food pane
@FXML
private Slider meatFishEggsSlider;
@FXML
private Label meatFishEggsLabel;
@FXML
private Slider grainsBakedGoodsSlider;
@FXML
private Label grainsBakedGoodsLabel;
@FXML
private Slider dairySlider;
@FXML
private Label dairyLabel;
@FXML
private Slider fruitsVegetablesSlider;
@FXML
private Label fruitsVegetablesLabel;
@FXML
private Slider snacksDrinksSlider;
@FXML
private Label snacksDrinksLabel;
//shopping pane
@FXML
private Text goodsField;
@FXML
private Text servicesField;
@FXML
private Slider goodsSlider;
@FXML
private Label goodsLabel;
@FXML
private Slider servicesSlider;
@FXML
private Label servicesLabel;
//extra pane
@FXML
private AnchorPane extraPane;
/**
* initializes the window, performs some actions before loading all other things.
* it sets the sliders to snap to the ticks.
* it adds listeners to all the sliders for updating the label they are associated with.
*/
@SuppressWarnings("Duplicates")
public void initialize() {
peopleInHouseholdSlider.setSnapToTicks(true);
//add listener to slider for amount of people in household
peopleInHouseholdSlider.valueProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
peopleInHouseHoldLabel.setText("" + newValue.intValue());
}
});
//add listener to slider for annual income
annualIncomeSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
annualIncomeLabel.setText("" + (newValue.intValue() * 1000));
}
});
addSliderListenerCarUsage(carTravelGasolineSlider, carTravelGasolineLabel, " km/L");
addSliderListenerCarUsage(carTravelDieselSlider, carTravelDieselLabel, " km/L");
addSliderListenerCarUsage(carTravelElectricSlider, carTravelElectricLabel, " km/Le");
cleanEnergyPurchasedSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
cleanEnergyPurchasedLabel.setText(newValue.intValue() + " %");
}
});
waterUsageSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
waterUsageLabel.setText(newValue.intValue() + "% of similar households");
}
});
addSliderListenerDailyServing(meatFishEggsSlider, meatFishEggsLabel);
addSliderListenerDailyServing(grainsBakedGoodsSlider, grainsBakedGoodsLabel);
addSliderListenerDailyServing(dairySlider, dairyLabel);
addSliderListenerDailyServing(fruitsVegetablesSlider, fruitsVegetablesLabel);
addSliderListenerDailyServing(snacksDrinksSlider, snacksDrinksLabel);
addSliderListenerGoodsServices(goodsSlider, goodsLabel);
addSliderListenerGoodsServices(servicesSlider, servicesLabel);
}
/**
* adds the listener to the given slider and displays it's output on a given label.
* @param slider the slider to attach the listener to.
* @param label the label to display the slider output on.
*/
private void addSliderListenerCarUsage(Slider slider, Label label, String unit) {
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(newValue.intValue() + unit);
}
});
}
@SuppressWarnings("Duplicates")
private void addSliderListenerDailyServing(Slider slider, Label label) {
DecimalFormat df = new DecimalFormat("0.0");
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(df.format(newValue.doubleValue()) + " daily servings per person");
}
});
}
private void addSliderListenerGoodsServices(Slider slider, Label label) {
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(newValue.intValue() + "€ / month");
}
});
}
/**
* adds a fade transition to the given node.
* @param node the node to add the transition to
*/
public void addFadeTransAnimation(Node node) {
FadeTransition fade = new FadeTransition(Duration.millis(350), node);
fade.setFromValue(0);
fade.setToValue(1.0);
TranslateTransition trans = new TranslateTransition(Duration.millis(350), node);
trans.setFromY(800);
trans.setToY(0);
ParallelTransition par = new ParallelTransition();
par.setNode(travelPane);
par.getChildren().addAll(fade, trans);
par.play();
}
private void addSlideInAnimation(Node node) {
Timeline timeline = new Timeline();
KeyValue keyValue = new KeyValue(node.translateXProperty(), 0, Interpolator.EASE_OUT);
KeyFrame keyFrame = new KeyFrame(Duration.millis(600), keyValue);
timeline.getKeyFrames().add(keyFrame);
timeline.play();
}
/**
* displays the 'get started' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayGetStarted(ActionEvent event) {
addFadeTransAnimation(getStartedPane);
getStartedPane.setVisible(true);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'travel' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayTravel(ActionEvent event) {
addFadeTransAnimation(travelPane);
getStartedPane.setVisible(false);
travelPane.setVisible(true);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'home' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayHome(ActionEvent event) {
addFadeTransAnimation(homePane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(true);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'food' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayFood(ActionEvent event) {
addFadeTransAnimation(foodPane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(true);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'shopping' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayShopping(ActionEvent event) {
addFadeTransAnimation(shoppingPane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(true);
extraPane.setVisible(false);
}
/**
* displays the 'Extra' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the designated button
*/
@SuppressWarnings("Duplicates")
public void displayExtra(ActionEvent event) throws IOException {
addFadeTransAnimation(extraPane);
extraPane.getChildren().setAll((Node) Application.load(this.getClass()
.getClassLoader().getResource("fxml/extraActivities.fxml")));
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(true);
}
/**
* The method saves the calculation.
* @param event user clicks to button
*/
@SuppressWarnings("Duplicates")
public void saveCalc(ActionEvent event) throws InterruptedException {
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
if (!annualIncomeLabel.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(), "input_income",
annualIncomeLabel.getText());
}
if (!peopleInHouseHoldLabel.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(), "input_size",
peopleInHouseHoldLabel.getText());
}
checkTransportLabels();
checkHousingLabels();
checkFoodLabels();
if (!goodsLabel.getText().replace(" € / month", "").equals("1520")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_goods_total",
goodsLabel.getText().replace("€ / month", ""));
}
if (!servicesLabel.getText().replace(" € / month", "").equals("3428")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_services_total",
servicesLabel.getText().replace("€ / month", ""));
}
try {
extraActivityController.updateExtras();
} catch (NullPointerException ex) {
System.out.println("continue");
}
Float footprint = userService.saveFootprint(userService.currentUser.getName());
Window owner = saveButton.getScene().getWindow();
controller.updateLeaderboard();
controller.updateAchievements();
UserController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION,
owner, "Footprint saved!", "Your footprint is saved!");
Stage current = (Stage) owner;
current.close();
}
/**
* Checks the food labels.
*/
@SuppressWarnings("Duplicates")
private void checkFoodLabels() {
if (!meatFishEggsLabel.getText().replace(" daily servings per person", "").equals("2.6")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_meatfisheggs",
meatFishEggsLabel.getText().replace(" daily servings per person", ""));
}
if (!grainsBakedGoodsLabel.getText()
.replace(" daily servings per person", "").equals("4.4")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_cereals",
grainsBakedGoodsLabel.getText().replace(" daily servings per person", ""));
}
if (!dairyLabel.getText().replace(" daily servings per person", "").equals("2.4")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_dairy",
dairyLabel.getText().replace(" daily servings per person", ""));
}
if (!fruitsVegetablesLabel.getText()
.replace(" daily servings per person", "").equals("3.9")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_fruitvegetables",
fruitsVegetablesLabel.getText().replace(" daily servings per person", ""));
}
if (!snacksDrinksLabel.getText().replace(" daily servings per person", "").equals("3.7")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_otherfood",
snacksDrinksLabel.getText().replace(" daily servings per person", ""));
}
}
/**
* Checks the house labels.
*/
@SuppressWarnings("Duplicates")
private void checkHousingLabels() {
if (!electricityField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_electricity_dollars",
electricityField.getText());
}
if (!cleanEnergyPurchasedLabel.getText().replace(" %", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_gco2_per_kwh",
cleanEnergyPurchasedLabel.getText().replace(" %", ""));
}
if (!naturalGasField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_naturalgas_dollars",
naturalGasField.getText());
}
if (!heatingOilField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_heatingoil_dollars",
heatingOilField.getText());
}
if (!livingSpaceField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_squarefeet",
livingSpaceField.getText());
}
if (!waterUsageLabel.getText().replace("% of similar households", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_watersewage",
waterUsageLabel.getText().replace("% of similar households", ""));
}
}
/**
* Checks the transport labels.
*/
@SuppressWarnings("Duplicates")
private void checkTransportLabels() {
if (!publicTransitField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_publictrans",
publicTransitField.getText());
}
if (!airplaneTravelField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_airtotal",
airplaneTravelField.getText());
}
if (!carTravelGasolineField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles1",
carTravelGasolineField.getText());
}
if (!carTravelGasolineLabel.getText().replace(" km/L", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg1",
carTravelGasolineLabel.getText().replace(" km/L", ""));
}
if (!carTravelDieselField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles2",
carTravelDieselField.getText());
}
if (!carTravelDieselLabel.getText().replace(" km/L", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg2",
carTravelDieselLabel.getText().replace(" km/L", ""));
}
if (!carTravelElectricField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles3",
carTravelElectricField.getText());
}
if (!carTravelElectricLabel.getText().replace(" km/Le", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg3",
carTravelElectricLabel.getText().replace(" km/Le", ""));
}
}
}

View File

@@ -0,0 +1,804 @@
package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.Application;
import greenify.client.features.Friend;
import greenify.client.features.Hints;
import greenify.client.rest.UserService;
import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.PathTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.Tooltip;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.effect.ColorAdjust;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Line;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* Class that controls the dashboard fxml file (the GUI Screen).
*/
@Controller
public class DashBoardController {
public static ObservableList<Friend> data = FXCollections.observableArrayList();
public ObservableList<Friend> friendLeaderData = FXCollections.observableArrayList();
public ObservableList<Friend> globalLeaderData = FXCollections.observableArrayList();
public ObservableList<Friend> developmentData = FXCollections.observableArrayList();
@Autowired
UserService userService;
Hints hints = new Hints();
private FadeTransition fadeTrans; //transition for switching between the different panels
@FXML
private AnchorPane dashboardPane;
@FXML
private AnchorPane userPane;
@FXML
private AnchorPane activitiesPane;
@FXML
private AnchorPane friendsPane;
@FXML
private Label welcomebacktext;
@FXML
private Button dashboardButton;
@FXML
private Button activitiesButton;
@FXML
private Button userButton;
@FXML
private Button friendsButton;
@FXML
private Button logOutButton;
@FXML
private Line pathLine;
@FXML
private AnchorPane menuBar;
@FXML
private Button calculateFootPrintButton;
@FXML
private Label footprintLabel;
@FXML
private Label firstFootprintLabel;
@FXML
private Label differenceLabel;
@FXML
private Button addFriendButton;
@FXML
private Button addFriend;
@FXML
private Button removeFriend;
@FXML
private Button addExtraActivityButton;
@FXML
private Button addExtraActivityButton2;
@FXML
private TableView<Friend> friendsTable;
@FXML
private TableColumn<Friend, String> friendsColumn;
@FXML
private TableColumn<Friend, Float> scoreColumn;
@FXML
private TableView<Friend> globalLeaderboard;
@FXML
private TableColumn<Friend, Integer> globalPlace;
@FXML
private TableColumn<Friend, String> globalUser;
@FXML
private TableColumn<Friend, Float> globalScore;
@FXML
private TableView<Friend> developmentLeaderboard;
@FXML
private TableColumn<Friend, Integer> developmentPlace;
@FXML
private TableColumn<Friend, String> developmentUser;
@FXML
private TableColumn<Friend, Float> developmentScore;
@FXML
private TableView<Friend> friendLeaderboard;
@FXML
private TableColumn<Friend, Integer> friendPlace;
@FXML
private TableColumn<Friend, String> friendUser;
@FXML
private TableColumn<Friend, Float> friendScore;
@FXML
private PieChart pieChart;
@FXML
private Label usernameLabel;
@FXML
private Label peopleNumber;
@FXML
private Label income;
@FXML
private Label electricityUsage;
@FXML
private Label cleanEnergy;
@FXML
private Label naturalGasUsage;
@FXML
private Label heatingOilUsage;
@FXML
private Label waterUsage;
@FXML
private Label livingSpace;
@FXML
private Label gasolineMiles;
@FXML
private Label gasolineMpg;
@FXML
private Label dieselMiles;
@FXML
private Label dieselMpg;
@FXML
private Label electricMiles;
@FXML
private Label electricMpg;
@FXML
private Label publicTransportation;
@FXML
private Label airPlane;
@FXML
private Label goodShopping;
@FXML
private Label serviceShopping;
@FXML
private Label meat;
@FXML
private Label grains;
@FXML
private Label dairy;
@FXML
private Label fruits;
@FXML
private Label snacks;
@FXML
private ImageView achieve1;
@FXML
private ImageView achieve2;
@FXML
private ImageView achieve3;
@FXML
private ImageView achieve4;
@FXML
private ImageView achieve5;
@FXML
private ImageView achieve6;
@FXML
private Label hintText;
@FXML
private Label veganMeal;
@FXML
private Label localProduce;
@FXML
private Label bike;
@FXML
private Label publicTrans;
@FXML
private Label loweringTemp;
@FXML
private Label solarPanels;
@FXML
private Button achiev1Tip;
@FXML
private Button achiev2Tip;
@FXML
private Button achiev3Tip;
@FXML
private Button achiev4Tip;
@FXML
private Button achiev5Tip;
@FXML
private Button achiev6Tip;
/**
* Loads the the necessary things before anything else.
* @throws InterruptedException exception if interrupted
*/
public void initialize() throws InterruptedException {
hintText.setWrapText(true);
hintText.setText(hints.randomHint());
//set the dashboardPane to visible
dashboardPane.setVisible(true);
userPane.setVisible(false);
activitiesPane.setVisible(false);
friendsPane.setVisible(false);
//sets the text of the 'welcome back' text to include the username
welcomebacktext.setText("Welcome back, " + userService.currentUser.getName() + "!");
//adds the slide transition to the menu bar
addSlideTransition(menuBar, pathLine);
//adds animations to the navigation buttons
dashboardButton.setSkin(new MyButtonSkin(dashboardButton));
activitiesButton.setSkin(new MyButtonSkin(activitiesButton));
userButton.setSkin(new MyButtonSkin(userButton));
friendsButton.setSkin(new MyButtonSkin(friendsButton));
logOutButton.setSkin(new MyButtonSkin(logOutButton));
friendsColumn.setCellValueFactory(new PropertyValueFactory<>("Friend"));
scoreColumn.setCellValueFactory(new PropertyValueFactory<>("Score"));
globalPlace.setCellValueFactory(new PropertyValueFactory<>("Place"));
globalUser.setCellValueFactory(new PropertyValueFactory<>("Friend"));
globalScore.setCellValueFactory(new PropertyValueFactory<>("Score"));
developmentUser.setCellValueFactory(new PropertyValueFactory<>("Friend"));
developmentPlace.setCellValueFactory(new PropertyValueFactory<>("Place"));
developmentScore.setCellValueFactory(new PropertyValueFactory<>("Score"));
friendPlace.setCellValueFactory(new PropertyValueFactory<>("Place"));
friendUser.setCellValueFactory(new PropertyValueFactory<>("Friend"));
friendScore.setCellValueFactory(new PropertyValueFactory<>("Score"));
List<String> friendList = userService.getFriendNames(userService.currentUser.getName());
for (int i = 0; i < friendList.size(); i++) {
Friend friend = new Friend(i, friendList.get(i),
userService.getFootprint(friendList.get(i)));
data.add(friend);
}
friendsTable.setItems(data);
updateLeaderboard();
updateAchievements();
updatePiechart();
calculateFootPrintButton.setSkin(new ClickButtonSkin(calculateFootPrintButton));
addFriendButton.setSkin(new ClickButtonSkin(addFriendButton));
addExtraActivityButton.setSkin(new ClickButtonSkin(addExtraActivityButton));
addExtraActivityButton2.setSkin(new ClickButtonSkin(addExtraActivityButton2));
addFriend.setSkin(new ClickButtonSkin(addFriend));
removeFriend.setSkin(new ClickButtonSkin(removeFriend));
addRandomHints();
Tooltip tooltip = new Tooltip("tip");
hackTooltipStartTiming(tooltip);
addToolTip(achiev1Tip, "Starting off \n You did your first green activity!");
addToolTip(achiev2Tip, "Social Butterfly \n You added three friends");
addToolTip(achiev3Tip, "Green Saver \n You saved 20 tonnes of CO2");
addToolTip(achiev4Tip, "Animal Friend \n You have eaten 10 vegetarian meals");
addToolTip(achiev5Tip, "Tom Dumoulin \n You have biked 15 km");
addToolTip(achiev6Tip, "Let it shine \n You installed solar panels");
}
/**
* adds a tooltip to the button.
* @param button the button to add the tooltip to.
* @param message the message to be displayed in the tooltip.
*/
private void addToolTip(Button button, String message) {
button.setTooltip(new Tooltip(message));
}
/**
* changes the delay time between hovering over something with a tooltip and when the
* tooltip is displayed.
* @param tooltip the tooltip to change the delay of
*/
private static void hackTooltipStartTiming(Tooltip tooltip) {
try {
Field fieldBehavior = tooltip.getClass().getDeclaredField("BEHAVIOR");
fieldBehavior.setAccessible(true);
Object objBehavior = fieldBehavior.get(tooltip);
Field fieldTimer = objBehavior.getClass().getDeclaredField("activationTimer");
fieldTimer.setAccessible(true);
Timeline objTimer = (Timeline) fieldTimer.get(objBehavior);
objTimer.getKeyFrames().clear();
objTimer.getKeyFrames().add(new KeyFrame(new Duration(150)));
} catch (NoSuchFieldException e) {
e.printStackTrace();
e.getMessage();
} catch (IllegalAccessException e) {
e.getMessage();
e.printStackTrace();
}
}
/**
* Sorts the scores of users.
* @param users the list of users
*/
public void sortScores(List<String> users) throws InterruptedException {
for (int i = 0; i < users.size(); i++) {
for (int j = 0; j < users.size(); j++) {
Double first = userService.getFootprint(users.get(i));
Double second = userService.getFootprint(users.get(j));
if (i < j && (first.compareTo(second) < 0)) {
String temp = users.get(i);
users.set(i, users.get(j));
users.set(j, temp);
}
if (i > j && (first.compareTo(second) > 0)) {
String temp = users.get(i);
users.set(i, users.get(j));
users.set(j, temp);
}
}
}
}
/**
* Sorts the scores of users.
* @param users the list of users
*/
public List<String> sortDiffScores(List<String> users) throws InterruptedException {
for (int i = 0; i < users.size(); i++) {
for (int j = 0; j < users.size(); j++) {
Double firstDiff = userService.getFirstFootprint(users.get(i)) - userService
.getFootprint(users.get(i));
Double secondDiff = userService.getFirstFootprint(users.get(j)) - userService
.getFootprint(users.get(j));
if (i < j && firstDiff < secondDiff) {
String temp = users.get(i);
users.set(i, users.get(j));
users.set(j, temp);
}
if (i > j && firstDiff > secondDiff) {
String temp = users.get(i);
users.set(i, users.get(j));
users.set(j, temp);
}
}
}
return users;
}
/**
* Adds a fade transition for switching between the different panes.
* @param node the node on which the transition needs to act
*/
public void addFadeTransition(Node node) {
fadeTrans = new FadeTransition(Duration.millis(400), node);
fadeTrans.setFromValue(0);
fadeTrans.setToValue(1.0);
fadeTrans.play();
}
/**
* Displays the dashboard pane.
* @param event the event (clicking the button)
*/
public void displayDashboard(ActionEvent event) throws InterruptedException {
addFadeTransition(dashboardPane);
System.out.println("display dashboard");
dashboardPane.setVisible(true);
userPane.setVisible(false);
activitiesPane.setVisible(false);
friendsPane.setVisible(false);
updateLeaderboard();
updateAchievements();
}
/**
* Displays the activities pane.
* @param event the event (clicking the button)
*/
public void displayActivities(ActionEvent event) {
addFadeTransition(activitiesPane);
System.out.println("display activities");
dashboardPane.setVisible(false);
userPane.setVisible(false);
activitiesPane.setVisible(true);
friendsPane.setVisible(false);
Map<String, String> inputMap = userService.getInputs(userService.currentUser.getName());
peopleNumber.setText(inputMap.get("input_size"));
income.setText(inputMap.get("input_income") + " €/yr");
electricityUsage.setText(inputMap.get("input_footprint_housing_electricity_dollars")
+ " €/yr");
cleanEnergy.setText(inputMap.get("input_footprint_housing_gco2_per_kwh"));
naturalGasUsage.setText(inputMap.get("input_footprint_housing_naturalgas_dollars")
+ " €/yr");
heatingOilUsage.setText(inputMap.get("input_footprint_housing_heatingoil_dollars")
+ " €/yr");
waterUsage.setText(inputMap.get("input_footprint_housing_watersewage") + " €/yr");
livingSpace.setText(inputMap.get("input_footprint_housing_squarefeet") + "");
gasolineMiles.setText(inputMap.get("input_footprint_transportation_miles1"));
gasolineMpg.setText(inputMap.get("input_footprint_transportation_mpg1"));
dieselMiles.setText(inputMap.get("input_footprint_transportation_miles2"));
dieselMpg.setText(inputMap.get("input_footprint_transportation_mpg2"));
electricMiles.setText(inputMap.get("input_footprint_transportation_miles3"));
electricMpg.setText(inputMap.get("input_footprint_transportation_mpg3"));
publicTransportation.setText(inputMap.get("input_footprint_transportation_publictrans")
+ " km/yr");
airPlane.setText(inputMap.get("input_footprint_transportation_airtotal") + " km/yr");
goodShopping.setText(inputMap.get("input_footprint_shopping_goods_total") + " €/mo");
serviceShopping.setText(inputMap.get("input_footprint_shopping_services_total") + " €/mo");
meat.setText(inputMap.get("input_footprint_shopping_food_meatfisheggs"));
grains.setText(inputMap.get("input_footprint_shopping_food_cereals"));
dairy.setText(inputMap.get("input_footprint_shopping_food_dairy"));
fruits.setText(inputMap.get("input_footprint_shopping_food_fruitvegetables"));
snacks.setText(inputMap.get("input_footprint_shopping_food_otherfood"));
Map<String, String> extraMap = userService
.getExtraInputs(userService.currentUser.getName());
veganMeal.setText(extraMap.get("vegan"));
localProduce.setText(extraMap.get("local_produce"));
bike.setText(extraMap.get("bike"));
publicTrans.setText(extraMap.get("public_transport"));
loweringTemp.setText(extraMap.get("temperature"));
solarPanels.setText(extraMap.get("solar_panels"));
}
/**
* Displays the user profile pane.
* @param event the event (clicking the button)
*/
public void displayUser(ActionEvent event) throws InterruptedException {
System.out.println(userService.currentUser.getName());
System.out.println(userService.getFootprint(userService.currentUser.getName()));
footprintLabel.setText("" + userService.getFootprint(userService.currentUser.getName()));
firstFootprintLabel.setText("" + userService
.getFirstFootprint(userService.currentUser.getName()));
Double diff = userService.getFirstFootprint(userService.currentUser.getName()) - userService
.getFootprint(userService.currentUser.getName());
differenceLabel.setText( "" + Math.round(diff * 10) / 10.0);
usernameLabel.setText("" + userService.currentUser.getName());
addFadeTransition(userPane);
System.out.println("display user");
dashboardPane.setVisible(false);
userPane.setVisible(true);
activitiesPane.setVisible(false);
friendsPane.setVisible(false);
updatePiechart();
}
/**
* Displays the friends pane.
* @param event the event (clicking the button)
*/
public void displayFriends(ActionEvent event) throws InterruptedException {
addFadeTransition(friendsPane);
System.out.println("display friends");
dashboardPane.setVisible(false);
userPane.setVisible(false);
activitiesPane.setVisible(false);
friendsPane.setVisible(true);
updateFriends();
}
/**
* Logs out the user.
* @param event the event (clicking the button)
* @throws IOException if the Application doesn't load.
*/
public void logOut(ActionEvent event) throws IOException {
//get the current window
Window owner = logOutButton.getScene().getWindow();
Stage current = (Stage) owner;
//close current window (log out)
current.close();
System.out.println("User is logged out");
//global leaderboard
globalLeaderboard.getItems().clear();
globalLeaderData.removeAll();
//development leaderboard
developmentLeaderboard.getItems().clear();
developmentData.removeAll();
//friends leaderboard
friendLeaderboard.getItems().clear();
friendLeaderData.removeAll();
//load the fxml file
Parent dash = Application.load(this.getClass().getClassLoader()
.getResource("fxml/LoginWindow.fxml"));
Scene scene = new Scene(dash);
//add the stylesheet for the CSS
scene.getStylesheets().add(Objects.requireNonNull(getClass().getClassLoader()
.getResource("stylesheets/LoginWindowStyle.css")).toExternalForm());
Stage appStage = new Stage();
appStage.setScene(scene);
//set the title
appStage.setTitle("Greenify");
appStage.show();
}
//sets the slide in transition for startup
public void addSlideTransition(Node node, Line path1) {
PathTransition pathTrans = new PathTransition(Duration.millis(1100), path1, node);
pathTrans.play();
}
/**
* Opens the calculator.
* @throws IOException if the Application doesn't load.
*/
@SuppressWarnings("Duplicates")
public void openCalculator() throws IOException, InterruptedException {
Parent calc = Application.load(this.getClass().getClassLoader()
.getResource("fxml/calculator.fxml"));
Scene scene = new Scene(calc);
scene.getStylesheets().add(getClass().getClassLoader()
.getResource("stylesheets/calculatorStyle.css").toExternalForm());
Stage calcStage = new Stage();
calcStage.setScene(scene);
calcStage.setTitle("Calculate CO2 footprint - " + userService.currentUser.getName());
calcStage.show();
}
/**
* This method adds a random hint to the side bar.
*/
public void addRandomHints() {
FadeTransition fadeOut = new FadeTransition(Duration.millis(400), hintText);
fadeOut.setFromValue(1.0);
fadeOut.setToValue(0.0);
fadeOut.play();
hintText.setWrapText(true);
hintText.setText(hints.randomHint());
FadeTransition fadeIn = new FadeTransition(Duration.millis(400), hintText);
fadeIn.setFromValue(0.0);
fadeIn.setToValue(1.0);
fadeIn.play();
}
/**
* Opens extra activities.
* @param event the event (clicking the button)
* @throws IOException if the Application doesn't load.
*/
public void openExtraActivities(ActionEvent event) throws IOException {
Parent extra = Application.load(this.getClass().getClassLoader()
.getResource("fxml/extraActivities.fxml"));
Scene scene = new Scene(extra);
Stage extraStage = new Stage();
extraStage.setScene(scene);
extraStage.setTitle("Add extra activity - " + userService.currentUser.getName());
extraStage.show();
}
/**
* method opens addFriend scene.
* @throws IOException when file is not found
*/
public void openAddFriend() throws IOException {
Parent calc = Application.load(this.getClass().getClassLoader()
.getResource("fxml/AddFriend.fxml"));
Scene scene = new Scene(calc);
Stage calcStage = new Stage();
calcStage.setScene(scene);
calcStage.setTitle("Add a new friend - " + userService.currentUser.getName());
calcStage.show();
}
/**
* method opens removeFriend scene.
* @throws IOException when file is not found
*/
public void openRemoveFriend() throws IOException {
Parent calc = Application.load(this.getClass().getClassLoader()
.getResource("fxml/RemoveFriend.fxml"));
Scene scene = new Scene(calc);
Stage calcStage = new Stage();
calcStage.setScene(scene);
calcStage.setTitle("Remove your friend - " + userService.currentUser.getName());
calcStage.show();
}
/**
* Leaderboard is updating.
* @throws InterruptedException throws exception
*/
@SuppressWarnings("Duplicates")
public void updateLeaderboard() throws InterruptedException {
//global leaderboard
globalLeaderboard.getItems().clear();
globalLeaderData.removeAll();
//development leaderboard
developmentLeaderboard.getItems().clear();
developmentData.removeAll();
List<String> userList = userService.getAllUsers();
sortScores(userList);
for (int i = userList.size() - 1; i >= 0; i--) {
Friend user = new Friend(userList.size() - i, userList.get(i),
userService.getFootprint(userList.get(i)));
globalLeaderData.add(user);
}
List<String> secondList = sortDiffScores(userList);
for (int j = 0; j < userList.size(); j++) {
double diff = Math.round((userService.getFirstFootprint(secondList.get(j))
- userService.getFootprint(secondList.get(j))) * 10) / 10.0;
Friend diffUser = new Friend(j + 1, secondList.get(j), diff);
developmentData.add(diffUser);
}
globalLeaderboard.setItems(globalLeaderData);
developmentLeaderboard.setItems(developmentData);
}
/**
* The method updating piechart.
* @throws InterruptedException exception
*/
public void updatePiechart() throws InterruptedException {
Map<String, String> resultMap = userService.getResults(userService.currentUser.getName());
if (pieChart != null) {
ObservableList<PieChart.Data> pieChartData =
FXCollections.observableArrayList(
new PieChart.Data("Transport",
Double.parseDouble(resultMap.get("transport"))),
new PieChart.Data("Housing",
Double.parseDouble(resultMap.get("housing"))),
new PieChart.Data("Food",
Double.parseDouble(resultMap.get("food"))),
new PieChart.Data("Goods",
Double.parseDouble(resultMap.get("goods"))),
new PieChart.Data("Services",
Double.parseDouble(resultMap.get("services")))
);
pieChart.setTitle("FOOTPRINT DISTRIBUTION");
pieChart.setMaxSize(1000, 1000);
pieChart.setData(pieChartData);
}
}
/**
* Friends tables are updating.
* @throws InterruptedException throws exception
*/
@SuppressWarnings("Duplicates")
public void updateFriends() throws InterruptedException {
List<String> wholeList = userService.getFriendNames(userService.currentUser.getName());
wholeList.add(userService.currentUser.getName());
//friend list
friendsTable.getItems().clear();
data.removeAll();
List<String> friendList = userService.getFriendNames(userService.currentUser.getName());
sortScores(friendList);
//friends leaderboard
friendLeaderboard.getItems().clear();
friendLeaderData.removeAll();
sortDiffScores(wholeList);
for (int i = friendList.size() - 1; i >= 0 ; i--) {
Friend user = new Friend(i, friendList.get(i), userService
.getFootprint(friendList.get(i)));
data.add(user);
}
for (int j = 0; j < wholeList.size(); j++) {
double diff = Math.round((userService.getFirstFootprint(wholeList.get(j))
- userService.getFootprint(wholeList.get(j))) * 10) / 10.0;
Friend diffUser = new Friend(j + 1, wholeList.get(j), diff);
friendLeaderData.add(diffUser);
}
friendsTable.setItems(data);
friendLeaderboard.setItems(friendLeaderData);
}
/**
* Updates the achievements.
*/
public void updateAchievements() {
Map achievements = userService.getAchievements(userService.currentUser.getName());
ColorAdjust desaturate = new ColorAdjust();
desaturate.setSaturation(-0.75);
if ((Boolean)achievements.get("Starting off")) {
achieve1.setOpacity(1);
} else {
achieve1.setEffect(desaturate);
achieve1.setOpacity(0.3);
}
if ((Boolean)achievements.get("Social butterfly")) {
achieve2.setOpacity(1);
} else {
achieve2.setEffect(desaturate);
achieve2.setOpacity(0.3);
}
if ((Boolean)achievements.get("Green saver")) {
achieve3.setOpacity(1);
} else {
achieve3.setEffect(desaturate);
achieve3.setOpacity(0.3);
}
if ((Boolean)achievements.get("Animal friend")) {
achieve4.setOpacity(1);
} else {
achieve4.setEffect(desaturate);
achieve4.setOpacity(0.3);
}
if ((Boolean)achievements.get("Tom Dumoulin")) {
achieve5.setOpacity(1);
} else {
achieve5.setEffect(desaturate);
achieve5.setOpacity(0.3);
}
if ((Boolean)achievements.get("Let it shine")) {
achieve6.setOpacity(1);
} else {
achieve6.setEffect(desaturate);
achieve6.setOpacity(0.3);
}
}
//class for the animations on the navigation buttons
private class MyButtonSkin extends ButtonSkin {
/**
* adds a skin and scale animation to a button.
* the scale transition is for hovering over it so it then scales up
* and scales down when you stop hovering over it.
* @param button the button to add the animation to
*/
private MyButtonSkin(Button button) {
//inherit the button properties
super(button);
//transition to scale up on hover
final ScaleTransition scaleUp = new ScaleTransition(Duration.millis(100));
//add the node and the position to scale to
scaleUp.setNode(button);
scaleUp.setToX(1.1);
//play the transition when hovered over the button
button.setOnMouseEntered(e -> scaleUp.playFromStart());
final ScaleTransition scaleDown = new ScaleTransition(Duration.millis(100));
scaleDown.setNode(button);
scaleDown.setToX(1.0);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
@SuppressWarnings("Duplicates")
private class ClickButtonSkin extends ButtonSkin {
/**
* button skin for the 'add activity' buttons.
* adds scale animations on entering, clicking and exiting the button
* @param button the button to set the skin of
*/
private ClickButtonSkin(Button button) {
super(button);
//transition to scale up on hover
final ScaleTransition scaleUp = new ScaleTransition(Duration.millis(100));
//add the node and the position to scale to
scaleUp.setNode(button);
scaleUp.setToX(1.1);
scaleUp.setToY(1.1);
//play the transition when hovered over the button
button.setOnMouseEntered(e -> scaleUp.playFromStart());
final ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setNode(button);
scaleMiddleDown.setToX(1.05);
scaleMiddleDown.setToY(1.05);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
final ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setNode(button);
scaleMiddleUp.setToX(1.1);
scaleMiddleUp.setToY(1.1);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
final ScaleTransition scaleDown = new ScaleTransition(Duration.millis(100));
scaleDown.setNode(button);
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
}

View File

@@ -0,0 +1,372 @@
package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.rest.UserService;
import javafx.animation.FadeTransition;
import javafx.animation.ParallelTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.TranslateTransition;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Slider;
import javafx.scene.layout.AnchorPane;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@Controller
public class ExtraActivityController {
@Autowired
UserService userService;
@Autowired
CalculatorController calculatorController;
@Autowired
DashBoardController controller;
@FXML
private AnchorPane veganMealPane;
@FXML
private AnchorPane bikePane;
@FXML
private AnchorPane temperaturePane;
@FXML
private AnchorPane solarPanelPane;
@FXML
private AnchorPane localProducePane;
@FXML
private AnchorPane publicTransportPane;
@FXML
private Button displayVeganMealButton;
@FXML
private Button displayBikeButton;
@FXML
private Button displayTemperatureButton;
@FXML
private Button displaySolarPanelButton;
@FXML
private Button displayLocalProduceButton;
@FXML
private Button displayPublicTransportButton;
@FXML
private Button addVeganMealButton;
@FXML
private Button addBikeButton;
@FXML
private Button addTemperatureButton;
@FXML
private Button addSolarPanelsButton;
@FXML
private Button addLocalProduceButton;
@FXML
private Button addPublicTransportButton;
@FXML
private Slider bikeSlider;
@FXML
private Label bikeLabel;
@FXML
private Slider temperatureSlider;
@FXML
private Label temperatureLabel;
@FXML
private Slider solarPanelsSlider;
@FXML
private Label solarPanelsLabel;
@FXML
private Label publicTransportLabel;
@FXML
private Slider publicTransportSlider;
/**
* initializes the sliders and labels before loading.
* sets the labels to display the outputs of the designated sliders.
*/
public void initialize() {
coupleSliderToLabel(bikeSlider, bikeLabel, " km", false);
coupleSliderToLabel(temperatureSlider, temperatureLabel, " Degrees", true);
coupleSliderToLabel(solarPanelsSlider, solarPanelsLabel, "", true);
coupleSliderToLabel(publicTransportSlider, publicTransportLabel, " km", false);
addVeganMealButton.setSkin(new ActivityButtonSkin(addVeganMealButton));
addBikeButton.setSkin(new ActivityButtonSkin(addBikeButton));
addTemperatureButton.setSkin(new ActivityButtonSkin(addTemperatureButton));
addSolarPanelsButton.setSkin(new ActivityButtonSkin(addSolarPanelsButton));
addLocalProduceButton.setSkin(new ActivityButtonSkin(addLocalProduceButton));
addPublicTransportButton.setSkin(new ActivityButtonSkin(addPublicTransportButton));
displayVeganMealButton.setSkin(new TranslateButtonSkin(displayVeganMealButton));
displayBikeButton.setSkin(new TranslateButtonSkin(displayBikeButton));
displayTemperatureButton.setSkin(new TranslateButtonSkin(displayTemperatureButton));
displaySolarPanelButton.setSkin(new TranslateButtonSkin(displaySolarPanelButton));
displayLocalProduceButton.setSkin(new TranslateButtonSkin(displayLocalProduceButton));
displayPublicTransportButton.setSkin(new TranslateButtonSkin(displayPublicTransportButton));
}
/**
* Sets the label to display the value of the designated slider.
* sets the text to be displayed after the value of the slider.
* sets whether the slider should snap to ticks
* @param slider the slider to read the value from
* @param label the label to display the value of the slider
* @param string the string to be placed after the outputted value of the slider
* @param snapToTicks whether the slider should snap to ticks or not
*/
private void coupleSliderToLabel(Slider slider, Label label, String string,
boolean snapToTicks) {
slider.setSnapToTicks(snapToTicks);
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(newValue.intValue() + string);
}
});
}
/**
* add transition animation.
* @param node adding animation
*/
public void addFadeTransAnimation(Node node) {
FadeTransition fade = new FadeTransition(Duration.millis(350), node);
fade.setFromValue(0);
fade.setToValue(1.0);
TranslateTransition trans = new TranslateTransition(Duration.millis(350), node);
trans.setFromX(-800);
trans.setToX(0);
ParallelTransition par = new ParallelTransition();
par.setNode(node);
par.getChildren().addAll(fade, trans);
par.play();
}
/**
* displays the vegetarian meal section.
* @param event the click of the designated button
*/
public void displayVeganMeal(ActionEvent event) {
// System.out.println("display vm");
addFadeTransAnimation(veganMealPane);
veganMealPane.setVisible(true);
bikePane.setVisible(false);
temperaturePane.setVisible(false);
solarPanelPane.setVisible(false);
localProducePane.setVisible(false);
publicTransportPane.setVisible(false);
}
/**
* displays the bike section.
* @param event the click of the designated button
*/
public void displayBike(ActionEvent event) {
// System.out.println("display b");
addFadeTransAnimation(bikePane);
veganMealPane.setVisible(false);
bikePane.setVisible(true);
temperaturePane.setVisible(false);
solarPanelPane.setVisible(false);
localProducePane.setVisible(false);
publicTransportPane.setVisible(false);
}
/**
* displays the temperature section.
* @param event the click of the designated button
*/
public void displayTemperature(ActionEvent event) {
// System.out.println("display t");
addFadeTransAnimation(temperaturePane);
veganMealPane.setVisible(false);
bikePane.setVisible(false);
temperaturePane.setVisible(true);
solarPanelPane.setVisible(false);
localProducePane.setVisible(false);
publicTransportPane.setVisible(false);
}
/**
* displays the solar panels section.
* @param event the click of the designated button
*/
public void displaySolarPanel(ActionEvent event) {
// System.out.println("display sp");
addFadeTransAnimation(solarPanelPane);
veganMealPane.setVisible(false);
bikePane.setVisible(false);
temperaturePane.setVisible(false);
solarPanelPane.setVisible(true);
localProducePane.setVisible(false);
publicTransportPane.setVisible(false);
}
/**
* displays the local produce section.
* @param event the click of the designated button
*/
public void displayLocalProduce(ActionEvent event) {
addFadeTransAnimation(localProducePane);
veganMealPane.setVisible(false);
bikePane.setVisible(false);
temperaturePane.setVisible(false);
solarPanelPane.setVisible(false);
localProducePane.setVisible(true);
publicTransportPane.setVisible(false);
}
/**
* displays the public transport section.
* @param event the click of the designated button
*/
public void displayPublicTransport(ActionEvent event) {
addFadeTransAnimation(publicTransportPane);
veganMealPane.setVisible(false);
bikePane.setVisible(false);
temperaturePane.setVisible(false);
solarPanelPane.setVisible(false);
localProducePane.setVisible(false);
publicTransportPane.setVisible(true);
}
/**
* The method updates the values.
*/
@SuppressWarnings("Duplicates")
public void save(ActionEvent event) {
try {
updateExtras();
Float footprint = userService.saveFootprint(userService.currentUser.getName());
controller.updateLeaderboard();
controller.updateAchievements();
} catch (InterruptedException ex) {
System.out.println("continue");
}
}
/**
* The method updates the values of extras.
*/
@SuppressWarnings("Duplicates")
public void updateExtras() throws InterruptedException {
if (!bikeLabel.getText().replace(" km", "").equals("0")) {
userService.updateExtraInput(userService.currentUser.getName(),
"bike",
bikeLabel.getText().replace(" km", ""));
}
if (!solarPanelsLabel.getText().equals("0")) {
userService.updateExtraInput(userService.currentUser.getName(),
"solar_panels",
solarPanelsLabel.getText());
}
if (!temperatureLabel.getText().replace(" Degrees", "").equals("0")) {
userService.updateExtraInput(userService.currentUser.getName(),
"temperature",
temperatureLabel.getText().replace(" Degrees", ""));
}
if (!publicTransportLabel.getText().replace(" km", "").equals("0")) {
userService.updateExtraInput(userService.currentUser.getName(),
"public_transport",
publicTransportLabel.getText().replace(" km", ""));
}
}
/**
* The method updates the values of extras.
*/
@SuppressWarnings("Duplicates")
public void updateExtraVegan() throws InterruptedException {
try {
userService.updateExtraInput(userService.currentUser.getName(), "vegan", "1");
Float footprint = userService.saveFootprint(userService.currentUser.getName());
controller.updateAchievements();
controller.updateLeaderboard();
} catch (NullPointerException ex) {
System.out.println("continue");
}
}
/**
* The method updates the values of extras.
*/
@SuppressWarnings("Duplicates")
public void updateExtraLocal() throws InterruptedException {
try {
userService.updateExtraInput(userService.currentUser.getName(), "local_produce", "1");
Float footprint = userService.saveFootprint(userService.currentUser.getName());
controller.updateAchievements();
controller.updateLeaderboard();
} catch (NullPointerException ex) {
System.out.println("continue");
}
}
public class TranslateButtonSkin extends ButtonSkin {
/**
* button skin that sets a translate animation on entering and exiting the button.
* @param button the button to set the animation for
*/
private TranslateButtonSkin(Button button) {
super(button);
TranslateTransition transEnter = new TranslateTransition(Duration.millis(50));
transEnter.setNode(button);
transEnter.setToX(10);
button.setOnMouseEntered(e -> transEnter.playFromStart());
TranslateTransition transExit = new TranslateTransition(Duration.millis(50));
transExit.setNode(button);
transExit.setToX(1.0);
button.setOnMouseExited(e -> transExit.playFromStart());
}
}
@SuppressWarnings("Duplicates")
private class ActivityButtonSkin extends ButtonSkin {
/**
* button skin for the 'add activity' buttons.
* adds scale animations on entering, clicking and exiting the button
* @param button the button to set the skin of
*/
private ActivityButtonSkin(Button button) {
super(button);
//transition to scale up on hover
final ScaleTransition scaleUp = new ScaleTransition(Duration.millis(100));
//add the node and the position to scale to
scaleUp.setNode(button);
scaleUp.setToX(1.1);
scaleUp.setToY(1.1);
//play the transition when hovered over the button
button.setOnMouseEntered(e -> scaleUp.playFromStart());
final ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setNode(button);
scaleMiddleDown.setToX(1.05);
scaleMiddleDown.setToY(1.05);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
final ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setNode(button);
scaleMiddleUp.setToX(1.1);
scaleMiddleUp.setToY(1.1);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
final ScaleTransition scaleDown = new ScaleTransition(Duration.millis(100));
scaleDown.setNode(button);
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
}

View File

@@ -0,0 +1,109 @@
package greenify.client.controller;
import greenify.client.rest.UserService;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import javafx.stage.Window;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@Controller
public class FriendController {
@Autowired
UserService userService;
@Autowired
DashBoardController dashBoardController;
@FXML
private Button addButton;
@FXML
private TextField userNameText;
@FXML
private Button removeButton;
@FXML
private TextField removeUserNameText;
/**
* Add a new friend.
* @param event the click of the sign up button
*/
@FXML
public void addFriend(ActionEvent event) throws InterruptedException {
//set the window to the current window (for displaying the alerts)
Window owner = addButton.getScene().getWindow();
//check if the username field is empty
if (userNameText.getText().isEmpty()) {
//if so, display an alert
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Username Error!",
"Please enter a username!");
return;
} else if (userNameText.getText().equals(userService.currentUser.getName())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"Cannot add yourself as a friend!");
return;
} else if (userService.getFriendNames(userService.currentUser.getName())
.contains(userNameText.getText())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"Cannot add a friend twice!");
return;
} else if (!userService.getAllUsers().contains(userNameText.getText())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"The user does not exist!");
return;
}
//add friend to the current user
userService.addFriend(userService.currentUser.getName(), userNameText.getText());
//close the register window after the user has entered all the credentials
String friendName = userNameText.getText();
Stage current = (Stage) owner;
dashBoardController.updateAchievements();
dashBoardController.updateFriends();
current.close();
UserController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION, owner, "Friend added!",
userNameText.getText() + " is now your friend!");
}
/**
* Removes one of the friends of the user.
* @param event the click of the sign up button
*/
@FXML
public void removeFriend(ActionEvent event) throws InterruptedException {
//set the window to the current window (for displaying the alerts)
Window owner = removeButton.getScene().getWindow();
//check if the username field is empty
if (removeUserNameText.getText().isEmpty()) {
//if so, display an alert
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Username Error!",
"Please enter a username!");
return;
} else if (removeUserNameText.getText().equals(userService.currentUser.getName())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"You are not your friend!");
return;
} else if (!userService.getFriendNames(userService.currentUser.getName())
.contains(removeUserNameText.getText())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"You do not have a friend with this username!");
return;
} else if (!userService.getAllUsers().contains(removeUserNameText.getText())) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Error!",
"The user does not exist!");
return;
}
//add friend to the current user
userService.removeFriend(userService.currentUser.getName(), removeUserNameText.getText());
//close the register window after the user has entered all the credentials
Stage current = (Stage) owner;
dashBoardController.updateFriends();
dashBoardController.updateAchievements();
current.close();
UserController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION, owner, "Friend removed!",
removeUserNameText.getText() + " is not your friend anymore!");
}
}

View File

@@ -0,0 +1,675 @@
package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.Application;
import greenify.client.rest.UserService;
import javafx.animation.FadeTransition;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ParallelTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Slider;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.client.HttpClientErrorException;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
import java.util.concurrent.TimeUnit;
/**
* Class that controls the actions for the register window.
*/
@Controller
public class RegisterWindowController {
@Autowired
UserService userService;
@Autowired
ExtraActivityController extraActivityController;
@FXML
private Text explainText;
//navigation panes
@FXML
private AnchorPane getStartedPane;
@FXML
private AnchorPane travelPane;
@FXML
private AnchorPane homePane;
@FXML
private ScrollPane foodPane;
@FXML
private AnchorPane shoppingPane;
//'get started' pane
@FXML
private Slider peopleInHouseholdSlider;
@FXML
private Label peopleInHouseHoldLabel;
@FXML
private Slider annualIncomeSlider;
@FXML
private Label annualIncomeLabel;
@FXML
private Button saveButton;
//travel pane
@FXML
private TextField publicTransitField;
@FXML
private TextField airplaneTravelField;
@FXML
private TextField carTravelGasolineField;
@FXML
private Slider carTravelGasolineSlider;
@FXML
private Label carTravelGasolineLabel;
@FXML
private TextField carTravelDieselField;
@FXML
private Slider carTravelDieselSlider;
@FXML
private Label carTravelDieselLabel;
@FXML
private TextField carTravelElectricField;
@FXML
private Slider carTravelElectricSlider;
@FXML
private Label carTravelElectricLabel;
//home pane
@FXML
private TextField electricityField;
@FXML
private Slider cleanEnergyPurchasedSlider;
@FXML
private Label cleanEnergyPurchasedLabel;
@FXML
private TextField naturalGasField;
@FXML
private TextField heatingOilField;
@FXML
private TextField livingSpaceField;
@FXML
private Slider waterUsageSlider;
@FXML
private Label waterUsageLabel;
//food pane
@FXML
private Slider meatFishEggsSlider;
@FXML
private Label meatFishEggsLabel;
@FXML
private Slider grainsBakedGoodsSlider;
@FXML
private Label grainsBakedGoodsLabel;
@FXML
private Slider dairySlider;
@FXML
private Label dairyLabel;
@FXML
private Slider fruitsVegetablesSlider;
@FXML
private Label fruitsVegetablesLabel;
@FXML
private Slider snacksDrinksSlider;
@FXML
private Label snacksDrinksLabel;
//shopping pane
@FXML
private Text goodsField;
@FXML
private Text servicesField;
@FXML
private Slider goodsSlider;
@FXML
private Label goodsLabel;
@FXML
private Slider servicesSlider;
@FXML
private Label servicesLabel;
//extra pane
@FXML
private AnchorPane extraPane;
@FXML
private TextField userNameText;
@FXML
private PasswordField passwordField;
@FXML
private PasswordField passwordField2;
@FXML
private Button signUpButton;
//@FXML
//private Line uNamePathLine;
/**
* Initializes the animation.
* @throws InterruptedException exception when interrupted
*/
public void initialize() throws InterruptedException {
addSlideAnimation(1100, userNameText, -300);
addSlideAnimation(1100, passwordField, 300);
TimeUnit.MILLISECONDS.sleep(300);
addSlideAnimation(1100, passwordField2, -420);
signUpButton.setSkin(new RegisterButtonSkin(signUpButton));
}
/**
* Adds the slide animation.
* @param duration the duration
* @param node the node
* @param from from where
*/
private void addSlideAnimation(int duration, Node node, int from) {
TranslateTransition slideIn = new TranslateTransition(Duration.millis(duration), node);
slideIn.setFromX(from);
slideIn.setToX(0);
slideIn.play();
}
/**
* Shows an explanation of the application.
* @param event the click of the question mark button
*/
public void showExplanation(ActionEvent event) {
if (explainText.isVisible()) {
explainText.setVisible(false);
} else {
explainText.setVisible(true);
}
}
/**
* Signs up the user.
* @param event the click of the sign up button
*/
@FXML
public void handleSignUpButton(ActionEvent event) throws IOException, NoSuchAlgorithmException {
//set the window to the current window (for displaying the alerts)
Window owner = signUpButton.getScene().getWindow();
//check if the username field is empty
if (userNameText.getText().isEmpty()) {
//if so, display an alert
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Username Error!",
"Please enter a username!");
return;
}
//check if the password field is empty
if (passwordField.getText().isEmpty()) {
//if so, display an alert
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Password Error!",
"Please enter a password!");
return;
}
//check if the two password fields are equal
if (!passwordField.getText().equals(passwordField2.getText())) {
//if not, display an alert
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Password Error!",
"Please make sure the passwords entered are the same!");
return;
}
//register the user with the provided username and password
try {
userService.registerUser(userNameText.getText(), passwordField.getText());
} catch (HttpClientErrorException ex) {
UserController.AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Username Error!",
"This username has already been taken!");
return;
}
//close the register window after the user has entered all the credentials
Stage current = (Stage) owner;
current.close();
Parent calc = Application.load(this.getClass().getClassLoader()
.getResource("fxml/FirstCalculator.fxml"));
Scene scene = new Scene(calc);
scene.getStylesheets().add(getClass().getClassLoader()
.getResource("stylesheets/calculatorStyle.css").toExternalForm());
Stage calcStage = new Stage();
calcStage.setScene(scene);
calcStage.setTitle("Calculate CO2 footprint - " + userService.currentUser.getName());
calcStage.show();
peopleInHouseholdSlider.setSnapToTicks(true);
//add listener to slider for amount of people in household
peopleInHouseholdSlider.valueProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
peopleInHouseHoldLabel.setText("" + newValue.intValue());
}
});
//add listener to slider for annual income
annualIncomeSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
annualIncomeLabel.setText("" + (newValue.intValue() * 1000));
}
});
addSliderListenerCarUsage(carTravelGasolineSlider, carTravelGasolineLabel, " km/L");
addSliderListenerCarUsage(carTravelDieselSlider, carTravelDieselLabel, " km/L");
addSliderListenerCarUsage(carTravelElectricSlider, carTravelElectricLabel, " km/Le");
cleanEnergyPurchasedSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
cleanEnergyPurchasedLabel.setText(newValue.intValue() + " %");
}
});
waterUsageSlider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
waterUsageLabel.setText(newValue.intValue() + "% of similar households");
}
});
addSliderListenerDailyServing(meatFishEggsSlider, meatFishEggsLabel);
addSliderListenerDailyServing(grainsBakedGoodsSlider, grainsBakedGoodsLabel);
addSliderListenerDailyServing(dairySlider, dairyLabel);
addSliderListenerDailyServing(fruitsVegetablesSlider, fruitsVegetablesLabel);
addSliderListenerDailyServing(snacksDrinksSlider, snacksDrinksLabel);
addSliderListenerGoodsServices(goodsSlider, goodsLabel);
addSliderListenerGoodsServices(servicesSlider, servicesLabel);
}
/**
* adds the listener to the given slider and displays it's output on a given label.
* @param slider the slider to attach the listener to.
* @param label the label to display the slider output on.
*/
private void addSliderListenerCarUsage(Slider slider, Label label, String unit) {
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(newValue.intValue() + unit);
}
});
}
@SuppressWarnings("Duplicates")
private void addSliderListenerDailyServing(Slider slider, Label label) {
DecimalFormat df = new DecimalFormat("0.0");
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(df.format(newValue.doubleValue()) + " daily servings per person");
}
});
}
private void addSliderListenerGoodsServices(Slider slider, Label label) {
slider.valueProperty().addListener(new ChangeListener<Number>() {
@Override
public void changed(ObservableValue<? extends Number> observable,
Number oldValue, Number newValue) {
label.setText(newValue.intValue() + "€ / month");
}
});
}
/**
* adds a fade transition to the given node.
* @param node the node to add the transition to
*/
public void addFadeTransAnimation(Node node) {
FadeTransition fade = new FadeTransition(Duration.millis(350), node);
fade.setFromValue(0);
fade.setToValue(1.0);
TranslateTransition trans = new TranslateTransition(Duration.millis(350), node);
trans.setFromY(800);
trans.setToY(0);
ParallelTransition par = new ParallelTransition();
par.setNode(travelPane);
par.getChildren().addAll(fade, trans);
par.play();
}
private void addSlideInAnimation(Node node) {
Timeline timeline = new Timeline();
KeyValue keyValue = new KeyValue(node.translateXProperty(), 0, Interpolator.EASE_OUT);
KeyFrame keyFrame = new KeyFrame(Duration.millis(600), keyValue);
timeline.getKeyFrames().add(keyFrame);
timeline.play();
}
/**
* displays the 'get started' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayGetStarted(ActionEvent event) {
addFadeTransAnimation(getStartedPane);
getStartedPane.setVisible(true);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'travel' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayTravel(ActionEvent event) {
addFadeTransAnimation(travelPane);
getStartedPane.setVisible(false);
travelPane.setVisible(true);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'home' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayHome(ActionEvent event) {
addFadeTransAnimation(homePane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(true);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'food' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayFood(ActionEvent event) {
addFadeTransAnimation(foodPane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(true);
shoppingPane.setVisible(false);
extraPane.setVisible(false);
}
/**
* displays the 'shopping' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the button
*/
@SuppressWarnings("Duplicates")
public void displayShopping(ActionEvent event) {
addFadeTransAnimation(shoppingPane);
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(true);
extraPane.setVisible(false);
}
/**
* displays the 'Extra' section of the calculator.
* Activated when the designated button (navigation button) is clicked
* @param event the click of the designated button
*/
@SuppressWarnings("Duplicates")
public void displayExtra(ActionEvent event) throws IOException {
addFadeTransAnimation(extraPane);
extraPane.getChildren().setAll((Node) Application.load(this.getClass()
.getClassLoader().getResource("fxml/extraActivities.fxml")));
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
extraPane.setVisible(true);
}
/**
* The method saves the calculation.
* @param event user clicks to button
*/
@SuppressWarnings("Duplicates")
public void saveCalc(ActionEvent event) throws InterruptedException {
getStartedPane.setVisible(false);
travelPane.setVisible(false);
homePane.setVisible(false);
foodPane.setVisible(false);
shoppingPane.setVisible(false);
if (!annualIncomeLabel.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(), "input_income",
annualIncomeLabel.getText());
}
if (!peopleInHouseHoldLabel.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(), "input_size",
peopleInHouseHoldLabel.getText());
}
checkTransportLabels();
checkHousingLabels();
checkFoodLabels();
if (!goodsLabel.getText().replace(" € / month", "").equals("1520")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_goods_total",
goodsLabel.getText().replace("€ / month", ""));
}
if (!servicesLabel.getText().replace(" € / month", "").equals("3428")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_services_total",
servicesLabel.getText().replace("€ / month", ""));
}
try {
extraActivityController.updateExtras();
} catch (NullPointerException ex) {
System.out.println("Continue");
}
Float firstFootprint = userService.saveFirstFootprint(userService.currentUser.getName());
Float footprint = userService.saveFootprint(userService.currentUser.getName());
Window owner = saveButton.getScene().getWindow();
Stage current = (Stage) owner;
current.close();
UserController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION,
owner, "Footprint saved!", "Your footprint is saved!");
}
/**
* Checks the food labels.
*/
public void checkFoodLabels() {
if (!meatFishEggsLabel.getText().replace(" daily servings per person", "").equals("2.6")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_meatfisheggs",
meatFishEggsLabel.getText().replace(" daily servings per person", ""));
}
if (!grainsBakedGoodsLabel.getText()
.replace(" daily servings per person", "").equals("4.4")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_cereals",
grainsBakedGoodsLabel.getText().replace(" daily servings per person", ""));
}
if (!dairyLabel.getText().replace(" daily servings per person", "").equals("2.4")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_dairy",
dairyLabel.getText().replace(" daily servings per person", ""));
}
if (!fruitsVegetablesLabel.getText()
.replace(" daily servings per person", "").equals("3.9")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_fruitvegetables",
fruitsVegetablesLabel.getText().replace(" daily servings per person", ""));
}
if (!snacksDrinksLabel.getText().replace(" daily servings per person", "").equals("3.7")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_shopping_food_otherfood",
snacksDrinksLabel.getText().replace(" daily servings per person", ""));
}
}
/**
* Checks the housing labels.
*/
public void checkHousingLabels() {
if (!electricityField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_electricity_dollars",
electricityField.getText());
}
if (!cleanEnergyPurchasedLabel.getText().replace(" %", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_gco2_per_kwh",
cleanEnergyPurchasedLabel.getText().replace(" %", ""));
}
if (!naturalGasField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_naturalgas_dollars",
naturalGasField.getText());
}
if (!heatingOilField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_heatingoil_dollars",
heatingOilField.getText());
}
if (!livingSpaceField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_squarefeet",
livingSpaceField.getText());
}
if (!waterUsageLabel.getText().replace("% of similar households", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_housing_watersewage",
waterUsageLabel.getText().replace("% of similar households", ""));
}
}
/**
* Checks the transport labels.
*/
public void checkTransportLabels() {
if (!publicTransitField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_publictrans",
publicTransitField.getText());
}
if (!airplaneTravelField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_airtotal",
airplaneTravelField.getText());
}
if (!carTravelGasolineField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles1",
carTravelGasolineField.getText());
}
if (!carTravelGasolineLabel.getText().replace(" km/L", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg1",
carTravelGasolineLabel.getText().replace(" km/L", ""));
}
if (!carTravelDieselField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles2",
carTravelDieselField.getText());
}
if (!carTravelDieselLabel.getText().replace(" km/L", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg2",
carTravelDieselLabel.getText().replace(" km/L", ""));
}
if (!carTravelElectricField.getText().equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_miles3",
carTravelElectricField.getText());
}
if (!carTravelElectricLabel.getText().replace(" km/Le", "").equals("0")) {
userService.updateInput(userService.currentUser.getName(),
"input_footprint_transportation_mpg3",
carTravelElectricLabel.getText().replace(" km/Le", ""));
}
}
@SuppressWarnings("Duplicates")
public class RegisterButtonSkin extends ButtonSkin {
/**
* registers button skins.
* @param button clicking
*/
public RegisterButtonSkin(Button button) {
super(button);
ScaleTransition scaleUp = new ScaleTransition(Duration.millis(140));
scaleUp.setToX(1.2);
scaleUp.setToY(1.2);
scaleUp.setNode(button);
button.setOnMouseEntered(e -> scaleUp.playFromStart());
ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setToX(1.1);
scaleMiddleDown.setToY(1.1);
scaleMiddleDown.setNode(button);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setToX(1.2);
scaleMiddleUp.setToY(1.2);
scaleMiddleUp.setNode(button);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
ScaleTransition scaleDown = new ScaleTransition(Duration.millis(200));
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
scaleDown.setNode(button);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
}

View File

@@ -0,0 +1,195 @@
package greenify.client.controller;
import com.sun.javafx.scene.control.skin.ButtonSkin;
import greenify.client.Application;
import greenify.client.rest.UserService;
import javafx.animation.ScaleTransition;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import javafx.stage.Window;
import javafx.util.Duration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.client.HttpClientErrorException;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.util.Objects;
/**
* Class that controls the actions for the login screen.
*/
@Controller
public class UserController {
@Autowired
UserService userService;
@FXML
private TextField usernameField;
@FXML
private PasswordField passwordField;
@FXML
private Button loginButton;
@FXML
private Button signUpButton;
public void initialize() {
loginButton.setSkin(new LoginButtonSkin(loginButton));
signUpButton.setSkin(new LoginButtonSkin(signUpButton));
}
/**
* Handles when the user clicks on the login button.
* it checks if the username and password fields are filled
* and gives alerts if they aren't filled in.
* @param event the click of the login button
* @throws IOException an exception for logging in the user
*/
@FXML
protected void handleLoginButtonAction(ActionEvent event)
throws IOException, NoSuchAlgorithmException {
Window owner = loginButton.getScene().getWindow(); //get the current window
if (usernameField.getText().isEmpty()) {
AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Log-in Error!",
"Please enter your username");
//checks if the username field is filled,
// and gives an alert if it is not
return;
} else {
System.out.println("Username is " + usernameField.getText());
}
if (passwordField.getText().isEmpty()) {
AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Log-in Error!",
"Please enter a password");
//checks if the password field is filled,
// and gives an alert if it is not.
return;
} else {
System.out.println("Password is " + passwordField.getText());
}
//log the user in with the userService method
try {
userService.loginUser(usernameField.getText(), passwordField.getText());
} catch (HttpClientErrorException ex) {
AlertHelper.showAlert(Alert.AlertType.ERROR, owner, "Log-in Error!",
"Your username or password is incorrect!");
return;
}
Stage current = (Stage) owner;
//after logging in, close the login window
current.close();
//open the other dashboard window
openDashboard();
}
/**
* Opens the dashboard stage.
* @throws IOException exception if fxml file can't be found
* @author sem
*/
private void openDashboard() throws IOException {
//load the fxml file
Parent dash = Application.load(this.getClass().getClassLoader()
.getResource("fxml/dashboard.fxml"));
Scene scene = new Scene(dash);
//add the stylesheet for the CSS
scene.getStylesheets().add(Objects.requireNonNull(getClass().getClassLoader()
.getResource("stylesheets/dashboardStyle.css")).toExternalForm());
Stage appStage = new Stage();
appStage.setScene(scene);
//set the title
appStage.setTitle("Greenify - " + usernameField.getText());
appStage.show();
}
/**
* Class for showing the alerts.
*/
static class AlertHelper {
/**
* alerts for the login screen.
* @param alertType the type of alert
* @param owner the owner (window) of the alert
* @param title the title given to the displayed alert
* @param message the message displayed in the alert
*/
static void showAlert(Alert.AlertType alertType,
Window owner,
String title,
String message) {
Alert alert = new Alert(alertType);
alert.setTitle(title);
alert.setHeaderText(null);
alert.setContentText(message);
alert.initOwner(owner);
alert.show();
}
}
/**
* The method handles the clicking of the register button.
* it then opens the register window where the user can register
* (handled by RegisterWindowController)
* @param event User clicks on the button
* @throws Exception when the fxml file couldn't be found
*/
public void handleRegisterButtonAction(ActionEvent event) throws Exception {
Parent registerWindow = Application.load(this.getClass().getClassLoader()
.getResource("fxml/RegisterWindow.fxml"));
Scene registerScene = new Scene(registerWindow);
registerScene.getStylesheets().add(this.getClass().getClassLoader()
.getResource("stylesheets/registerWindowStyle.css").toExternalForm());
Stage registerStage = new Stage();
registerStage.setScene(registerScene);
registerStage.setTitle("Enter register credentials");
registerStage.show();
}
@SuppressWarnings("Duplicates")
public class LoginButtonSkin extends ButtonSkin {
/**
* method for the skin of login button.
* @param button clicking
*/
public LoginButtonSkin(Button button) {
super(button);
ScaleTransition scaleUp = new ScaleTransition(Duration.millis(140));
scaleUp.setToX(1.1);
scaleUp.setToY(1.1);
scaleUp.setNode(button);
button.setOnMouseEntered(e -> scaleUp.playFromStart());
ScaleTransition scaleMiddleDown = new ScaleTransition(Duration.millis(50));
scaleMiddleDown.setFromX(1.1);
scaleMiddleDown.setFromY(1.1);
scaleMiddleDown.setToX(1.05);
scaleMiddleDown.setToY(1.05);
scaleMiddleDown.setNode(button);
button.setOnMousePressed(e -> scaleMiddleDown.playFromStart());
ScaleTransition scaleMiddleUp = new ScaleTransition(Duration.millis(50));
scaleMiddleUp.setFromX(1.05);
scaleMiddleUp.setFromY(1.05);
scaleMiddleUp.setToX(1.1);
scaleMiddleUp.setToY(1.1);
scaleMiddleUp.setNode(button);
button.setOnMouseReleased(e -> scaleMiddleUp.playFromStart());
ScaleTransition scaleDown = new ScaleTransition(Duration.millis(200));
scaleDown.setToX(1.0);
scaleDown.setToY(1.0);
scaleDown.setNode(button);
button.setOnMouseExited(e -> scaleDown.playFromStart());
}
}
}

View File

@@ -0,0 +1,48 @@
package greenify.client.features;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
public class Friend {
private SimpleIntegerProperty place;
private SimpleStringProperty friend;
private SimpleDoubleProperty score;
/**
* Constructor for a friend.
* @param place place in the leaderboard
* @param friend name of the user
* @param friendScore score of the user
*/
public Friend(Integer place, String friend, Double friendScore) {
this.place = new SimpleIntegerProperty(place);
this.friend = new SimpleStringProperty(friend);
this.score = new SimpleDoubleProperty(friendScore);
}
public Integer getPlace() {
return place.get();
}
public void setPlace(Integer place) {
this.place = new SimpleIntegerProperty(place);
}
public String getFriend() {
return friend.get();
}
public void setFriend(String name) {
this.friend = new SimpleStringProperty(name);
}
public Double getScore() {
return score.get();
}
public void setScore(Double score) {
this.score = new SimpleDoubleProperty(score);
}
}

View File

@@ -0,0 +1,92 @@
package greenify.client.features;
import java.util.ArrayList;
import java.util.Random;
public class Hints {
public ArrayList<String> hints;
public Hints() {
this.hints = new ArrayList<String>();
initHints();
}
/**
* This method adds all the Strings to the array list.
*/
private void initHints() {
this.hints.add("Buying local produce will not only decrease your carbon "
+ "footprint, but it will also help your local economy: A win-win!");
this.hints.add("Did you know that a gas oven only uses 6% of its energy "
+ "to cook? And an electric oven is not much better at 12%!");
this.hints.add("70% of the deforestation of the Amazon rainforest is to provide land "
+ "for cattle ranches.");
this.hints.add("Research shows that reducing meat consumption can "
+ "increase your life span by 3,6 years");
this.hints.add("Vegetarians have a lower risk of getting: Heart disease, high blood "
+ "pressure, diabetes and cancer than meat eaters.");
this.hints.add("The carbon footprint of a vegetarian diet is about half "
+ "that of a meat-lovers diet!");
this.hints.add("Cycling is good for the environment and for your body, "
+ "so why not grab your bike instead of your car?");
this.hints.add("If we could capture all of the suns energy shining on the Earth for just "
+ "one hour, we could power the entire world for one whole year!");
this.hints.add("27,000 trees are cut down every day so we can have toilet paper.");
this.hints.add("Recycle glass bottles! A glass bottle made now will take "
+ "more than 4,000 years to decompose.");
this.hints.add("Don't forget to turn off the lights and heating in rooms"
+ " you're not using at the moment. Save some energy!");
this.hints.add("Did you know that about 4,5% of the Dutch population does not eat meat?");
this.hints.add("Reuse your bags when you go grocery shopping. You will save "
+ "plastic bags and won't have a lot of unused bags at home!");
this.hints.add("An estimated 250 million trees can be saved each year "
+ "if every published newspaper would be recycled!");
this.hints.add("About 88,000 jobs were created in 2015 through the wind power sector. "
+ "That is a lot of jobs");
this.hints.add("You can use LED lights in your home to save energy! "
+ "They make light from about 85% of their energy");
this.hints.add("If you isolate your home well, it will be warmer, "
+ "and you'll save energy as well! No need to wear sweaters anymore");
this.hints.add("Do you have leftovers? Donate them to food kitchens."
+ " This way you won't waste"
+ " food, and you'll help a lot of people at the same time!");
this.hints.add("A lot of coffee places give you a discount if you bring your own cup. "
+ "Get rid of disposable cups!");
this.hints.add("When shopping, look for products with minimal to no packaging, "
+ "or packaging made from recycled items. ");
this.hints.add("If you order food, you can ask the restaurant to not include "
+ "utensils and napkins, it saves plastic and paper!");
this.hints.add("It takes about 66 days to form a new habit, keep going, you'll get there!");
this.hints.add("Get yourself a nice reusable water bottle! It's cheaper and better for "
+ "the environment to refill than to buy one every time it's empty.");
this.hints.add("Only 1% of our planets water supply can be used a drinkwater."
+ " 97% is ocean water and 2% is frozen solid in the Arctic, for now.");
this.hints.add("For every two million tons of paper and glass, collected in "
+ "the Netherlands, close to 90% gets recycled and used to make new products");
this.hints.add("In the Netherlands: Whenever you purchase any new, electronic or household "
+ "equipment, you will automatically be charged a recycling tax on it. This is "
+ "also known as removal tax, or verwijderingsbijdrage in Dutch");
this.hints.add("Second only to Germany, the Netherlands leads the world in recycling"
+ ", with 65 percent of all waste recycled.");
this.hints.add("If tbe back of your fridge is dusty, it can increase "
+ "energy consumption by 30 per cent.");
this.hints.add("Underinflated tyres decrease fuel economy by up to three percent and"
+ " lead to increased pollution and higher greenhouse gas emissions.");
this.hints.add("Meat production is extremely resource-intensive. "
+ "If you gave it up just once a week, you would save the 840 gallons "
+ "of fresh water it takes to produce a single serving.");
this.hints.add("Plastic bad, very bad.");
}
/**
* This seeks out a random hint from the list of strings.
* @return the random string hint.
*/
public String randomHint() {
Random rand = new Random();
int index = rand.nextInt(this.hints.size());
return this.hints.get(index);
}
}

View File

@@ -0,0 +1,394 @@
package greenify.client.rest;
import greenify.common.UserDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;
@Service
public class UserService {
public UserDto currentUser;
@Value( "${server.address:http://localhost:8080}" )
String serverAddress = "http://localhost:8080";
@Autowired
RestTemplate restTemplate;
@Bean
RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}
/**
* Registers the user.
* @param name the username of the user
* @param password the password of the user
* @return a userDTO
*/
@SuppressWarnings("Duplicates")
//this suppressWarnings is to get rid of the errors of duplicate code
//because the methods are very similar
public UserDto registerUser(String name, String password) throws NoSuchAlgorithmException {
//headers for http
HttpHeaders headers = new HttpHeaders();
//set the accept header in JSON value
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
//connect to the server with the needed url
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/registerUser")
.queryParam("name", name)
//getting the name from the database
.queryParam("password", hashPassword(password));
//getting the password from the database
//create a http entity to be sent
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
//the result to be sent is a userDto
//encodes the userDTO object to a Uri so the database can work with it
UserDto result = this.restTemplate.getForObject(builder.build()
.encode().toUri(), UserDto.class);
this.currentUser = result;
return result;
}
/**
* Signs in the user.
* @param name the username of the user
* @param password the password of the user
* @return a userDTO
*/
@SuppressWarnings("Duplicates")
public UserDto loginUser(String name, String password) throws NoSuchAlgorithmException {
//this method is almost the same as the registerUser one, but with a different link
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/loginUser")
.queryParam("name", name)
.queryParam("password", hashPassword(password));
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
UserDto result = this.restTemplate.getForObject(builder.build()
.encode().toUri(), UserDto.class);
this.currentUser = result;
return result;
}
/**
* Updates the input of the user.
* @param name name of the user
* @param inputName name of the input
* @param value value of the input
*/
@SuppressWarnings("Duplicates")
public void updateInput(String name, String inputName, String value) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(serverAddress + "/setInput")
.queryParam("name", name)
.queryParam("inputName", inputName)
.queryParam("value",value);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
ResponseEntity<String> authenticateResponse = this.restTemplate.getForEntity(builder.build()
.encode().toUri(), String.class);
}
/**
* Updates the extra input of the user.
* @param name name of the user
* @param inputName name of the input
* @param value value of the input
*/
@SuppressWarnings("Duplicates")
public void updateExtraInput(String name, String inputName, String value) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/setExtraInput")
.queryParam("name", name)
.queryParam("inputName", inputName)
.queryParam("value", value);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
ResponseEntity<String> authenticateResponse = this.restTemplate.getForEntity(builder.build()
.encode().toUri(), String.class);
}
/**
* Gets the footprint of the user.
* @param name name of the user
* @return returns the footprint score
*/
@SuppressWarnings("Duplicates")
public double getFootprint(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getFootprint")
.queryParam("name", name);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Float footprint = this.restTemplate.getForObject(builder
.build().encode().toUri(), Float.class);
double result = Math.round(footprint * 10) / 10.0;
return result;
}
/**
* Gets the first footprint of the user.
* @param name name of the user
* @return returns the footprint score
*/
public double getFirstFootprint(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(serverAddress + "/getFirst")
.queryParam("name", name);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Float footprint = this.restTemplate.getForObject(builder
.build().encode().toUri(), Float.class);
double result = Math.round(footprint * 10) / 10.0;
return result;
}
/**
* Saves the footprint of the user.
* @param name name of the user
* @return returns the footprint score
*/
@SuppressWarnings("Duplicates")
public Float saveFootprint(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/saveFootprint")
.queryParam("name", name);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Float result = this.restTemplate.getForObject(builder
.build().encode().toUri(), Float.class);
return result;
}
/**
* Saves the first footprint of the user.
* @param name name of the user
* @return returns the footprint score
*/
@SuppressWarnings("Duplicates")
public Float saveFirstFootprint(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/saveFirstFootprint")
.queryParam("name", name);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Float result = this.restTemplate.getForObject(builder
.build().encode().toUri(), Float.class);
return result;
}
/**
* Gets the friend list of the user.
* @param name name of the user
* @return returns the friend list
*/
@SuppressWarnings("Duplicates")
public List<String> getFriendNames(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getFriends")
.queryParam("name", name);
new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
List<String> result = this.restTemplate.getForObject(builder
.build().encode().toUri(), List.class);
return result;
}
/**
* Adds a friend to the user.
* @param name the username of the current user.
* @param friend the username of the friend you want to add.
*/
@SuppressWarnings("Duplicates")
public void addFriend(String name, String friend) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/addFriend")
.queryParam("name", name)
.queryParam("friend",friend);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
ResponseEntity<String> authenticateResponse = this.restTemplate.getForEntity(builder.build()
.encode().toUri(), String.class);
}
/**
* Removes a friend from the friendslist of the user.
* @param name the username of the current user.
* @param friend the username of the friend you want to remove.
*/
@SuppressWarnings("Duplicates")
public void removeFriend(String name, String friend) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/removeFriend")
.queryParam("name", name)
.queryParam("friend",friend);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
ResponseEntity<String> authenticateResponse = this.restTemplate.getForEntity(builder.build()
.encode().toUri(), String.class);
}
/**
* Gets the footprint inputs of the user.
* @param name the username of the current user.
*/
@SuppressWarnings("Duplicates")
public Map<String, String> getInputs(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getInputs")
.queryParam("name", name);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Map<String, String> result = this.restTemplate.getForObject(builder.build()
.encode().toUri(), Map.class);
return result;
}
/**
* Gets the footprint inputs of the user.
* @param name the username of the current user.
*/
@SuppressWarnings("Duplicates")
public Map<String, String> getExtraInputs(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getExtraInputs")
.queryParam("name", name);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
Map<String, String> result = this.restTemplate.getForObject(builder.build()
.encode().toUri(), Map.class);
return result;
}
/**
* Gets the achievements of a user.
* @param name name of the user
* @return Map with all achievements
*/
@SuppressWarnings("Duplicates")
public Map getAchievements(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getAchievements")
.queryParam("name", name);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
return this.restTemplate.getForObject(builder.build()
.encode().toUri(), Map.class);
}
/**
* Gets the results of a user.
* @param name name of the user
* @return Map with all results
*/
@SuppressWarnings("Duplicates")
public Map<String, String> getResults(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getResults")
.queryParam("name", name);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
return this.restTemplate.getForObject(builder.build()
.encode().toUri(), Map.class);
}
/**
* Gets the list of all users.
*/
@SuppressWarnings("Duplicates")
public List<String> getAllUsers() {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/getAllUsers");
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
List<String> result = this.restTemplate.getForObject(builder
.build().encode().toUri(), List.class);
return result;
}
/**
* Removes a user from the database.
* @param name the username of the current user.
*/
@SuppressWarnings("Duplicates")
public void deleteAccount(String name) {
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(serverAddress + "/deleteAccount")
.queryParam("name", name);
HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri());
ResponseEntity<String> authenticateResponse = this.restTemplate.getForEntity(builder.build()
.encode().toUri(), String.class);
}
/**
* Hashes the password of a user.
* @param password password of the user
* @return hashed password
* @throws NoSuchAlgorithmException when there is no such algorithm
*/
public String hashPassword(String password)
throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] encodedHash = digest.digest(password.getBytes(StandardCharsets.UTF_8));
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < encodedHash.length; i++) {
String hex = Integer.toHexString(0xff & encodedHash[i]);
if (hex.length() == 1) {
hexString.append('0');
}
hexString.append(hex);
}
return hexString.toString();
}
}

View File

@@ -1,34 +0,0 @@
package main.java.hello;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
/*
Application that connects to the server
*/
@SpringBootApplication
public class Application {
private static final Logger log = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) {
SpringApplication.run(Application.class);
}
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}
@Bean
public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
return args -> {
Message message = restTemplate.getForObject("http://localhost:8080/greeting?name=Ceren", Message.class);
log.info(message.toString());
};
}
}

View File

@@ -1,37 +0,0 @@
package main.java.hello;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Message {
private long id;
private String content;
public Message() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public String toString() {
return "Message{"
+ "id='" + id + '\''
+ ", content=" + content
+ '}';
}
}

View File

@@ -0,0 +1 @@
logging.level.org.springframework.beans.factory=DEBUG

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<AnchorPane prefHeight="287.0" prefWidth="187.0" style="-fx-background-color: #e2f0c8;" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="greenify.client.controller.FriendController">
<children>
<Text fill="#00650d" layoutX="114.0" layoutY="64.0" strokeType="OUTSIDE" strokeWidth="0.0" text="Add Friend" textAlignment="CENTER" wrappingWidth="234.96600341796875">
<font>
<Font size="36.0" />
</font>
</Text>
<TextField fx:id="userNameText" layoutX="140.0" layoutY="100.0" prefHeight="35.0" prefWidth="183.0" promptText="Username">
<font>
<Font size="13.0" />
</font>
</TextField>
<Button fx:id="addButton" layoutX="206.0" layoutY="154.0" mnemonicParsing="false" onAction="#addFriend" style="-fx-background-color: #005e07;" text="Add!" textFill="#c4eec9">
<font>
<Font name="Corbel Bold" size="14.0" />
</font>
</Button>
<ImageView fitHeight="80.0" fitWidth="349.0" layoutY="211.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/grass.png"/>
</image>
</ImageView>
<ImageView fitHeight="150.0" fitWidth="200.0" layoutY="43.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/friends.png" />
</image>
</ImageView>
</children>
</AnchorPane>

Some files were not shown because too many files have changed in this diff Show More