private void updateWidth() { Window stage = getOwner(); setWidth(stage.getScene().getWidth()); }
private void updateHeight() { Window stage = getOwner(); setHeight(stage.getScene().getHeight()); }
private void addLayoutListeners() { Window stage = getOwner(); if (stage != null) { if (widthListener == null) { throw new RuntimeException("Owner can only be set using the constructor"); } stage.getScene().widthProperty().addListener(widthListener); stage.getScene().heightProperty().addListener(heightListener); stage.xProperty().addListener(xListener); stage.yProperty().addListener(yListener); } }
private void removeLayoutListeners() { Window stage = getOwner(); if (stage != null) { stage.getScene().widthProperty().removeListener(widthListener); stage.getScene().heightProperty().removeListener(heightListener); stage.xProperty().removeListener(xListener); stage.yProperty().removeListener(yListener); } }
private void updateY() { Window stage = getOwner(); setY(stage.getY() + stage.getScene().getY()); }
private void updateX() { Window stage = getOwner(); setX(stage.getX() + stage.getScene().getX()); }
customScene = new Scene(pickerDecorator, Color.TRANSPARENT); if(owner!=null) { final Scene ownerScene = owner.getScene(); if (ownerScene != null) { if (ownerScene.getUserAgentStylesheet() != null) {
/** * @return the stylesheets to use */ protected List<String> getStylesheets() { if (this.parent != null) { return Collections.unmodifiableList(this.parent.getScene().getStylesheets()); } return Collections.emptyList(); }
private PopupWindow getPopupWindow() { @SuppressWarnings("deprecation") final Iterator<Window> windows = Window.impl_getWindows(); while (windows.hasNext()) { final Window window = windows.next(); if (window instanceof PopupWindow) { if(window.getScene()!=null && window.getScene().getRoot()!=null){ Parent root = window.getScene().getRoot(); if(root.getChildrenUnmodifiable().size()>0){ Node popup = root.getChildrenUnmodifiable().get(0); if(popup.lookup(".fxvk")!=null){ return (PopupWindow)window; } } } return null; } } return null; }
@Override public Set<T> apply( Window input ) { return findAllRecursively(predicate, input.getScene().getRoot()); } } );
@Override public Set<Node> apply( Window input ) { return findAllRecursively(matcher, input.getScene().getRoot()); } } );
public static List<Node> getAllNodesInWindow(Window window) { Parent root = Optional.of(window).map(w -> w.getScene()).map(s -> s.getRoot()).get(); if (root == null) { return new ArrayList<>(); } else { List<Node> ret = new ArrayList<>(); ret.add(root); ret.addAll(getAllNodesInParent(root)); return ret; } }
public static List<Node> getAllNodesInWindow(Window window) { Parent root = Optional.of(window).map(w -> w.getScene()).map(s -> s.getRoot()).get(); if (root == null) { return new ArrayList<>(); } else { List<Node> ret = new ArrayList<>(); ret.add(root); ret.addAll(getAllNodesInParent(root)); return ret; } }
private void updateHeight() { Window stage = getOwner(); setHeight(stage.getScene().getHeight()); }
private void updateWidth() { Window stage = getOwner(); setWidth(stage.getScene().getWidth()); }
private void addLayoutListeners() { Window stage = getOwner(); if (stage != null) { if (widthListener == null) { throw new RuntimeException("Owner can only be set using the constructor"); } stage.getScene().widthProperty().addListener(widthListener); stage.getScene().heightProperty().addListener(heightListener); stage.xProperty().addListener(xListener); stage.yProperty().addListener(yListener); } }
private void updateX() { Window stage = getOwner(); setX(stage.getX() + stage.getScene().getX()); }
private void updateY() { Window stage = getOwner(); setY(stage.getY() + stage.getScene().getY()); }
private void removeLayoutListeners() { Window stage = getOwner(); if (stage != null) { stage.getScene().widthProperty().removeListener(widthListener); stage.getScene().heightProperty().removeListener(heightListener); stage.xProperty().removeListener(xListener); stage.yProperty().removeListener(yListener); } }
public static void addResponsiveToWindow(Window window) { StringProperty stylesheet = new SimpleStringProperty(getCurrentResponsiveStylesheet(window)); Util.bindStyleSheetToWindow(window, stylesheet); updatePseudoClassesForAllChildren(window); //TODO: Falsch! Hier muss der ursprünglich gesetzte Wert gespeichert werden! managed müsste eine styledProperty sein updateManagedPropertyForAllChildren(window); Util.registerRecursiveChildObserver(window, n -> removeAllPseudoClasses(n), n -> updatePseudoClasses(n, getTypeForWindow(window))); window.widthProperty().addListener(e -> { stylesheet.setValue(getCurrentResponsiveStylesheet(window)); updatePseudoClassesForAllChildren(window); updateManagedPropertyForAllChildren(window); }); window.getScene().getRoot().layout(); }