java.awt.peer.ContainerPeer Java Examples

The following examples show how to use java.awt.peer.ContainerPeer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Container.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #2
Source File: Container.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #3
Source File: Container.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #4
Source File: Container.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #5
Source File: Container.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #6
Source File: Container.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #7
Source File: Container.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #8
Source File: Container.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #9
Source File: Container.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #10
Source File: Container.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #11
Source File: Container.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #12
Source File: Container.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #13
Source File: Container.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #14
Source File: Container.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #15
Source File: Container.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #16
Source File: Container.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #17
Source File: Container.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #18
Source File: Container.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #19
Source File: Container.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #20
Source File: Container.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #21
Source File: Container.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #22
Source File: Container.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #23
Source File: Container.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #24
Source File: Container.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #25
Source File: Container.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #26
Source File: Container.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #27
Source File: Container.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example #28
Source File: Container.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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();
    }
}
 
Example #29
Source File: Container.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
        }
    }
}
 
Example #30
Source File: Container.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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());
    }
}