Search in sources :

Example 16 with HBox

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();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) SpecResource(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.model.SpecResource) SpecTabPane(com.kyj.fx.voeditor.visual.words.spec.auto.msword.ui.tabs.SpecTabPane) Button(javafx.scene.control.Button) Text(javafx.scene.text.Text) TextFlow(javafx.scene.text.TextFlow) ImageView(javafx.scene.image.ImageView) Scene(javafx.scene.Scene) File(java.io.File)

Example 17 with HBox

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;
}
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 18 with HBox

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();
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) Stage(javafx.stage.Stage) KeyCode(javafx.scene.input.KeyCode) Scene(javafx.scene.Scene)

Example 19 with HBox

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);
}
Also used : Button(javafx.scene.control.Button) TextArea(javafx.scene.control.TextArea) PseudoClass(javafx.css.PseudoClass) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) LoggerFactory(org.slf4j.LoggerFactory) HashMap(java.util.HashMap) DialogUtil(com.kyj.fx.voeditor.visual.util.DialogUtil) TableColumn(javafx.scene.control.TableColumn) Task(javafx.concurrent.Task) TabPane(javafx.scene.control.TabPane) Map(java.util.Map) FileUtil(com.kyj.fx.voeditor.visual.util.FileUtil) TableView(javafx.scene.control.TableView) Pane(javafx.scene.layout.Pane) ColorPicker(javafx.scene.control.ColorPicker) HBox(javafx.scene.layout.HBox) Color(javafx.scene.paint.Color) Pair(javafx.util.Pair) Logger(org.slf4j.Logger) Label(javafx.scene.control.Label) MenuBar(javafx.scene.control.MenuBar) Node(javafx.scene.Node) FXMLController(com.kyj.fx.voeditor.visual.framework.annotation.FXMLController) Set(java.util.Set) IOException(java.io.IOException) ValueUtil(com.kyj.fx.voeditor.visual.util.ValueUtil) JFXToggleButton(com.jfoenix.controls.JFXToggleButton) Background(javafx.scene.layout.Background) File(java.io.File) FxPostInitialize(com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) FxUtil(com.kyj.fx.voeditor.visual.util.FxUtil) List(java.util.List) Stage(javafx.stage.Stage) Optional(java.util.Optional) Window(javafx.stage.Window) SkinManager(com.kyj.fx.voeditor.visual.momory.SkinManager) ObservableList(javafx.collections.ObservableList) BorderPane(javafx.scene.layout.BorderPane) StringProperty(javafx.beans.property.StringProperty) Window(javafx.stage.Window) Task(javafx.concurrent.Task) Set(java.util.Set) Background(javafx.scene.layout.Background) Optional(java.util.Optional) Color(javafx.scene.paint.Color) Label(javafx.scene.control.Label) TabPane(javafx.scene.control.TabPane) Pane(javafx.scene.layout.Pane) BorderPane(javafx.scene.layout.BorderPane) FxPostInitialize(com.kyj.fx.voeditor.visual.framework.annotation.FxPostInitialize)

Example 20 with HBox

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);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets)

Aggregations

HBox (javafx.scene.layout.HBox)54 Button (javafx.scene.control.Button)25 Insets (javafx.geometry.Insets)22 Label (javafx.scene.control.Label)22 Scene (javafx.scene.Scene)12 VBox (javafx.scene.layout.VBox)11 BorderPane (javafx.scene.layout.BorderPane)8 Node (javafx.scene.Node)7 InputTextField (io.bitsquare.gui.components.InputTextField)6 TextArea (javafx.scene.control.TextArea)6 Stage (javafx.stage.Stage)6 Popup (io.bitsquare.gui.main.overlays.popups.Popup)5 IOException (java.io.IOException)5 ObservableList (javafx.collections.ObservableList)5 FXML (javafx.fxml.FXML)5 ImageView (javafx.scene.image.ImageView)5 KeyFrame (javafx.animation.KeyFrame)4 Timeline (javafx.animation.Timeline)4 File (java.io.File)3 Group (javafx.scene.Group)3