本文整理汇总了Java中java.awt.peer.ComponentPeer.createVolatileImage方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentPeer.createVolatileImage方法的具体用法?Java ComponentPeer.createVolatileImage怎么用?Java ComponentPeer.createVolatileImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.ComponentPeer
的用法示例。
在下文中一共展示了ComponentPeer.createVolatileImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createVolatileImage
import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
* Creates a volatile off-screen drawable image
* to be used for double buffering.
* @param width the specified width.
* @param height the specified height.
* @return an off-screen drawable image, which can be used for double
* buffering. The return value may be <code>null</code> if the
* component is not displayable. This will always happen if
* <code>GraphicsEnvironment.isHeadless()</code> returns
* <code>true</code>.
* @see java.awt.image.VolatileImage
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.4
*/
public VolatileImage createVolatileImage(int width, int height) {
ComponentPeer peer = this.peer;
if (peer instanceof LightweightPeer) {
if (parent != null) {
return parent.createVolatileImage(width, height);
}
else { return null;}
} else {
return (peer != null) ?
peer.createVolatileImage(width, height) : null;
}
}
示例2: createVolatileImage
import java.awt.peer.ComponentPeer; //导入方法依赖的package包/类
/**
* Creates a volatile off-screen drawable image to be used for double
* buffering.
*
* @param width the specified width
* @param height the specified height
* @return an off-screen drawable image, which can be used for double
* buffering. The {@code null} value if the component is not
* displayable or {@code GraphicsEnvironment.isHeadless()} returns
* {@code true}.
* @see java.awt.image.VolatileImage
* @see #isDisplayable
* @see GraphicsEnvironment#isHeadless
* @since 1.4
*/
public VolatileImage createVolatileImage(int width, int height) {
ComponentPeer peer = this.peer;
if (peer instanceof LightweightPeer) {
if (parent != null) {
return parent.createVolatileImage(width, height);
}
else { return null;}
} else {
return (peer != null) ?
peer.createVolatileImage(width, height) : null;
}
}