Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. public class SobrietyController implements Initializable {
  2.    
  3.     //@FXML
  4.     //private ImageView imgDistance;
  5.     //@FXML
  6.     //private ImageView imgAlcohol;
  7.     @FXML
  8.     private LineChart distanceChart;
  9.     @FXML
  10.     private Label alcoholLabel;
  11.     @FXML
  12.     private Label distanceLabel;
  13.    
  14.     @Override
  15.     public void initialize(URL url, ResourceBundle rb) {
  16.         ThingsClientREST thingsClient11 = new ThingsClientREST("192.168.1.11");
  17.         ThingsClientREST thingsClient12 = new ThingsClientREST("192.168.1.12");
  18.  
  19.         // Alcohol Monitor
  20.         AlcoholMonitor alcoholMonitor = new AlcoholMonitor(thingsClient12.createTarget());
  21.         alcoholLabel.textProperty().bind(alcoholMonitor.alcoholProperty());
  22.         alcoholMonitor.start();
  23.        
  24.         // Distance Monitor
  25.         DistanceMonitor distanceMonitor = new DistanceMonitor(thingsClient11.createTarget(), distanceChart);
  26.         distanceLabel.textProperty().bind(distanceMonitor.distanceProperty());
  27.         distanceMonitor.start();
  28. }