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

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

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

Node.getBoundsInLocal介绍

暂无

代码示例

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

  1. OverLayRipple() {
  2. super();
  3. setOverLayBounds(this);
  4. this.getStyleClass().add("jfx-rippler-overlay");
  5. // update initial position
  6. if(JFXRippler.this.getChildrenUnmodifiable().contains(control)) {
  7. double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX());
  8. double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY());
  9. Bounds bounds = control.getBoundsInParent();
  10. this.setX(bounds.getMinX() + diffMinX - snappedLeftInset());
  11. this.setY(bounds.getMinY() + diffMinY - snappedTopInset());
  12. }
  13. // set initial attributes
  14. setOpacity(0);
  15. setCache(true);
  16. setCacheHint(CacheHint.SPEED);
  17. setCacheShape(true);
  18. setManaged(false);
  19. }
  20. }

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

  1. double width = control.getLayoutBounds().getWidth();
  2. double height = control.getLayoutBounds().getHeight();
  3. double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX());
  4. double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY());
  5. double diffMaxX = Math.abs(control.getBoundsInLocal().getMaxX() - control.getLayoutBounds().getMaxX());
  6. double diffMaxY = Math.abs(control.getBoundsInLocal().getMaxY() - control.getLayoutBounds().getMaxY());
  7. Node mask;
  8. switch (getMaskType()) {

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

  1. Node chartArea = chart.lookup(".chart-plot-background");
  2. Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());

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

  1. (burgerHeight / 2) - burger.getChildren()
  2. .get(0)
  3. .getBoundsInLocal()
  4. .getHeight() / 2,
  5. Interpolator.EASE_BOTH),
  6. -((burgerHeight / 2) - burger.getChildren()
  7. .get(0)
  8. .getBoundsInLocal()
  9. .getHeight() / 2),
  10. Interpolator.EASE_BOTH),

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

  1. (burgerHeight / 2) - burger.getChildren()
  2. .get(0)
  3. .getBoundsInLocal()
  4. .getHeight() / 2,
  5. Interpolator.EASE_BOTH),
  6. -((burgerHeight / 2) - burger.getChildren()
  7. .get(2)
  8. .getBoundsInLocal()
  9. .getHeight() / 2),
  10. Interpolator.EASE_BOTH),

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

  1. Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());

代码示例来源:origin: org.refcodes/refcodes-checkerboard-alt-javafx

  1. /**
  2. * Gets the scale Y.
  3. *
  4. * @param aSprite the sprite
  5. * @param aCheckerboard the checkerboard
  6. * @return the scale Y
  7. */
  8. protected static double getScaleY( Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard ) {
  9. return aCheckerboard.getFieldHeight() / aSprite.getBoundsInLocal().getHeight();
  10. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> moveToCenter() {
  3. Bounds bounds = node.getBoundsInLocal();
  4. moveTo(bounds.getWidth() / 2, bounds.getHeight() / 2);
  5. return this;
  6. }

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

  1. public <T extends Node & Caret> Bounds getCaretBoundsOnScreen(T caret) {
  2. layout(); // ensure layout, is a no-op if not dirty
  3. checkWithinParagraph(caret);
  4. Bounds localBounds = caret.getBoundsInLocal();
  5. return caret.localToScreen(localBounds);
  6. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> moveToCenter(Duration d) {
  3. Bounds bounds = node.getBoundsInLocal();
  4. return moveTo(d, bounds.getWidth() / 2, bounds.getHeight() / 2);
  5. }

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

  1. /**
  2. *
  3. * @param node
  4. * @return The Y scene coordinate of the node.
  5. */
  6. static public double sceneY(Node node) {
  7. return node.localToScene(node.getBoundsInLocal()).getMinY() + node.getScene().getY();
  8. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> moveTo(Duration d, double x, double y) {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. controller.run(Move.to(d,bounds.getMinX() + x, bounds.getMinY() + y));
  5. return null;
  6. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> dragTo(double x, double y) {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. controller.run(Drag.to(bounds.getWidth() / 2, bounds.getHeight() / 2, x, y));
  5. return this;
  6. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> dragTo(Duration d, double x, double y) {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. controller.run(Drag.to(d, bounds.getWidth() / 2, bounds.getHeight() / 2, x, y));
  5. return this;
  6. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public Point2D center() {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. return new Point2D(bounds.getMinX() + bounds.getWidth()/2, bounds.getMinY() + bounds.getHeight()/2);
  5. }

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

  1. /**
  2. *
  3. * @param node
  4. * @return The Y screen coordinate of the node.
  5. */
  6. static public double screenY(Node node) {
  7. return node.localToScene(node.getBoundsInLocal()).getMinY() + node.getScene().getY() + node.getScene().getWindow().getY();
  8. }

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

  1. /**
  2. *
  3. * @param node
  4. * @return The X screen coordinate of the node.
  5. */
  6. static public double screenX(Node node) {
  7. return node.localToScene(node.getBoundsInLocal()).getMinX()
  8. + node.getScene().getX() + node.getScene().getWindow().getX();
  9. }

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

  1. /**
  2. *
  3. * @param node
  4. * @return The X screen coordinate of the node.
  5. */
  6. static public double screenX(Node node) {
  7. return node.localToScene(node.getBoundsInLocal()).getMinX() + node.getScene().getX() + node.getScene().getWindow().getX();
  8. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> dragBy(Duration d, double dx, double dy) {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. controller.run(Drag.by(d, bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy));
  5. return this;
  6. }

代码示例来源:origin: at.bestsolution.fx.test/at.bestsolution.fx.test.rcontrol

  1. @Override
  2. public RNode<T> dragBy(double dx, double dy) {
  3. Bounds bounds = node.localToScreen(node.getBoundsInLocal());
  4. controller.run(Drag.by( bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy));
  5. return this;
  6. }

相关文章

Node类方法