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

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

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

Parent.getParent介绍

暂无

代码示例

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

private static DecorationPane getDecorationPaneInParentHierarchy(Node target) {
    Parent p = target.getParent();
    while (p != null) {
      if (p instanceof DecorationPane) {
        return (DecorationPane) p;
      }
      p = p.getParent();
    }
    return null;
  }
}

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

/**
 * Returns all ancestors of the specified node till the specified one is
 * reached.
 *
 * @param n scene graph node
 * @param parent scene graph parent
 * @return a list that contains all ancestors of the specified node
 */
public static List<Parent> getAncestors(Node n, Parent parent) {
  List<Parent> nParents = new ArrayList<>();
  Parent p = n.getParent();
  while (p != null && p != parent) {
    nParents.add(p);
    p = p.getParent();
  }
  return nParents;
}

代码示例来源:origin: org.tentackle/tentackle-fx

@Override
public FxContainer getParentContainer() {
 Parent parent = getNode().getParent();
 while (parent != null) {
  if (parent instanceof FxContainer) {
   return (FxContainer) parent;
  }
  parent = parent.getParent();
 }
 return null;
}

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

public static void injectPane(Parent parent, Parent injectedParent, boolean useReflection) {
  if (parent == null) {
    throw new IllegalArgumentException("parent can not be null"); //$NON-NLS-1$
  }
  
  List<Node> ownerParentChildren = getChildren(parent.getParent(), useReflection);
  
  // we've got the children list, now we need to insert a temporary
  // layout container holding our dialogs and opaque layer / effect
  // in place of the owner (the owner will become a child of the dialog
  // stack)
  int ownerPos = ownerParentChildren.indexOf(parent);
  ownerParentChildren.remove(ownerPos);
  ownerParentChildren.add(ownerPos, injectedParent);
  
  // now we install the parent as a child of the injectedParent
  getChildren(injectedParent, useReflection).add(0, parent);
  
  // copy in layout properties, etc, so that the dialogStack displays
  // properly in (hopefully) whatever layout the owner node is in
  injectedParent.getProperties().putAll(parent.getProperties());
}

代码示例来源:origin: eu.mihosoft.vrl.jcsg/jcsg

Parent parent = p.getParent();
if (parent instanceof Group) {
  trEmpty++;

代码示例来源:origin: eu.mihosoft.vrl.jcsg/jcsg

private void removeEmptyGroups() {
  for (Parent p : emptyParents) {
    Parent parent = p.getParent();
    Group g = (Group) parent;
    g.getChildren().addAll(p.getChildrenUnmodifiable());
    g.getChildren().remove(p);
  }
}

相关文章