You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
package modele;
|
|
|
|
import javafx.beans.property.ObjectProperty;
|
|
import javafx.beans.property.SimpleObjectProperty;
|
|
import javafx.beans.property.SimpleStringProperty;
|
|
import javafx.beans.property.StringProperty;
|
|
import javafx.scene.image.Image;
|
|
|
|
import java.io.IOException;
|
|
|
|
public class CapteurImage extends Capteur{
|
|
|
|
private final ObjectProperty<Image> image = new SimpleObjectProperty<>();
|
|
public ObjectProperty<Image> imageProperty() {return image;}
|
|
public void setImage(Image image) {this.image.set(image);}
|
|
|
|
public CapteurImage(float temp, String nom) {
|
|
super(temp, nom);
|
|
genTemp(temp);
|
|
}
|
|
|
|
@Override
|
|
public void genTemp(float x){
|
|
setTemperature(x);
|
|
if (getTemperature()<0){
|
|
setImage(new Image("/Assets/hilarious-snow-memes.jpg"));
|
|
}
|
|
else if(getTemperature()<22){
|
|
setImage(new Image("https://www.francetvinfo.fr/pictures/sbviI2swQTsA1oabZGCUO9wWajQ/1200x900/2017/08/30/phppmKyIc_1.jpg"));
|
|
}
|
|
else{
|
|
setImage(new Image("/Assets/this-is-fine.png"));
|
|
}
|
|
}
|
|
}
|