69 lines
1.9 KiB
Java
69 lines
1.9 KiB
Java
package fabrik.simulator.pic16f84;
|
|
|
|
import fabrik.simulator.pic16f84.interfaces.*;
|
|
import javafx.application.Application;
|
|
|
|
import javafx.fxml.FXMLLoader;
|
|
import javafx.scene.Parent;
|
|
import javafx.scene.Scene;
|
|
|
|
import javafx.scene.layout.GridPane;
|
|
import javafx.scene.layout.VBox;
|
|
import javafx.stage.Stage;
|
|
|
|
import java.io.IOException;
|
|
import java.util.Objects;
|
|
|
|
public class CreateWindow extends Application implements WindowManagement {
|
|
private static PICComponentLocator picComponents; // Subjekt
|
|
public static GridPane grid = new GridPane();
|
|
private static VBox table;
|
|
|
|
@Override
|
|
public void start(Stage primaryStage) throws IOException {
|
|
picComponents.registerComponent(FrontendControllerInterface.class, new Controller_Frontend());
|
|
picComponents.initAll();
|
|
|
|
FXMLLoader codewindow = new FXMLLoader(CreateWindow.class.getResource("frontend.fxml"));
|
|
codewindow.setController(picComponents.getComponent(FrontendControllerInterface.class));
|
|
Parent code = codewindow.load();
|
|
|
|
table = Table.init(picComponents);
|
|
grid.add(table, 1, 1);
|
|
grid.add(code, 0, 1);
|
|
|
|
grid.relocate(0, 0);
|
|
|
|
grid.getStylesheets().add(Objects.requireNonNull(getClass().getResource("styles.css")).toExternalForm());
|
|
Scene scene = new Scene(grid, 1845, 800);
|
|
primaryStage.setScene(scene);
|
|
primaryStage.setTitle("Simulator");
|
|
primaryStage.show();
|
|
}
|
|
|
|
public void startFromMain(String[] args){
|
|
launch(args);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
launch(args);
|
|
}
|
|
|
|
public static void refreshTable() {
|
|
grid.getChildren().remove(table);
|
|
table= Table.refresh();
|
|
grid.add(table, 1, 1);
|
|
}
|
|
|
|
@Override
|
|
public void initialize(PICComponentLocator picComponents) {
|
|
CreateWindow.picComponents = picComponents;
|
|
}
|
|
|
|
public CreateWindow (){
|
|
|
|
}
|
|
}
|
|
|
|
|