javafx.stage.StageStyle Java Examples

The following examples show how to use javafx.stage.StageStyle. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GUIUtil.java    From bisq with GNU Affero General Public License v3.0 7 votes vote down vote up
public static void showSelectableTextModal(String title, String text) {
    TextArea textArea = new BisqTextArea();
    textArea.setText(text);
    textArea.setEditable(false);
    textArea.setWrapText(true);
    textArea.setPrefSize(800, 600);

    Scene scene = new Scene(textArea);
    Stage stage = new Stage();
    if (null != title) {
        stage.setTitle(title);
    }
    stage.setScene(scene);
    stage.initModality(Modality.NONE);
    stage.initStyle(StageStyle.UTILITY);
    stage.show();
}
 
Example #2
Source File: LoginController.java    From Library-Assistant with Apache License 2.0 7 votes vote down vote up
void loadMain() {
    try {
        Parent parent = FXMLLoader.load(getClass().getResource("/library/assistant/ui/main/main.fxml"));
        Stage stage = new Stage(StageStyle.DECORATED);
        stage.setTitle("Library Assistant");
        stage.setScene(new Scene(parent));
        stage.show();
        LibraryAssistantUtil.setStageIcon(stage);
    }
    catch (IOException ex) {
        LOGGER.log(Level.ERROR, "{}", ex);
    }
}
 
Example #3
Source File: UserAccountController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML private void sendMsg3()
{
    Stage stage= new Stage();
    NewMessageController newMessage = new NewMessageController(admin);
    
    newMessage.userid.setText(msgLabel3.getText());
    newMessage.receivertxt.setText(" "+userName3.getText());
    
    Scene scene = new Scene(newMessage);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show(); 
}
 
Example #4
Source File: MainGUI.java    From MSPaintIDE with MIT License 6 votes vote down vote up
@Override
public void start(Stage primaryStage) throws Exception {
    this.primaryStage = primaryStage;
    primaryStage.initStyle(StageStyle.UNDECORATED);

    primaryStage.setMinWidth(1000);
    primaryStage.setMinHeight(100);

    ProjectManager.getRecent();

    if (initialProject != null) ProjectManager.switchProject(ProjectManager.readProject(initialProject));
    if (ProjectManager.getPPFProject() == null) {
        new WelcomeWindow(this);
    } else {
        refreshProject();
    }
}
 
Example #5
Source File: DoctorController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
 
Example #6
Source File: DesignerApplication.java    From OEE-Designer with MIT License 6 votes vote down vote up
FileEventSource showFileShareEditor() throws Exception {
	FXMLLoader loader = FXMLLoaderFactory.fileShareLoader();
	AnchorPane page = (AnchorPane) loader.getRoot();

	// Create the dialog Stage.
	Stage dialogStage = new Stage(StageStyle.DECORATED);
	dialogStage.setTitle(DesignerLocalizer.instance().getLangString("file.editor.title"));
	dialogStage.initModality(Modality.WINDOW_MODAL);
	Scene scene = new Scene(page);
	dialogStage.setScene(scene);

	// get the controller
	FileShareController fileShareController = loader.getController();
	fileShareController.setDialogStage(dialogStage);
	fileShareController.initialize(this);

	// Show the dialog and wait until the user closes it
	if (!fileShareController.getDialogStage().isShowing()) {
		fileShareController.getDialogStage().showAndWait();
	}

	return fileShareController.getSource();
}
 
Example #7
Source File: DesignerApplication.java    From OEE-Designer with MIT License 6 votes vote down vote up
CronEventSource showCronEditor() throws Exception {
	FXMLLoader loader = FXMLLoaderFactory.cronEditorLoader();
	AnchorPane page = (AnchorPane) loader.getRoot();

	// Create the dialog Stage.
	Stage dialogStage = new Stage(StageStyle.DECORATED);
	dialogStage.setTitle(DesignerLocalizer.instance().getLangString("cron.editor.title"));
	dialogStage.initModality(Modality.WINDOW_MODAL);
	Scene scene = new Scene(page);
	dialogStage.setScene(scene);

	// get the controller
	CronEditorController cronController = loader.getController();
	cronController.setDialogStage(dialogStage);
	cronController.initialize(this);

	// Show the dialog and wait until the user closes it
	if (!cronController.getDialogStage().isShowing()) {
		cronController.getDialogStage().showAndWait();
	}

	return cronController.getSource();
}
 
Example #8
Source File: DockZones.java    From AnchorFX with GNU Lesser General Public License v3.0 6 votes vote down vote up
public DockZones(DockStation station, DockNode nodeToMove) {

        this.nodeToMove = nodeToMove;
        this.ownerStation = station;

        initOwner(ownerStation.getStationWindow());
        initStyle(StageStyle.TRANSPARENT);

        buildUI();

        buildCircleStage();
        makeSelectors();
        createRectangleForPreview();

        setAlwaysOnTop(true);
        circleStage.setAlwaysOnTop(true);
    }
 
Example #9
Source File: NewMessageController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
 
Example #10
Source File: LoginController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
public void loadLabAssistant(String username)
{
    Stage stage = new Stage();
    LabAssistantController lab = new LabAssistantController(username);
    lab.loadProfileData(); 
    lab.fillPieChart();
    lab.setAppointments();
    lab.fillLabAppiontments();
    lab.addFocusListener();
    lab.setPaceholders();
    lab.fillTodayAppointments();
    
    stage.setScene(new Scene(lab));
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    stage.initStyle(StageStyle.UNDECORATED);
    stage.show();
}
 
Example #11
Source File: CashierController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
 
Example #12
Source File: FrostyTech.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
@Override public void start(Stage stage) {
    layout.getChildren().setAll(background, createContent());
    layout.setStyle("-fx-background-color: null");

    Scene scene = new Scene(
            layout,
            200, 300,
            Color.TRANSPARENT
    );

    Platform.setImplicitExit(false);

    scene.setOnMouseClicked(event -> {
            if (event.getClickCount() == 2) Platform.exit();
    });
    makeSmoke(stage);

    stage.initStyle(StageStyle.TRANSPARENT);
    stage.setScene(scene);
    stage.show();

    background.setImage(copyBackground(stage));
    background.setEffect(frostEffect);

    makeDraggable(stage, layout);
}
 
Example #13
Source File: ConfirmationDialog.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
public ConfirmationDialog(StylesConfig styles, DialogStyle style, String positiveButtonText,
        String negativeButtonText) {
    initModality(Modality.WINDOW_MODAL);
    initStyle(StageStyle.UTILITY);
    setResizable(false);
    this.dialogContent = new ConfirmationDialogContent(style.icon);
    VBox containerPane = new VBox();
    containerPane.getStyleClass().addAll(Style.CONTAINER.css());
    containerPane.getStyleClass().addAll("-pdfsam-dialog", style.style);
    HBox buttons = new HBox(buildPositiveButton(positiveButtonText, true),
            buildCancelButton(negativeButtonText, false));
    buttons.getStyleClass().add("-pdfsam-dialog-buttons");
    containerPane.getChildren().addAll(dialogContent, buttons);
    Scene scene = new Scene(containerPane);
    scene.getStylesheets().addAll(styles.styles());
    setScene(scene);
}
 
Example #14
Source File: Controller.java    From J-Kinopoisk2IMDB with Apache License 2.0 6 votes vote down vote up
@FXML
protected void handleStartAction(ActionEvent event) {
    try {
        clientExecutor.setListeners(Arrays.asList(new ProgressBarUpdater(), new RunButtonUpdater()));
        clientExecutor.setConfig(configMap);
        clientExecutor.run();
    } catch (IllegalArgumentException | NullPointerException | ConfigException e) {
        Alert alert = new Alert(Alert.AlertType.ERROR);
        alert.initModality(Modality.APPLICATION_MODAL);
        alert.initStyle(StageStyle.UTILITY);
        alert.setTitle("Ошибка");
        alert.setHeaderText("Произошла ошибка");
        alert.setContentText(e.getMessage());

        alert.showAndWait();
    }
}
 
Example #15
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewCashierAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("cashier",admin);
    
    ArrayList<ArrayList<String>> data = admin.getUserInfo("cashier");
    System.out.println(data);
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show(); 
}
 
Example #16
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewLabAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("lab_assistant",admin);
    
    ArrayList<ArrayList<String>> data = admin.getUserInfo("lab_assistant");
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show(); 
}
 
Example #17
Source File: ModalDialog.java    From metastone with GNU General Public License v2.0 6 votes vote down vote up
public ModalDialog(Window parent, Node content) {

		Stage stage = new Stage();
		Scene scene = new Scene(this);
		scene.setFill(null);
		stage.setScene(scene);
		stage.initModality(Modality.WINDOW_MODAL);
		stage.initStyle(StageStyle.TRANSPARENT);
		stage.initOwner(parent);
		stage.setX(parent.getX());
		stage.setY(parent.getY());

		setPrefSize(parent.getWidth(), parent.getHeight());
		setStyle("-fx-background-color: rgba(0, 0, 0, 0.5);");
		getChildren().add(content);

		stage.show();
	}
 
Example #18
Source File: HideTaskBar.java    From oim-fx with MIT License 6 votes vote down vote up
@Override
public void start(final Stage stage) throws Exception {
	stage.initStyle(StageStyle.UTILITY);
	stage.setScene(new Scene(new Group(), 100, 100));
	stage.setX(0);
	stage.setY(Screen.getPrimary().getBounds().getHeight() + 100);
	stage.show();

	Stage app = new Stage();
	app.setScene(new Scene(new Group(), 300, 200));
	app.setTitle("JavaFX隐藏任务栏");
	app.initOwner(stage);
	app.initModality(Modality.APPLICATION_MODAL);
	app.setOnCloseRequest(new EventHandler<WindowEvent>() {
		@Override
		public void handle(WindowEvent event) {
			event.consume();
			stage.close();
		}
	});

	app.show();
}
 
Example #19
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
private void viewPharmacistAccounts()
{
    Stage stage = new Stage();
    UserAccountController userAccounts = new UserAccountController("pharmacist",admin);
    ArrayList<ArrayList<String>> data = admin.getUserInfo("pharmacist");
    userAccounts.fillUserDetail(data);
    
    Scene scene = new Scene(userAccounts);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show(); 
}
 
Example #20
Source File: DockZones.java    From AnchorFX with GNU Lesser General Public License v3.0 6 votes vote down vote up
private void buildCircleStage() {

        circleStage = new Stage();
        circleStage.initStyle(StageStyle.TRANSPARENT);
        circleStage.initOwner(this);

        circleZone = new Circle(CIRCLE_RADIUS);
        circleZone.setCenterX(CIRCLE_RADIUS);
        circleZone.setCenterY(CIRCLE_RADIUS);
        circleZone.getStyleClass().add("dockzone-circle-container-selectors");

        circleStageRoot = new Pane(circleZone);
        circleStageRoot.setStyle("-fx-background-color:rgba(0,0,0,0);");

        circleStageScene = new Scene(circleStageRoot, CIRCLE_RADIUS * 2, CIRCLE_RADIUS * 2, Color.TRANSPARENT);

        circleStage.setScene(circleStageScene);

        circleStageRoot.setOpacity(0);
    }
 
Example #21
Source File: ViewUtils.java    From ApkToolPlus with Apache License 2.0 6 votes vote down vote up
/**
 * 打开一个新窗口
 *
 * @param fxmlUrl       fxml文件的url
 * @param isShowTitle   是否显示title
 * @return  Stage,如果出现异常返回null
 */
public static Stage newWindow(URL fxmlUrl, boolean isShowTitle){
    try {
        Stage stage = new Stage();
        if (!isShowTitle){
            setNoBroder(stage);
        }
        // 背景透明
        stage.initStyle(StageStyle.TRANSPARENT);
        Parent layout = FXMLLoader.load(fxmlUrl);

        Scene scene = new Scene(layout, Color.TRANSPARENT);
        stage.setScene(scene);

        // 在屏幕中间
        stage.centerOnScreen();

        return stage;
    } catch (IOException e) {
        e.printStackTrace();
    }
    return null;
}
 
Example #22
Source File: NotificationView.java    From Maus with GNU General Public License v3.0 6 votes vote down vote up
public static void openNotification(String text) {
    Stage stage = new Stage();
    stage.setWidth(300);
    stage.setHeight(125);
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    NotificationView notificationView = new NotificationView();
    stage.setScene(new Scene(notificationView.getNotificationView(), 300, 125));
    stage.setResizable(false);
    stage.setAlwaysOnTop(true);
    stage.setX(primaryScreenBounds.getMinX() + primaryScreenBounds.getWidth() - 300);
    stage.setY(primaryScreenBounds.getMinY() + primaryScreenBounds.getHeight() - 125);
    stage.initStyle(StageStyle.UNDECORATED);
    notificationView.getNotificationText().setWrapText(true);
    notificationView.getNotificationText().setAlignment(Pos.CENTER);
    notificationView.getNotificationText().setPadding(new Insets(0, 5, 0, 20));
    notificationView.getNotificationText().setText(text);
    stage.show();
    PauseTransition delay = new PauseTransition(Duration.seconds(5));
    delay.setOnFinished(event -> stage.close());
    delay.play();
}
 
Example #23
Source File: LabAssistantController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML
public void showSuccessIndicator()
{
    Stage stage= new Stage();
    SuccessIndicatorController success = new SuccessIndicatorController();
    Scene scene = new Scene(success);
    stage.setScene(scene);
    
    Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
    //set Stage boundaries to visible bounds of the main screen
    stage.setX(primaryScreenBounds.getMinX());
    stage.setY(primaryScreenBounds.getMinY());
    stage.setWidth(primaryScreenBounds.getWidth());
    stage.setHeight(primaryScreenBounds.getHeight());
    
    stage.initStyle(StageStyle.UNDECORATED);
    scene.setFill(null);
    stage.initStyle(StageStyle.TRANSPARENT);
    stage.show();
}
 
Example #24
Source File: DesktopNotification.java    From yfiton with Apache License 2.0 6 votes vote down vote up
@Override
public void start(Stage primaryStage) {
    Map<String, String> parameters = getParameters().getNamed();

    primaryStage.initStyle(StageStyle.TRANSPARENT);

    Scene scene = new Scene(new VBox(), 1, 1);
    scene.setFill(null);
    primaryStage.setScene(scene);
    primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/yfiton-icon.png")));
    primaryStage.show();

    Notifications.create()
            .darkStyle()
            .graphic(new ImageView(Notifications.class.getResource("/" + parameters.get("type") + ".png").toExternalForm()))
            .hideAfter(Duration.seconds(Integer.parseInt(parameters.get("hideAfter"))))
            .onHideAction(event -> System.exit(0))
            .position(Pos.valueOf(parameters.get("position")))
            .text(parameters.get("message"))
            .show();
}
 
Example #25
Source File: GlobalUI.java    From SONDY with GNU General Public License v3.0 6 votes vote down vote up
public void about(){
    final Stage stage = new Stage();
    stage.setResizable(false);
    stage.initModality(Modality.WINDOW_MODAL);
    stage.initStyle(StageStyle.UTILITY);
    stage.setTitle("About SONDY");
    WebView webView = new WebView();
    webView.getEngine().loadContent(getReferences());
    webView.setMaxWidth(Main.columnWidthLEFT);
    webView.setMinWidth(Main.columnWidthLEFT);
    webView.setMaxHeight(Main.columnWidthLEFT);
    webView.setMinHeight(Main.columnWidthLEFT);
    Scene scene = new Scene(VBoxBuilder.create().children(new Label("SONDY "+Main.version),new Label("Main developper: Adrien Guille <[email protected]>"),webView).alignment(Pos.CENTER).padding(new Insets(10)).spacing(3).build());
    scene.getStylesheets().add("resources/fr/ericlab/sondy/css/GlobalStyle.css");
    stage.setScene(scene);
    stage.show();
}
 
Example #26
Source File: AdminController.java    From HealthPlus with Apache License 2.0 6 votes vote down vote up
@FXML private void searchUser()
{
    
    String userid = userIDlbl.getText();
    
    if (!userid.equals(""))
    {    
        Stage stage= new Stage();
        SysUserController user = new SysUserController(this,userid);
        user.load();
        Scene scene = new Scene(user);
        stage.setScene(scene);

        Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
        //set Stage boundaries to visible bounds of the main screen
        stage.setX(primaryScreenBounds.getMinX());
        stage.setY(primaryScreenBounds.getMinY());
        stage.setWidth(primaryScreenBounds.getWidth());
        stage.setHeight(primaryScreenBounds.getHeight());

        stage.initStyle(StageStyle.UNDECORATED);
        scene.setFill(null);
        stage.initStyle(StageStyle.TRANSPARENT);
        stage.show();   
    }    
}
 
Example #27
Source File: DesignerApplication.java    From OEE-Designer with MIT License 6 votes vote down vote up
public Material showMaterialEditor() throws Exception {
	if (this.materialController == null) {
		FXMLLoader loader = FXMLLoaderFactory.materialEditorLoader();
		AnchorPane pane = (AnchorPane) loader.getRoot();

		// Create the dialog Stage.
		Stage dialogStage = new Stage(StageStyle.DECORATED);
		dialogStage.setTitle(DesignerLocalizer.instance().getLangString("material.editor.title"));
		dialogStage.initModality(Modality.NONE);

		Scene scene = new Scene(pane);
		dialogStage.setScene(scene);

		// get the controller
		materialController = loader.getController();
		materialController.setDialogStage(dialogStage);
		materialController.initialize(this);
	}

	// Show the dialog and wait until the user closes it
	if (!materialController.getDialogStage().isShowing()) {
		materialController.getDialogStage().showAndWait();
	}

	return materialController.getSelectedMaterial();
}
 
Example #28
Source File: DesktopSearchController.java    From FXDesktopSearch with Apache License 2.0 6 votes vote down vote up
public void configure() {
    try {
        final var stage = new Stage();
        stage.setResizable(false);
        stage.initStyle(StageStyle.UTILITY);

        final var theLoader = new FXMLLoader(getClass().getResource("/scenes/configuration.fxml"));
        final Parent theConfigurationRoot = theLoader.load();
        stage.setScene(new Scene(theConfigurationRoot));
        stage.setTitle("Configuration");
        stage.initModality(Modality.APPLICATION_MODAL);

        final ConfigurationController theConfigController = theLoader.getController();
        theConfigController.initialize(application.getConfigurationManager(), stage);
        stage.initOwner(window);
        stage.show();
    } catch (final IOException e) {
        log.error("Error running configuration dialog", e);
    }
}
 
Example #29
Source File: DesignerApplication.java    From OEE-Designer with MIT License 6 votes vote down vote up
public Reason showReasonEditor() throws Exception {
	// Load the fxml file and create a new stage for the pop-up dialog.
	if (reasonController == null) {
		FXMLLoader loader = FXMLLoaderFactory.reasonEditorLoader();
		AnchorPane page = (AnchorPane) loader.getRoot();

		// Create the dialog Stage.
		Stage dialogStage = new Stage(StageStyle.DECORATED);
		dialogStage.setTitle(DesignerLocalizer.instance().getLangString("reason.editor.title"));
		dialogStage.initModality(Modality.NONE);
		Scene scene = new Scene(page);
		dialogStage.setScene(scene);

		// get the controller
		reasonController = loader.getController();
		reasonController.setDialogStage(dialogStage);
		reasonController.initialize(this);
	}

	// Show the dialog and wait until the user closes it
	if (!reasonController.getDialogStage().isShowing()) {
		reasonController.getDialogStage().showAndWait();
	}

	return reasonController.getSelectedReason();
}
 
Example #30
Source File: OverlayStage.java    From DeskChan with GNU Lesser General Public License v3.0 5 votes vote down vote up
OverlayStage() {
	stage = this;
	setTitle(App.NAME);
	getIcons().add(new Image(App.ICON_URL.toString()));
	initStyle(StageStyle.TRANSPARENT);
	scene.setFill(Color.TRANSPARENT);
	setScene(scene);

	// All nodes position automatically changed when window position change
	// So nodes will save their absolute position on screen
	xProperty().addListener(onPositionChange);
	yProperty().addListener(onPositionChange);
}