javafx.scene.Parent.sceneToLocal()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(190)

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

Parent.sceneToLocal介绍

暂无

代码示例

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

private ArrayList<Bounds> getMatchingBounds(String query, Text text) {
  Bounds textBounds = parent.sceneToLocal(text.localToScene(text.getBoundsInLocal()));

代码示例来源:origin: org.copper-engine/copper-monitoring-client

@Override
  public void handle(MouseEvent mouseEvent) {
    filterAreaPanes.setPrefWidth(allFilterParent.getParent().sceneToLocal(mouseEvent.getSceneX(), mouseEvent.getSceneY()).getX());
  }
});

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

private ArrayList<Bounds> getMatchingBounds(String query, Text text) {
  Bounds textBounds = parent.sceneToLocal(text.localToScene(text.getBoundsInLocal()));

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

public void performDragBegin(
      Node n, MouseEvent event) {

    final double parentScaleX = n.getParent().
        localToSceneTransformProperty().getValue().getMxx();
    final double parentScaleY = n.getParent().
        localToSceneTransformProperty().getValue().getMyy();

    // record the current mouse X and Y position on Node
    mouseX = event.getSceneX();
    mouseY = event.getSceneY();

    if (centerNode) {
      Point2D p2d = n.getParent().sceneToLocal(mouseX, mouseY);
      nodeX = p2d.getX();
      nodeY = p2d.getY();
    } else {
      nodeX = n.getLayoutX() * parentScaleX;
      nodeY = n.getLayoutY() * parentScaleY;
    }

    n.toFront();
  }
}

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

public void performDrag(
    Node n, MouseEvent event) {
  final double parentScaleX = n.getParent().
      localToSceneTransformProperty().getValue().getMxx();
  final double parentScaleY = n.getParent().
      localToSceneTransformProperty().getValue().getMyy();
  // Get the exact moved X and Y
  double offsetX = event.getSceneX() - mouseX;
  double offsetY = event.getSceneY() - mouseY;
  nodeX += offsetX;
  nodeY += offsetY;
  double scaledX;
  double scaledY;
  if (centerNode) {
    Point2D p2d = n.getParent().sceneToLocal(mouseX, mouseY);
    scaledX = p2d.getX();
    scaledY = p2d.getY();
  } else {
    scaledX = nodeX * 1 / (parentScaleX);
    scaledY = nodeY * 1 / (parentScaleY);
  }
  n.setLayoutX(scaledX);
  n.setLayoutY(scaledY);
  // again set current Mouse x AND y position
  mouseX = event.getSceneX();
  mouseY = event.getSceneY();
}

相关文章