Java Code Examples for java.awt.peer.ContainerPeer

The following examples show how to use java.awt.peer.ContainerPeer. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: jdk1.8-source-analysis   Source File: Container.java    License: 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 2
Source Project: jdk1.8-source-analysis   Source File: Container.java    License: 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 Project: dragonwell8_jdk   Source File: Container.java    License: 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 4
Source Project: dragonwell8_jdk   Source File: Container.java    License: 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 5
Source Project: dragonwell8_jdk   Source File: Container.java    License: 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 6
Source Project: TencentKona-8   Source File: Container.java    License: 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 7
Source Project: TencentKona-8   Source File: Container.java    License: 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 8
Source Project: TencentKona-8   Source File: Container.java    License: 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 9
Source Project: openjdk-8-source   Source File: Container.java    License: 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 10
Source Project: jdk8u60   Source File: Container.java    License: 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 Project: jdk8u_jdk   Source File: Container.java    License: 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 Project: JDKSourceCode1.8   Source File: Container.java    License: 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 Project: JDKSourceCode1.8   Source File: Container.java    License: 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 Project: openjdk-jdk8u   Source File: Container.java    License: 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 Project: openjdk-jdk8u   Source File: Container.java    License: 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 Project: hottub   Source File: Container.java    License: 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 17
/**
 * 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
/**
 * 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 Project: Bytecoder   Source File: Container.java    License: 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 Project: Bytecoder   Source File: Container.java    License: 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 Project: Bytecoder   Source File: Container.java    License: 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 Project: openjdk-jdk9   Source File: Container.java    License: 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 Project: openjdk-jdk9   Source File: Container.java    License: 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 Project: openjdk-8   Source File: Container.java    License: 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 Project: jdk8u-jdk   Source File: Container.java    License: 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 Project: jdk8u-jdk   Source File: Container.java    License: 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 Project: Java8CN   Source File: Container.java    License: 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 Project: openjdk-8-source   Source File: Container.java    License: 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 Project: openjdk-8-source   Source File: Container.java    License: 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 Project: openjdk-8   Source File: Container.java    License: 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());
    }
}