mirror of
https://github.com/Akomry/sae302_applicom.git
synced 2025-12-06 11:43:53 +00:00
feat(contact): Début de création du modèle des contacts, jusqu'à "equals", toString à finir
This commit is contained in:
parent
e75e5485ff
commit
45f18e9309
3 changed files with 44 additions and 1 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
43
chat/src/main/java/rtgre/modeles/Contact.java
Normal file
43
chat/src/main/java/rtgre/modeles/Contact.java
Normal 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;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue