Search in sources :

Example 36 with BorderPane

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

the class DialogUtil method open.

/**
	 * 특정 location에 위치한 fxml파일을 팝업형태로 로드한다.
	 *
	 * @Date 2015. 10. 15.
	 * @param packageLocation
	 * @param fxmlName
	 * @param width
	 * @param height
	 * @param modal
	 * @throws IOException
	 * @User KYJ
	 */
public static void open(Class<?> packageLocation, String fxmlName, int width, int height, boolean modal) throws IOException {
    FXMLLoader loader = new FXMLLoader();
    loader.setLocation(packageLocation.getResource(fxmlName));
    Parent parent = loader.load();
    BorderPane borderPane = new BorderPane(parent);
    Stage stage = new Stage();
    Scene scene = new Scene(borderPane, width, height);
    stage.setScene(scene);
    if (modal)
        stage.initModality(Modality.WINDOW_MODAL);
    stage.setAlwaysOnTop(true);
    stage.initOwner(SharedMemory.getPrimaryStage());
    stage.show();
// stage.setScene(borderPane, 800, 500);
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Parent(javafx.scene.Parent) Stage(javafx.stage.Stage) Scene(javafx.scene.Scene) FXMLLoader(javafx.fxml.FXMLLoader)

Example 37 with BorderPane

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

the class ProjectInfoBaseInfoTab method supplyNode.

@Override
public BorderPane supplyNode() throws Exception {
    BorderPane root = new BorderPane();
    try {
        /* BaseInfo */
        baseInfoController = new BaseInfoComposite(this);
        //			FXMLLoader loader = new FXMLLoader();
        //			loader.setLocation(BaseInfoComposite.class.getResource("BaseInfoApp.fxml"));
        //			BorderPane supplyNode = loader.load();
        //			supplyNode.setPrefWidth(BorderPane.USE_COMPUTED_SIZE);
        //			BaseInfoComposite baseInfoController = loader.getController();
        /* 버튼박스 */
        HBox hboxButton = new HBox(5);
        hboxButton.setPrefHeight(HBox.USE_COMPUTED_SIZE);
        HBox.setHgrow(hboxButton, Priority.NEVER);
        btnGenerate = new Button("사양서 생성");
        btnGenerate.setOnMouseClicked(this::btnGenerateOnMouseClick);
        btnGenerate.setPrefWidth(120);
        hboxButton.getChildren().add(btnGenerate);
        /* TableInfo */
        gv = new CrudBaseGridView<MethodDVO>(MethodDVO.class, new AnnotateBizOptions<MethodDVO>(MethodDVO.class) {

            @Override
            public boolean isCreateColumn(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                //						return false;
                return super.isCreateColumn(columnName);
            }

            @Override
            public boolean visible(String columnName) {
                if ("methodMetaDVO".equals(columnName))
                    return false;
                return super.visible(columnName);
            }
        });
        //이벤트 리스너로 그리드에 추가되는 항목이 존재하면 추가.
        ObservableList<MethodDVO> methodData = baseInfoController.getMethodData();
        methodData.addListener(new ListChangeListener<MethodDVO>() {

            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends MethodDVO> c) {
                if (c.next()) {
                    if (c.wasAdded()) {
                        gv.getItems().addAll(c.getAddedSubList());
                    } else if (c.wasRemoved()) {
                        gv.getItems().removeAll(c.getRemoved());
                    }
                }
            }
        });
        //			ObservableList<MethodDVO> items = gv.getItems();
        //			gv.getItems().addAll(methodData);
        baseInfoController.setBottom(hboxButton);
        root.setTop(baseInfoController);
        root.setCenter(gv);
        baseInfoController.start();
    } catch (IOException | NullPointerException e) {
        LOGGER.error(ValueUtil.toString(e));
    }
    root.setPrefSize(BorderPane.USE_COMPUTED_SIZE, BorderPane.USE_COMPUTED_SIZE);
    root.setPadding(new Insets(5, 5, 5, 5));
    return root;
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) BaseInfoComposite(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.skin.BaseInfoComposite) IOException(java.io.IOException) ListChangeListener(javafx.collections.ListChangeListener) AnnotateBizOptions(com.kyj.fx.voeditor.visual.component.grid.AnnotateBizOptions) Button(javafx.scene.control.Button) MethodDVO(com.kyj.fx.voeditor.visual.words.spec.auto.msword.vo.MethodDVO)

Example 38 with BorderPane

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

the class AbsoltePointFocusExam method start.

@Override
public void start(Stage stage) throws Exception {
    // 포커스
    ScrollPane scrPane = new ScrollPane();
    scrPane.setPrefWidth(ScrollPane.USE_COMPUTED_SIZE);
    BorderPane borderPane = new BorderPane(scrPane);
    Scene scene = new Scene(borderPane, Color.LINEN);
    VBox vbox = new VBox();
    VBox.setVgrow(vbox, Priority.ALWAYS);
    vbox.setPrefWidth(VBox.USE_PREF_SIZE);
    vbox.setPrefHeight(VBox.USE_COMPUTED_SIZE);
    for (int i = 0; i < 20; i++) {
        AnchorPane ancPane = new AnchorPane();
        AnchorPane ancPane2 = new AnchorPane();
        ancPane2.setLayoutY(500);
        TextField text1 = new TextField();
        TextField text2 = new TextField();
        text2.setLayoutY(800);
        Button btn = new Button("Focus" + i);
        btn.setOnMouseClicked(event -> {
            text2.requestFocus();
            double absolteY = FxUtil.getAbsolteY(vbox, text2) + text2.getHeight();
            scrPane.setVvalue((absolteY / vbox.getHeight()));
        });
        btn.setLayoutX(150);
        ancPane2.getChildren().add(text2);
        ancPane.getChildren().addAll(text1, btn, ancPane2);
        vbox.getChildren().add(ancPane);
    }
    scrPane.setContent(vbox);
    stage.setWidth(700);
    stage.setHeight(400);
    Label status = new Label();
    borderPane.setBottom(status);
    vbox.addEventFilter(MouseEvent.ANY, event -> {
        status.textProperty().set(String.format(" x: %s y : %s scene x : %s scene y : %s screen x :%s screen y : %s", event.getX(), event.getY(), event.getSceneX(), event.getSceneY(), event.getScreenX(), event.getScreenY()));
    });
    stage.setScene(scene);
    stage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Button(javafx.scene.control.Button) ScrollPane(javafx.scene.control.ScrollPane) Label(javafx.scene.control.Label) TextField(javafx.scene.control.TextField) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) AnchorPane(javafx.scene.layout.AnchorPane)

Example 39 with BorderPane

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

the class AutoCompletionTextBindingExam method start.

/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    TextField textField = new TextField();
    List<String> asList = Arrays.asList("sssss", "aaaaa");
    AutoCompletionTextFieldBinding<String> autoCompletionTextFieldBinding = new AutoCompletionTextFieldBinding<>(textField, new Callback<ISuggestionRequest, Collection<String>>() {

        @Override
        public Collection<String> call(ISuggestionRequest param) {
            String userText = param.getUserText();
            return asList.stream().filter(v -> v.startsWith(userText)).collect(Collectors.toList());
        }
    });
    autoCompletionTextFieldBinding.setVisibleRowCount(10);
    primaryStage.setScene(new Scene(new BorderPane(textField)));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) AutoCompletionTextFieldBinding(impl.org.controlsfx.autocompletion.AutoCompletionTextFieldBinding) TextField(javafx.scene.control.TextField) Collection(java.util.Collection) ISuggestionRequest(org.controlsfx.control.textfield.AutoCompletionBinding.ISuggestionRequest) Scene(javafx.scene.Scene)

Example 40 with BorderPane

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

the class SvnViewExam method start.

/***********************************************************************************/
/* 이벤트 구현 */
@Override
public void start(Stage primaryStage) throws Exception {
    Properties prop = new Properties();
    prop.put(SVNTreeView.SVN_USER_ID, "callakrsos");
    prop.put(SVNTreeView.SVN_USER_PASS, "mFn+QPl+TW8=");
    prop.put(SVNTreeView.SVN_URL, "https://dev.naver.com/svn/javafxvoeditor/trunk");
    prop.put(SVNTreeView.SVN_PATH, ConfigResourceLoader.getInstance().get(SVNTreeView.SVN_PATH_WINDOW));
    BorderPane borderPane = new BorderPane(new SVNTreeView());
    primaryStage.setScene(new Scene(borderPane));
    primaryStage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) SVNTreeView(com.kyj.fx.voeditor.visual.component.scm.SVNTreeView) Properties(java.util.Properties) Scene(javafx.scene.Scene)

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