Search in sources :

Example 1 with Window

use of javafx.stage.Window in project JFoenix by jfoenixadmin.

the class JFXPopup method show.

/**
	 * show the popup according to the specified position with a certain offset
	 * 
	 * @param vAlign can be TOP/BOTTOM
	 * @param hAlign can be LEFT/RIGHT
	 * @param initOffsetX on the x axis
	 * @param initOffsetY on the y axis
	 */
public void show(Node node, PopupVPosition vAlign, PopupHPosition hAlign, double initOffsetX, double initOffsetY) {
    if (!isShowing()) {
        if (node.getScene() == null || node.getScene().getWindow() == null)
            throw new IllegalStateException("Can not show popup. The node must be attached to a scene/window.");
        Window parent = node.getScene().getWindow();
        this.show(parent, parent.getX() + node.localToScene(0, 0).getX() + node.getScene().getX() + (PopupHPosition.RIGHT.equals(hAlign) ? ((Region) node).getWidth() : 0), parent.getY() + node.localToScene(0, 0).getY() + node.getScene().getY() + (PopupVPosition.BOTTOM.equals(vAlign) ? ((Region) node).getHeight() : 0));
        ((JFXPopupSkin) getSkin()).reset(vAlign, hAlign, initOffsetX, initOffsetY);
        Platform.runLater(() -> ((JFXPopupSkin) getSkin()).animate());
    }
}
Also used : Window(javafx.stage.Window) JFXPopupSkin(com.jfoenix.skins.JFXPopupSkin) Region(javafx.scene.layout.Region)

Example 2 with Window

use of javafx.stage.Window in project bitsquare by bitsquare.

the class PasswordTextField method getErrorPopupPosition.

private Point2D getErrorPopupPosition() {
    Window window = getScene().getWindow();
    Point2D point;
    point = layoutReference.localToScene(0, 0);
    double x = Math.floor(point.getX() + window.getX() + layoutReference.getWidth() + 20 - getPadding().getLeft() - getPadding().getRight());
    double y = Math.floor(point.getY() + window.getY() + getHeight() / 2 - getPadding().getTop() - getPadding().getBottom());
    return new Point2D(x, y);
}
Also used : Window(javafx.stage.Window) Point2D(javafx.geometry.Point2D)

Example 3 with Window

use of javafx.stage.Window in project bitsquare by bitsquare.

the class Notification method layout.

@Override
protected void layout() {
    Window window = owner.getScene().getWindow();
    double titleBarHeight = window.getHeight() - owner.getScene().getHeight();
    stage.setX(Math.round(window.getX() + window.getWidth() - stage.getWidth()));
    stage.setY(Math.round(window.getY() + titleBarHeight));
}
Also used : Window(javafx.stage.Window)

Example 4 with Window

use of javafx.stage.Window in project Gargoyle by callakrsos.

the class ExceptionDialogComposite method show.

/**
	 * 다이얼로그 OPEN.
	 * 
	 * @작성자 : KYJ
	 * @작성일 : 2016. 8. 23.
	 * @param node
	 */
public void show(Node node) {
    Window _root = null;
    if (node != null) {
        Scene _scene = node.getScene();
        if (_scene != null) {
            _root = _scene.getWindow();
        }
    }
    show(_root);
}
Also used : Window(javafx.stage.Window) Scene(javafx.scene.Scene)

Example 5 with Window

use of javafx.stage.Window 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)

Aggregations

Window (javafx.stage.Window)27 Scene (javafx.scene.Scene)11 Stage (javafx.stage.Stage)6 FXML (javafx.fxml.FXML)4 Point2D (javafx.geometry.Point2D)4 Button (javafx.scene.control.Button)4 TextField (javafx.scene.control.TextField)4 SkinManager (com.kyj.fx.voeditor.visual.momory.SkinManager)3 File (java.io.File)3 IOException (java.io.IOException)3 Optional (java.util.Optional)3 ObservableList (javafx.collections.ObservableList)3 Node (javafx.scene.Node)3 TextArea (javafx.scene.control.TextArea)3 Tooltip (javafx.scene.control.Tooltip)3 BorderPane (javafx.scene.layout.BorderPane)3 Profile (com.exalttech.trex.remote.models.profiles.Profile)2 DialogWindow (com.exalttech.trex.ui.dialog.DialogWindow)2 TableProfile (com.exalttech.trex.ui.views.models.TableProfile)2 TrafficProfile (com.exalttech.trex.util.TrafficProfile)2