Create Main Class
This commit is contained in:
@ -14,25 +14,14 @@ import javafx.stage.Stage;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class CreateWindow extends Application {
|
public class CreateWindow extends Application implements WindowManagement {
|
||||||
private PICComponentLocator picComponents = new PICComponentLocator(); // Subjekt
|
private static PICComponentLocator picComponents; // Subjekt
|
||||||
public static GridPane grid = new GridPane();
|
public static GridPane grid = new GridPane();
|
||||||
private static VBox table;
|
private static VBox table;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start(Stage primaryStage) throws IOException {
|
public void start(Stage primaryStage) throws IOException {
|
||||||
|
|
||||||
picComponents.registerComponent(CommandInterface.class, new Commands());
|
|
||||||
picComponents.registerComponent(ToggleButtonInterface.class, new ToggleButtonGroupExt());
|
|
||||||
picComponents.registerComponent(FrontendControllerInterface.class, new Controller_Frontend());
|
picComponents.registerComponent(FrontendControllerInterface.class, new Controller_Frontend());
|
||||||
picComponents.registerComponent(DataRegisterInterface.class, new DataRegister());
|
|
||||||
picComponents.registerComponent(EEPROMInterface.class, new EEPROM());
|
|
||||||
picComponents.registerComponent(InterruptInterface.class, new Interrupts());
|
|
||||||
picComponents.registerComponent(IOPortInterface.class, new IOPorts());
|
|
||||||
picComponents.registerComponent(PreScalerInterface.class, new PreScaler());
|
|
||||||
picComponents.registerComponent(ProgramStackInterface.class, new ProgramStack());
|
|
||||||
picComponents.registerComponent(TimerInterface.class, new Timer());
|
|
||||||
picComponents.registerComponent(WatchdogTimerInterface.class, new WatchdogTimer());
|
|
||||||
picComponents.initAll();
|
picComponents.initAll();
|
||||||
|
|
||||||
FXMLLoader codewindow = new FXMLLoader(CreateWindow.class.getResource("frontend.fxml"));
|
FXMLLoader codewindow = new FXMLLoader(CreateWindow.class.getResource("frontend.fxml"));
|
||||||
@ -52,6 +41,10 @@ public class CreateWindow extends Application {
|
|||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void startFromMain(String[] args){
|
||||||
|
launch(args);
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
launch(args);
|
launch(args);
|
||||||
}
|
}
|
||||||
@ -61,7 +54,15 @@ public class CreateWindow extends Application {
|
|||||||
table= Table.refresh();
|
table= Table.refresh();
|
||||||
grid.add(table, 1, 1);
|
grid.add(table, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initialize(PICComponentLocator picComponents) {
|
||||||
|
CreateWindow.picComponents = picComponents;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CreateWindow (){
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
25
src/main/java/fabrik/simulator/pic16f84/Main.java
Normal file
25
src/main/java/fabrik/simulator/pic16f84/Main.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package fabrik.simulator.pic16f84;
|
||||||
|
|
||||||
|
import fabrik.simulator.pic16f84.interfaces.*;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
private static final PICComponentLocator picComponents = new PICComponentLocator(); // Subjekt
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
picComponents.registerComponent(CommandInterface.class, new Commands());
|
||||||
|
picComponents.registerComponent(ToggleButtonInterface.class, new ToggleButtonGroupExt());
|
||||||
|
picComponents.registerComponent(DataRegisterInterface.class, new DataRegister());
|
||||||
|
picComponents.registerComponent(EEPROMInterface.class, new EEPROM());
|
||||||
|
picComponents.registerComponent(InterruptInterface.class, new Interrupts());
|
||||||
|
picComponents.registerComponent(IOPortInterface.class, new IOPorts());
|
||||||
|
picComponents.registerComponent(PreScalerInterface.class, new PreScaler());
|
||||||
|
picComponents.registerComponent(ProgramStackInterface.class, new ProgramStack());
|
||||||
|
picComponents.registerComponent(TimerInterface.class, new Timer());
|
||||||
|
picComponents.registerComponent(WatchdogTimerInterface.class, new WatchdogTimer());
|
||||||
|
CreateWindow window = new CreateWindow();
|
||||||
|
picComponents.registerComponent(WindowManagement.class, window);
|
||||||
|
picComponents.initAll();
|
||||||
|
|
||||||
|
window.startFromMain(new String[]{});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
package fabrik.simulator.pic16f84.interfaces;
|
package fabrik.simulator.pic16f84.interfaces;
|
||||||
|
|
||||||
public interface WindowManagement extends PICComponentInterface {
|
public interface WindowManagement extends PICComponentInterface {
|
||||||
void refreshTable();
|
static void refreshTable() {}
|
||||||
|
|
||||||
|
static void startFromMain(String[] args) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import java.nio.file.Files;
|
|||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
|
|
||||||
@ -133,5 +132,4 @@ class EEPROMTests {
|
|||||||
|
|
||||||
assertEquals(0, result);
|
assertEquals(0, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user