@Override
  protected int getLayer(final Graph2D graph, final Node node) {
    final boolean isGroupNode = graph.getRealizer(node) instanceof ZyGroupNodeRealizer<?>;
    if ((graph.isSelected(node) || isAnyParentNodeSelected(node)) && !isGroupNode) {
      return 3;
    } else if ((m_node == node) && !isGroupNode) {
      return 4;
    } else if (isGroupNode) {
      return 1;
    } else {
      return 2;
    }
  }
Determines whether any of the parent nodes of the given node is selected.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/ZyGraphLayeredRenderer.java