本文整理了Java中java.awt.Canvas.isDisplayable()
方法的一些代码示例,展示了Canvas.isDisplayable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.isDisplayable()
方法的具体详情如下:
包路径:java.awt.Canvas
类名称:Canvas
方法名:isDisplayable
暂无
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
while (!canvas.isDisplayable()){
try {
Thread.sleep(10);
代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl
while (!canvas.isDisplayable()){
try {
Thread.sleep(10);
代码示例来源:origin: org.processing/core
synchronized protected void render() {
if (canvas.isDisplayable() &&
graphics.image != null) {
if (canvas.getBufferStrategy() == null) {
canvas.createBufferStrategy(2);
}
BufferStrategy strategy = canvas.getBufferStrategy();
if (strategy != null) {
// Render single frame
// try {
do {
// The following loop ensures that the contents of the drawing buffer
// are consistent in case the underlying surface was recreated
do {
Graphics2D draw = (Graphics2D) strategy.getDrawGraphics();
// draw to width/height, since this may be a 2x image
draw.drawImage(graphics.image, 0, 0, sketchWidth, sketchHeight, null);
draw.dispose();
} while (strategy.contentsRestored());
// Display the buffer
strategy.show();
// Repeat the rendering if the drawing buffer was lost
} while (strategy.contentsLost());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!