javafx.stage.Window.getUserData()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(126)

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

Window.getUserData介绍

暂无

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls

if (!FIND_NODE_EXCLUDE.equals(window.getUserData()) && new BoundingBox(window.getX(), window.getY(), window.getWidth(), window.getHeight()).contains(screenX, screenY)) {
  return findNode(window.getScene().getRoot(), screenX, screenY);

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

/**
 * Find a node in all windows
 *
 * @param w
 *            the preferred window
 * @param screenX
 *            the screen x
 * @param screenY
 *            the screen y
 * @return the node or <code>null</code>
 */
@SuppressWarnings("deprecation")
public static Node findNode(Window w, double screenX, double screenY) {
  // First check the owner
  if (new BoundingBox(w.getX(), w.getY(), w.getWidth(), w.getHeight()).contains(screenX, screenY)) {
    return findNode(w.getScene().getRoot(), screenX, screenY);
  }
  // FIXME If multiple match take the closest
  Iterator<Window> impl_getWindows = Window.impl_getWindows();
  while (impl_getWindows.hasNext()) {
    Window window = impl_getWindows.next();
    if (!FIND_NODE_EXCLUDE.equals(window.getUserData()) && new BoundingBox(window.getX(), window.getY(), window.getWidth(), window.getHeight()).contains(screenX, screenY)) {
      return findNode(window.getScene().getRoot(), screenX, screenY);
    }
  }
  return null;
}

相关文章