本文整理汇总了Java中processing.core.PSurface类的典型用法代码示例。如果您正苦于以下问题:Java PSurface类的具体用法?Java PSurface怎么用?Java PSurface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PSurface类属于processing.core包,在下文中一共展示了PSurface类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSurface
import processing.core.PSurface; //导入依赖的package包/类
/**
*
* @see processing.core.PApplet#initSurface()
*/
@Override
protected PSurface initSurface() {
final PSurface s = super.initSurface();
this.frame = null; // eliminate a memory leak from 2.x compat hack
// s.setTitle(pySketchPath.getFileName().toString().replaceAll("\\..*$", ""));
if (s instanceof PSurfaceAWT) {
final PSurfaceAWT surf = (PSurfaceAWT) s;
final Component c = (Component) surf.getNative();
c.addComponentListener(new ComponentAdapter() {
@Override
public void componentHidden(final ComponentEvent e) {
log("initSurface");
finishedLatch.countDown();
}
});
} else if (s instanceof PSurfaceJOGL) {
final PSurfaceJOGL surf = (PSurfaceJOGL) s;
final GLWindow win = (GLWindow) surf.getNative();
win.addWindowListener(new com.jogamp.newt.event.WindowAdapter() {
示例2: createSurface
import processing.core.PSurface; //导入依赖的package包/类
public PSurface createSurface() {
return currentGraphics.createSurface();
}