Java Code Examples for java.awt.peer.ComponentPeer#isObscured()

The following examples show how to use java.awt.peer.ComponentPeer#isObscured() . 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: JViewport.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 2
Source File: JViewport.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 3
Source File: JViewport.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 4
Source File: JViewport.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 5
Source File: JViewport.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 6
Source File: JViewport.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 7
Source File: JViewport.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 8
Source File: JViewport.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 9
Source File: JViewport.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 10
Source File: JViewport.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 11
Source File: JViewport.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 12
Source File: JViewport.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 13
Source File: JViewport.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 14
Source File: JViewport.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 15
Source File: JViewport.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = heavyParent.getPeer();

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 16
Source File: JViewport.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = AWTAccessor.getComponentAccessor()
                                        .getPeer(heavyParent);

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}
 
Example 17
Source File: JViewport.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Returns true if the component needs to be completely repainted after
 * a blit and a paint is received.
 */
private boolean needsRepaintAfterBlit() {
    // Find the first heavy weight ancestor. isObscured and
    // canDetermineObscurity are only appropriate for heavy weights.
    Component heavyParent = getParent();

    while (heavyParent != null && heavyParent.isLightweight()) {
        heavyParent = heavyParent.getParent();
    }

    if (heavyParent != null) {
        ComponentPeer peer = AWTAccessor.getComponentAccessor()
                                        .getPeer(heavyParent);

        if (peer != null && peer.canDetermineObscurity() &&
                            !peer.isObscured()) {
            // The peer says we aren't obscured, therefore we can assume
            // that we won't later be messaged to paint a portion that
            // we tried to blit that wasn't valid.
            // It is certainly possible that when we blited we were
            // obscured, and by the time this is invoked we aren't, but the
            // chances of that happening are pretty slim.
            return false;
        }
    }
    return true;
}