Search in sources :

Example 6 with Pane

use of javafx.scene.layout.Pane 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 7 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class TransactionDialog method buildTab.

private Tab buildTab(final String tabName, final SlipType slipType) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("BankSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final SlipController slipController = fxmlLoader.getController();
        // Override the default event handler for the enter and cancel buttons
        slipController.enterButton.setOnAction(event -> handleEnterAction(slipController));
        slipController.cancelButton.setOnAction(event -> tabPane.getScene().getWindow().hide());
        slipController.setSlipType(slipType);
        slipController.accountProperty().bind(accountProperty());
        final Tab tab = new Tab(tabName);
        tab.setContent(pane);
        tab.setUserData(slipController);
        return tab;
    } catch (final IOException e) {
        Logger.getLogger(getClass().getName()).log(Level.SEVERE, e.getLocalizedMessage(), e);
    }
    return new Tab();
}
Also used : Tab(javafx.scene.control.Tab) IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) TabPane(javafx.scene.control.TabPane) Pane(javafx.scene.layout.Pane)

Example 8 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildReinvestDividendTab.

private SlipControllerContainer buildReinvestDividendTab(final String name) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ReinvestDividendSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final ReinvestDividendSlipController slipController = fxmlLoader.getController();
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 9 with Pane

use of javafx.scene.layout.Pane in project jgnash by ccavanaugh.

the class InvestmentSlipManager method buildReturnOfCapitalTab.

private SlipControllerContainer buildReturnOfCapitalTab(final String name) {
    try {
        final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ReturnOfCapitalSlip.fxml"), resources);
        final Pane pane = fxmlLoader.load();
        final ReturnOfCapitalSlipController slipController = fxmlLoader.getController();
        slipController.accountProperty().bind(accountProperty());
        return new SlipControllerContainer(name, slipController, pane);
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
Also used : IOException(java.io.IOException) FXMLLoader(javafx.fxml.FXMLLoader) StackPane(javafx.scene.layout.StackPane) Pane(javafx.scene.layout.Pane)

Example 10 with Pane

use of javafx.scene.layout.Pane in project trex-stateless-gui by cisco-system-traffic-generator.

the class NotificationPanel method buildUI.

/**
     * Build component UI
     */
private void buildUI() {
    this.setSpacing(5);
    // add notification message
    notificationContainer = new Pane();
    notificationContainer.setPrefSize(184, 64);
    notificationContainer.getStyleClass().add("notificationContainer");
    notificationLabel = new Label();
    notificationLabel.setPrefSize(155, 60);
    notificationLabel.setWrapText(true);
    notificationLabel.getStyleClass().add("notificationMsg");
    notificationContainer.getChildren().add(notificationLabel);
    getChildren().add(notificationContainer);
    // add notification icon
    VBox iconHolder = new VBox();
    iconHolder.setPrefHeight(68);
    iconHolder.setAlignment(Pos.CENTER);
    ImageView notificationIcon = new ImageView(new Image("/icons/info_icon.png"));
    notificationIcon.getStyleClass().add("notificationIcon");
    notificationIcon.setOnMouseClicked((MouseEvent event) -> {
        notificationContainer.setVisible(!notificationContainer.isVisible());
    });
    iconHolder.getChildren().add(notificationIcon);
    getChildren().add(iconHolder);
}
Also used : MouseEvent(javafx.scene.input.MouseEvent) Label(javafx.scene.control.Label) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Pane(javafx.scene.layout.Pane) VBox(javafx.scene.layout.VBox)

Aggregations

Pane (javafx.scene.layout.Pane)34 StackPane (javafx.scene.layout.StackPane)13 IOException (java.io.IOException)12 FXMLLoader (javafx.fxml.FXMLLoader)12 Node (javafx.scene.Node)7 BorderPane (javafx.scene.layout.BorderPane)6 Scene (javafx.scene.Scene)5 Label (javafx.scene.control.Label)5 ArrayList (java.util.ArrayList)4 AnchorPane (javafx.scene.layout.AnchorPane)4 Stage (javafx.stage.Stage)4 HashMap (java.util.HashMap)3 List (java.util.List)3 FXML (javafx.fxml.FXML)3 ScrollPane (javafx.scene.control.ScrollPane)3 UserThread (io.bitsquare.common.UserThread)2 Insets (javafx.geometry.Insets)2 Parent (javafx.scene.Parent)2 Button (javafx.scene.control.Button)2 TabPane (javafx.scene.control.TabPane)2