diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 71f77f4..5ffed27 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -5,7 +5,6 @@ */ public class Main { public static void main(String[] args){ - SecondOrderSystem G = new SecondOrderSystem("G"); - G.start(); + } } diff --git a/src/main/java/gui/Gui.java b/src/main/java/gui/Gui.java index f41d56e..8998d90 100644 --- a/src/main/java/gui/Gui.java +++ b/src/main/java/gui/Gui.java @@ -2,18 +2,22 @@ import javafx.beans.property.*; import javafx.fxml.FXML; +import javafx.fxml.FXMLLoader; import javafx.scene.chart.CategoryAxis; import javafx.scene.chart.LineChart; import javafx.scene.chart.NumberAxis; import javafx.scene.chart.XYChart; import javafx.scene.control.Button; import javafx.scene.control.TextField; +import javafx.scene.layout.AnchorPane; + +import java.io.IOException; import java.sql.Timestamp; /** * Created by marlon on 6/16/14. */ -public class Gui { +public class Gui extends AnchorPane{ private static final int TRENDING_DATA_LIMIT = 50; private static final long SAMPLING_TIME = 500; @@ -35,6 +39,15 @@ public class Gui { private final XYChart.Series systemOutput = new XYChart.Series<>(); public Gui() { + try { + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("Gui.fxml")); + fxmlLoader.setRoot(this); + fxmlLoader.setController(this); + fxmlLoader.load(); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + output = new SimpleDoubleProperty(this, "systemOutput", 0.0); lastUpdate = System.currentTimeMillis(); timestamp = new ObjectPropertyBase(new Timestamp(System.currentTimeMillis())) {