JFXNodeUtils.updateBackground(((Region) control).getBackground(), (Region) mask); mask.resize(width, height); mask.relocate(bounds.getMinX() + diffMinX, bounds.getMinY() + diffMinY); break;
@Override public void resize(Node node, double breadth, double length) { node.resize(breadth, length); }
@Override public void resize(Node node, double breadth, double length) { node.resize(length, breadth); }
Node backgroundNode = getBackgroundNode(); backgroundNode.resize(1080, 720); backgroundNode.snapshot(new SnapshotParameters(), null);
@Override protected void layoutChildren() { super.layoutChildren(); for(Node child : getChildren()) { if(!child.equals(playIcon) && !child.equals(pauseIcon)) { child.relocate(0, 0); child.resize(getWidth(), getHeight()); } } } }
private class MyLayer extends Layer { private final Node root; private final double size = 150; public MyLayer() { root = new StackPane(new Button("A custom layer")); root.setStyle("-fx-background-color: white;"); getChildren().add(root); getGlassPane().getLayers().add(this); } @Override public void layoutChildren() { root.setVisible(isShowing()); if (!isShowing()) { return; } root.resize(size, size); resizeRelocate((getGlassPane().getWidth() - size)/2, (getGlassPane().getHeight()- size)/2, size, size); } }
@Override protected void layoutChildren() { getParent().requestLayout(); super.layoutChildren(); for (Node n : getManagedChildren()) { if (n instanceof Region) { Region p = (Region) n; double width = Math.max(p.getMinWidth(), p.getPrefWidth()); double height = Math.max(p.getMinHeight(), p.getPrefHeight()); n.resize(width, height); double nX = Math.min(0, n.getLayoutX()); double nY = Math.min(0, n.getLayoutY()); n.relocate(nX, nY); } } }
@Override protected void layoutChildren() { double width = getLayoutBounds().getWidth(); double height = getLayoutBounds().getHeight(); content.resize(width / zoom.getX(), height/ zoom.getY()); }
lNode.resize(lNodeLayoutInfo.w, lNodeLayoutInfo.h);
@Override protected void layoutChildren(double x, double y, double w, double h) { for (int i = 0; i < getChildren().size(); i++) { Node n = getChildren().get(i); double nw = snapSize(n.prefWidth(h)); double nh = snapSize(n.prefHeight(-1)); if (i > 0) { // We have to position the bread crumbs slightly overlapping double ins = n instanceof BreadCrumbButton ? ((BreadCrumbButton)n).getArrowWidth() : 0; x = snapPosition(x - ins); } n.resize(nw, nh); n.relocate(x, y); x += nw; } }
@Override protected void layoutChildren() { double layoutWidth = getLayoutBounds().getWidth(); double layoutHeight = getLayoutBounds().getHeight(); boolean vbarVisible = vbar.isVisible(); boolean hbarVisible = hbar.isVisible(); double vbarWidth = vbarVisible ? vbar.prefWidth(-1) : 0; double hbarHeight = hbarVisible ? hbar.prefHeight(-1) : 0; double w = layoutWidth - vbarWidth; double h = layoutHeight - hbarHeight; content.resize(w, h); hbar.setVisibleAmount(w); vbar.setVisibleAmount(h); if(vbarVisible) { vbar.resizeRelocate(layoutWidth - vbarWidth, 0, vbarWidth, h); } if(hbarVisible) { hbar.resizeRelocate(0, layoutHeight - hbarHeight, w, hbarHeight); } }
@Override protected void layoutChildren(double x, double y, double w, double h) { // double currentWidth = getSkinnable().getWidth(); double cellWidth = getSkinnable().gridViewProperty().get().getCellWidth(); double cellHeight = getSkinnable().gridViewProperty().get().getCellHeight(); double horizontalCellSpacing = getSkinnable().gridViewProperty().get().getHorizontalCellSpacing(); double verticalCellSpacing = getSkinnable().gridViewProperty().get().getVerticalCellSpacing(); double xPos = 0; double yPos = 0; // This has been commented out as I removed the API from GridView until // a use case was created. // HPos currentHorizontalAlignment = getSkinnable().gridViewProperty().get().getHorizontalAlignment(); // if (currentHorizontalAlignment != null) { // if (currentHorizontalAlignment.equals(HPos.CENTER)) { // xPos = (currentWidth % computeCellWidth()) / 2; // } else if (currentHorizontalAlignment.equals(HPos.RIGHT)) { // xPos = currentWidth % computeCellWidth(); // } // } for (Node child : getChildren()) { child.relocate(xPos + horizontalCellSpacing, yPos + verticalCellSpacing); child.resize(cellWidth, cellHeight); xPos = xPos + horizontalCellSpacing + cellWidth + horizontalCellSpacing; } } }
JFXNodeUtils.updateBackground(((Region) control).getBackground(), (Region) mask); mask.resize(width, height); mask.relocate(bounds.getMinX() + diffMinX, bounds.getMinY() + diffMinY); break;
node.resize(w - SHADOW_WIDTH * 2 - ROUNDED_DELTA * 2, h - SHADOW_WIDTH * 2 - ROUNDED_DELTA * 2); node.setLayoutX(SHADOW_WIDTH + ROUNDED_DELTA); node.setLayoutY(SHADOW_WIDTH + ROUNDED_DELTA);