Search in sources :

Example 26 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class Main method start.

// public Main() {
//
//
// }
@Override
public void start(Stage primaryStage) throws IOException {
    // 초기화 처리
    callInitializers();
    // setApplicationUncaughtExceptionHandler();
    // 어플리케이션 타이틀 지정
    primaryStage.setTitle(APPLICATION_TITLE);
    // 화면 중앙 위치.
    primaryStage.centerOnScreen();
    // 메인 스테이지 클로즈 이벤트 구현.
    primaryStage.setOnCloseRequest(onPrimaryStageCloseRequest);
    /* [시작 ]초기 워크스페이스 선택 지정. */
    String baseDir = ResourceLoader.getInstance().get(ResourceLoader.BASE_DIR);
    if (baseDir == null || baseDir.isEmpty() || !new File(baseDir).exists()) {
        SelectWorkspaceView selectWorkspaceView = new SelectWorkspaceView();
        @SuppressWarnings("rawtypes") ResultDialog show = selectWorkspaceView.showAndWait();
        if (ResultDialog.CANCEL == show.getStatus()) {
            Platform.exit();
            return;
        }
    }
    try {
        // 예상치 못한 에외에 대한 대비 로직구현.
        setApplicationUncaughtExceptionHandler();
        // 클래스 로딩같은 어플리케이션이 메모리에 로딩됨과 동기에 무거운 처리를 비동기로 로딩하는 로직이 구현되있음.
        SharedMemory.init();
        // PrimaryStage를 공유변수로 지정하기 위한 로직 처리.
        SharedMemory.setPrimaryStage(primaryStage);
        // Main Application을 로드
        BorderPane mainParent = setNewRootView();
        Scene scene = new Scene(mainParent, 1280, 900);
        //			SkinManager.getInstance().resetSkin();
        scene.getStylesheets().add(SkinManager.getInstance().getSkin());
        scene.getStylesheets().add(SkinManager.getInstance().getButtonSkin());
        primaryStage.setScene(scene);
        primaryStage.show();
    } catch (Exception e) {
        LOGGER.error(ValueUtil.toString(e));
    }
}
Also used : BorderPane(javafx.scene.layout.BorderPane) ResultDialog(com.kyj.fx.voeditor.visual.component.ResultDialog) SelectWorkspaceView(com.kyj.fx.voeditor.visual.component.popup.SelectWorkspaceView) Scene(javafx.scene.Scene) File(java.io.File) IOException(java.io.IOException)

Example 27 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class Main method loadMainLayout.

/********************************
	 * 작성일 : 2016. 7. 26. 작성자 : KYJ
	 *
	 * Appliucation 메인로직.
	 *
	 * @return
	 * @throws IOException
	 ********************************/
BorderPane loadMainLayout() throws IOException {
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(Main.class.getResource("layout/SystemLayoutView.fxml"));
    BorderPane borderpane = loader.load();
    return borderpane;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) FXMLLoader(javafx.fxml.FXMLLoader)

Example 28 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class DAOLoaderController method menuHistoryOnAction.

/**
	 * 히스토리 이력을 살펴보는경우 사용
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2015. 11. 6.
	 * @param event
	 */
public void menuHistoryOnAction(ActionEvent event) {
    Map<String, Object> selectedItem = tbSrchDao.getSelectionModel().getSelectedItem();
    if (selectedItem == null)
        return;
    String packageName = ValueUtil.emptyThan(selectedItem.get("PACKAGE_NAME"), "").toString();
    String className = ValueUtil.emptyThan(selectedItem.get("CLASS_NAME"), "").toString();
    // Stage primaryStage = SharedMemory.getPrimaryStage();
    Map<String, Object> paramMap = new HashMap<>();
    paramMap.put("packageName", packageName);
    paramMap.put("className", className);
    try {
        List<TbmSysDaoMethodsHDVO> select = listHistoryItems(paramMap);
        CommonsBaseGridView<TbmSysDaoMethodsHDVO> commonsBaseGridView = new CommonsBaseGridView<>(TbmSysDaoMethodsHDVO.class, select);
        TableViewSelectionModel<TbmSysDaoMethodsHDVO> selectionModel = commonsBaseGridView.getSelectionModel();
        selectionModel.setSelectionMode(SelectionMode.MULTIPLE);
        BorderPane borderPane = new BorderPane();
        Label value = new Label("History");
        value.setStyle("-fx-font-size:75px");
        borderPane.setTop(value);
        SqlKeywords sqlKeyword = new SqlKeywords();
        borderPane.setBottom(sqlKeyword);
        SplitPane splitPane = new SplitPane(commonsBaseGridView, sqlKeyword);
        splitPane.setOrientation(Orientation.VERTICAL);
        borderPane.setCenter(splitPane);
        commonsBaseGridView.setOnMouseClicked(ev -> {
            if (ev.getClickCount() == 2) {
                try {
                    TbmSysDaoMethodsHDVO selectedItem2 = commonsBaseGridView.getSelectionModel().getSelectedItem();
                    String histTsp = selectedItem2.getHistTsp();
                    String sqlBody = getSqlBody(histTsp);
                    sqlKeyword.setContent(sqlBody);
                } catch (Exception e) {
                    LOGGER.error(ValueUtil.toString(e));
                }
            }
        });
        MenuItem compare = new MenuItem("Compare.");
        compare.setDisable(true);
        compare.setOnAction(ev -> {
            ObservableList<TbmSysDaoMethodsHDVO> selectedItems = commonsBaseGridView.getSelectionModel().getSelectedItems();
            if (selectedItems.size() == 2) {
                compare(selectedItems.get(0), selectedItems.get(1));
            }
        });
        ContextMenu historyContextMenu = new ContextMenu(compare);
        historyContextMenu.setOnShowing(ev -> {
            if (selectionModel.getSelectedItems().size() == 2) {
                compare.setDisable(false);
            } else {
                compare.setDisable(true);
            }
        });
        commonsBaseGridView.setContextMenu(historyContextMenu);
        Scene scene = new Scene(borderPane);
        Stage stage = new Stage();
        stage.initOwner(SharedMemory.getPrimaryStage());
        stage.setScene(scene);
        stage.show();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : SqlKeywords(com.kyj.fx.voeditor.visual.component.text.SqlKeywords) BorderPane(javafx.scene.layout.BorderPane) HashMap(java.util.HashMap) Label(javafx.scene.control.Label) TbmSysDaoMethodsHDVO(com.kyj.fx.voeditor.visual.main.model.vo.TbmSysDaoMethodsHDVO) MenuItem(javafx.scene.control.MenuItem) ContextMenu(javafx.scene.control.ContextMenu) SplitPane(javafx.scene.control.SplitPane) Scene(javafx.scene.Scene) CommonsBaseGridView(com.kyj.fx.voeditor.visual.component.grid.CommonsBaseGridView) Stage(javafx.stage.Stage)

Example 29 with BorderPane

use of javafx.scene.layout.BorderPane 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)

Example 30 with BorderPane

use of javafx.scene.layout.BorderPane in project Gargoyle by callakrsos.

the class SystemLayoutViewController method lblSVNOnAction.

@FXML
public void lblSVNOnAction(ActionEvent e) {
    try {
        Scene scene = new Scene(new BorderPane(new SVNViewer()), 1100, 900);
        scene.getStylesheets().add(SkinManager.getInstance().getSkin());
        FxUtil.createStageAndShow(scene, stage -> {
            stage.setTitle("SVN");
            stage.initOwner(SharedMemory.getPrimaryStage());
            stage.setAlwaysOnTop(false);
            stage.centerOnScreen();
        });
    // Stage stage = new Stage();
    // Scene scene = new Scene(new BorderPane(new SVNViewer()), 1100,
    // 900);
    //
    //
    // scene.getStylesheets().add(SkinManager.getInstance().getSkin());
    // stage.setScene(scene);
    // stage.initOwner(SharedMemory.getPrimaryStage());
    //
    // stage.setTitle("SVN");
    // stage.setAlwaysOnTop(false);
    // stage.centerOnScreen();
    // stage.show();
    } catch (Exception ex) {
        LOGGER.error(ValueUtil.toString(ex));
        DialogUtil.showExceptionDailog(ex);
    }
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Scene(javafx.scene.Scene) SVNViewer(com.kyj.fx.voeditor.visual.component.scm.SVNViewer) IOException(java.io.IOException) GargoyleException(com.kyj.fx.voeditor.visual.exceptions.GargoyleException) FXML(javafx.fxml.FXML)

Aggregations

BorderPane (javafx.scene.layout.BorderPane)95 Scene (javafx.scene.Scene)58 Button (javafx.scene.control.Button)19 Label (javafx.scene.control.Label)17 FXMLLoader (javafx.fxml.FXMLLoader)14 Stage (javafx.stage.Stage)14 StackPane (javafx.scene.layout.StackPane)12 IOException (java.io.IOException)11 Parameter (aima.gui.fx.framework.Parameter)10 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)10 File (java.io.File)10 HBox (javafx.scene.layout.HBox)9 HashMap (java.util.HashMap)8 Insets (javafx.geometry.Insets)8 TextField (javafx.scene.control.TextField)8 Map (java.util.Map)6 MenuItem (javafx.scene.control.MenuItem)6 TableColumn (javafx.scene.control.TableColumn)6 TableView (javafx.scene.control.TableView)6 List (java.util.List)5