Java 类java.awt.peer.ContainerPeer 实例源码

项目:OpenJSharp    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:OpenJSharp    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:OpenJSharp    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:jdk8u-jdk    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:jdk8u-jdk    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:jdk8u-jdk    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:openjdk-jdk10    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.peer.reparent(parentPeer);
        }
    }
}
项目:openjdk-jdk10    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)peer, (Container)comp);
        }
    } else {
        comp.peer.reparent((ContainerPeer) peer);
    }
}
项目:openjdk-jdk10    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:openjdk9    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.peer.reparent(parentPeer);
        }
    }
}
项目:openjdk9    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
@SuppressWarnings("deprecation")
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)peer, (Container)comp);
        }
    } else {
        comp.peer.reparent((ContainerPeer) peer);
    }
}
项目:openjdk9    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:Java8CN    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:Java8CN    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:Java8CN    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:jdk8u_jdk    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:jdk8u_jdk    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:jdk8u_jdk    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:VarJ    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:VarJ    文件:Container.java   
/**
 * Reparents child component peer to this container peer. 
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:VarJ    文件:Container.java   
/**
    * Recursively descends the container tree and recomputes the
    * layout for any subtrees marked as needing it (those marked as
    * invalid).  Synchronization should be provided by the method
    * that calls this one:  <code>validate</code>.
    *
    * @see #doLayout
    * @see #validate
    */
   protected void validateTree() {
if (!valid) {
    if (peer instanceof ContainerPeer) {
    ((ContainerPeer)peer).beginLayout();
    }
    doLayout();
           Component component[] = this.component;
    for (int i = 0 ; i < ncomponents ; ++i) {
    Component comp = component[i];
    if (   (comp instanceof Container) 
            && !(comp instanceof Window)
        && !comp.valid) {
        ((Container)comp).validateTree();
    } else {
        comp.validate();
    }
    }
    if (peer instanceof ContainerPeer) {
    ((ContainerPeer)peer).endLayout();
    }
}
valid = true;
   }
项目:VarJ    文件:Container.java   
/** 
 * Makes this Container displayable by connecting it to
 * a native screen resource.  Making a container displayable will
 * cause all of its children to be made displayable.
 * This method is called internally by the toolkit and should
 * not be called directly by programs.
 * @see Component#isDisplayable
 * @see #removeNotify
 */
public void addNotify() {
    synchronized (getTreeLock()) {
 // addNotify() on the children may cause proxy event enabling
 // on this instance, so we first call super.addNotify() and
 // possibly create an lightweight event dispatcher before calling
 // addNotify() on the children which may be lightweight.
 super.addNotify();
 if (! (peer instanceof LightweightPeer)) {
     dispatcher = new LightweightDispatcher(this);
 }
 int ncomponents = this.ncomponents;
        Component component[] = this.component;
 for (int i = 0 ; i < ncomponents ; i++) {
     component[i].addNotify();
 }
        // Update stacking order if native platform allows
        ContainerPeer cpeer = (ContainerPeer)peer;
        if (cpeer.isRestackSupported()) {
            cpeer.restack();
        }


    }
}
项目:jdk-1.7-annotated    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:jdk-1.7-annotated    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:jdk-1.7-annotated    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:infobip-open-jdk-8    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:infobip-open-jdk-8    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:infobip-open-jdk-8    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:jdk8u-dev-jdk    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:jdk8u-dev-jdk    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:jdk8u-dev-jdk    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:jdk7-jdk    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:jdk7-jdk    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:jdk7-jdk    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}
项目:openjdk-source-code-learn    文件:Container.java   
/**
 * Traverses the tree of components and reparents children heavyweight component
 * to new heavyweight parent.
 * @since 1.5
 */
private void reparentTraverse(ContainerPeer parentPeer, Container child) {
    checkTreeLock();

    for (int i = 0; i < child.getComponentCount(); i++) {
        Component comp = child.getComponent(i);
        if (comp.isLightweight()) {
            // If components is lightweight check if it is container
            // If it is container it might contain heavyweight children we need to reparent
            if (comp instanceof Container) {
                reparentTraverse(parentPeer, (Container)comp);
            }
        } else {
            // Q: Need to update NativeInLightFixer?
            comp.getPeer().reparent(parentPeer);
        }
    }
}
项目:openjdk-source-code-learn    文件:Container.java   
/**
 * Reparents child component peer to this container peer.
 * Container must be heavyweight.
 * @since 1.5
 */
private void reparentChild(Component comp) {
    checkTreeLock();
    if (comp == null) {
        return;
    }
    if (comp.isLightweight()) {
        // If component is lightweight container we need to reparent all its explicit  heavyweight children
        if (comp instanceof Container) {
            // Traverse component's tree till depth-first until encountering heavyweight component
            reparentTraverse((ContainerPeer)getPeer(), (Container)comp);
        }
    } else {
        comp.getPeer().reparent((ContainerPeer)getPeer());
    }
}
项目:openjdk-source-code-learn    文件:Container.java   
/**
 * Unconditionally validate the component hierarchy.
 */
final void validateUnconditionally() {
    boolean updateCur = false;
    synchronized (getTreeLock()) {
        descendUnconditionallyWhenValidating = true;

        validate();
        if (peer instanceof ContainerPeer) {
            updateCur = isVisible();
        }

        descendUnconditionallyWhenValidating = false;
    }
    if (updateCur) {
        updateCursorImmediately();
    }
}