Search in sources :

Example 1 with ReadOnlyConsole

use of com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole in project Gargoyle by callakrsos.

the class SystemLayoutViewController method lblDBConsoleOnMouseClick.

@FXML
public void lblDBConsoleOnMouseClick(MouseEvent e) {
    if (dbConsoleProperty.get() != null)
        return;
    try {
        ReadOnlyConsole console = ReadOnlySingletonConsole.getInstance();
        console.init();
        dbConsoleProperty.set(console);
        Stage stage = new Stage();
        BorderPane root = new BorderPane(console);
        Scene scene = new Scene(root, 700, 300);
        scene.getStylesheets().add(SkinManager.getInstance().getSkin());
        stage.setScene(scene);
        double x = SharedMemory.getPrimaryStage().getX();
        double y = SharedMemory.getPrimaryStage().getY();
        stage.setTitle("Database Console");
        stage.setX(x);
        stage.setY(y);
        stage.setAlwaysOnTop(false);
        stage.initOwner(SharedMemory.getPrimaryStage());
        stage.centerOnScreen();
        stage.addEventHandler(WindowEvent.WINDOW_CLOSE_REQUEST, ev -> {
            try {
                dbConsoleProperty.set(null);
                console.close();
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        });
        stage.show();
    //			dbConsoleProperty.set(null);
    } catch (Exception ex) {
        DialogUtil.showExceptionDailog(ex);
        LOGGER.error(ValueUtil.toString(ex));
    }
}
Also used : BorderPane(javafx.scene.layout.BorderPane) ReadOnlyConsole(com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) FXML(javafx.fxml.FXML)

Example 2 with ReadOnlyConsole

use of com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole in project Gargoyle by callakrsos.

the class SystemLayoutViewController method lblSystemConsoleOnMouseClick.

@FXML
public void lblSystemConsoleOnMouseClick(MouseEvent e) {
    if (systemConsoleProperty.get() != null)
        return;
    ReadOnlyConsole console = null;
    try {
        console = SystemConsole.getInstance();
        console.init();
        systemConsoleProperty.set(console);
        Stage stage = new Stage();
        BorderPane root = new BorderPane(console);
        Scene scene = new Scene(root, 700, 300);
        scene.getStylesheets().add(SkinManager.getInstance().getSkin());
        stage.setScene(scene);
        double x = SharedMemory.getPrimaryStage().getX();
        double y = SharedMemory.getPrimaryStage().getY();
        stage.setTitle("System Console");
        stage.setX(x);
        stage.setY(y);
        stage.setAlwaysOnTop(false);
        stage.initOwner(SharedMemory.getPrimaryStage());
        stage.centerOnScreen();
        stage.setOnCloseRequest(ev -> {
            systemConsoleProperty.set(null);
            try {
                SystemConsole.getInstance().close();
            } catch (Exception e1) {
                e1.printStackTrace();
            }
        });
        stage.show();
    } catch (Exception ex) {
        DialogUtil.showExceptionDailog(ex);
        LOGGER.error(ValueUtil.toString(ex));
    }
}
Also used : BorderPane(javafx.scene.layout.BorderPane) ReadOnlyConsole(com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) FXML(javafx.fxml.FXML)

Aggregations

ReadOnlyConsole (com.kyj.fx.voeditor.visual.component.console.ReadOnlyConsole)2 GargoyleException (com.kyj.fx.voeditor.visual.exceptions.GargoyleException)2 IOException (java.io.IOException)2 FXML (javafx.fxml.FXML)2 Scene (javafx.scene.Scene)2 BorderPane (javafx.scene.layout.BorderPane)2 Stage (javafx.stage.Stage)2