update indicator on user state change
This commit is contained in:
parent
312bbaa5a6
commit
f544711bfb
1 changed files with 10 additions and 1 deletions
|
@ -18,7 +18,7 @@ public class UserActiveIndicatorController implements Initializable {
|
|||
|
||||
}
|
||||
|
||||
public void setUser(PeerUser user) {
|
||||
private void updateState(PeerUser user) {
|
||||
circle.getStyleClass().clear();
|
||||
if (user.isActive()) {
|
||||
circle.getStyleClass().add("active-user-dot");
|
||||
|
@ -27,6 +27,15 @@ public class UserActiveIndicatorController implements Initializable {
|
|||
}
|
||||
}
|
||||
|
||||
public void setUser(PeerUser user) {
|
||||
user.addObserver(propertyChangeEvent -> {
|
||||
if (propertyChangeEvent.getPropertyName().equals("state")) {
|
||||
updateState(user);
|
||||
}
|
||||
});
|
||||
updateState(user);
|
||||
}
|
||||
|
||||
public void setSize(double value) {
|
||||
circle.setRadius(value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue