Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alexandre Ducarne
ai12-othello
Commits
bd827059
Commit
bd827059
authored
Nov 29, 2019
by
William Sha
Browse files
Merge branch 'fix/v2/notifyControllers' into 'int/v2'
Fix/v2/notify controllers See merge request
!50
parents
eff578c0
7c38b1aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/client/main/DataToMainImpl.java
View file @
bd827059
...
...
@@ -55,11 +55,14 @@ public class DataToMainImpl implements IDataToMain {
for
(
GameLight
game
:
gameList
)
{
this
.
getController
().
getFX
().
getModel
().
addGameInList
(
game
);
}
this
.
getController
().
getFX
().
getModel
().
notifyControllers
();
}
@Override
public
void
updateUserList
(
UserLight
user
)
{
this
.
getController
().
getFX
().
getModel
().
addUserInList
(
user
);
this
.
getController
().
getFX
().
getModel
().
notifyControllers
();
}
@Override
...
...
src/main/java/client/main/controller/FXHome.java
View file @
bd827059
...
...
@@ -59,9 +59,6 @@ public class FXHome {
}
public
void
updateData
()
{
// TODO : remove mock when real data update is possible
System
.
out
.
println
(
"updateUsersListWithMock"
);
// Add some sample data.
homeListViewUsersOnlineData
.
clear
();
for
(
int
i
=
0
;
i
<
this
.
model
.
getUsersList
().
size
();
i
++)
{
homeListViewUsersOnlineData
.
add
(
this
.
model
.
getUsersList
().
get
(
i
));
...
...
src/main/java/client/main/model/MainApplicationModel.java
View file @
bd827059
...
...
@@ -25,7 +25,6 @@ public class MainApplicationModel {
public
void
setUserLight
(
UserLight
userLight
)
{
this
.
userLight
=
userLight
;
this
.
notifyControllers
();
}
public
List
<
UserLight
>
getUsersList
()
{
...
...
@@ -38,17 +37,14 @@ public class MainApplicationModel {
public
void
addUserInList
(
UserLight
user
)
{
this
.
getUsersList
().
add
(
user
);
this
.
notifyControllers
();
}
public
void
addGameInList
(
GameLight
game
)
{
this
.
getGamesList
().
add
(
game
);
this
.
notifyControllers
();
}
public
UserLight
removeUserInList
()
{
UserLight
userRemoved
=
this
.
getUsersList
().
remove
(
this
.
getUsersList
().
size
()
-
1
);
this
.
notifyControllers
();
return
userRemoved
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment