use of il.ac.technion.cs.smarthouse.simulator.model.SensorData in project Smartcity-Smarthouse by TechnionYP5777.
the class RoomViewController method addSensor.
private void addSensor(final double x, final double y) {
final TextInputDialog dialog = new TextInputDialog("sensor name");
dialog.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("Homeicon.png"))));
dialog.setTitle("Create Sensor");
dialog.setHeaderText("Config your simulator");
dialog.setContentText("Please enter sensor name:");
final Optional<String> result = dialog.showAndWait();
if (!result.isPresent())
return;
final String name = result.get();
final SensorLabel label = new SensorLabel(x, y, name);
final SensorData sensor = new SensorData(name, label, location);
mainController.addSensor(sensor);
RoomViewController.this.labels.add(label);
pane.getChildren().add(label);
}
Aggregations