use of javafx.scene.layout.HBox in project Gargoyle by callakrsos.
the class SpecExample method start.
@Override
public void start(Stage primaryStage) throws Exception {
String projectDir = System.getProperty("user.dir");
File file = new File(projectDir, "src/main/java/com/kyj/fx/voeditor/visual/example/SpecExample.java");
SpecResource specResource = new SpecResource(new File(projectDir), file);
SpecTabPane center = new SpecTabPane(specResource);
Button btnCapture = new Button("SnapShot");
ImageView ivOrigin = new ImageView();
btnCapture.setOnAction(ev -> {
FxUtil.snapShot(center, new File("example.png"));
FxUtil.printJob(primaryStage, center);
});
Text text1 = new Text("Big italic red text");
text1.setFill(Color.RED);
text1.setFont(Font.font("Helvetica", FontPosture.ITALIC, 40));
Text text2 = new Text(" little bold blue text");
text2.setFill(Color.BLUE);
text2.setFont(Font.font("Helvetica", FontWeight.BOLD, 10));
TextFlow textFlow = new TextFlow(text1, text2);
BorderPane root = new BorderPane(center);
root.setTop(new HBox(textFlow, btnCapture));
root.setBottom(ivOrigin);
root.setPrefSize(800, 600);
Scene value = new Scene(root, 800, 600);
primaryStage.setScene(value);
primaryStage.show();
}
use of javafx.scene.layout.HBox 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.HBox in project Gargoyle by callakrsos.
the class VariableMappingView method showAndWait.
public void showAndWait(Consumer<Map<String, Object>> resultItem) {
Stage dialog = new Stage();
dialog.setScene(new Scene(this));
Button value2 = new Button("Mapping");
value2.setPrefWidth(300);
value2.setOnMouseClicked(e -> {
doMapping(resultItem);
dialog.close();
});
HBox value3 = new HBox(value2);
value3.setPrefWidth(HBox.USE_COMPUTED_SIZE);
value3.setPrefHeight(HBox.USE_COMPUTED_SIZE);
value3.setAlignment(Pos.CENTER);
value3.setPadding(new Insets(5, 5, 5, 5));
this.setBottom(value3);
dialog.setTitle(TITLE);
dialog.initModality(Modality.APPLICATION_MODAL);
dialog.initStyle(StageStyle.UTILITY);
if (parentStage != null)
dialog.initOwner(parentStage);
dialog.setResizable(false);
dialog.addEventHandler(KeyEvent.KEY_RELEASED, event -> {
KeyCode code = event.getCode();
if (KeyCode.ESCAPE == code) {
dialog.close();
event.consume();
}
});
dialog.showAndWait();
}
use of javafx.scene.layout.HBox in project Gargoyle by callakrsos.
the class SkinPreviewViewComposite method previewTabInit.
@FxPostInitialize
public void previewTabInit() {
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
Thread.sleep(5000L);
Platform.runLater(() -> {
//메뉴바 배경.
{
Background background = mbSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorMbSample.setValue(fill);
//메뉴바 텍스트
{
Label lookup = (Label) mbSample.lookup(".label");
Color textFill = (Color) lookup.getTextFill();
colorMbLabelSample.setValue(textFill);
}
}
//Hbox 배경.
{
Background background = hboxSample.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorHboxSample.setValue(fill);
}
{
//선택디지않는 탭 색상 처리.
Set<Node> lookupAll = tabpaneSample.lookupAll(".tab:top");
lookupAll.forEach(lookup -> {
Optional<PseudoClass> findFirst = lookup.getPseudoClassStates().stream().filter(v -> {
return "selected".equals(v.getPseudoClassName());
}).findFirst();
if (findFirst.isPresent()) {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorSelectedTabText.setValue(textFill);
} else {
Label selectedTabLabel = (Label) lookup.lookup(".tab-label");
Color textFill = (Color) selectedTabLabel.getTextFill();
colorUnSelectedTabText.setValue(textFill);
}
});
{
lookupAll.stream().findFirst().ifPresent(n -> {
Pane p = (Pane) n;
Background background = p.getBackground();
Color fill = (Color) background.getFills().get(0).getFill();
colorTabSample1Selected.setValue(fill);
});
}
}
});
return null;
}
};
Window window = this.getScene().getWindow();
if (window != null) {
FxUtil.showLoading(window, task);
} else
FxUtil.showLoading(task);
}
use of javafx.scene.layout.HBox in project Gargoyle by callakrsos.
the class TitledBorderPane method init.
protected void init() {
this.setCenter(content);
// lblTitle.setPrefWidth(Double.MAX_VALUE);
// lblTitle.setMaxWidth(Double.MAX_VALUE);
lblTitle.setPadding(new Insets(3d));
paneColor.setPrefSize(10d, 10d);
lblTitle.setGraphic(paneColor);
titleContainer = new HBox(lblTitle);
// titleContainer.setPrefSize(Double.MAX_VALUE, Double.MAX_VALUE);
this.setTop(titleContainer);
setTitle(this.title);
}
Aggregations