/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.livesub;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Popup;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import org.livesub.utils.Utils;
import org.livesub.utils.log.LogUtils;
/**
*
* @author vasilis
*/
public class LiveSubtitler extends Application {
@Override
public void start(Stage stage) throws Exception {
(new LogUtils()).setupLogger();
Utils.printVersion();
Parent root = FXMLLoader.load(getClass().getResource("ui/MainUI.fxml"));
Scene scene = new Scene(new BorderPane(), 1, 1);
scene.setFill(null);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setScene(scene);
stage.show();
Popup popup = new Popup();
popup.getContent().add(root);
popup.show(stage);
//Place the window to an optimal position
Utils.adjustLocation(popup);
}
/**
* The main() method is ignored in correctly deployed JavaFX application.
* main() serves only as fallback in case the application can not be
* launched through deployment artifacts, e.g., in IDEs with limited FX
* support. NetBeans ignores main().
*
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
}