first commit
This commit is contained in:
45
src/main/java/id/co/gtc/erhacam/MainApplication.java
Normal file
45
src/main/java/id/co/gtc/erhacam/MainApplication.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package id.co.gtc.erhacam;
|
||||
|
||||
import Config.SomeCodes;
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.geometry.Rectangle2D;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
import org.tinylog.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static Config.SomeCodes.config;
|
||||
|
||||
|
||||
public class MainApplication extends Application {
|
||||
@Override
|
||||
public void start(Stage stage) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(MainApplication.class.getResource("main-view.fxml"));
|
||||
Screen screen = Screen.getPrimary();
|
||||
Rectangle2D screenbound = screen.getVisualBounds();
|
||||
Scene scene = new Scene(fxmlLoader.load(), screenbound.getWidth(), screenbound.getHeight());
|
||||
stage.setTitle("MultiCam Capture App for ERHA");
|
||||
stage.setScene(scene);
|
||||
stage.setResizable(false);
|
||||
stage.setMaximized(true);
|
||||
stage.setOnCloseRequest(e->{
|
||||
config.Save();
|
||||
MainView mainView = fxmlLoader.getController();
|
||||
mainView.Unload();
|
||||
Logger.info("Application closed");
|
||||
});
|
||||
SomeCodes.LoadQRReader();
|
||||
SomeCodes.LoadFaceDetector();
|
||||
stage.show();
|
||||
Logger.info("Application started");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SomeCodes.ExtractResource("/tinylog.properties");
|
||||
launch();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user