Commit bd827059 authored by William Sha's avatar William Sha
Browse files

Merge branch 'fix/v2/notifyControllers' into 'int/v2'

Fix/v2/notify controllers

See merge request !50
parents eff578c0 7c38b1aa
......@@ -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
......
......@@ -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));
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment