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);
}
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;
}
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();
}
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();
}
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();
}
Aggregations