本文整理汇总了Java中java.awt.peer.ComponentPeer.checkImage方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentPeer.checkImage方法的具体用法?Java ComponentPeer.checkImage怎么用?Java ComponentPeer.checkImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.ComponentPeer
的用法示例。
在下文中一共展示了ComponentPeer.checkImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkImage
import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
* application must use the <code>prepareImage</code> method
* to force the loading of an image.
* <p>
* The <code>checkImage</code> method of <code>Component</code>
* calls its peer's <code>checkImage</code> method to calculate
* the flags. If this component does not yet have a peer, the
* component's toolkit's <code>checkImage</code> method is called
* instead.
* <p>
* Information on the flags returned by this method can be found
* with the discussion of the <code>ImageObserver</code> interface.
* @param image the <code>Image</code> object whose status
* is being checked
* @param width the width of the scaled version
* whose status is to be checked
* @param height the height of the scaled version
* whose status is to be checked
* @param observer the <code>ImageObserver</code> object
* to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
* <code>ImageObserver</code> flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since JDK1.0
*/
public int checkImage(Image image, int width, int height,
ImageObserver observer) {
ComponentPeer peer = this.peer;
if (peer instanceof LightweightPeer) {
return (parent != null)
? parent.checkImage(image, width, height, observer)
: getToolkit().checkImage(image, width, height, observer);
} else {
return (peer != null)
? peer.checkImage(image, width, height, observer)
: getToolkit().checkImage(image, width, height, observer);
}
}
示例2: checkImage
import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
* Returns the status of the construction of a screen representation
* of the specified image.
* <p>
* This method does not cause the image to begin loading. An
* application must use the {@code prepareImage} method
* to force the loading of an image.
* <p>
* The {@code checkImage} method of {@code Component}
* calls its peer's {@code checkImage} method to calculate
* the flags. If this component does not yet have a peer, the
* component's toolkit's {@code checkImage} method is called
* instead.
* <p>
* Information on the flags returned by this method can be found
* with the discussion of the {@code ImageObserver} interface.
* @param image the {@code Image} object whose status
* is being checked
* @param width the width of the scaled version
* whose status is to be checked
* @param height the height of the scaled version
* whose status is to be checked
* @param observer the {@code ImageObserver} object
* to be notified as the image is being prepared
* @return the bitwise inclusive <b>OR</b> of
* {@code ImageObserver} flags indicating what
* information about the image is currently available
* @see #prepareImage(Image, int, int, java.awt.image.ImageObserver)
* @see Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
* @see java.awt.image.ImageObserver
* @since 1.0
*/
public int checkImage(Image image, int width, int height,
ImageObserver observer) {
ComponentPeer peer = this.peer;
if (peer instanceof LightweightPeer) {
return (parent != null)
? parent.checkImage(image, width, height, observer)
: getToolkit().checkImage(image, width, height, observer);
} else {
return (peer != null)
? peer.checkImage(image, width, height, observer)
: getToolkit().checkImage(image, width, height, observer);
}
}