Search in sources :

Example 1 with SosSensor

use of il.ac.technion.cs.smarthouse.sensors.sos.SosSensor in project Smartcity-Smarthouse by TechnionYP5777.

the class SosSensorSimulator method start.

@Override
public void start(final Stage s) throws Exception {
    sensor = new SosSensor(Random.sensorId(), 40001);
    for (boolean res = false; !res; ) res = sensor.register();
    final Image sosImage = new Image(getClass().getResourceAsStream("/sensors/sos/sos_icon.png"), 320, 0, true, true);
    final Button sosButton = new Button();
    sosButton.setId("sosButton");
    sosButton.setGraphic(new ImageView(sosImage));
    sosButton.setStyle("-fx-focus-color: transparent;");
    sosButton.setOnAction(event -> sensor.updateSystem());
    final StackPane layout = new StackPane();
    layout.getChildren().add(sosButton);
    s.setScene(new Scene(layout, 320, 268));
    s.setTitle("SOS Sensor Simulator");
    s.show();
}
Also used : SosSensor(il.ac.technion.cs.smarthouse.sensors.sos.SosSensor) Button(javafx.scene.control.Button) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

SosSensor (il.ac.technion.cs.smarthouse.sensors.sos.SosSensor)1 Scene (javafx.scene.Scene)1 Button (javafx.scene.control.Button)1 Image (javafx.scene.image.Image)1 ImageView (javafx.scene.image.ImageView)1 StackPane (javafx.scene.layout.StackPane)1