javafx.scene.Node.resize()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(256)

本文整理了Java中javafx.scene.Node.resize()方法的一些代码示例,展示了Node.resize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.resize()方法的具体详情如下:
包路径:javafx.scene.Node
类名称:Node
方法名:resize

Node.resize介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

  1. JFXNodeUtils.updateBackground(((Region) control).getBackground(), (Region) mask);
  2. mask.resize(width, height);
  3. mask.relocate(bounds.getMinX() + diffMinX, bounds.getMinY() + diffMinY);
  4. break;

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public void resize(Node node, double breadth, double length) {
  3. node.resize(breadth, length);
  4. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public void resize(Node node, double breadth, double length) {
  3. node.resize(length, breadth);
  4. }

代码示例来源:origin: stackoverflow.com

  1. Node backgroundNode = getBackgroundNode();
  2. backgroundNode.resize(1080, 720);
  3. backgroundNode.snapshot(new SnapshotParameters(), null);

代码示例来源:origin: com.guigarage/animations

  1. @Override
  2. protected void layoutChildren() {
  3. super.layoutChildren();
  4. for(Node child : getChildren()) {
  5. if(!child.equals(playIcon) && !child.equals(pauseIcon)) {
  6. child.relocate(0, 0);
  7. child.resize(getWidth(), getHeight());
  8. }
  9. }
  10. }
  11. }

代码示例来源:origin: stackoverflow.com

  1. private class MyLayer extends Layer {
  2. private final Node root;
  3. private final double size = 150;
  4. public MyLayer() {
  5. root = new StackPane(new Button("A custom layer"));
  6. root.setStyle("-fx-background-color: white;");
  7. getChildren().add(root);
  8. getGlassPane().getLayers().add(this);
  9. }
  10. @Override
  11. public void layoutChildren() {
  12. root.setVisible(isShowing());
  13. if (!isShowing()) {
  14. return;
  15. }
  16. root.resize(size, size);
  17. resizeRelocate((getGlassPane().getWidth() - size)/2, (getGlassPane().getHeight()- size)/2, size, size);
  18. }
  19. }

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

  1. @Override
  2. protected void layoutChildren() {
  3. getParent().requestLayout();
  4. super.layoutChildren();
  5. for (Node n : getManagedChildren()) {
  6. if (n instanceof Region) {
  7. Region p = (Region) n;
  8. double width = Math.max(p.getMinWidth(), p.getPrefWidth());
  9. double height = Math.max(p.getMinHeight(), p.getPrefHeight());
  10. n.resize(width, height);
  11. double nX = Math.min(0, n.getLayoutX());
  12. double nY = Math.min(0, n.getLayoutY());
  13. n.relocate(nX, nY);
  14. }
  15. }
  16. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. protected void layoutChildren() {
  3. double width = getLayoutBounds().getWidth();
  4. double height = getLayoutBounds().getHeight();
  5. content.resize(width / zoom.getX(), height/ zoom.getY());
  6. }

代码示例来源:origin: org.jfxtras/jfxtras-common

  1. lNode.resize(lNodeLayoutInfo.w, lNodeLayoutInfo.h);

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override protected void layoutChildren(double x, double y, double w, double h) {
  2. for (int i = 0; i < getChildren().size(); i++) {
  3. Node n = getChildren().get(i);
  4. double nw = snapSize(n.prefWidth(h));
  5. double nh = snapSize(n.prefHeight(-1));
  6. if (i > 0) {
  7. // We have to position the bread crumbs slightly overlapping
  8. double ins = n instanceof BreadCrumbButton ? ((BreadCrumbButton)n).getArrowWidth() : 0;
  9. x = snapPosition(x - ins);
  10. }
  11. n.resize(nw, nh);
  12. n.relocate(x, y);
  13. x += nw;
  14. }
  15. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. protected void layoutChildren() {
  3. double layoutWidth = getLayoutBounds().getWidth();
  4. double layoutHeight = getLayoutBounds().getHeight();
  5. boolean vbarVisible = vbar.isVisible();
  6. boolean hbarVisible = hbar.isVisible();
  7. double vbarWidth = vbarVisible ? vbar.prefWidth(-1) : 0;
  8. double hbarHeight = hbarVisible ? hbar.prefHeight(-1) : 0;
  9. double w = layoutWidth - vbarWidth;
  10. double h = layoutHeight - hbarHeight;
  11. content.resize(w, h);
  12. hbar.setVisibleAmount(w);
  13. vbar.setVisibleAmount(h);
  14. if(vbarVisible) {
  15. vbar.resizeRelocate(layoutWidth - vbarWidth, 0, vbarWidth, h);
  16. }
  17. if(hbarVisible) {
  18. hbar.resizeRelocate(0, layoutHeight - hbarHeight, w, hbarHeight);
  19. }
  20. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override protected void layoutChildren(double x, double y, double w, double h) {
  2. // double currentWidth = getSkinnable().getWidth();
  3. double cellWidth = getSkinnable().gridViewProperty().get().getCellWidth();
  4. double cellHeight = getSkinnable().gridViewProperty().get().getCellHeight();
  5. double horizontalCellSpacing = getSkinnable().gridViewProperty().get().getHorizontalCellSpacing();
  6. double verticalCellSpacing = getSkinnable().gridViewProperty().get().getVerticalCellSpacing();
  7. double xPos = 0;
  8. double yPos = 0;
  9. // This has been commented out as I removed the API from GridView until
  10. // a use case was created.
  11. // HPos currentHorizontalAlignment = getSkinnable().gridViewProperty().get().getHorizontalAlignment();
  12. // if (currentHorizontalAlignment != null) {
  13. // if (currentHorizontalAlignment.equals(HPos.CENTER)) {
  14. // xPos = (currentWidth % computeCellWidth()) / 2;
  15. // } else if (currentHorizontalAlignment.equals(HPos.RIGHT)) {
  16. // xPos = currentWidth % computeCellWidth();
  17. // }
  18. // }
  19. for (Node child : getChildren()) {
  20. child.relocate(xPos + horizontalCellSpacing, yPos + verticalCellSpacing);
  21. child.resize(cellWidth, cellHeight);
  22. xPos = xPos + horizontalCellSpacing + cellWidth + horizontalCellSpacing;
  23. }
  24. }
  25. }

代码示例来源:origin: com.jfoenix/jfoenix

  1. JFXNodeUtils.updateBackground(((Region) control).getBackground(), (Region) mask);
  2. mask.resize(width, height);
  3. mask.relocate(bounds.getMinX() + diffMinX, bounds.getMinY() + diffMinY);
  4. break;

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

  1. node.resize(w - SHADOW_WIDTH * 2 - ROUNDED_DELTA * 2, h - SHADOW_WIDTH * 2 - ROUNDED_DELTA * 2);
  2. node.setLayoutX(SHADOW_WIDTH + ROUNDED_DELTA);
  3. node.setLayoutY(SHADOW_WIDTH + ROUNDED_DELTA);

相关文章

Node类方法