本文整理汇总了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;
}
示例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;
}