当前位置: 首页>>代码示例>>Java>>正文


Java ComponentPeer.isObscured方法代码示例

本文整理汇总了Java中java.awt.peer.ComponentPeer.isObscured方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentPeer.isObscured方法的具体用法?Java ComponentPeer.isObscured怎么用?Java ComponentPeer.isObscured使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.peer.ComponentPeer的用法示例。


在下文中一共展示了ComponentPeer.isObscured方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: needsRepaintAfterBlit

import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:JViewport.java

示例2: needsRepaintAfterBlit

import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:JViewport.java


注:本文中的java.awt.peer.ComponentPeer.isObscured方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。