feat(contact): Début de création du modèle des contacts, jusqu'à "equals", toString à finir

This commit is contained in:
bouclyma 2024-12-05 12:01:19 +01:00
parent e75e5485ff
commit 45f18e9309
3 changed files with 44 additions and 1 deletions

View file

@ -2,6 +2,7 @@ module rtgre.chat {
requires javafx.controls; requires javafx.controls;
requires javafx.fxml; requires javafx.fxml;
requires java.logging; requires java.logging;
requires java.desktop;
opens rtgre.chat to javafx.fxml; opens rtgre.chat to javafx.fxml;

View file

@ -67,7 +67,6 @@ public class ChatController implements Initializable {
while (true) { while (true) {
try { try {
String datetime = "%1$ta %1$te %1$tb %1$tY - %1$tH:%1$tM".formatted(new Date()); String datetime = "%1$ta %1$te %1$tb %1$tY - %1$tH:%1$tM".formatted(new Date());
// System.out.println(datetime);
Platform.runLater(() -> dateTimeLabel.setText(datetime)); Platform.runLater(() -> dateTimeLabel.setText(datetime));
Thread.sleep(60000); Thread.sleep(60000);
} catch (Exception e) { } catch (Exception e) {

View file

@ -0,0 +1,43 @@
package rtgre.modeles;
public class Contact {
protected String login;
protected java.awt.Image avatar;
protected boolean connected;
protected String currentRoom;
Contact(String login, java.awt.Image avatar) {
this.login = login;
this.avatar = avatar;
this.connected = false;
this.currentRoom = null;
}
public String getLogin() {
return this.login;
}
public java.awt.Image getAvatar() {
return this.avatar;
}
@Override
public String toString() {
return "";
}
public void setConnected(boolean connected) {
this.connected = connected;
}
public boolean equals(Object o) {return true;}
/*if (this.login == o.login) {
return true;
} else {
return false;
}
}*/
}